aclrtcCompileProg

Supported Products

Product

Supported

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference product 's AI Core

x

Atlas inference product 's Vector Core

x

Atlas training products

x

Function

A compilation API that compiles a specified program.

Prototype

1
aclError aclrtcCompileProg(aclrtcProg prog, int numOptions, const char **options)

Parameters

Table 1 API parameters

Parameter

Input/Output

Description

prog

Input

Handle to the program to be compiled at runtime.

numOptions

Input

Number of compilation options.

options

Input

Array of compilation options, which stores specific compilation options. By default, -std=c++17 is added.

For details about the supported compilation options, see BiSheng Compiler Compilation Options.

Returns

aclError is of the int type. For details, see RTC Error Codes.

Restrictions

None

Example

1
2
3
4
aclrtcProg prog;
const char *options[] = {"--npu-arch=dav-2201"};
int numOptions = sizeof(options) / sizeof(options[0]);
aclError result = aclrtcCompileProg(prog, numOptions, options);