## Developer Reference

Contents

Computes a sum of two general matrices, with optional transposes.

## Description

The
routine performs an out-of-place scaled matrix addition with optional transposes in the arguments. The operation is defined as:
where:
• op(
X
) is one of op(
X
) =
X
, or op(
X
) =
X
T
, or op(
X
) =
X
H
• alpha
and
beta
are scalars
• A
,
B
and
C
are matrices
• op(
A
) is
m
x
n
matrix
• op(
B
) is
m
x
n
matrix
• C
is
m
x
n
matrix
supports the following precisions:
T
float
double
std::complex<float>
std::complex<double>

Syntax
``````namespace oneapi::mkl::blas::column_major {
oneapi::mkl::transpose transb,
std::int64_t m, std::int64_t n,
T alpha, sycl::buffer<T, 1> &a, std::int64_t lda,
T beta, sycl::buffer<T, 1> &b, std::int64_t ldb,
sycl::buffer<T, 1> &c, std::int64_t ldc)
}``````
``````namespace oneapi::mkl::blas::row_major {
oneapi::mkl::transpose transb,
std::int64_t m, std::int64_t n,
T alpha, sycl::buffer<T, 1> &a, std::int64_t lda,
T beta, sycl::buffer<T, 1> &b, std::int64_t ldb,
sycl::buffer<T, 1> &c, std::int64_t ldc)
}``````
Input Parameters
queue
The queue where the routine will be executed.
transa
Specifies op(
A
), the transposition operation applied to the matrix A.
transb
Specifies op(
B
), the transposition operation applied to the matrix B.
m
Number of rows for the result matrix
C
. Must be at least zero.
n
Number of columns for the result matrix
C
. Must be at least zero.
alpha
Scaling factor for the matrix
A
.
a
Buffer holding the input matrix
A
.
transa
=
transpose::nontrans
transa
=
transpose::trans
or
transa
=
transpose::conjtrans
Column major
A
is
m
x
n
matrix. Size of array
a
must be at least
lda
*
n
A
is
n
x
m
matrix. Size of array
a
must be at least
lda
*
m
Row major
A
is
m
x
n
matrix. Size of array
a
must be at least
lda
*
m
A
is
n
x
m
matrix. Size of array
a
must be at least
lda
*
n
lda
A
. Must be positive
transa
=
transpose::nontrans
transa
=
transpose::trans
or
transa
=
transpose::conjtrans
Column major
Must be at least
m
Must be at least
n
Row major
Must be at least
n
Must be at least
m
beta
Scaling factor for the matrix
B
.
b
Buffer holding the input matrix
B
.
transb
=
transpose::nontrans
transb
=
transpose::trans
or
transb
=
transpose::conjtrans
Column major
B
is
m
x
n
matrix. Size of array
b
must be at least
ldb
*
n
B
is
n
x
m
matrix. Size of array
b
must be at least
ldb
*
m
Row major
B
is
m
x
n
matrix. Size of array
b
must be at least
ldb
*
m
B
is
n
x
m
matrix. Size of array
b
must be at least
ldb
*
n
ldb
B
. Must be positive.
transb
=
transpose::nontrans
transb
=
transpose::trans
or
transb
=
transpose::conjtrans
Column major
Must be at least
m
Must be at least
n
Row major
Must be at least
n
Must be at least
m
c
Buffer holding output matrix
C
.
 Column major C is m x n matrix. Size of array c must be at least ldc * n Row major C is m x n matrix. Size of array c must be at least ldc * m
ldc
C
. If matrices are stored using column major layout,
ldc
must be at least
m
. If matrices are stored using row major layout,
ldc
must be at least
n
. Must be positive.
Output Parameters
c
Output buffer overwritten by
alpha
* op(
A
) +
beta
* op(
B
).

Syntax
``````namespace oneapi::mkl::blas::column_major {
oneapi::mkl::transpose transa,
oneapi::mkl::transpose transb,
std::int64_t m,
std::int64_t n,
T alpha,
const T *a,
std::int64_t lda,
T beta,
T *b,
std::int64_t ldb,
T *c,
std::int64_t ldc,
const std::vector<sycl::event> &dependencies = {});
}``````
``````namespace oneapi::mkl::blas::row_major {
oneapi::mkl::transpose transa,
oneapi::mkl::transpose transb,
std::int64_t m,
std::int64_t n,
T alpha,
const T *a,
std::int64_t lda,
T beta,
T *b,
std::int64_t ldb,
T *c,
std::int64_t ldc,
const std::vector<sycl::event> &dependencies = {});
}``````
Input Parameters
queue
The queue where the routine will be executed.
transa
Specifies op(
A
), the transposition operation applied to matrix
A
. See Data Types for more details.
transb
Specifies op(
B
), the transposition operation applied to matrix
B
. See Data Types for more details.
m
Number of rows for the result matrix
C
. Must be at least zero.
n
Number of columns for the result matrix
C
. Must be at least zero.
alpha
Scaling factor for the matrix
A
.
a
Pointer to input matrix
A
. See Matrix Storage for more details.
transa
=
transpose::nontrans
transa
=
transpose::trans
or
transa
=
transpose::conjtrans
Column major
A
is
m
x
n
matrix. Size of array
a
must be at least
lda
*
n
A
is
n
x
m
matrix. Size of array
a
must be at least
lda
*
m
Row major
A
is
m
x
n
matrix. Size of array
a
must be at least
lda
*
m
A
is
n
x
m
matrix. Size of array
a
must be at least
lda
*
n
lda
A
. Must be positive
transa
=
transpose::nontrans
transa
=
transpose::trans
or
transa
=
transpose::conjtrans
Column major
Must be at least
m
Must be at least
n
Row major
Must be at least
n
Must be at least
m
beta
Scaling factor for the matrix
B
.
b
Pointer to input matrix
B
. See Matrix Storage for more details.
transb
=
transpose::nontrans
transb
=
transpose::trans
or
transb
=
transpose::conjtrans
Column major
B
is
m
x
n
matrix. Size of array
b
must be at least
ldb
*
n
B
is
n
x
m
matrix. Size of array
b
must be at least
ldb
*
m
Row major
B
is
m
x
n
matrix. Size of array
b
must be at least
ldb
*
m
B
is
n
x
m
matrix. Size of array
b
must be at least
ldb
*
n
ldb
B
. Must be positive.
transb
=
transpose::nontrans
transb
=
transpose::trans
or
transb
=
transpose::conjtrans
Column major
Must be at least
m
Must be at least
n
Row major
Must be at least
n
Must be at least
m
c
Pointer to output matrix
C
. See Matrix Storage for more details.
 Column major C is m x n matrix. Size of array c must be at least ldc * n Row major C is m x n matrix. Size of array c must be at least ldc * m
ldc
C
. If matrices are stored using column major layout,
ldc
must be at least
m
. If matrices are stored using row major layout,
ldc
must be at least
n
. Must be positive.
dependencies
List of events to wait for before starting computation, if any. If omitted, defaults to no dependencies.
Output Parameters
c
Pointer to output matrix overwritten by
alpha
* op(
A
) +
beta
* op(
B
).
Return Values
Output event to wait for to ensure computation is complete.

#### Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.