Affinity Analyzer
The Affinity Analyzer is an application source code analysis tool designed for developers, users, and independent software vendors (ISVs) of the Kunpeng platform. This tool performs the following functions:
- 64-bit running mode check: Identifies the applications to be ported from the 32-bit platform to the 64-bit platform and provides modification suggestions for the porting.
- Byte alignment check: Checks the byte alignment of structure variables in the source code.
Cache line alignment check : Checks the 128-byte alignment of structure variables in the C/C++ source code to improve memory access performance.- Static memory consistency check: Analyzes and rectifies memory consistency issues in the user software on the Kunpeng platform.
- Vectorization check: Checks vectorizable code fragments and provides modification suggestions.
- Matricization check: Checks matricizable code fragments and provides modification suggestions.
- Build affinity: Analyzes the content in Makefile and CMakeLists.txt that can be replaced with content in the Kunpeng Library, and provides replacement suggestions and function repair.
- Calculation precision analysis: After instrumenting application functions using the precision analysis tool, run the functions on the x86 platform and Kunpeng platform. Then the precision analysis tool compares the output results to analyze the calculation precision differences between the platforms.
For example, use the Affinity Analyzer in vectorization check:
Vectorization Check
The vectorization check function checks vectorizable code snippets and provides modification suggestions.
- Create a vectorization check task.Figure 1 Vectorization check (in VS Code)
Upload the source file and the BC file generated after compilation. For details about how to generate a BC file, see the Online Help.
- View the vectorization check result.Figure 2 Vectorization check result
Figure 3 Source code modification suggestion
Parent topic: Code Optimization
