Rate This Document
Findability
Accuracy
Completeness
Readability

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

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

Table 1 Parameter description

Parameter

Option

Description

-h/--help

-

Obtains help information.

-i/--input

-

Path of the source code folder corresponding to the BC file.

-f/--bc-file

-

BC folder path. BC files must exist in this path.

NOTE:

-c/--cmd

-

Source code build command.

-p/--compiler

gcc/clang

Source code compiler, which defaults to clang.

-o/--output

-

Path for storing scan reports. By default, scan reports are stored in the current execution path. A report name is the format of Feature name_Timestamp.

--set-timeout

-

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.
  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR

-r/--report-type

all/json/html/csv

Scan report format, which defaults to all.
  • all: generates reports in JSON, HTML, and CSV formats.
  • json: generates a report only in JSON format.
  • html: generates a report only in HTML format.
  • csv: generates a report only in CSV format.

--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 Armv8-A. 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 code in the /home/testcase/cplusproject directory is scanned.

devkit advisor vec-check -i /home/testcase/cplusproject -f /home/advisor/bc_file -c 'make' -p gcc -l 0
The following information is displayed and a report is generated:
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

Table 2 Output report parameters

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.