ADD_TO_LAUNCHER_LIST_AICPU

Function Usage

Creates an execution task of an AI CPU operator and adds the task to the aclOpExecutor execution queue. The task is executed when the second-phase API aclnnXxx is called.

Prototype

ADD_TO_LAUNCHER_LIST_AICPU(KERNEL_NAME, attrNames, opArgs...)

Parameters

Parameter

Input/Output

Description

KERNEL_NAME

Input

Operator name, for example, Add.

attrNames

Input

Operator attribute names. For details, see OP_ATTR_NAMES.

opArgs...

Input

Operator arguments.

Returns

0 on success; otherwise, failure. For details about the failure causes, see aclnn Return Codes.

Constraints

  • If the operator requires INFER_SHAPE, this macro must be called after INFER_SHAPE.
  • The following are associated APIs called by the preceding macro definitions:
    如下接口是上述宏定义会调用到的关联接口。
    OP_ATTR_NAMES
    OP_INPUT(x...)
    OP_OUTPUT(x...)
    OP_ATTR(x...)

Example

1
2
// Call ADD_TO_LAUNCHER_LIST_AICPU to create an execution task for the IndexPut operator. IndexPut is the operator name, accumulate is the operator attribute name and parameter, selfRef, values, masks, and indices are the operator input parameters, and out is the operator output parameter.
ADD_TO_LAUNCHER_LIST_AICPU(IndexPut, OP_ATTR_NAMES({"accumulate"}), OP_INPUT(selfRef, values, masks, indices), OP_OUTPUT(out), OP_ATTR(accumulate));