---
title: aclopExecWithHandle
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/aclcppdevg_03_0253.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/aclcppdevg_03_0253.html
indexId: b90d5d3f973103fbccb9207ff4d74d6873dc77292109d5c1f39f78cb2a27330d72
---
# aclopExecWithHandle

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |


#### 功能说明

以Handle方式调用一个算子，不支持动态Shape算子，动态Shape算子请使用aclopExecuteV2。异步接口。


#### 函数原型

```
aclError aclopExecWithHandle(aclopHandle *handle,
int numInputs,
const aclDataBuffer *const inputs[],
int numOutputs,
aclDataBuffer *const outputs[],
aclrtStream stream)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| handle | 输入 | 算子执行handle的指针。类型定义请参见aclopHandle。 需提前调用aclopCreateHandle接口创建aclopHandle类型的数据。 |
| numInputs | 输入 | 算子输入tensor的数量。 |
| inputs | 输入 | 算子输入tensor的指针数组。类型定义请参见aclDataBuffer(https://www.hiascend.comdocument/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg\_03\_1430.html)。 需提前调用aclCreateDataBuffer(https://www.hiascend.comdocument/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg\_03\_1431.html)接口创建aclDataBuffer类型的数据。 inputs数组中的元素个数必须与numInputs参数值保持一致。 |
| numOutputs | 输入 | 算子输出tensor的数量。 |
| outputs | 输出 | 算子输出tensor的指针数组。类型定义请参见aclDataBuffer(https://www.hiascend.comdocument/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg\_03\_1430.html)。 需提前调用aclCreateDataBuffer(https://www.hiascend.comdocument/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg\_03\_1431.html)接口创建aclDataBuffer类型的数据。 outputs数组中的元素个数必须与numOutputs参数值保持一致 |
| stream | 输入 | 该算子需要加载的stream。类型定义请参见aclrtStream(https://www.hiascend.comdocument/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg\_03\_1355.html)。 |


#### 返回值说明

返回0表示成功，返回其他值表示失败，请参见aclError。


#### 约束说明

- 多线程场景下，不支持调用本接口时指定同一个Stream或使用默认Stream，否则可能任务执行异常。
- 执行有可选输入的算子时，如果可选输入不使用，则需按此种方式创建aclDataBuffer(https://www.hiascend.comdocument/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg_03_1430.html)类型的数据：aclCreateDataBuffer(nullptr, 0)，同时aclDataBuffer中的数据不需要释放，因为是空指针。
