ComplexMatDot

Applicable Products

Hardware Model

Supported or Not

Atlas 200I/500 A2 inference products

Not supported

Atlas inference products

Not supported

Atlas training products

Not supported

Atlas A2 training products/Atlas A2 inference products

Supported

Atlas A3 inference products/Atlas A3 training products

Supported

Function Description

API function

  • asdBlasMakeComplexMatDotPlan: initializes the ComplexMatDot operator configuration corresponding to the handle.
  • asdBlasComplexMatDot: multiplies the corresponding positions of two complex matrices point by point and returns a complex matrix with the same shape and size as the input matrix.

Formula:

  • asdBlasComplexMatDot formula:
  • Example:

    Input matx:

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

    Input maty:

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

    After the ComplexMatDot operator is called, the output result is as follows:

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

Function Prototype

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

Parameter Description

  • asdBlasMakeComplexMatDotPlan

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    Handle of the ComplexMatDot operator.

  • asdBlasComplexMatDot

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    complex_mat_dot operator handle.

    m

    Input

    const int64_t

    Number of rows in a matrix

    n

    Input

    const int64_t

    Number of columns in a matrix

    matx

    Input

    Tensor &

    x in the formula, which is a tensor on the device. The data type can be COMPLEX64, the data format can be ND, and the shape is [m, n].

    maty

    Input

    Tensor &

    y in the formula, which is a tensor on the device. The data type can be COMPLEX64, the data format can be ND, and the shape is [m, n]. The data format, data type, and shape are consistent with those of matx.

    result

    Output

    Tensor &

    result in the formula, which is a tensor on the device. The data type can be COMPLEX64, the data format can be ND, and the shape is [m, n]. The data format, data type, and shape are consistent with those of matx.

Return Value Description

For details about the return values, see Return Value.

Constraints

  • asdBlasMakeComplexMatDotPlan: none.
  • asdBlasComplexMatDot
    • In non-in-place update mode, the size of the memory occupied by the input and output cannot exceed the GM size of the NPU.
    • In in-place update mode, the size of the memory occupied by the input cannot exceed the GM size of the NPU.
    • The input shape of the operator is [m, n] and [m, n], and the output shape is [m, n].
    • The operator does not support the calculation for three or more dimensions.

Calling Example

For details about the operator calling example, see ComplexMatDot.