Function: execute

This API will be deprecated in future releases. Use acl.op.execute_v2 instead.

C Prototype

aclError aclopExecute(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, aclrtStream stream);

Python Function

ret = acl.op.execute(op_type, input_desc, inputs, output_desc, outputs, attr, stream)

Function Usage

Executes a specified operator. This API is asynchronous.

Input Description

op_type: str, operator type name.

input_desc: int list, description of the operator input tensor. It contains multiple ACL tensor description address objects.

inputs: int list, input tensor of the operator. It contains multiple aclDataBuffer data address objects.

output_desc: int list, description of the operator output tensor. It contains multiple ACL tensor description address objects.

outputs: int list, output tensor of the operator. It contains multiple aclDataBuffer data address objects.

attr: int, attribute address object of the operator.

stream: int, stream object to be loaded by the operator.

Return Value

ret: int, error code.

Restrictions

  • This API is asynchronous. The API call delivers a task rather than executes a task. After this API is called, call the synchronization API (for example, acl.rt.synchronize_stream) to ensure that the task is complete.
  • 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.
  • As the inputs, outputs, and attributes of each operator are different, the app needs to organize operators in strict accordance with their inputs, outputs, and attributes. When acl.op.execute is called, pyACL searches for the corresponding task based on the op_type, input tensor description, output tensor description, and attribute information, and delivers the task for execution.