---
title: 向量化检查命令参考
description: "向量化检查功能用于对可向量化片段进行检查，并提供向量化修改建议。"
url: https://www.hikunpeng.com/document/detail/zh/nativedevp/userguide/pipeline/NativeDevelopment_0092.html
sourcePath: /source/zh/nativedevp/userguide/pipeline/NativeDevelopment_0092.html
indexId: 10c8fc5977de48f8963a929015041e928f739c26e90cee75ccc0b6baa0cb3d8968
---
# 向量化检查命令参考

向量化检查功能用于对可向量化片段进行检查，并提供向量化修改建议。

#### 前提条件

已参照安装工具(https://www.hikunpeng.com/document/detail/zh/nativedevp/userguide/install/NativeDevelopment_0075.html)安装鲲鹏DevKit CLI工具。


#### 命令功能

对可向量化片段进行检查。

使用向量化需要在运行环境上准备对应编译器版本。

- GCC版本：GCC 7/GCC 8/GCC 9/GCC 10。
- clang版本：clang12/clang15/clang16。


#### 命令格式

```
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}]
```


#### 参数说明


**表1 参数说明**

| 参数 | 参数选项 | 参数说明 |
| --- | --- | --- |
| \-h/\-\-help | \- | 获取帮助信息。 |
| \-i/\-\-input | input\_path | 必选参数，BC文件对应的源码文件夹路径。 |
| \-f/\-\-bc\-file | path | 必选参数，BC文件夹路径，该路径下必须存在BC文件。 说明： 使用命令行工作方式生成BC文件请参见BC文件生成。 使用工程构建工具生成BC文件请参见方法二（使用工程构建工具生成BC文件）(https://www.hikunpeng.com/document/detail/zh/kunpengdevkithistory/devkit\_24\_t50/Plugins\_UserGuide/DevKit\_Affinity\_0018.html\#ZH\-CN\_TOPIC\_0000001616019848\_\_section735882312245)。 |
| \-c/\-\-cmd | command | 必选参数，源码的构建命令。 说明： 命令行工具源码构建命令不支持设置变量和export环境变量。 例如："CFLAGS='\-O0 \-g';make"或"export CFLAGS='\-O0 \-g';make"。 |
| \-p/\-\-compiler | gcc/clang | 指定用于编译源码的编译器，默认为clang。 |
| \-o/\-\-output | output\_path | 扫描报告的存放路径，默认存放在当前执行路径下，报告名称为模块名称\_时间戳。 |
| \-\-set\-timeout | time | 任务超时时间，单位为分钟，若执行时间超过超时时间则退出执行。默认无超时时间，任务将持续执行直到结束。 |
| \-l/\-\-log\-level | 0/1/2/3 | 设置日志级别，默认为1。 0：日志级别为DEBUG。 1：日志级别为INFO。 2：日志级别为WARNING。 3：日志级别为ERROR。 |
| \-r/\-\-report\-type | all/json/html/csv | 扫描报告的格式，默认为all。 all：生成JSON、HTML、CSV三种格式报告。 json：生成JSON格式报告。 html：生成HTML格式报告。 csv：生成CSV格式报告。 |
| \-\-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 -o /opt/DevKit -l 0
```

返回信息如下，并输出报告。
```
debug: Enter the second level command: advisor
Executing Vector Check task, please wait...
Current progress:  [0%]Start generate the compile log.
Generate the compile log succeed.
Current progress: ################################# [100%]
Scanned time: 2025/04/07 06:51:24
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: /opt/DevKit
Generate report type: all
Task Timeout Interval: The timeout period is not set.
Log level: debug
Summary:
Scanned 2 bc files, there are 2 recommended modifications.
For the details information, please check:
/opt/DevKit/vec-check_20250407065124_cbe5.json
/opt/DevKit/vec-check_20250407065124_cbe5.html
/opt/DevKit/vec-check_20250407065124_cbe5.csv
```


#### 输出报告说明


**表2 向量化检查输出报告参数说明**

| 参数 | 说明 |
| --- | --- |
| 配置信息 | 显示软件源码文件及BC文件存放路径。 |
| 需要修改的源码文件 | 显示存在向量化问题，并需要进行修改的源码文件路径等相关信息。 |
