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

#### 产品支持情况

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


#### 功能说明

创建数据类型转换的handle。创建handle成功后，需调用aclopExecWithHandle接口执行算子。


#### 函数原型

```
aclError aclopCreateHandleForCast(aclTensorDesc *srcDesc,
aclTensorDesc *dstDesc,
uint8_t truncate,
aclopHandle **handle)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| srcDesc | 输入 | 输入tensor描述的指针。类型定义请参见aclTensorDesc。 |
| dstDesc | 输入 | 输出tensor描述的指针。类型定义请参见aclTensorDesc。 |
| truncate | 输入 | 预留。 |
| handle | 输出 | “算子执行handle的指针”的指针。类型定义请参见aclopHandle。 |


#### 返回值说明

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