aclopCompileAndExecute

Description

Compiles and executes an operator. This API is asynchronous. Currently, only static-shape operators are supported. The compilation options are set by using the aclSetCompileopt call.

Restrictions

Prototype

aclError aclopCompileAndExecute(const char *opType,

int numInputs,

const aclTensorDesc *const inputDesc[],

const aclDataBuffer *const inputs[],

int numOutputs,

const aclTensorDesc *const outputDesc[],

aclDataBuffer *const outputs[],

const aclopAttr *attr,

aclopEngineType engineType,

aclopCompileType compileFlag,

const char *opPath,

aclrtStream stream)

Parameters

Parameter

Input/Output

Description

opType

Input

Pointer to the operator type name.

numInputs

Input

Number of input tensors.

inputDesc

Input

Pointer array of the input tensor description.

Call aclCreateTensorDesc to create data of the aclTensorDesc type in advance.

The array length is consistent with numInputs. The elements in the inputs array match those in the inputDesc array with ordering preserved.

inputs

Input

Pointer array of the input tensors.

Call aclCreateDataBuffer to create data of the aclDataBuffer type in advance.

The array length is consistent with numInputs. The elements in the inputs array match those in the inputDesc array with ordering preserved.

numOutputs

Input

Number of output tensors.

outputDesc

Input

Pointer array of the output tensor description.

Call aclCreateTensorDesc to create data of the aclTensorDesc type in advance.

The array length is consistent with numOutputs. The elements in the outputs array match those in the outputDesc array with ordering preserved.

outputs

Input/Output

Pointer array of the output tensors.

Call aclCreateDataBuffer to create data of the aclDataBuffer type in advance.

The array length is consistent with numOutputs. The elements in the outputs array match those in the outputDesc array with ordering preserved.

attr

Input

Pointer to the operator attributes.

Call aclopCreateAttr to create data of the aclopAttr type in advance.

engineType

Input

Operator execution engine.

compileFlag

Input

Operator compiled flag.

typedef enum aclCompileType {
    ACL_COMPILE_SYS, //The operator has been registered with GE and FE.
    ACL_COMPILE_UNREGISTERED  //The operator has not been registered with GE or FE. (The .py source file will be used to compile the operator. Not supported currently.)

} aclopCompileType;

opPath

Input

Pointer to the path of the operator implementation file (.py), excluding the file name.

Required if compileFlag = ACL_COMPILE_UNREGISTERED.

stream

Input

Target stream of the operator.

Returns

0 on success; else, failure.