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

#### 产品支持情况

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


#### 功能说明

创建一个执行算子的handle。

如需销毁handle，请参见aclopDestroyHandle。


#### 函数原型

```
aclError aclopCreateHandle(const char *opType,
int numInputs,
const aclTensorDesc *const inputDesc[],
int numOutputs,
const aclTensorDesc *const outputDesc[],
const aclopAttr *opAttr,
aclopHandle **handle)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| opType | 输入 | 算子类型名称的指针。 |
| numInputs | 输入 | 算子输入tensor的数量。 |
| inputDesc | 输入 | 算子输入tensor描述的指针数组。 |
| numOutputs | 输入 | 算子输出tensor的数量。 |
| outputDesc | 输入 | 算子输出tensor描述的指针数组。类型定义请参见aclTensorDesc。 |
| opAttr | 输入 | 算子属性的指针。类型定义请参见aclopAttr。 |
| handle | 输出 | “aclopHandle数据指针”的指针。类型定义请参见aclopHandle。 |


#### 返回值说明

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


#### 约束说明

对于算子有constant输入的场景，如果未调用aclSetTensorConst接口设置constant输入，则需调用aclSetTensorPlaceMent设置TensorDesc的placement属性，将memType设置为Host内存。
