Function: create_handle_for_gemm_ex

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

Creates a handle to matrix-matrix multiplication. The data types of the input and output data are set using arguments.

After the handle is created, call acl.op.execute_with_handle to execute the operator.

Prototype

  • C Prototype
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    aclError aclblasCreateHandleForGemmEx(aclTransType transA,
    aclTransType transB,
    aclTransType transC,
    int m,
    int n,
    int k,
    aclDataType dataTypeA,
    aclDataType dataTypeB,
    aclDataType dataTypeC,
    aclComputeType type,
    aclopHandle **handle)
    
  • Python Function
    1
    handle, ret = acl.blas.create_handle_for_gemm_ex(trans_a, trans_b, trans_c, m, n, k, data_type_a, data_type_b, data_type_c,type)
    

Parameter Description

Parameter

Description

trans_a

Int, whether matrix A is transposed.

trans_b

Int, whether matrix B is transposed.

trans_c

Int, whether matrix C is transposed. Currently, only aclTrans_N is supported.

m

Int, number of rows in matrix A and matrix C.

n

Int, number of columns in matrix B and matrix C.

k

Int, number of columns in matrix A and number of rows in matrix B.

data_type_a

Int, data type of matrix A.

data_type_b

Int, data type of matrix B.

data_type_c

Int, data type of matrix C.

type

Int, computation precision.

Return Value Description

Return Value

Description

handle

Int, pointer address of the handle data of the operator to be executed.

ret

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

Restrictions

A, B, and C support a limited combination of data types.

Data Type of A

Data Type of x

Data Type of y

aclFloat16

aclFloat16

aclFloat16

aclFloat16

aclFloat16

float(float32)

int8_t

int8_t

float(float32)

int8_t

int8_t

int32_t