向量化检查命令参考
向量化检查功能用于对可向量化片段进行检查,并提供向量化修改建议。
命令功能
对可向量化片段进行检查。

使用向量化需要在运行环境上准备对应编译器版本。
- GCC版本:GCC 7/GCC 8/GCC 9/GCC 10。
- clang版本:clang12/clang15。
命令格式
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}]
参数说明
参数 |
参数选项 |
参数说明 |
---|---|---|
-h/--help |
- |
获取帮助信息。 |
-i/--input |
- |
BC文件对应的源码文件夹路径。 |
-f/--bc-file |
- |
BC文件夹路径,该路径下必须存在BC文件。 说明:
|
-c/--cmd |
- |
源码的构建命令。 |
-p/--compiler |
gcc/clang |
指定用于编译源码的编译器,默认为clang。 |
-o/--output |
- |
扫描报告的存放路径,默认存放在当前执行路径下,报告名称为特性名称_时间戳。 |
--set-timeout |
- |
任务超时时间,单位为分钟,若执行时间超过超时时间则退出执行。默认无超时时间,任务将持续执行直到结束。 |
-l/--log-level |
0/1/2/3 |
设置日志级别,默认为1。
|
-r/--report-type |
all/json/html/csv |
扫描报告的格式,默认为all。
|
--sve-enable |
true,false |
是否启用SVE,默认不开启。SVE是在ARMv8a之后引入的可变长度向量化指令,目的是增强二进制代码的可移植性,使其可以运行在更广泛的SIMD单元上。 |
使用示例
此处以扫描“/home/testcase/cplusproject”路径下源码文件为例,请根据实际情况替换成实际需要扫描的配置文件路径。
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
输出报告说明
参数 |
说明 |
---|---|
配置信息 |
显示软件源码文件及BC文件存放路径。 |
需要修改的源码文件 |
显示存在向量化问题,并需要进行修改的源码文件路径等相关信息。 |
父主题: 向量化检查