Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

mkl_?gemm_compact

Computes a matrix-matrix product of a set of compact format general matrices.

Syntax

void mkl_sgemm_compact (MKL_LAYOUT layout, MKL_TRANSPOSE transa, MKL_TRANSPOSE transb, MKL_INT m, MKL_INT n, MKL_INT k, float alpha, const float *ap, MKL_INT ldap, const float *bp, MKL_INT ldbp, float beta, float *cp, MKL_INT ldcp, MKL_COMPACT_PACK format, MKL_INT nm);

void mkl_dgemm_compact (MKL_LAYOUT layout, MKL_TRANSPOSE transa, MKL_TRANSPOSE transb, MKL_INT m, MKL_INT n, MKL_INT k, double alpha, const double *ap, MKL_INT ldap, const double *bp, MKL_INT ldbp, double beta, double *cp, MKL_INT ldcp, MKL_COMPACT_PACK format, MKL_INT nm);

void mkl_cgemm_compact (MKL_LAYOUT layout, MKL_TRANSPOSE transa, MKL_TRANSPOSE transb, MKL_INT m, MKL_INT n, MKL_INT k, mkl_compact_complex_float *alpha, const float *ap, MKL_INT ldap, const float *bp, MKL_INT ldbp, mkl_compact_complex_float *beta, float *cp, MKL_INT ldcp, MKL_COMPACT_PACK format, MKL_INT nm);

void mkl_zgemm_compact (MKL_LAYOUT layout, MKL_TRANSPOSE transa, MKL_TRANSPOSE transb, MKL_INT m, MKL_INT n, MKL_INT k, mkl_compact_complex_double *alpha, const double *ap, MKL_INT ldap, const double *bp, MKL_INT ldbp, mkl_compact_complex_double *beta, double *cp, MKL_INT ldcp, MKL_COMPACT_PACK format, MKL_INT nm);

Description

The mkl_?gemm_compact routine computes a scalar-matrix-matrix product and adds the result to a scalar-matrix product for a group of nm general matrices Ac that have been stored in compact format. The operation is defined for each matrix as:

Cc := alpha*op(Ac)*op(Bc) + beta*Cc

Where

  • op(Xc) is one of op(Xc) = Xc, or op(Xc) = XcT, or op(Xc) = XcH,

  • alpha and beta are scalars,

  • Ac, Bc, and Cc are matrices that have been stored in compact format,

  • op(Ac) is an m-by-k matrix for each matrix in the group,

  • op(Bc) is a k-by-n matrix for each matrix in the group,

  • and Cc is an m-by-n matrix.

Input Parameters
layout

Specifies whether two-dimensional array storage is row-major (MKL_ROW_MAJOR) or column-major (MKL_COL_MAJOR).

transa

Specifies the operation:

If transa=MKL_NOTRANS, then op(Ac):=Ac.

If transa=MKL_TRANS, then op(Ac):=AcT.

If transa=MKL_CONJTRANS, then op(Ac):=AcH.

transb

Specifies the operation:

If transb=MKL_NOTRANS, then op(Bc):=Bc.

If transb=MKL_TRANS, then op(Bc):=BcT.

If transb=MKL_CONJTRANS, then op(Bc):=BcH.

m
The number of rows of the matrices op(Ac), m >= 0.
n

The number of columns of matrices op(Bc) and Cc. n0.

k

The number of columns of matrices op(Ac) and the number of rows of matrices op(Bc). k0.

alpha

Specifies the scalar alpha.

ap

Points to the beginning of the array that stores the nmAc matrices. See Compact Format for more details.

 

transa=MKL_NOTRANS

transa=MKL_TRANS or transa=MKL_CONJTRANS

layout = MKL_COL_MAJOR

ap has size ldap*k*nm.

ap has size ldap*m*nm.

layout = MKL_ROW_MAJOR

ap has size ldap*m*nm.

ap has size ldap*k*nm.

ldap

Specifies the leading dimension of Ac.

bp

Points to the beginning of the array that stores the nmBc matrices. See Compact Format for more details.

 

transb=MKL_NOTRANS

transb=MKL_TRANS or transb=MKL_CONJTRANS

layout = MKL_COL_MAJOR

bp has size ldbp*n*nm.

bp has size ldbp*k*nm.

layout = MKL_ROW_MAJOR

bp has size ldbp*k*nm.

bp has size ldbp*n*nm.

ldbp

Specifies the leading dimension of Bc.

beta

Specifies the scalar beta.

cp

Before entry, cp points to the beginning of the array that stores the nmCc matrices, except when beta is equal to zero, in which case cp need not be set on entry.

layout = MKL_COL_MAJOR

cp has size ldap*n*nm.

layout = MKL_ROW_MAJOR

cp has size ldap*m*nm.

ldcp

Specifies the leading dimension of Cc.

layout = MKL_COL_MAJOR

ldcp must be at least max (1,m).

layout = MKL_ROW_MAJOR

ldcp must be at least max (1,n).

format

Specifies the format of the compact matrices. See Compact Format or mkl_get_format_compact for details.

nm

Total number of matrices stored in compact format in the group of matrices.

NOTE:

The values of ldap, ldbp, and ldcp used in mkl_?gemm_compact must be consistent with the values used in mkl_?get_size_compact, mkl_?gepack_compact, and mkl_?geunpack_compact.

Output Parameters
cp

Each matrix Cc is overwritten by the m-by-n matrix (alpha*op(Ac)*op(Bc) + beta*Cc).