aclopExecWithHandle

Description

Executes an operator by its handle. This mode provides better performance. This API is asynchronous.

Restrictions

For an operator that supports dynamic shape, if the accurate shape can be obtained by the aclopInferShape call, call aclopExecWithHandle to execute the operator; otherwise, call aclopExecuteV2.

If an operator with an unused optional input is executed, create data of the aclDataBuffer type by using the aclCreateDataBuffer(nullptr, 0) call, where, aclDataBuffer does not need to be freed since it is a null pointer.

Prototype

aclError aclopExecWithHandle(aclopHandle *handle,

int numInputs,

const aclDataBuffer *const inputs[],

int numOutputs,

aclDataBuffer *const outputs[],

aclrtStream stream);

Parameters

Parameter

Input/Output

Description

handle

Input

Pointer to the operator handle.

Call aclopCreateHandle to create data of the aclopHandle type in advance.

numInputs

Input

Number of input tensors.

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.

numOutputs

Input

Number of output tensors.

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.

stream

Input

Target stream of the operator.

Returns

0 on success; else, failure.