Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
?gemm_batch_strided
Computes groups of matrix-matrix product with general matrices.
Syntax
call sgemm_batch_strided(transa, transb, m, n, k, alpha, a, lda, stridea, b, ldb, strideb, beta,
c, ldc, stridec, batch_size)
call dgemm_batch_strided(transa, transb, m, n, k, alpha, a, lda, stridea, b, ldb, strideb, beta,
c, ldc, stridec, batch_size)
call cgemm_batch_strided(transa, transb, m, n, k, alpha, a, lda, stridea, b, ldb, strideb, beta,
c, ldc, stridec, batch_size)
call zgemm_batch_strided(transa, transb, m, n, k, alpha, a, lda, stridea, b, ldb, strideb, beta,
c, ldc, stridec, batch_size)
Include Files
mkl.fi
Description
The ?gemm_batch_stridedcblas_?gemm_batch_strided routines perform a series of matrix-matrix operations with general matrices. They are similar to the ?gemmcblas_?gemm routine counterparts, but the ?gemm_batch_stridedcblas_?gemm_batch_strided routines perform matrix-matrix operations with groups of matrices. The groups contain matrices with the same parameters.
All matrix a (respectively, b or c ) have the same parameters (size, leading dimension, transpose operation, alpha, beta scaling) and are stored at constant stridea (respectively, strideb or stridec ) from each other. The operation is defined as
For i = 0 … batch_size – 1
Ai, Bi and Ci are matrices at offset i * stridea, i * strideb and i * stridec in a, b and c
Ci = alpha * Ai * Bi + beta * Ci
end for
Input Parameters
- layout
-
Specifies whether two-dimensional array storage is row-major (CblasRowMajor) or column-major (CblasColMajor).
- transa
-
CHARACTER*1 .
Specifies op(A) the transposition operation applied to the matrices A .
if transa = ‘N’ or ‘n’ , then op(A) = A;
if transa = ‘T’ or ‘t’ , then op(A) = A T ;
if transa = ‘C’ or ‘c’ , then op(A) = A H .
- transb
-
CHARACTER*1 .
Specifies op(B) the transposition operation applied to the matrices B .
if transb = ‘N’ or ‘n’ , then op(B) = B;
if transb = ‘T’ or ‘t’ , then op(B) = B T ;
if transb = ‘C’ or ‘c’ , then op(B) = B H .
- m
-
INTEGER . Number of rows of the op(A) and C matrices. Must be at least 0.
- n
-
INTEGER . Number of columns of the op(B) and C matrices. Must be at least 0.
- k
-
INTEGER . Number of columns of the op(A) matrix and number of rows of the op(B) matrix. Must be at least 0.
- alpha
-
REAL for sgemm_batch_strided DOUBLE PRECISION for dgemm_batch_strided COMPLEX for cgemm_batch_strided DOUBLE COMPLEX for zgemm_batch_strided Specifies the scalar alpha .
- a
-
REAL for sgemm_batch_strided DOUBLE PRECISION for dgemm_batch_strided COMPLEX for cgemm_batch_strided DOUBLE COMPLEX for zgemm_batch_strided Array of size at least stridea * batch_size holding the a matrices.
- lda
-
INTEGER . Specifies the leading dimension of the a matrices.
- stridea
-
INTEGER . Stride between two consecutive a matrices.
- b
-
REAL for sgemm_batch_strided DOUBLE PRECISION for dgemm_batch_strided COMPLEX for cgemm_batch_strided DOUBLE COMPLEX for zgemm_batch_strided Array of size at least strideb * batch_size holding the b matrices.
- ldb
-
INTEGER . Specifies the leading dimension of the b matrices.
- strideb
-
INTEGER . Stride between two consecutive b matrices.
- beta
-
REAL for sgemm_batch_strided DOUBLE PRECISION for dgemm_batch_strided COMPLEX for cgemm_batch_strided DOUBLE COMPLEX for zgemm_batch_strided Specifies the scalar beta .
- c
-
REAL for sgemm_batch_strided DOUBLE PRECISION for dgemm_batch_strided COMPLEX for cgemm_batch_strided DOUBLE COMPLEX for zgemm_batch_strided Array of size at least stridec * batch_size holding the c matrices. If layout=CblasColMajor, before entry, the leading m -by- n part of the array c + i * stridec must contain the matrix Ci . If layout=CblasRowMajor, before entry, the leading n -by- m part of the array c + i * stridec must contain the matrix Ci .
- ldc
-
INTEGER . Specifies the leading dimension of the c matrices.
Must be at least max(1, m ) .
- stridec
-
INTEGER . Specifies the stride between two consecutive c matrices.
Must be at least ldc* n .
- batch_size
-
INTEGER . Number of gemm computations to perform and a , b and c matrices. Must be at least 0.
Output Parameters
- c
-
Array holding the batch_size updated c matrices.