Developer Reference for Intel® oneAPI Math Kernel Library for C
?trsm_batch
Solves a triangular matrix equation for a group of matrices.
Syntax
void cblas_strsm_batch(const CBLAS_LAYOUT Layout, const CBLAS_SIDE *Side_Array,
const CBLAS_UPLO *Uplo_Array, const CBLAS_TRANSPOSE *TransA_Array,
const CBLAS_DIAG *Diag_Array, const MKL_INT *M_Array,
const MKL_INT *N_Array, const float *alpha_Array, const float **A_Array,
const MKL_INT *lda_Array, float **B_Array, const MKL_INT *ldb_Array,
const MKL_INT group_count, const MKL_INT *group_size);
void cblas_dtrsm_batch(const CBLAS_LAYOUT Layout, const CBLAS_SIDE *Side_Array,
const CBLAS_UPLO *Uplo_Array, const CBLAS_TRANSPOSE *Transa_Array,
const CBLAS_DIAG *Diag_Array, const MKL_INT *M_Array,
const MKL_INT *N_Array, const double *alpha_Array, const double **A_Array,
const MKL_INT *lda_Array, double **B_Array, const MKL_INT *ldb_Array,
const MKL_INT group_count, const MKL_INT *group_size);
void cblas_ctrsm_batch(const CBLAS_LAYOUT Layout, const CBLAS_SIDE *Side_Array,
const CBLAS_UPLO *Uplo_Array, const CBLAS_TRANSPOSE *Transa_Array,
const CBLAS_DIAG *Diag_Array, const MKL_INT *M_Array,
const MKL_INT *N_Array, const void *alpha_Array, const void **A_Array,
const MKL_INT *lda_Array, void **B_Array, const MKL_INT *ldb_Array,
const MKL_INT group_count, const MKL_INT *group_size);
void cblas_ztrsm_batch(const CBLAS_LAYOUT Layout, const CBLAS_SIDE *Side_Array,
const CBLAS_UPLO *Uplo_Array, const CBLAS_TRANSPOSE *Transa_Array,
const CBLAS_DIAG *Diag_Array, const MKL_INT *M_Array,
const MKL_INT *N_Array, const void *alpha_Array, const void **A_Array,
const MKL_INT *lda_Array, void **B_Array, const MKL_INT *ldb_Array,
const MKL_INT group_count, const MKL_INT *group_size);
Include Files
mkl.h
Description
The ?trsm_batch routines solve a series of matrix equations. They are similar to the ?trsm (Solves a triangular matrix equation.) routines except that they operate on groups of matrices which have the same parameters. The ?trsm_batch routines process a number of groups at once.
The operation is defined as
idx = 0
for i = 0..group_count - 1
alpha in alpha_array[i]
for j = 0..group_size[i] - 1
A and B matrix in a_array[idx] and b_array[idx]
Solve op(A)*X = alpha * B or Solve X*op(A) = alpha * B
idx = idx + 1
end for
end for
where:
alpha is a scalar element of alpha_array ,
X and B are m -by- n matrices for m and n which are elements of m_array and n_array , respectively,
A is a unit, or non-unit, upper or lower triangular matrix,
and op(A) is one of op(A) = A , or op(A) = A^{T} , or op(A) = conjg(A^{T}) .
A and B represent matrices stored at addresses pointed to by a_array and b_array , respectively. There are total_batch_count entries in each of a_array and b_array , where total_batch_count is the sum of all the group_size entries.
Input Parameters
- Layout
-
Specifies whether two-dimensional array storage is row-major ( CblasRowMajor ) or column-major ( CblasColMajor ).
side_array
Array of size group_count . For group i , 0 ≤ i ≤ group_count - 1 , sidei = side_array(i)[i] specifies whether op(A) appears on the left or right of X in the equation:
if sidei = CblasLeft , then op(A)*X = alpha*B ;
if sidei = CblasRight , then X*op(A) = alpha*B .
uplo_array
Array of size group_count . For group i , 0 ≤ i ≤ group_count - 1 , uploi = uplo_array(i)[i] specifies whether the matrix A is upper or lower triangular:
if uploi = CblasLower , then the matrix is low triangular.
transa_array
Array of size group_count . For group i , 0 ≤ i ≤ group_count - 1 , transai = transa_array(i)[i] specifies the form of op(A) used in the matrix multiplication:
if transai = CblasNoTrans , then op(A) = A ;
if transai = CblasTrans ;
if transai = CblasConjTrans , then op(A) = conjg(A') .
diag_array
Array of size group_count . For group i , 0 ≤ i ≤ group_count - 1 , diagi = diag_array(i)[i] specifies whether the matrix A is unit triangular:
if diagi = CblasUnit then the matrix is unit triangular;
if diagi = CblasNonUnit , then the matrix is not unit triangular.
m_array
Array of size group_count . For group i , 0 ≤ i ≤ group_count - 1 , mi = m_array(i)[i] specifies the number of rows of B . The value of mi must be at least zero.
n_array
Array of size group_count . For group i , 0 ≤ i ≤ group_count - 1 , ni = n_array(i)[i] specifies the number of columns of B . The value of ni must be at least zero.
- alpha_array
-
REAL for strsm_batch DOUBLE PRECISION for dtrsm_batch COMPLEX for ctrsm_batch DOUBLE COMPLEX for ztrsm_batch
Array of size group_count . For group i , 0 ≤ i ≤ group_count - 1 , alpha_array(i)[i] specifies the scalar alphai .
- a_array
-
INTEGER*8 for Intel ® 64 architecture Array, size total_batch_count , of pointers to arrays used to store A matrices.
For group i , , k is mi when sidei = CblasLeft and is ni when sidei = CblasRight and a is any of the group_size(i)[i] arrays starting with a_array(group_size(1) + group_size(2) + ... + group_size(i - 1) + 1)[group_size[0] + group_size[1] + ... + group_size(i - 1)] :
For group i , 0 ≤ i ≤ group_count - 1 , k is mi when and is ni when and a is any of the group_size(i)[i] arrays starting with a_array(group_size(1) + group_size(2) + ... + group_size(i - 1) + 1)[group_size[0] + group_size[1] + ... + group_size(i - 1)] :
Before entry with uploi = CblasUpper , the leading k by k upper triangular part of the array a must contain the upper triangular matrix and the strictly lower triangular part of a is not referenced.
Before entry with uploi = CblasLower lower triangular part of the array a must contain the lower triangular matrix and the strictly upper triangular part of a is not referenced.
When diagi = CblasUnit , the diagonal elements of a are not referenced either, but are assumed to be unity.
lda_array
Array of size group_count . For group i , , ldai = lda_array(i)[i] specifies the leading dimension of a as declared in the calling (sub)program. When sidei = CblasLeft , then ldai must be at least max(1, m_{i}) , when sidei = CblasRight , then ldai must be at least max(1, n_{i}) .
Array of size group_count . For group i , 0 ≤ i ≤ group_count - 1 , ldai = lda_array(i)[i] specifies the leading dimension of a as declared in the calling (sub)program. When , then ldai must be at least max(1, m_{i}) , when , then ldai must be at least max(1, n_{i}) .
- b_array
-
REAL for strsm_batch DOUBLE PRECISION for dtrsm_batch COMPLEX for ctrsm_batch DOUBLE COMPLEX for ztrsm_batch Array, size total_batch_count , of pointers to arrays used to store B matrices.
For group i , 0 ≤ i ≤ group_count - 1 , b is any of the group_size(i)[i] arrays starting with b_array(group_size(1) + group_size(2) + ... + group_size(i - 1) + 1)[group_size[0] + group_size[1] + ... + group_size(i - 1)] :
Before entry, the leading mi -by- ni part of array b must contain the matrix B . For Layout = CblasColMajor : before entry, the leading mi -by- ni part of the array b must contain the matrix B . For Layout = CblasRowMajor : before entry, the leading ni -by- mi part of the array b must contain the matrix B .
ldb_array
Array of size group_count . Specifies the leading dimension of b as declared in the calling (sub)program. When Layout = CblasColMajor , ldb must be at least max(1, m) ; otherwise, ldb must be at least max(1, n) .
Array of size group_count . For group i , , ldbi = ldb_array(i)[i] specifies the leading dimension of b as declared in the calling (sub)program. When Layout = CblasColMajor , ldbi must be at least max(1, m_{i}) ; otherwise, ldbi must be at least max(1, n_{i}) .
Array of size group_count . For group i , 0 ≤ i ≤ group_count - 1 , ldbi = ldb_array(i)[i] specifies the leading dimension of b as declared in the calling (sub)program. ldbi must be at least max(1, m_{i}) .
- group_count
-
INTEGER . Specifies the number of groups. Must be at least 0.
- group_size
-
INTEGER . Array of size group_count . The element group_size(i)[i] specifies the number of matrices in group i . Each element in group_size must be at least 0.
Output Parameters
- b_array
-
Overwritten by the solution matrix X .
BLAS 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.