aclopExecWithHandle

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Usage

Calls an operator in handle mode. Dynamic-shape operators are not supported. To call dynamic-shape operators, use aclopExecuteV2 instead. This API is asynchronous.

Prototype

1
2
3
4
5
6
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 execution handle. For details about the type definition, see aclopHandle.

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

numInputs

Input

Number of input tensors.

inputs

Input

Pointer array of the operator input tensor. For details about the type definition, see aclDataBuffer.

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

The array length must be consistent with numInputs.

numOutputs

Input

Number of output tensors.

outputs

Output

Pointer array of the operator output tensor. For details about the type definition, see aclDataBuffer.

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

The array length must be consistent with numOutputs.

stream

Input

Target stream of the operator. For details about the type definition, see aclrtStream.

Returns

0 on success; else, failure. For details, see aclError.

Restrictions

  • In multi-thread scenarios, this API cannot be called to specify the same stream or the default stream. Otherwise, exceptions may occur in task execution.
  • 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.