Ctrmv

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

  • asdBlasMakeCtrmvPlan: initializes the Ctrmv operator configuration corresponding to the handle.
  • asdBlasCtrmv: single-precision complex matrix-vector multiplication operator, which is used to compute the product of a complex triangular matrix and a complex vector.

Formula:

  • asdBlasCtrmv formula:

    Matrix-vector product:

    Transposed matrix-vector product:

    Conjugately transposed matrix-vector product:

  • Example:

    Input A:

        [  [ 1+2i, 1+2i ],
          [ 1+2i, 1+2i ]  ]

    Input x:

        [  [ 0+0i, 1+i ]  ]

    The input uplo is L, the input trans is N, and the input diag is N.

    The input n is 2, the input lda is 2, and the input incx is 1.

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

        [  [ 0+0i, -1+3i ]  ]

Function Prototype

  • AspbStatus asdBlasMakeCtrmvPlan(asdBlasHandle handle, asdBlasFillMode_t uplo, int64_t n)
  • AspbStatus asdBlasCtrmv(asdBlasHandle handle, asdBlasFillMode_t uplo, asdBlasOperation_t trans, asdBlasDiagType_t diag,const int64_t n, aclTensor *A, const int64_t lda, aclTensor *x, const int64_t incx)

Parameter Description

  • asdBlasMakeCtrmvPlan

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    ctrmv operator handle.

    uplo

    Input

    asdBlasFillMode_t

    Storage format of matrix A.

    ASDBLAS_FILL_MODE_LOWER // Lower triangle
    ASDBLAS_FILL_MODE_UPPER // Upper triangle

    n

    Input

    int64_t

    Order of matrix A, and dimension of vector x.

  • asdBlasCtrmv

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    ctrmv operator handle.

    uplo

    Input

    asdBlasFillMode_t

    Storage format of matrix A.

    ASDBLAS_FILL_MODE_LOWER // Lower triangle
    ASDBLAS_FILL_MODE_UPPER // Upper triangle

    trans

    Input

    asdBlasDiagType_t

    Whether matrix A should be transposed.

    ASDBLAS_OP_N // Not transposed
    ASDBLAS_OP_T // Transposed
    ASDBLAS_OP_C // Conjugately transposed

    diag

    Input

    asdBlasDiagType_t

    Diagonal element handling mode of matrix A.

    ASDBLAS_DIAG_NON_UNIT // General matrix
    ASDBLAS_DIAG_UNIT // Unit matrix

    n

    Input

    const int64_t

    Order of matrix A, and dimension of vector x.

    A

    Input

    aclTensor *

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

    lda

    Input

    const int64_t

    Leading dimension of matrix A

    x

    Input/Output

    aclTensor *

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

    incx

    Input

    const int64_t

    Stride of elements in vector x

Return Value Description

For details about the return values, see Return Value.

Constraints

  • asdBlasMakeCtrmvPlan: none.
  • asdBlasCtrmv
    • The input element count n currently supports the range [1, 8192].
    • The input shape of the operator is [n, n] and [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 Ctrmv.