Computes a scalar-matrix-matrix product and adds the result to a scalar-matrix product.
FORTRAN 77:
call sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call scgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call dzgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
Fortran 95:
call gemm(a, b, c [,transa][,transb] [,alpha][,beta])
The FORTRAN 77 interfaces are specified in the mkl_blas.fi include file, the Fortran 95 interfaces are specified in the blas.f90 include file, and the C interfaces are specified in the mkl_blas.h include file.
The ?gemm routines perform a matrix-matrix operation with general matrices. The operation is defined as C := alpha*op(A)*op(B) + beta*C,
where:
op(x) is one of op(x) = x, or op(x) = x', or op(x) = conjg(x'),
alpha and beta are scalars,
A, B and C are matrices:
op(A) is an m-by-k matrix,
op(B) is a k-by-n matrix,
C is an m-by-n matrix.
See also ?gemm3m, BLAS-like extension routines, that use matrix multiplication for similar matrix-matrix operations.
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';
if transa = 'C' or 'c', then op(A) = conjg(A').
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';
if transb = 'C' or 'c', then op(B) = conjg(B').
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.
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.
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.
REAL for sgemm
DOUBLE PRECISION for dgemm
COMPLEX for cgemm, scgemm
DOUBLE COMPLEX for zgemm, dzgemm
Specifies the scalar alpha.
REAL for sgemm, scgemm
DOUBLE PRECISION for dgemm, dzgemm
COMPLEX for cgemm
DOUBLE COMPLEX for zgemm
Array, DIMENSION (lda, ka), where ka is k when transa = 'N' or 'n', and is m otherwise. Before entry with transa = 'N' or 'n', the leading m-by-k part of the array a must contain the matrix A, otherwise the leading k-by-m part of the array a must contain the matrix A.
INTEGER. Specifies the leading dimension of a as declared in the calling (sub)program. When transa = 'N' or 'n', then lda must be at least max(1, m), otherwise lda must be at least max(1, k).
REAL for sgemm
DOUBLE PRECISION for dgemm
COMPLEX for cgemm, scgemm
DOUBLE COMPLEX for zgemm, dzgemm
Array, DIMENSION (ldb, kb), where kb is n when transb = 'N' or 'n', and is k otherwise. Before entry with transb = 'N' or 'n', the leading k-by-n part of the array b must contain the matrix B, otherwise the leading n-by-k part of the array b must contain the matrix B.
INTEGER. Specifies the leading dimension of b as declared in the calling (sub)program. When transb = 'N' or 'n', then ldb must be at least max(1, k), otherwise ldb must be at least max(1, n).
REAL for sgemm
DOUBLE PRECISION for dgemm
COMPLEX for cgemm, scgemm
DOUBLE COMPLEX for zgemm, dzgemm
Specifies the scalar beta.
When beta is equal to zero, then c need not be set on input.
REAL for sgemm
DOUBLE PRECISION for dgemm
COMPLEX for cgemm, scgemm
DOUBLE COMPLEX for zgemm, dzgemm
Array, DIMENSION (ldc, n).
Before entry, the leading m-by-n part of the array c must contain the matrix C, except when beta is equal to zero, in which case c need not be set on entry.
INTEGER. Specifies the leading dimension of c as declared in the calling (sub)program. The value of ldc must be at least max(1, m).
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95 Interface Conventions.
Specific details for the routine gemm interface are the following:
Holds the matrix A of size (ma,ka) where
ka = k if transa= 'N',
ka = m otherwise,
ma = m if transa= 'N',
ma = k otherwise.
Holds the matrix B of size (mb,kb) where
kb = n if transb = 'N',
kb = k otherwise,
mb = k if transb = 'N',
mb = n otherwise.
Holds the matrix C of size (m,n).
Must be 'N', 'C', or 'T'.
The default value is 'N'.
Must be 'N', 'C', or 'T'.
The default value is 'N'.
The default value is 1.
The default value is 0.
Copyright © 1994 - 2011, Intel Corporation. All rights reserved.