Vectorization Check
The vectorization check function checks vectorizable code snippets and provides modification suggestions.
Command Function
Checks vectorizable code snippets.
To enable vectorization, you need to prepare the required compiler versions in the operating environment.
- GCC version: GCC 7/GCC 8/GCC 9/GCC 10
- Clang version: Clang 12/Clang 15/Clang 16
Syntax
devkit advisor vec-check [-h | --help] {-i INPUT_PATH | --input INPUT_PATH} {-f BC_PATH| --bc-file BC_PATH} {-c COMMAND | --cmd COMMAND} [-p {clang,gcc} | --compiler {clang,gcc}][-o OUTPUT_PATH | --output OUTPUT_PATH] [-r {all,json,html,csv} | --report-type {all,json,html,csv}] [-l {0,1,2,3} | --log-level {0,1,2,3}][--set-timeout TIMEOUT][--sve-enable {true,false}]
Parameter Description
Parameter |
Option |
Description |
|---|---|---|
-h/--help |
- |
Obtains help information. |
-i/--input |
input_path |
Path of the source code folder corresponding to the BC file. This parameter is mandatory. |
-f/--bc-file |
path |
BC folder path. BC files must exist in this path. This parameter is mandatory. NOTE:
|
-c/--cmd |
command |
Source code build command. This parameter is mandatory. NOTE:
The source code build command in the command line tool does not support variable setting and environment variable export. Example: "CFLAGS='-O0 -g';make" or "export CFLAGS='-O0 -g';make" |
-p/--compiler |
gcc/clang |
Source code compiler, which defaults to clang. |
-o/--output |
output_path |
Path for storing scan reports. By default, scan reports are stored in the current execution path. A report name is the format of Module name_Timestamp. |
--set-timeout |
time |
Timeout interval of a task, in minutes. If the execution duration exceeds the timeout interval, the task exits. By default, there is no timeout interval. The task will be executed until it is complete. |
-l/--log-level |
0/1/2/3 |
Log level, which defaults to 1.
|
-r/--report-type |
all/json/html/csv |
Scan report format, which defaults to all.
|
--sve-enable |
true/false |
Indicates whether to enable Scalable Vector Extension (SVE). The default value is false. SVE is a variable-length instruction set introduced since ARMv8a. It aims to enhance the portability of binary code so that it can run on a wider range of SIMD units. |
Example
In this example, the source file in the /home/testcase/cplusproject directory is scanned. Replace the example directory with the actual one.
devkit advisor vec-check -i /home/testcase/cplusproject -f /home/advisor/bc_file -c 'make' -p gcc -l 0
Scanned time: 2024/02/29 06:11:25
Configuration:
Scan bc files path: /home/advisor/bc_file
Scan source code path: /home/testcase/cplusproject
Command: make
Compiler: gcc
EnableSVE: false
Generate report path: /home/DevKit_Softwar
Generate report type: all
Task Timeout Interval: The timeout period is not set.
Log level: debug
Summary:
Scanned 1 bc files, there are 0 recommended modifications.
For the detailed information, please check:
/home/DevKit_Software/vec-check_20240229061125_0cdc.json
/home/DevKit_Software/vec-check_20240229061125_0cdc.html
/home/DevKit_Software/vec-check_20240229061125_0cdc.csv
Output Report
Parameter |
Description |
|---|---|
Configuration |
Displays the paths of the software source file and BC file. |
Source File to Be Modified |
Displays information such as the path of the source file that needs to be modified. |