Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
gemm_*_pack
Pack the matrix into the buffer allocated previously.
Syntax
call gemm_s8u8s32_pack(identifier, trans, m, n, k, src, ld, dest)
call gemm_s16s16s32_pack(identifier, trans, m, n, k, src, ld, dest)
Include Files
mkl.fi
Description
The gemm_*_packcblas_gemm_*_pack routine is one of a set of related routines that enable the use of an internal packed storage. Call gemm_*_packcblas_gemm_*_pack after you allocate a buffer whose size is given by cblas_gemm_*_pack_get_sizegemm_*_pack_get_size . The gemm_*_packcblas_gemm_*_pack routine packs the identified matrix into the buffer allocated previously.
The gemm_*_packcblas_gemm_*_pack routine performs this operation:
dest := op(src) as part of the computation C := alpha*(op(A) + A_offset)*(op(B) + B_offset) + beta*C + C_offset for integer types.
C := alpha*op(A) * op(B) + beta*C for bfloat16 type.
where: op(X) is one of the operations op(X) = X or op(X) = X^{T}alpha and beta are scalars, src is a matrix, A , A_offset , B , B_offset , c ,and C_offset are matrices op(src) is an m -by- k matrix if identifier = CblasAMatrix 'A' or 'a' , op(src) is a k -by- n matrix if identifier = CblasBMatrix 'B' or 'b' , dest is the buffer previously allocated to store the matrix packed into an internal format A_offset is an m -by- k matrix. B_offset is an k -by- n matrix. C_offset is an m -by- n matrix.
For best performance, use the same number of threads for packing and for computing.
If packing for both A and B matrices, you must use the same number of threads for packing A as for packing B .
Input Parameters
- Layout
-
Specifies whether two-dimensional array storage is row-major ( CblasRowMajor ) or column-major( CblasColMajor ).
- identifier
-
Specifies which matrix is to be packed:
If identifier = 'A' or 'a' CblasAMatrix , the A matrix is packed.
If identifier = 'B' or 'b' CblasBMatrix , the B matrix is packed.
- trans
-
Specifies the form of op(src) used in the packing:
If trans = 'N' or 'n' CblasNoTrans op(src) = src .
If trans = 'T' or 't' CblasTrans op(src) = src^{T} .
- m
-
Specifies the number of rows of matrix op( A ) and of the matrix C . The value of m must be at least zero.
- n
-
Specifies the number of columns of matrix op( B ) and the number of columns of matrix C . The value of n must be at least zero.
- k
-
Specifies the number of columns of matrix op( A ) and the number of rows of matrix op( B ). The value of k must be at least zero.
- src
-
MKL_BF16* for cblas_gemm_bf16bf16f32_pack , MKL_F16* for cblas_gemm_f16f16f32_pack , void* for cblas_gemm_s8u8s32_pack and MKL_INT16* for cblas_gemm_s16s16s32_pack INTEGER*1 for gemm_s8u8s32_pack and INTEGER*2 for gemm_s16s16s32_pack
- ld
-
INTEGER. Specifies the leading dimension of src as declared in the calling (sub)program.
- dest
-
Buffer for the packed matrix.
Output Parameters
- dest
-
Overwritten by the matrix op(src) stored in a format internal to Intel® oneAPI Math Kernel Library (oneMKL) .