Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

mkl_?omatadd

Scales and sums two matrices including 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, as well as 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.

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

This parameter scales the input matrix by alpha.

a

Array.

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

This parameter scales the input matrix by beta.

b

Array.

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

Array.

Interfaces