Developer Reference

  • 098
  • 03/30/2020
  • Public Content
Contents

?gemm_pack

Performs scaling and packing of the matrix into the previously allocated buffer.

Syntax

call sgemm_pack
(
identifier
,
trans
,
m
,
n
,
k
,
alpha
,
src
,
ld
,
dest
)
call dgemm_pack
(
identifier
,
trans
,
m
,
n
,
k
,
alpha
,
src
,
ld
,
dest
)
Include Files
  • mkl.fi
Description
The
?gemm_pack
routine is one of a set of related routines that enable use of an internal packed storage. Call
?gemm_pack
after you allocate a buffer whose size is given by
?gemm_pack_get_size
. The
?gemm_pack
routine scales the identified matrix by alpha and packs it into the buffer allocated previously.
Do not copy the packed matrix to a different address because the internal implementation depends on the alignment of internally-stored metadata.
The
?gemm_pack
routine performs this operation:
dest
:=
alpha
*op(
src
)
as part of the computation
C
:=
alpha
*op(
A
)*op(
B
) +
beta
*
C
where:

    op(
    X
    )
    is one of the operations
    op(
    X
    ) =
    X
    ,
    op(
    X
    ) =
    X
    T
    , or
    op(
    X
    ) =
    X
    H
    ,

    alpha
    and
    beta
    are scalars,

    src
    is a matrix,

    A
    ,
    B
    , and
    C
    are matrices

    op(
    src
    )
    is an
    m
    -by-
    k
    matrix if
    identifier
    =
    'A'
    or
    'a'
    ,

    op(
    src
    )
    is a
    k
    -by-
    n
    matrix if
    identifier
    =
    'B'
    or
    'b'
    ,

    dest
    is an internal packed storage buffer.

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
identifier
CHARACTER*1
.
Specifies which matrix is to be packed:
If
identifier
=
'A'
or
'a'
, the routine allocates storage to pack matrix
A
.
If
identifier
=
'B'
or
'b'
, the routine allocates storage to pack matrix
B
.
trans
CHARACTER*1
.
Specifies the form of
op(
src
)
used in the packing:
If
trans
=
'N'
or
'n'
 
op(
src
) =
src
.
If
trans
=
'T'
or
't'
 
op(
src
) =
src
T
.
If
trans
=
'C'
or
'c'
 
op(
src
) =
src
H
.
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
n
must be at least zero.
k
INTEGER
.
Specifies the number of columns of the matrix
op(
A
)
and the number of rows of the matrix
op(
B
)
. The value of
k
must be at least zero.
alpha
REAL
for
sgemm_pack
DOUBLE PRECISION
for
dgemm_pack
Specifies the scalar
alpha
.
src
REAL
for