CommonOpExecutorRun

Function Usage

Runs all tasks in the operator executor context based on workspace and stream.

Prototype

aclnnStatus CommonOpExecutorRun(void *workspace, uint64_t workspaceSize, aclOpExecutor *executor, aclrtStream stream)

Parameters

Parameter

Input/Output

Description

workspace

Input

Pointer to the on-chip memory allocated on the device based on workspaceSize.

workspaceSize

Input

Workspace size computed by the L2 first-phase API.

executor

Input

Operator executor object generated after the L2 first-phase API is called.

stream

Input

Stream for running the operator task in executor.

Returns

Success: ACLNN_SUCCESS. Failure: aclnn error code.

Constraints

  • executor must not be empty.
  • When workspaceSize is greater than 0, workspace must not be empty.

Example

1
2
3
4
// Second-phase function of aclnnAdd, which is used to execute the operator in the executor task queue.
aclnnStatus aclnnAdd(void *workspace, uint64_t workspaceSize, aclOpExecutor *executor, aclrtStream stream) {
    return CommonOpExecutorRun(workspace, workspaceSize, executor, stream);
}