cblas_gemm_*_compute
cblas_gemm_*_compute
Computes a matrix-matrix product with general integer matrices (where one or both input matrices are stored in a packed data structure) and adds the result to a scalar-matrix product.
Syntax
void cblas_gemm_s8u8s32_compute
(
const
CBLAS_LAYOUT
Layout
,
const
MKL_INT
transa
,
const
MKL_INT
transb
,
const
CBLAS_OFFSET
offsetc
,
const
MKL_INT
m
,
const
MKL_INT
n
,
const
MKL_INT
k
,
const
float
alpha
,
const
void
*a
,
const
MKL_INT
lda
,
const
MKL_INT8
oa
,
const
void
*b
,
const
MKL_INT
ldb
,
const
MKL_INT8
ob
,
const
float
beta
,
MKL_INT32
*c
,
const
MKL_INT
ldc
,
const
MKL_INT32
*oc
);
void cblas_gemm_s16s16s32_compute
(
const
CBLAS_LAYOUT
Layout
,
const
MKL_INT
transa
,
const
MKL_INT
transb
,
const
CBLAS_OFFSET
offsetc
,
const
MKL_INT
m
,
const
MKL_INT
n
,
const
MKL_INT
k
,
const
float
alpha
,
const
MKL_INT16
*a
,
const
MKL_INT
lda
,
const
MKL_INT16
oa
,
const
MKL_INT16
*b
,
const
MKL_INT
ldb
,
const
MKL_INT16
ob
,
const
float
beta
,
MKL_INT32
*c
,
const
MKL_INT
ldc
,
const
MKL_INT32
*oc
);
Include Files
- mkl.h
Description
The
cblas_gemm_*_compute
routine is one of a set of related routines
that enable use of an internal packed storage.
After calling cblas_gemm_*_pack
call cblas_gemm_*_compute
to computeC
:= alpha
*(op(A
) + A_offset
)*(op(B
) + B_offset
) + beta
*C
+ C_offset
where:
op(
is either X
) op(
or X
) = X
op(
X
) = X
T
alpha
and beta
are scalarsA
, B
, and
C
are matrices: op(
is an A
)m
-by-k
matrix, op(
is a B
)k
-by-n
matrix,C
is an
m
-by-n
matrix.A_offset
is an
m
-by-k
matrix with every element equal to the value oa
.B_offset
is an
k
-by-n
matrix with every element equal to the value ob
.C_offset
is an
m
-by-n
matrix defined by the oc
array as described in the description of the offsetc
parameter.You must use the same value of the
Layout
parameter for the entire sequence of related cblas_?gemm_pack
and cblas_?gemm_compute
calls. For best performance, use the same number of threads for packing and for computing.
If you are 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
- CBLAS_LAYOUTSpecifies whether two-dimensional array storage is row-major (CblasRowMajor) or column-major(CblasColMajor).
- transa
- MKL_INTSpecifies the form ofop(used in the packing:A)Iftransa=CblasNoTransop(.A) =AIftransa=CblasTransop(.A) =ATIftransa=CblasPackedthe matrix in arrayais packed into a format internal toandIntel® oneAPI Math Kernel Libraryldais ignored.
- transb
- MKL_INTSpecifies the form ofop(used in the packing:B)Iftransb=CblasNoTransop(.B) =BIftransb=CblasTransop(.B) =BTIftransb=CblasPackedthe matrix in arraybis packed into a format internal toandIntel® oneAPI Math Kernel Libraryldbis ignored.
- offsetc
- CBLAS_OFFSETSpecifies the form ofC_offsetused in the matrix multiplication.Ifoffsetc=CblasFixOffset:ochas a single element and every element ofC_offsetis equal to this element.Ifoffsetc=CblasColOffset:ochas a size ofmand every element ofC_offsetis equal tooc.Ifoffsetc=CblasRowOffset:ochas a size ofnand every element ofC_offsetis equal tooc.
- m
- MKL_INTSpecifies the number of rows of the matrixop(and of the matrixA)C. The value ofmmust be at least zero.
- n
- MKL_INTSpecifies the number of columns of the matrixop(and the number of columns of the matrixB)C. The value ofnmust be at least zero.
- k
- MKL_INTSpecifies the number of columns of the matrixop(and the number of rows of the matrixA)op(. The value ofB)kmust be at least zero.
- alpha
- floatSpecifies the scalaralpha.
- a
- void*forgemm_s8u8s32_computeMKL_INT16*forgemm_s16s16s32_computeLayout=CblasColMajortransa=CblasNoTransArray, size.lda*kBefore entry, the leadingm-by-kpart of the arrayamust contain the matrixA.Forcblas_gemm_s8u8s32_compute, the element in theaarray must be an 8-bit signed integer.transa=CblasTransArray, size.lda*mBefore entry, the leadingk-by-mpart of the arrayamust contain the matrixA.Forcblas_gemm_s8u8s32_compute, the element in theaarray must be an 8-bit signed integer.transa=CblasPackedArray of size returned bycblas_gemm_*_pack_get_sizeand initialized usingcblas_gemm_*_packLayout=CblasRowMajortransa=CblasNoTransArray, size.lda*mBefore entry, the leadingk-by-mpart of the arrayamust contain the matrixA.Forcblas_gemm_s8u8s32_compute, the element in theaarray must be an 8-bit unsigned integer.transa=CblasTransArray, size.lda*kBefore entry, the leadingm-by-kpart of the arrayamust contain the matrixA.Forcblas_gemm_s8u8s32_compute, the element in theaarray must be an 8-bit unsigned integer.transa=CblasPackedArray size returned bycblas_gemm_*_pack_get_sizeand initialized usingcblas_gemm_*_pack
- lda
- MKL_INTSpecifies the leading dimension ofaas declared in the calling (sub)program.transa=CblasNoTranstransa=CblasTransLayout=CblasColMajorldamust be at leastmax(1,.m)ldamust be at leastmax(1,.k)Layout=CblasRowMajorldamust be at leastmax(1,.k)ldamust be at leastmax(1,.m)
- oa
- MKL_INT8 forcblas_gemm_s8u8s32_computeMKL_INT16 forcblas_gemm_s16s16s32_computeSpecifies the scalar offset value for the matrixA.
- b
- void*forgemm_s8u8s32_computeMKL_INT16*forgemm_s16s16s32_computeLayout=CblasColMajortransa=CblasNoTransArray, size.ldb*nBefore entry, the leadingk-by-npart of the arraybmust contain the matrixB.Forcblas_gemm_s8u8s32_compute, the element in thebarray must be an 8-bit unsigned integer.transa=CblasTransArray, size.ldb*kBefore entry, the leadingn-by-kpart of the arraybmust contain the matrixB.Forcblas_gemm_s8u8s32_compute, the element in thebarray must be an 8-bit unsigned integer.transa=CblasPackedArray of size returned bycblas_gemm_*_pack_get_sizeand initialized usingcblas_gemm_*_packLayout=CblasRowMajortransa=CblasNoTransArray, size.ldb*kBefore entry, the leadingn-by-kpart of the arraybmust contain the matrixB.Forcblas_gemm_s8u8s32_compute, the element in thebarray must be an 8-bit signed integer.transa=CblasTransArray, size.ldb*nBefore entry, the leadingk-by-npart of the arraybmust contain the matrixB.Forcblas_gemm_s8u8s32_compute, the element in thebarray must be an 8-bit signed integer.transa=CblasPackedArray of size returned bycblas_gemm_*_pack_get_sizeand initialized usingcblas_gemm_*_pack
- ldb
- MKL_INTSpecifies the leading dimension ofbas declared in the calling (sub)program.transb=CblasNoTranstransb=CblasTransLayout=CblasColMajorldbmust be at leastmax(1,.k)ldbmust be at leastmax(1,.n)Layout=CblasRowMajorldbmust be at leastmax(1,.n)ldbmust be at leastmax(1,.k)
- ob
- MKL_INT8 forcblas_gemm_s8u8s32_computeMKL_INT16 forcblas_gemm_s16s16s32_computeSpecifies the scalar offset value for the matrixB.
- beta
- floatSpecifies the scalarbeta.
- c
- MKL_INT32*Array:Layout=CblasColMajorArray, size.ldc*nBefore entry, the leadingm-by-npart of the arraycmust contain the matrixC, except whenbetais equal to zero, in which casecneed not be set on entry.Layout=CblasRowMajorArray, size.ldc*mBefore entry, the leadingn-by-mpart of the arraycmust contain the matrixC, except whenbetais equal to zero, in which casecneed not be set on entry.
- ldc
- MKL_INTSpecifies the leading dimension ofcas declared in the calling (sub)program.Layout=CblasColMajorldcmust be at leastmax(1,m)Layout=CblasRowMajorldcmust be at leastmax(1,n)
- oc
- MKL_INT32*Array, sizelen. Specifies the scalar offset value for the matrixC.Ifoffsetc=CblasFixOffset,lenmust be at least 1.Ifoffsetc=CblasColOffset,lenmust be at leastmax(1,.m)