syrk_batch#
Computes a group of syrk operations.
Description#
The syrk_batch routines are batched versions of syrk, performing multiple syrk operations in a single call. Each syrk operation performs a rank-k update with general matrices.
syrk_batch supports the following precisions:
T |
|---|
|
|
|
|
syrk_batch (Buffer Version)#
Buffer version of syrk_batch supports only strided API.
Strided API#
Strided API operation is defined as:
for i = 0 … batch_size – 1
A and C are matrices at offset i * stridea and i * stridec in a and c.
C = alpha * op(A) * op(A)^T + beta * C
end for
where:
op(
X) is one of op(X) =X, or op(X) =XT, or op(X) =XHalphaandbetaare scalarsAis general matrix andCis symmetric matrixop(
A) isnxkandCisnxn
For strided API, a and c buffers contain all the input matrices. The stride between matrices is given by the stride parameters. Total number of matrices in a and c buffers is given by batch_size parameter.
Syntax#
namespace oneapi::mkl::blas::column_major {
void syrk_batch(sycl::queue &queue,
oneapi::mkl::uplo upper_lower,
oneapi::mkl::transpose trans,
std::int64_t n,
std::int64_t k,
T alpha,
sycl::buffer<T,1> &a,
std::int64_t lda,
std::int64_t stridea,
T beta,
sycl::buffer<T,1> &c,
std::int64_t ldc,
std::int64_t stridec,
std::int64_t batch_size,
compute_mode mode = compute_mode::unset)
}
namespace oneapi::mkl::blas::row_major {
void syrk_batch(sycl::queue &queue,
oneapi::mkl::uplo upper_lower,
oneapi::mkl::transpose trans,
std::int64_t n,
std::int64_t k,
T alpha,
sycl::buffer<T,1> &a,
std::int64_t lda,
std::int64_t stridea,
T beta,
sycl::buffer<T,1> &c,
std::int64_t ldc,
std::int64_t stridec,
std::int64_t batch_size,
compute_mode mode = compute_mode::unset)
}
Input Parameters#
- queue
The queue where the routine should be executed.
- upper_lower
Specifies whether matrices
Care upper or lower triangular. See Data Types for more details.- trans
Specifies op(
A), transposition operation applied to matricesA. Conjugation is never performed even iftrans=transpose::conjtrans. See Data Types for more details.- n
Number of rows and columns of matrices
C. Must be at least zero.- k
Number of columns of matrices op(
A). Must be at least zero.- alpha
Scaling factor for rank-k update.
- a
Buffer holding input matrices
A. Size of the buffer must be at leaststridea*batch_size.- lda
Leading dimension of matrices
A. Must be positive.transa=transpose::nontranstransa=transpose::transortrans=transpose::conjtransColumn major
Must be at least
nMust be at least
kRow major
Must be at least
kMust be at least
n- stridea
Stride between two consecutive
Amatrices.transa=transpose::nontranstransa=transpose::transortrans=transpose::conjtransColumn major
Must be at least
lda*kMust be at least
lda*nRow major
Must be at least
lda*nMust be at least
lda*k- beta
Scaling factor for matrices
C.- c
Buffer holding input/output matrices
C. Size of the buffer must be at leaststridec*batch_size.- ldc
Leading dimension of matrices
C. Must be positive and at leastn.- stridec
Stride between two consecutive
Cmatrices. Must be leastldc*n.- batch_size
Specifies the number of matrix multiply operations to perform.
- mode
Optional. Compute mode settings. See Compute Modes for more details.
Output Parameters#
- c
Output buffer overwritten by
batch_sizesyrkoperations of the formalpha* op(A) * op(A)T +beta*C.
syrk_batch (USM Version)#
USM version of syrk_batch supports group API and strided API.
Group API#
The type Ti of integer pointers in the group API may be either std::int64_t or std::int32_t.
Group API operation is defined as:
idx = 0
for i = 0 … group_count – 1
for j = 0 … group_size – 1
A, and C are matrices in a[idx] and c[idx]
C = alpha[i] * op(A) * op(A)^T + beta[i] * C
idx := idx + 1
end for
end for
where:
op(
X) is one of op(X) =X, or op(X) =XT, or op(X) =XHalphaandbetaare scalarsAis general matrix andCis symmetric matrixop(
A) isnxkandCisnxn
For group API, a and c arrays contain the pointers for all the input matrices.
The total number of matrices in a and c are given by:
Syntax#
namespace oneapi::mkl::blas::column_major {
sycl::event syrk_batch(sycl::queue &queue,
const oneapi::mkl::uplo *upper_lower,
const oneapi::mkl::transpose *trans,
const Ti *n,
const Ti *k,
const T *alpha,
const T **a,
const Ti *lda,
const T *beta,
T **c,
const Ti *ldc,
std::int64_t group_count,
const Ti *group_size,
compute_mode mode = compute_mode::unset,
const std::vector<sycl::event> &dependencies = {})
}
namespace oneapi::mkl::blas::row_major {
sycl::event syrk_batch(sycl::queue &queue,
const oneapi::mkl::uplo *upper_lower,
const oneapi::mkl::transpose *trans,
const Ti *n,
const Ti *k,
const T *alpha,
const T **a,
const Ti *lda,
const T *beta,
T **c,
const Ti *ldc,
std::int64_t group_count,
const Ti *group_size,
compute_mode mode = compute_mode::unset,
const std::vector<sycl::event> &dependencies = {})
}
Input Parameters#
- queue
The queue where the routine should be executed.
- upper_lower
Array of
group_countoneapi::mkl::uplovalues.upper_lower[i]specifies whether matricesCare upper or lower triangular in groupi. See Data Types for more details.- trans
Array of
group_countoneapi::mkl::transposevalues.trans[i]specifies op(A), transposition operation applied to matricesAin groupi. See Data Types for more details.- n
Array of
group_countintegers.n[i]specifies number of rows and columns of matricesCin groupi. All entries must be at least zero.- k
Array of
group_countintegers.k[i]specifies number of columns of matrices op(A) in groupi. All entries must be at least zero.- alpha
Array of
group_countscalar elements.alpha[i]specifies scaling factor for every rank-k update in groupi.- a
Array of
total_batch_countpointers for input matricesA. See Matrix Storage for more details.trans=transpose::nontranstrans=transpose::transortrans=transpose::conjtransColumn major
Size of array
A[i]must be at leastlda[i]*k[i]Size of array
A[i]must be at leastlda[i]*n[i]Row major
Size of array
A[i]must be at leastlda[i]*n[i]Size of array
A[i]must be at leastlda[i]*k[i]- lda
Array of
group_countintegers.lda[i]specifies leading dimension of matricesAin groupi. Must be positive.trans=transpose::nontranstrans=transpose::transortrans=transpose::conjtransColumn major
Must be at least
n[i].Must be at least
k[i].Row major
Must be at least
k[i].Must be at least
n[i].- beta
Array of
group_countscalar elements.beta[i]specifies scaling factor for matricesCin groupi.- c
Array of
total_batch_countpointers for input/output matricesC. Size of arrayC[i]must be at leastldc[i]*n[i]. See Matrix Storage for more details.- ldc
Array of
group_countintegers.ldc[i]specifies leading dimension of matricesCin groupi. Must be positive.- group_count
Number of groups. Must be at least zero.
- group_size
Array of
group_countintegers.group_size[i]specifies the number ofsyrkoperations in groupi. Each element ingroup_sizemust be at least zero.- mode
Optional. Compute mode settings. See Compute Modes for more details.
- dependencies
Optional. List of events to wait for before starting computation, if any. If omitted, defaults to no dependencies.
modeanddependenciesmay be omitted independently; it is not necessary to specifymodein order to provide dependencies.
Output Parameters#
- c
Array of pointers to output matrices
Coverwritten bytotal_batch_countsyrkoperations of the formalpha* op(A) * op(A)T +beta*C.
Return Values#
Output event to wait on to ensure computation is complete.
Strided API#
Strided API operation is defined as:
for i = 0 … batch_size – 1
A and C are matrices at offset i * stridea and i * stridec in a and c.
C = alpha * op(A) * op(A)^T + beta * C
end for
where:
op(
X) is one of op(X) =X, or op(X) =XT, or op(X) =XHalphaandbetaare scalarsAis general matrix andCis symmetric matrixop(
A) isnxkandCisnxn
For strided API, a and c arrays contain all the input matrices. The stride between matrices is given by the stride parameters. Total number of matrices in a and c arrays is given by batch_size parameter.
Syntax#
namespace oneapi::mkl::blas::column_major {
sycl::event syrk_batch(sycl::queue &queue,
oneapi::mkl::uplo upper_lower,
oneapi::mkl::transpose trans,
std::int64_t n,
std::int64_t k,
oneapi::mkl::value_or_pointer<T> alpha,
const T *a,
std::int64_t lda,
std::int64_t stridea,
oneapi::mkl::value_or_pointer<T> beta,
T *c,
std::int64_t ldc,
std::int64_t stridec,
std::int64_t batch_size,
compute_mode mode = compute_mode::unset,
const std::vector<sycl::event> &dependencies = {})
}
namespace oneapi::mkl::blas::row_major {
sycl::event syrk_batch(sycl::queue &queue,
oneapi::mkl::uplo upper_lower,
oneapi::mkl::transpose trans,
std::int64_t n,
std::int64_t k,
oneapi::mkl::value_or_pointer<T> alpha,
const T *a,
std::int64_t lda,
std::int64_t stridea,
oneapi::mkl::value_or_pointer<T> beta,
T *c,
std::int64_t ldc,
std::int64_t stridec,
std::int64_t batch_size,
compute_mode mode = compute_mode::unset,
const std::vector<sycl::event> &dependencies = {})
}
Input Parameters#
- queue
The queue where the routine should be executed.
- upper_lower
Specifies whether matrices
Care upper or lower triangular. See Data Types for more details.- trans
Specifies op(
A), transposition operation applied to matricesA. Conjugation is never performed even iftrans=transpose::conjtrans. See Data Types for more details.- n
Number of rows and columns of matrices
C. Must be at least zero.- k
Number of columns of matrices op(
A). Must be at least zero.- alpha
Scaling factor for rank-k update. See Scalar Arguments for more information on the
value_or_pointerdata type.- a
Pointer to input matrices
A. Size of the array must be at leaststridea*batch_size.- lda
Leading dimension of matrices
A. Must be positive.transa=transpose::nontranstransa=transpose::transortrans=transpose::conjtransColumn major
Must be at least
nMust be at least
kRow major
Must be at least
kMust be at least
n- stridea
Stride between two consecutive
Amatrices.transa=transpose::nontranstransa=transpose::transortrans=transpose::conjtransColumn major
Must be at least
lda*kMust be at least
lda*nRow major
Must be at least
lda*nMust be at least
lda*k- beta
Scaling factor for matrices
C. See Scalar Arguments for more information on thevalue_or_pointerdata type.- c
Pointer to input/output matrices
C. Size of the array must be at leaststridec*batch_size.- ldc
Leading dimension of matrices
C. Must be positive and at leastn.- stridec
Stride between two consecutive
Cmatrices. Must be leastldc*n.- batch_size
Specifies the number of matrix multiply operations to perform.
- mode
Optional. Compute mode settings. See Compute Modes for more details.
- dependencies
Optional. List of events to wait for before starting computation, if any. If omitted, defaults to no dependencies.
modeanddependenciesmay be omitted independently; it is not necessary to specifymodein order to provide dependencies.
Output Parameters#
- c
Pointer to output matrices
Coverwritten bybatch_sizesyrkoperations of the formalpha* op(A) * op(A)T +beta*C.
Return Values#
Output event to wait on to ensure computation is complete.