aclopExecuteV2

Description

Executes an operator synchronously or asynchronously.

Restrictions

As the inputs and outputs of each operator are organized differently, the app needs to organize operators in strict accordance with their input and output parameters. When aclopExecuteV2 is called, AscendCL searches for the corresponding task based on the optype, input tensor description, output tensor description, and operator attributes, and then executes the operator.

Prototype

aclError aclopExecuteV2(const char *opType,

int numInputs,

aclTensorDesc *inputDesc[],

aclDataBuffer *inputs[],

int numOutputs,

aclTensorDesc *outputDesc[],

aclDataBuffer *outputs[],

aclopAttr *attr,

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/Output

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

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.

stream

Input

Target stream of the operator.

Returns

0 on success; else, failure.

See Also

For details about the API call sequence and example, see Single-Operator Execution.