Csrot

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

  • asdBlasMakeRotPlan: initializes the Csrot operator configuration corresponding to the handle.
  • asdBlasCsrot: rotates the input complex vector group (x, y).

Formula:

  • asdBlasCsrot formula:

    c is the cosine value of the rotation angle, s is the sine value of the rotation angle, and x and y are complex vectors.

  • Example:

    Input x:

    [3.0 + 4.0j, 2.0 + 1.0j]

    Input y:

    [1.0 + 1.0j, 3.0 + 3.0j]

    Input c:

    Input s: 0.5

    After the Csrot operator is called, the output x is as follows:

    [3.098076+3.9641016j, 3.232051+2.3660254j]

    Output y:

    [-0.6339746-1.1339746j, 1.5980761+2.098076j]

Function Prototype

  • AspbStatus asdBlasMakeRotPlan(asdBlasHandle handle)
  • AspbStatus asdBlasCsrot(asdBlasHandle handle, const int64_t n, aclTensor *x, const int64_t incx, aclTensor *y,const int64_t incy, const float *c, const float *s)

Parameter Description

  • asdBlasMakeRotPlan

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    Handle of the Csrot operator.

  • asdBlasCsrot

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    Handle of the Csrot operator.

    n

    Input

    const int64_t

    Number of complex elements in the vector

    x

    Input/Output

    aclTensor *

    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 [n].

    incx

    Input

    const int64_t

    Memory address increment between consecutive elements of x (currently restricted to 1).

    y

    Input/Output

    aclTensor *

    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 [n].

    incy

    Input

    const int64_t

    Memory address increment between consecutive elements of y (currently restricted to 1).

    c

    Input

    const float *

    Pointer to the cosine value of the rotation matrix.

    s

    Input

    const float *

    Pointer to the sine value of the rotation matrix.

Return Value Description

For details about the return values, see Return Value.

Constraints

  • asdBlasMakeRotPlan: none.
  • asdBlasCsrot
    • The input element count n currently supports the range [1, 2.50e+06].
    • The input shape of the operator is [n], and the output shape is [n].
    • The operator does not support the calculation for three or more dimensions.

Calling Example

For details about the operator calling example, see Csrot.