Function: execute
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Executes a specified operator. This API is asynchronous.
This API will be deprecated in future releases. Use acl.op.execute_v2 instead.
Prototype
- C Prototype
1aclError 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
1ret = acl.op.execute(op_type, input_desc,inputs, output_desc, outputs, attr,stream)
Parameter Description
Parameter |
Description |
|---|---|
op_type |
Str, operator type. |
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 |
attr: int, attribute address object of the operator. |
stream |
Int, stream object to be loaded by the operator. |
Return Value Description
Return Value |
Description |
|---|---|
ret |
Int, error code: 0 on success; else, failure. |
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, it searches for the corresponding task based on the operator type, input tensor description, output tensor description, and attribute information, and delivers the task for execution.