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

#### 产品支持情况

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


#### 功能描述

接口功能

- asdBlasMakeComplexMatDotPlan：初始化该句柄对应的ComplexMatDot算子配置。
- asdBlasComplexMatDot：实现两个复数矩阵对应位置逐点乘，返回一个和输入矩阵同样形状大小的复数矩阵。

计算公式

- asdBlasComplexMatDot的计算公式：

- 示例：
  输入“matx”为：

```
[   [ 1 +  i, 1 + 2i, 1 + 3i ],
[ 1 + 4i, 1 + 5i, 1 + 6i ]   ]
```


  输入“maty”为：

```
[   [ 2 +  i, 2 + 2i, 2 + 3i ],
[ 2 + 4i, 2 + 5i, 2 + 6i ]   ]
```


  调用“ComplexMatDot”算子后，输出“result”为：

```
[   [   1 +  3i,  -2 +  6i, -7 + 9i ],
[ -14 + 12i, -23 + 15i, -34 + 18i ]   ]
```


#### 函数原型

- AspbStatus asdBlasMakeComplexMatDotPlan(asdBlasHandle handle)
- AspbStatus asdBlasComplexMatDot(asdBlasHandle handle, const int64_t m, const int64_t n, aclTensor *matx, aclTensor *maty,aclTensor *result)


#### 参数说明

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


- asdBlasComplexMatDot| 参数名称 | Input/Output | 类型 | 描述 |
| --- | --- | --- | --- |
| handle | Input | asdBlasHandle | complex\_mat\_dot算子的句柄。 |
| m | Input | const int64\_t | 矩阵行数。 |
| n | Input | const int64\_t | 矩阵列数。 |
| matx | Input | Tensor & | 公式中的x，Device侧的Tensor，数据类型支持COMPELX64，数据格式支持ND，shape为[m，n]。 |
| maty | Input | Tensor & | 公式中的y，Device侧的Tensor，数据类型支持COMPELX64，数据格式支持ND，shape为[m，n]，数据格式、类型、shape和matx保持一致。 |
| result | Output | Tensor & | 公式中的result，Device侧的Tensor，数据类型支持COMPELX64，数据格式支持ND，shape为[m，n]，数据格式、类型、shape和matx保持一致。 |


#### 返回值说明

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


#### 约束说明

- asdBlasMakeComplexMatDotPlan：无。
- asdBlasComplexMatDot

  - 非原地更新情况下，输入和输出占用的内存大小应不超过NPU的GM大小。
  - 原地更新情况下，输入占用的内存大小应不超过NPU的GM大小。

  - 算子输入shape为[m，n]、[m，n]，输出shape为[m，n]。

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


#### 调用示例

算子的调用示例参见ComplexMatDot。
