cblas_?gemm_compute
cblas_?gemm_compute
Computes a matrix-matrix product with general 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_sgemm_compute
(
const
CBLAS_LAYOUT
Layout
,
const
MKL_INT
transa
,
const
MKL_INT
transb
,
const
MKL_INT
m
,
const
MKL_INT
n
,
const
MKL_INT
k
,
const
float
*a
,
const
MKL_INT
lda
,
const
float
*b
,
const
MKL_INT
ldb
,
const
float
beta
,
float
*c
,
const
MKL_INT
ldc
);
void cblas_dgemm_compute
(
const
CBLAS_LAYOUT
Layout
,
const
MKL_INT
transa
,
const
MKL_INT
transb
,
const
MKL_INT
m
,
const
MKL_INT
n
,
const
MKL_INT
k
,
const
double
*a
,
const
MKL_INT
lda
,
const
double
*b
,
const
MKL_INT
ldb
,
const
double
beta
,
double
*c
,
const
MKL_INT
ldc
);
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
:= op(A
)*op(B
) + beta
*C
where:
op(
is one of the operations X
) op(
, X
) = X
op(
, or X
) = X
T
op(
,X
) = X
H
beta
is a scalar,A
, 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.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 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).
- transa
- Specifies the form ofop(used in the matrix multiplicationA), one of the:CBLAS_TRANSPOSEorCBLAS_STORAGEenumerated typesIftransa=CblasNoTransop(.A) =AIftransa=CblasTransop(.A) =ATIftransa=CblasConjTransop(.A) =AHIftransa=CblasPackedthe matrix in arrayais packed andldais ignored.
- transb
- Specifies the form ofop(used in the matrix multiplicationB), one of the:CBLAS_TRANSPOSEorCBLAS_STORAGEenumerated typesIftransb=CblasNoTransop(.B) =BIftransb=CblasTransop(.B) =BTIftransb=CblasConjTransop(.B) =BHIftransb=CblasPackedthe matrix in arraybis packed andldbis ignored.
- m
- Specifies the number of rows of the matrixop(and of the matrixA)C. The value ofmmust be at least zero.
- n
- Specifies the number of columns of the matrixop(and the number of columns of the matrixB)C. The value ofnmust be at least zero.
- k
- Specifies the number of columns of the matrixop(and the number of rows of the matrixA)op(. The value ofB)kmust be at least zero.
- a
- Array:transa=CblasNoTranstransa=CblasTransortransa=CblasConjTranstransa=CblasPackedLayout=CblasColMajorSize.lda*kBefore entry, the leadingm-by-kpart of the arrayamust contain the matrixA.Size.lda*mBefore entry, the leadingk-by-mpart of the arrayamust contain the matrixA.Stored in internal packed format.Layout=CblasRowMajorSize.lda*mBefore entry, the leadingk-by-mpart of the arrayamust contain the matrixA.Size.lda*kBefore entry, the leadingm-by-kpart of the arrayamust contain the matrixA.Stored in internal packed format.
- lda
- Specifies the leading dimension ofaas declared in the calling (sub)program.transa=CblasNoTranstransa=CblasTransortransa=CblasConjTranstransa=CblasPackedLayout=CblasColMajorldamust be at leastmax(1,.m)ldamust be at leastmax(1,.k)ldais ignored.Layout=CblasRowMajorldamust be at leastmax(1,.k)ldamust be at leastmax(1,.m)ldais ignored.
- b
- Array:transb=CblasNoTranstransb=CblasTransortransb=CblasConjTranstransb=CblasPackedLayout=CblasColMajorSize.ldb*nBefore entry, the leadingk-by-npart of the arraybmust contain the matrixB.Size.ldb*kBefore entry, the leadingn-by-kpart of the arraybmust contain the matrixB.Stored in internal packed format.Layout=CblasRowMajorSize.ldb*kBefore entry, the leadingn-by-kpart of the arraybmust contain the matrixB.Size.ldb*nBefore entry, the leadingk-by-npart of the arraybmust contain the matrixB.Stored in internal packed format.
- ldb
- Specifies the leading dimension ofbas declared in the calling (sub)program.transb=CblasNoTranstransb=CblasTransortransb=CblasConjTranstransb=CblasPackedLayout=CblasColMajorldbmust be at leastmax(1,.k)ldbmust be at leastmax(1,.n)ldbis ignored.Layout=CblasRowMajorldbmust be at leastmax(1,.n)ldbmust be at leastmax(1,.k)ldbis ignored.
- beta
- Specifies the scalarbeta. Whenbetais equal to zero, thencneed not be set on input.
- c
- Array:Layout=CblasColMajorSize.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=CblasRowMajorSize.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
- Specifies the leading dimension ofcas declared in the calling (sub)program.Layout=CblasColMajorldcmust be at leastmax(1,.m)Layout=CblasRowMajorldcmust be at leastmax(1,.n)
Output Parameters
- c
- Overwritten by them-by-nmatrixop(.A)*op(B) +beta*C