Checking Vectorization Using Command Lines
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
Syntax
devkit advisor vec-check {-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
Argument |
Parameter |
Description |
|---|---|---|
-i/--input |
input_path |
Path of the source code folder corresponding to the BC file. This parameter is mandatory. Example: /home/test |
-f/--bc-file |
path |
BC folder path. BC files must exist in this path. This parameter is mandatory. Example: /home/testbc |
-c/--cmd |
cmd |
Builds source code. This parameter is mandatory. Example: 'make all' |
-p/--compiler |
gcc,clang |
Compiler name. This parameter is optional. The default value is clang. Example: gcc |
-o/--output |
output_path |
Path for storing the report. This parameter is optional. By default, the report is saved in the current execution path and is named in the format of Feature name_Timestamp. |
--set-timeout |
time |
Task timeout period. This parameter is optional. 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. The options are 0 (DEBUG), 1 (INFO), 2 (WARNING) and 3 (ERROR). The default value is 1 (INFO). |
-r/--report-type |
all,json,html,csv |
Format of the scan report. This parameter is optional. The default value is all, indicating that JSON, HTML, and CSV reports are generated. |
--sve-enable |
true,false |
Indicates whether to enable SVE. This parameter is optional. The function is disabled by default. |
Example
Replace the path in the following example command with the actual path of the configuration file to be scanned.
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/test001/DevKit-CLI-24.0.RC1-Linux-Kunpeng
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/test001/DevKit-CLI-24.0.RC1-Linux-Kunpeng/vec-check_20240229061125_0cdc.json
/home/test001/DevKit-CLI-24.0.RC1-Linux-Kunpeng/vec-check_20240229061125_0cdc.html
/home/test001/DevKit-CLI-24.0.RC1-Linux-Kunpeng/vec-check_20240229061125_0cdc.csv
Output Description
Parameter |
Description |
|---|---|
Configuration |
Displays the path 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. |