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

#### 产品支持情况

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


#### 功能说明

转换输入数据的数据类型。异步接口。


#### 函数原型

```
aclError aclopCast(const aclTensorDesc *srcDesc,
const aclDataBuffer *srcBuffer,
const aclTensorDesc *dstDesc,
aclDataBuffer *dstBuffer,
uint8_t truncate,
aclrtStream stream)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| srcDesc | 输入 | 输入tensor描述的指针。类型定义请参见aclTensorDesc。 |
| srcBuffer | 输入 | 输入tensor的指针。类型定义请参见aclDataBuffer(https://www.hiascend.comdocument/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg\_03\_1430.html)。 |
| dstDesc | 输入 | 输出tensor描述的指针。类型定义请参见aclTensorDesc。 |
| dstBuffer | 输出 | 输出tensor的指针。类型定义请参见aclDataBuffer(https://www.hiascend.comdocument/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg\_03\_1430.html)。 |
| truncate | 输入 | 预留。 |
| stream | 输入 | 执行算子所在的Stream。类型定义请参见aclrtStream(https://www.hiascend.comdocument/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg\_03\_1355.html)。 |


#### 返回值说明

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