Function: hgemv

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Function Usage

Computes matrix-vector multiplication: y = αAx + βy. The inputs and outputs are all of data type aclFloat16. This API is asynchronous.

Prototype

  • C Prototype
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    aclError aclblasHgemv(aclTransType transA,
    int m,
    int n,
    const aclFloat16 *alpha,
    const aclFloat16 *a,
    int lda,
    const aclFloat16 *x,
    int incx,
    const aclFloat16 *beta,
    aclFloat16 *y,
    int incy,
    aclComputeType type,
    aclrtStream stream)
    
  • Python Function
    1
    ret = acl.blas.hgemv(trans_a, m, n, alpha, a, lda, x, incx, beta, y, incy, type, stream)
    

Parameters

Parameter

Description

trans_a

Int, whether matrix A is transposed.

m

Int, number of rows in matrix A (row-major first in data storing).

n

Int, number of columns in matrix A.

alpha

Int, data pointer address of scalar alpha used for executing the multiplication operation.

a

Int, data pointer address of matrix A.

lda

Int, leading dimension of matrix A. For row-major transpose, lda is the number of columns of matrix A. This parameter is reserved and can only be set to –1.

x

Int, data pointer address of vector x.

incx

Int, increment between successive x elements. This parameter is reserved and can only be set to –1.

beta

Int, data pointer address of scalar beta used for executing the multiplication operation.

y

Int, data pointer address of vector y.

incy

Int, increment between successive y elements. This parameter is reserved and can only be set to –1.

type

Int, computation precision type (high precision by default).

stream

Int, stream where the operator is executed.

Returns

Return Value

Description

ret

Int, error code: 0 on success; else, failure.

Reference

For the API call sequence, see API Call Sequence.