---
title: aclopExecWithHandle
description: "以Handle方式调用一个算子，不支持动态Shape算子，动态Shape算子请使用aclopExecuteV2。异步接口。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgc/aclcppdevg_03_0633.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgc/aclcppdevg_03_0633.html
indexId: a9f42e2ffd7e1e44eed52c4f71c8e137e467c4ca8ec286f8b4eb32fda9e15d58105
---
# aclopExecWithHandle

#### 函数功能

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


#### 约束说明

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


#### 函数原型

aclError aclopExecWithHandle(aclopHandle *handle,

int numInputs,

const aclDataBuffer *const inputs[],

int numOutputs,

aclDataBuffer *const outputs[],

aclrtStream stream);


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| handle | 输入 | 算子执行算子handle的指针。 需提前调用aclopCreateHandle接口创建aclopHandle类型的数据。 |
| numInputs | 输入 | 算子输入tensor的数量。 |
| inputs | 输入 | 算子输入tensor的指针数组。 需提前调用aclCreateDataBuffer接口创建aclDataBuffer类型的数据。 inputs数组中的元素个数必须与numInputs参数值保持一致。 |
| numOutputs | 输入 | 算子输出tensor的数量。 |
| outputs | 输出 | 算子输出tensor的指针数组。 需提前调用aclCreateDataBuffer接口创建aclDataBuffer类型的数据。 outputs数组中的元素个数必须与numOutputs参数值保持一致 |
| stream | 输入 | 该算子需要加载的stream。 |


#### 返回值说明

返回0表示成功，返回其它值表示失败。
