Developer Reference for Intel® oneAPI Math Kernel Library for C
mkl_?omatadd
Scales and sums two matrices in addition to performing out-of-place transposition operations.
Syntax
void mkl_somatadd(char ordering, char transa, char transb, size_t m, size_t n,
const float alpha, const float *A, size_t lda,
const float beta, const float *B, size_t ldb,
float *C, size_t ldc);
void mkl_domatadd(char ordering, char transa, char transb, size_t m, size_t n,
const double alpha, const double *A, size_t lda,
const double beta, const double *B, size_t ldb,
double *C, size_t ldc);
void mkl_comatadd(char ordering, char transa, char transb, size_t m, size_t n,
const MKL_Complex8 alpha, const MKL_Complex8 *A, size_t lda,
const MKL_Complex8 beta, const MKL_Complex8 *B, size_t ldb,
MKL_Complex8 *C, size_t ldc);
void mkl_zomatadd(char ordering, char transa, char transb, size_t m, size_t n,
const MKL_Complex16 alpha, const MKL_Complex16 *A, size_t lda,
const MKL_Complex16 beta, const MKL_Complex16 *B, size_t ldb,
MKL_Complex16 *C, size_t ldc);
Include Files
mkl.h
Description
The mkl_?omatadd routine scales and adds two matrices in addition to performing out-of-place transposition operations. A transposition operation can be no operation, a transposition, a conjugate transposition, or a conjugation (without transposition). The following out-of-place memory movement is done:
C := alpha*op(A) + beta*op(B)
where the op(A) and op(B) operations are transpose, conjugate-transpose, conjugate (no transpose), or no transpose, depending on the values of transa and transb . If no transposition of the source matrices is required, m is the number of rows and n is the number of columns in the source matrices A and B . In this case, the output matrix C is m -by- n .
In general, a , b , and c must not overlap in memory, with the exception of the following in-place operations:
a and c can point to the same memory if transa is non-transpose and lda = ldc .
b and c can point to the same memory if transb is non-transpose and ldb = ldc .
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the section “Interfaces” below.
Input Parameters
ordering
Ordering of the matrix storage.
If ordering = ‘R’ or ‘r’ , the ordering is row-major. If ordering = ‘C’ or ‘c’ , the ordering is column-major.
transa
Parameter that specifies the operation type on matrix A .
If transa = ‘N’ or ‘n’ , op(A)=A and the matrix A is assumed unchanged on input. If transa = ‘T’ or ‘t’ , it is assumed that A should be transposed. If transa = ‘C’ or ‘c’ , it is assumed that A should be conjugate transposed. If transa = ‘R’ or ‘r’ , it is assumed that A should be conjugated (and not transposed). If the data is real, then transa = ‘R’ is the same as transa = ‘N’ , and transa = ‘C’ is the same as transa = ‘T’ .
transb
Parameter that specifies the operation type on matrix B .
If transb = ‘N’ or ‘n’ , op(B)=B and the matrix B is assumed unchanged on input. If transb = ‘T’ or ‘t’ , it is assumed that B should be transposed. If transb = ‘C’ or ‘c’ , it is assumed that B should be conjugate transposed. If transb = ‘R’ or ‘r’ , it is assumed that B should be conjugated (and not transposed). If the data is real, then transb = ‘R’ is the same as transb = ‘N’ , and transb = ‘C’ is the same as transb = ‘T’ .
m
The number of matrix rows in op( A ), op( B ), and C .
n
The number of matrix columns in op( A ), op( B ), and C .
- alpha
-
REAL for mkl_somatadd . DOUBLE PRECISION for mkl_domatadd . COMPLEX for mkl_comatadd . DOUBLE COMPLEX for mkl_zomatadd . This parameter scales the input matrix by alpha .
- a
-
REAL for mkl_somatadd . DOUBLE PRECISION for mkl_domatadd . COMPLEX for mkl_comatadd . DOUBLE COMPLEX for mkl_zomatadd . Array of size a(lda,*) if alpha is nonzero. Otherwise the array is never accessed. Pointer to array for input matrix A. If alpha is zero, a is never accessed and may be a null pointer.
lda
Distance between the first elements in adjacent columns (in the case of the column-major order) or rows (in the case of the row-major order) in the source matrix A ; measured in the number of elements.
For ordering = ‘C’ or ‘c’ : when transa = ‘N’ , ‘n’ , ‘R’ , or ‘r’ , lda must be at least max(1,m) ; otherwise lda must be max(1,n) . For ordering = ‘R’ or ‘r’ : when transa = ‘N’ , ‘n’ , ‘R’ , or ‘r’ , lda must be at least max(1,n) ; otherwise lda must be max(1,m) .
- beta
-
REAL for mkl_somatadd . DOUBLE PRECISION for mkl_domatadd . COMPLEX for mkl_comatadd . DOUBLE COMPLEX for mkl_zomatadd . This parameter scales the input matrix by beta .
- b
-
REAL for mkl_somatadd . DOUBLE PRECISION for mkl_domatadd . COMPLEX for mkl_comatadd . DOUBLE COMPLEX for mkl_zomatadd . Array of size b(lda,*) if beta is nonzero. Otherwise the array is never accessed. Pointer to array for input matrix B. If beta is zero, b is never accessed and may be a null pointer.
ldb
Distance between the first elements in adjacent columns (in the case of the column-major order) or rows (in the case of the row-major order) in the source matrix B ; measured in the number of elements.
For ordering = ‘C’ or ‘c’ : when transa = ‘N’ , ‘n’ , ‘R’ , or ‘r’ , ldb must be at least max(1,m) ; otherwise ldb must be max(1,n) . For ordering = ‘R’ or ‘r’ : when transa = ‘N’ , ‘n’ , ‘R’ , or ‘r’ , ldb must be at least max(1,n) ; otherwise ldb must be max(1,m) .
ldc
Distance between the first elements in adjacent columns (in the case of the column-major order) or rows (in the case of the row-major order) in the destination matrix C ; measured in the number of elements.
If ordering = ‘C’ or ‘c’ , then ldc must be at least max(1, m) , otherwise ldc must be at least max(1, n) .
Output Parameters
- c
-
REAL for mkl_somatadd . DOUBLE PRECISION for mkl_domatadd . COMPLEX for mkl_comatadd . DOUBLE COMPLEX for mkl_zomatadd .
Array .
Interfaces
FORTRAN 77:
SUBROUTINE mkl_somatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
CHARACTER*1 ordering, transa, transb
INTEGER m, n, lda, ldb, ldc
REAL alpha, beta
REAL a(lda,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_domatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
CHARACTER*1 ordering, transa, transb
INTEGER m, n, lda, ldb, ldc
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION a(lda,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_comatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
CHARACTER*1 ordering, transa, transb
INTEGER m, n, lda, ldb, ldc
COMPLEX alpha, beta
COMPLEX a(lda,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_zomatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
CHARACTER*1 ordering, transa, transb
INTEGER m, n, lda, ldb, ldc
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX a(lda,*), b(ldb,*), c(ldc,*)