Rate This Document
Findability
Accuracy
Completeness
Readability

Vectorization Check

The tool checks vectorizable code fragments and provides modification suggestions.

Prerequisites

You have logged in to the Kunpeng DevKit.
  • /opt is the default installation directory of the tool. The following uses this directory as an example. Replace it with the actual directory.
  • In the IDE, the tool plugin can scan local projects. If the source code is included in a compressed package, decompress the package and select the decompressed folder.

Procedure

  1. On the left pane of the page, choose Affinity Analyzer > Vectorization Check and click to create a task. See Figure 1.
    Figure 1 Vectorization check
  2. Enter Source File Path in either of the following ways:
    • Enter the absolute path of the source file.
    • Click Select Folder on the right and select the folder for storing the source file.
  3. Enter the compile command, for example, cd src;cmake ..;make.
    • Compile commands include make, cmake, configure, shell, and shell scripts. The make install command is not supported.
    • The build command or build script cannot be used to create or modify directories or files that are not in the user space (/opt/DevKit/workspace/user_name/).
  4. Set BC File Path using either of the following methods:
    • Enter the absolute path of the BC file.
    • Click Select Folder on the right and select the folder for storing the BC file.
    • Only one folder can be uploaded at a time. The size of the folder must be less than or equal to half of the remaining drive space.
  5. Set SVE. It is Disabled by default.

    SVE is an instruction set that is used as an extension to the Armv8-A architecture. It allows for flexible vector length implementations for better binary code portability so that the binary code can run on wider SIMD units.

  6. Set Compiler. The options are GCC and Clang.

    If SVE is not enabled, the supported compiler versions are Clang12, Clang 15, GCC 7, GCC 8, GCC 9, and GCC10. If SVE is enabled, the supported compiler versions are Clang 15, GCC 9, and GCC 10.

    Click Check. After the check is complete, the check report page is displayed. See Figure 2.

    Figure 2 Vectorization check report
    • You can click to sort the source files to be modified by path or number of recommended items.
    • In the upper right corner of the page, you can click Download Report. Then click Download Report (.csv) or Download Report (.html) to download the analysis report. Alternatively, you can click next to the task name and click Download Report (.csv) or Download Report (.html) to download the analysis report.
    Table 1 Parameters in the report

    Parameter

    Description

    Source File Statistics

    Files to Modify

    Total number of files to be modified in the source file path.

    Code Lines to Modify

    Number of code lines to be modified.

    Total Number of Suggestions

    Total number of items recommended for modification. Modify these items to enhance application performance on the Kunpeng platform.

    Source Files to Modify

    Source files to be modified and suggestions for each file. You can click View Suggested Source Code in the Operation column to quickly go to the source file suggestion page.

  7. If the check result suggests that there are source files need to be modified, click View Suggested Source Code in the Operation column. See Figure 3. For details about the modification suggestion for vectorizing source code, see Suggestions for Vectorizing Source Code.
    Figure 3 Source code modification suggestion
    • The tool supports concurrent running of multiple vectorization check tasks.
    • To cancel a task, click Close during the task running process.
    • To modify the configuration of a successful or failed task, click on the right of the task name to restart the task.
    • If the check fails or the check result indicates that no modification is required, an empty report is generated.