---
title: ADD_TO_LAUNCHER_LIST_AICPU
description: "创建某个AI CPU算子的执行任务并置入aclOpExecutor的执行队列，一般在二阶段接口aclnnXxx调用时执行。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasascendc_api_07_1046.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasascendc_api_07_1046.html
indexId: 59d2471f52db7b058aa9454fb1a21c4373fc5e42307363100b8a54a74c9995cb70
---
# ADD_TO_LAUNCHER_LIST_AICPU

#### 宏功能

创建某个AI CPU算子的执行任务并置入aclOpExecutor的执行队列，一般在二阶段接口aclnnXxx调用时执行。


#### 宏原型

```
ADD_TO_LAUNCHER_LIST_AICPU(KERNEL_NAME, attrNames, opArgs...)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| KERNEL\_NAME | 输入 | 算子名，例如Add。 |
| attrNames | 输入 | 算子的属性名，参见OP\_ATTR\_NAMES。 |
| opArgs... | 输入 | 算子的参数。 |


#### 返回值说明

返回0表示成功，返回其他值表示失败，失败可能的原因可参见aclnn返回码。


#### 约束说明

- 如果算子需要INFER_SHAPE，那么此宏需要在  INFER_SHAPE
之后调用。
- 如下接口是上述宏定义会调用到的关联接口。

```
如下接口是上述宏定义会调用到的关联接口。
OP_ATTR_NAMES
OP_INPUT(x...)
OP_OUTPUT(x...)
OP_ATTR(x...)
```


#### 调用示例

```
// 调用ADD_TO_LAUNCHER_LIST_AICPU创建IndexPut算子的执行任务，其中IndexPut是算子名，accumulate是算子的属性名，selfRef，values，masks，indices是算子输入参数，out是算子输出参数，accumulate是算子的属性参数
ADD_TO_LAUNCHER_LIST_AICPU(IndexPut, OP_ATTR_NAMES({"accumulate"}), OP_INPUT(selfRef, values, masks, indices), OP_OUTPUT(out), OP_ATTR(accumulate));
```
