Ssyr

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

  • asdBlasMakeSsyrPlan: initializes the Ssyr operator configuration corresponding to the handle.
  • asdBlasSsyr: computes the outer product of single-precision vectors and adds the result to a matrix.

Formula:

  • asdBlasSsyr formula:
  • Example:

    The input x is as follows:

    [   [ 1 ], 
        [ 2 ] ]

    The input A is as follows:

    [   [ 1, 2 ], 
        [ 3, 4 ]  ]

    The input uplo is U.

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

    Input alpha: 2.0

    :

     [ 1, 2 ]

    :

     [ 2, 4 ]

    :

    [ [ 2 ], [ 4 ] ] × [ 1, 2 ] =  [ [ 2, 4 ], [ 4, 8 ] ]

    After the Ssyr operator is called, the upper triangular data is updated, and the output A is as follows:

    [   [ 3, 6 ], 
        [ 3, 12 ]  ].

Function Prototype

  • AspbStatus asdBlasMakeSsyrPlan(asdBlasHandle handle)
  • AspbStatus asdBlasSsyr(asdBlasHandle handle, asdBlasFillMode_t uplo, const int64_t n, const float *alpha, aclTensor *x, const int64_t incx, aclTensor *A, const int64_t lda)

Parameter Description

  • asdBlasMakeSsyrPlan

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    Handle of the Ssyr operator.

  • asdBlasSsyr

    Parameter

    Input/Output

    Type

    Description

    handle

    Input

    asdBlasHandle

    Handle of the Ssyr operator.

    uplo

    Input

    asdBlasFillMode_t

    Triangular region of matrix A involved in the computation.

    ASDBLAS_FILL_MODE_LOWER // Lower triangle
    ASDBLAS_FILL_MODE_UPPER // Upper triangle

    n

    Input

    const int64_t

    Number of elements in vector x, that is, the number of rows and columns of matrix A.

    alpha

    Input

    const float *

    alpha, the scalar in the formula that scales the vector product.

    x

    Input

    aclTensor *

    x in the formula, which is a tensor on the device. The data type can be FLOAT32, 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).

    A

    Input/Output

    aclTensor *

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

    lda

    Input

    const int64_t

    Storage stride of elements in each column of matrix A (currently constrained to n).

Return Value Description

For details about the return values, see Return Value.

Constraints

  • asdBlasMakeSsyrPlan: none.
  • asdBlasSsyr
    • The input element count n currently supports the range [1, 16384].
    • The input shape is [n] or [n, n], and the output shape is [n, n].
    • The operator does not support the calculation for three or more dimensions.

Calling Example

For details about the operator calling example, see Ssyr.