---
title: Copy
description: "| 硬件型号 | 支持情况 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/SiP/SIP_API_0015.html
sourcePath: /source/zh/canncommercial/900/API/SiP/SIP_API_0015.html
indexId: a11f554c6fea8bb2316cc94357949080d3184ce783860c92ae8a1bb8b67a5cd855
---
# Copy

#### 产品支持情况

| 硬件型号 | 支持情况 |
| --- | --- |
| Atlas 200I/500 A2 推理产品 | 不支持 |
| Atlas 推理系列产品 | 不支持 |
| Atlas 训练系列产品 | 不支持 |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | 支持 |
| Atlas A3 推理系列产品 / Atlas A3 训练系列产品 | 支持 |


#### 功能描述

接口功能

- asdBlasMakeCopyPlan：初始化该句柄对应的Copy算子配置。
- asdBlasScopy：将实数向量的值复制到另外一个向量中。
- asdBlasCcopy：将复数向量的值复制到另外一个向量中。

计算公式

- asdBlasScopy的计算公式：

  - 示例：
    输入“x”为：

```
[3, 4]
```


    调用“Scopy”算子后，输出“y”为：

```
[3, 4]
```


- asdBlasCcopy的计算公式：

  - 示例：
    输入“x”为：

```
[3+4i,4-3i,4+3i,3-4i]
```


    调用“Ccopy”算子后，输出“y”为：

```
[3+4i,4-3i,4+3i,3-4i]
```


#### 函数原型

- AspbStatus asdBlasMakeCopyPlan(asdBlasHandle handle)
- AspbStatus asdBlasScopy(asdBlasHandle handle, const int64_t n, aclTensor *x, const int64_t incx, aclTensor *y,const int64_t incy)
- AspbStatus asdBlasCcopy(asdBlasHandle handle, const int64_t n, aclTensor *x, const int64_t incx, aclTensor *y,const int64_t incy)


#### 参数说明

- asdBlasMakeCopyPlan| 参数名称 | Input/Output | 类型 | 描述 |
| --- | --- | --- | --- |
| handle | Input | asdBlasHandle | copy算子的句柄。 |


- asdBlasScopy & asdBlasCcopy| 参数名称 | Input/Output | 类型 | 描述 |
| --- | --- | --- | --- |
| handle | Input | asdBlasHandle | copy算子的句柄。 |
| n | Input | const int64\_t | 总的元素个数。 |
| x | Input | aclTensor \* | 公式中的x，Device侧的Tensor，数据格式支持ND，shape为[n]。 Scopy下数据类型支持FLOAT32。 Ccopy下数据类型支持COMPLEX64。 |
| incx | Input | const int64\_t | x相邻元素间的内存地址偏移量（当前约束为1）。 |
| y | Output | aclTensor \* | 公式中的y，Device侧的Tensor，数据格式支持ND，shape为[n]，数据格式、类型、shape和入参x保持一致。 Scopy下数据类型支持FLOAT32。 Ccopy下数据类型支持COMPLEX64。 |
| incy | Input | const int64\_t | y相邻元素间的内存地址偏移量（当前约束为1）。 |


#### 返回值说明

返回值相关说明参见返回值。


#### 约束说明

- asdBlasMakeCopyPlan：无。
- asdBlasScopy

  - 输入的元素个数n当前覆盖支持[1，6.71e+06]。
  - 算子输入shape为[n]，输出shape为[n]。
  - 算子实际计算时，不支持ND高维度运算（不支持维度≥3的运算）。
- asdBlasCcopy

  - 输入的元素个数n当前覆盖支持[1，6.71e+06]。
  - 算子输入shape为[n]，输出shape为[n]。
  - 算子实际计算时，不支持ND高维度运算（不支持维度≥3的运算）。


#### 调用示例

算子的调用示例参见Copy。
