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

#### 产品支持情况

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


#### 功能描述

接口功能

- asdBlasMakeCgercPlan：初始化该句柄对应的Cgerc算子配置。
- asdBlasCgerc：复数向量乘以另一个复数向量的共轭转置后，加在一个矩阵上。

计算公式

- asdBlasCgerc的计算公式：

- 示例：
  输入“x”为：

```
[1.0 + 1.0j, 2.0 + 2.0j]
```


  输入“alpha”为：

```
1.0 + 1.0j
```


  输入“y”为：

```
[1.0 + 1.0j, 1.0 + 2.0j]
```


  输入“A”为：

```
[ [2.0 + 3.0j, 3.0 + 4.0j],
[3.0 + 3.0j, 4.0 + 4.0j] ]
```


  调用“Cgerc”算子后，输出“A”为：

```
[ [4.0 + 5.0j, 7.0 + 6.0j],
[7.0 + 7.0j, 12.0 + 8.0j] ]
```


#### 函数原型

- AspbStatus asdBlasMakeCgercPlan(asdBlasHandle handle)
- AspbStatus asdBlasCgerc(asdBlasHandle handle, const int64_t m, const int64_t n, const std::complex<float> *alpha,aclTensor *x, const int64_t incx, aclTensor *y, const int64_t incy, aclTensor *A,const int64_t lda)


#### 参数说明

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


- asdBlasCgerc| 参数名称 | Input/Output | 类型 | 描述 |
| --- | --- | --- | --- |
| handle | Input | asdBlasHandle | Cgerc算子的句柄。 |
| m | Input | const int64\_t | 表示x向量中复数元素的个数，矩阵A的行数。 |
| n | Input | const int64\_t | 表示y向量中复数元素的个数，矩阵A的列数。 |
| alpha | Input | const std::complex<float> \* | 公式中的alpha，输入的复数标量，数据类型支持COMPLEX64。 |
| x | Input | aclTensor \* | 公式中的x，Device侧的Tensor，数据类型支持COMPLEX64，数据格式支持ND，shape为[m]。 |
| incx | Input | const int64\_t | x左右相邻元素间的内存地址偏移量（当前约束为1）。 |
| y | Input | aclTensor \* | 公式中的y，Device侧的Tensor，数据类型支持COMPLEX64，数据格式支持ND，shape为[n]。 |
| incy | Input | const int64\_t | y左右相邻元素间的内存地址偏移量（当前约束为1）。 |
| A | Input/Output | aclTensor \* | 公式中的A，Device侧的Tensor，数据类型支持COMPLEX64，数据格式支持ND，shape为[m，n]。 |
| lda | Input | const int64\_t | 表示矩阵A的第一个维度大小（当前约束为m）。 |


#### 返回值说明

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


#### 约束说明

- asdBlasMakeCgercPlan：无。
- asdBlasCgerc

  - 输入的元素个数m，n当前覆盖支持[1，8192]。
  - 算子输入shape为[m]、[n]、[m，n]，输出shape为[m，n]。

  - 算子实际计算时，不支持ND高维度运算（不支持维度≥3的运算）。


#### 调用示例

算子的调用示例参见Cgerc。
