Developer Reference

  • 2020.2
  • 07/15/2020
  • Public Content
Contents

gemm_*

Computes a matrix-matrix product with general integer matrices.

Syntax

call gemm_s8u8s32
(
transa
,
transb
,
offsetc
,
m
,
n
,
k
,
alpha
,
a
,
lda
,
oa
,
b
,
ldb
,
ob
,
beta
,
c
,
ldc
,
oc
)
call gemm_s16s16s32
(
transa
,
transb
,
offsetc
,
m
,
n
,
k
,
alpha
,
a
,
lda
,
oa
,
b
,
ldb
,
ob
,
beta
,
c
,
ldc
,
oc
)
Include Files
  • mkl.fi
Description
The
gemm_*
routines compute a scalar-matrix-matrix product and adds the result to a scalar-matrix product. To get the final result, a vector is added to each row or column of the output matrix. The operation is defined as:
C
:=
alpha
*(op(
A
) + A_offset)*(op(
B
) + B_offset) +
beta
*C + C_offset
where :

    op(
    X
    )
    is either
    op(
    X
    ) =
    X
    or
    op(
    X
    ) =
    X
    T
    ,

    A_offset
    is an
    m
    -by-
    k
    matrix with every element equal to the value
    oa
    ,

    B_offset
    is a
    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,

    alpha
    and
    beta
    are scalars,

    A
    is a matrix such that
    op(
    A
    )
    is
    m
    -by-
    k
    ,

    B
    is a matrix such that
    op(
    B
    )
    is
    k
    -by-
    n
    ,

    and
    C
    is an
    m
    -by-
    n
    matrix.

Input Parameters
transa
CHARACTER*1.
Specifies the form of op(
A
) used in the matrix multiplication:
if
transa
= 'N'
or
'n'
, then
op(
A
) =
A
;
if
transa
= 'T'
or
't'
, then
op(
A
) =
A
T
.
transb
CHARACTER*1.
Specifies the form of op(
B
) used in the matrix multiplication:
if
transb
= 'N'
or
'n'
, then
op(
B
) =
B
;
if
transb
= 'T'
or
't'
, then
op(
B
) =
B
T
.
offsetc
CHARACTER*1.
Specifies the form of
C_offset
used in the matrix multiplication.

    offsetc
    =
    'F'
    or
    'f'
    :
    oc
    has a single element and every element of
    C_offset
    is equal to this element.

    offsetc
    =
    'C'
    or
    'c'
    :
    oc
    has a size of
    m
    and every column of
    C_offset
    is equal to
    oc
    .

    offsetc
    =
    'R'
    or
    'r'
    :
    oc
    has a size of
    n
    and every row of
    C_offset
    is equal to
    oc
    .

m
INTEGER
.
Specifies the number of rows of the matrix
op(
A
)
and of the matrix
C
. The value of
m
must be at least zero.
n
INTEGER
.
Specifies the number of columns of the matrix
op(
B
)
and the number of columns of the matrix
C
. The value of