omatadd#
Computes a sum of two general dense matrices, with optional transposes.
Description
The omatadd 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) = XT, or op(X) = XH
alpha and beta are scalars,
A and B are input matrices while C is an output matrix,
C is m x n,
A is m x n if the op(A) is not transposed or n by m if it is,
and B is m x n if the op(B) is not transposed or n by m if it is.
In general, A, B, and C should not overlap in memory, with the exception of
the following in-place operations:
AandCmay point to the same memory ifop(A)is non-transpose andlda=ldc;
BandCmay point to the same memory ifop(B)is non-transpose andldb=ldc.
omatadd supports the following precisions:
T
float
double
std::complex<float>
std::complex<double>
omatadd (Buffer Version)#
Syntax
namespace oneapi::mkl::blas::column_major {
void omatadd(sycl::queue &queue,
oneapi::mkl::transpose transa,
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 {
void omatadd(sycl::queue &queue,
oneapi::mkl::transpose transa,
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 should be executed.
- transa
Specifies op(
A), the transposition operation applied to the matrixA. See oneMKL defined datatypes for more details.- transb
Specifies op(
B), the transposition operation applied to the matrixB. See oneMKL defined datatypes 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
Buffer holding the input matrix
A.transa=transpose::nontranstransa=transpose::transortransa=transpose::conjtransColumn major
Aismxnmatrix. Size of arrayamust be at leastlda*nAisnxmmatrix. Size of arrayamust be at leastlda*mRow major
Aismxnmatrix. Size of arrayamust be at leastlda*mAisnxmmatrix. Size of arrayamust be at leastlda*n- lda
The leading dimension of the matrix
A. It must be positive.transa=transpose::nontranstransa=transpose::transortransa=transpose::conjtransColumn major
ldamust be at leastm.ldamust be at leastn.Row major
ldamust be at leastn.ldamust be at leastm.- beta
Scaling factor for the matrix
B.- b
Buffer holding the input matrix
B. Must have size at least:transb=transpose::nontranstransb=transpose::transortransb=transpose::conjtransColumn major
Bismxnmatrix. Size of arraybmust be at leastldb*nBisnxmmatrix. Size of arraybmust be at leastldb*mRow major
Bismxnmatrix. Size of arraybmust be at leastldb*mBisnxmmatrix. Size of arraybmust be at leastldb*n- ldb
The leading dimension of the
Bmatrix. It must be positive.transb=transpose::nontranstransb=transpose::transortransb=transpose::conjtransColumn major
ldbmust be at leastm.ldbmust be at leastn.Row major
ldbmust be at leastn.ldbmust be at leastm.- c
Buffer holding the output matrix
C.Column major
Cismxnmatrix. Size of arraycmust be at leastldc*nRow major
Cismxnmatrix. Size of arraycmust be at leastldc*m- ldc
Leading dimension of the C matrices. If matrices are stored using column major layout,
ldcmust be at leastm. If matrices are stored using row major layout,ldcmust be at leastn. Must be positive.
Output Parameters
- c
Output buffer overwritten by
alpha* op(A) +beta* op(B).
Throws
This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.
omatadd (USM Version)#
Syntax
namespace oneapi::mkl::blas::column_major {
sycl::event omatadd(sycl::queue &queue,
oneapi::mkl::transpose transa,
oneapi::mkl::transpose transb,
std::int64_t m,
std::int64_t n,
value_or_pointer<T> alpha,
const T *a,
std::int64_t lda,
value_or_pointer<T> beta,
const T *b,
std::int64_t ldb,
T *c,
std::int64_t ldc,
const std::vector<sycl::event> &dependencies = {});
}
namespace oneapi::mkl::blas::row_major {
sycl::event omatadd(sycl::queue &queue,
oneapi::mkl::transpose transa,
oneapi::mkl::transpose transb,
std::int64_t m,
std::int64_t n,
value_or_pointer<T> alpha,
const T *a,
std::int64_t lda,
value_or_pointer<T> beta,
const 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 should be executed.
- transa
Specifies op(
A), the transposition operation applied to the matrixA. See oneMKL defined datatypes for more details.- transb
Specifies op(
B), the transposition operation applied to the matrixB. See oneMKL defined datatypes 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. See Scalar Arguments in BLAS for more details.- a
Array holding the input matrix
A.transa=transpose::nontranstransa=transpose::transortransa=transpose::conjtransColumn major
Aismxnmatrix. Size of arrayamust be at leastlda*nAisnxmmatrix. Size of arrayamust be at leastlda*mRow major
Aismxnmatrix. Size of arrayamust be at leastlda*mAisnxmmatrix. Size of arrayamust be at leastlda*n- lda
The leading dimension of the matrix
A. It must be positive.transa=transpose::nontranstransa=transpose::transortransa=transpose::conjtransColumn major
ldamust be at leastm.ldamust be at leastn.Row major
ldamust be at leastn.ldamust be at leastm.- beta
Scaling factor for the matrices
B. See Scalar Arguments in BLAS for more details.- b
Array holding the input matrices
B.transb=transpose::nontranstransb=transpose::transortransb=transpose::conjtransColumn major
Bismxnmatrix. Size of arraybmust be at leastldb*nBisnxmmatrix. Size of arraybmust be at leastldb*mRow major
Bismxnmatrix. Size of arraybmust be at leastldb*mBisnxmmatrix. Size of arraybmust be at leastldb*n- ldb
The leading dimension of the
Bmatrix. It must be positive.transb=transpose::nontranstransb=transpose::transortransb=transpose::conjtransColumn major
ldbmust be at leastm.ldbmust be at leastn.Row major
ldbmust be at leastn.ldbmust be at leastm.- c
Array holding the output matrix
C.Column major
Cismxnmatrix. Size of arraycmust be at leastldc*nRow major
Cismxnmatrix. Size of arraycmust be at leastldc*m- ldc
Leading dimension of the
Cmatrix. If matrices are stored using column major layout,ldcmust be at leastm. If matrices are stored using row major layout,ldcmust be at leastn. Must be positive.- dependencies
List of events to wait for before starting computation, if any. If omitted, defaults to no dependencies.
Output Parameters
- c
Output array, overwritten by
alpha* op(A) +beta* op(B).
Return Values
Output event to wait on to ensure computation is complete.
Throws
This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.
oneapi::mkl::unsupported_device
Parent topic: BLAS-like Extensions