---
title: AddCustom算子样例执行
description: "AddCustom算子样例支持多种方式调用执行，以下内容以ACLNN接口和核函数两种常用的方式为例进行介绍，更多方式请参考样例仓(https://gitee.com/ascend/samples/tree/8.0.RC1)中的readme指导。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/operatordev/Ascendcopdevg/opdev_002.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/operatordev/Ascendcopdevg/opdev_002.html
indexId: 2045bbe0e4555c6583e4de408aff0e1ecbcfef5491812b69fb46f95edc7926c886
---
# AddCustom算子样例执行

AddCustom算子样例支持多种方式调用执行，以下内容以ACLNN接口和核函数两种常用的方式为例进行介绍，更多方式请参考样例仓(https://gitee.com/ascend/samples/tree/8.0.RC1)中的readme指导。

#### ACLNN接口调用执行

1. 进入AddCustom算子样例目录。

```
cd
~
/samples/operator/AddCustomSample/
```


  目录示例如下：

2. 执行编译打包命令生成自定义算子包。

```
cd FrameworkLaunch/AddCustom
./build.sh
```


  编译成功结果示例：

3. 部署自定义算子包。

```
./build_out/custom_opp_ubuntu_aarch64.run
```


  部署成功结果示例：

4. 通过应用程序样例调用算子的ACLNN接口进行测试。

```
cd
~
/samples/operator/AddCustomSample/FrameworkLaunch/AclNNInvocation
bash run.sh
```


  测试结果示例：


#### 核函数调用执行

1. 进入AddCustom算子样例核函数调用执行目录。

```
cd
~
/samples/operator/AddCustomSample/KernelLaunch/AddKernelInvocation
```


2. 运行kernellanch调用执行样例脚本。

```
bash run.sh -v Ascend310B1 -r npu
```
