aclopExecWithHandle

Applicable Products

Product

Supported

Ascend 950PR / Ascend 950DT

×

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

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 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 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 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.