aclblasHgemm

Applicable Products

Product

Supported

Ascend 950PR / Ascend 950DT

×

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

Function Usage

Computes matrix-matrix multiplication: C = αAB + βC. Both the input and output are of data type FLOAT16. This API is asynchronous.

Prototype

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
aclError aclblasHgemm(aclTransType transA,
aclTransType transB,
aclTransType transC,
int m,
int n,
int k,
const aclFloat16 *alpha,
const aclFloat16 *matrixA,
int lda,
const aclFloat16 *matrixB,
int ldb,
const aclFloat16 *beta,
aclFloat16 *matrixC,
int ldc,
aclComputeType type,
aclrtStream stream)

Parameters

Parameter

Input/Output

Description

transA

Input

Transpose flag of matrix A. For details about the type definition, see aclTransType.

transB

Input

Transpose flag of matrix B. For details about the type definition, see aclTransType.

transC

Input

Transpose flag of matrix C. For details about the type definition, see aclTransType.

Currently, the value can only be ACL_TRANS_N.

m

Input

Number of rows in matrix A and matrix C.

n

Input

Number of columns in matrix B and matrix C.

k

Input

Number of columns in matrix A and number of rows in matrix B.

alpha

Input

Pointer to scalar α used for executing the multiplication operation. For the type definition, see aclFloat16.

matrixA

Input

Pointer to matrix A. For the type definition, see aclFloat16.

lda

Input

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.

matrixB

Input

Pointer to matrix B. For the type definition, see aclFloat16.

ldb

Input

Leading dimension of matrix B. For row-major transpose, ldb is the number of columns of matrix B.

This parameter is reserved and can only be set to –1.

beta

Input

Pointer to scalar β used for executing the multiplication operation. For the type definition, see aclFloat16.

matrixC

Input and output

Pointer to matrix C. For the type definition, see aclFloat16.

ldc

Input

Leading dimension of matrix C. This parameter is reserved and can only be set to –1.

type

Input

Computation precision type (high precision by default). For details about the type definition, see aclComputeType.

stream

Input

Stream where the operator is executed. For the type definition, see aclrtStream.

Returns

0 on success; else, failure. For details, see aclError.