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

cblas_?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 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.

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) = AT, or op(A) = conjg(AT).

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 igroup_count - 1, sidei = side_array[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 igroup_count - 1, uploi = uplo_array[i] specifies whether the matrix A is upper or lower triangular:

uploi = CblasUpper

if uploi = CblasLower, then the matrix is low triangular.

transa_array

Array of size group_count. For group i, 0 igroup_count - 1, transai = transa_array[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 igroup_count - 1, diagi = diag_array[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 igroup_count - 1, mi = m_array[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 igroup_count - 1, ni = n_array[i] specifies the number of columns of B. The value of ni must be at least zero.

alpha_array

Array of size group_count. For group i, 0 igroup_count - 1, alpha_array[i] specifies the scalar alphai.

a_array

Array, size total_batch_count, of pointers to arrays used to store A matrices.

For group i, 0 igroup_count - 1, k is mi when sidei = CblasLeft and is ni when sidei = CblasRight and a is any of the group_size[i] arrays starting with a_array[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, 0 igroup_count - 1, ldai = lda_array[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, mi), when sidei = CblasRight, then ldai must be at least max(1, ni).

b_array

Array, size total_batch_count, of pointers to arrays used to store B matrices.

For group i, 0 igroup_count - 1, b is any of the group_size[i] arrays starting with b_array[group_size[0] + group_size[1] + ... + group_size(i - 1)]:

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, 0 igroup_count - 1, ldbi = ldb_array[i] specifies the leading dimension of b as declared in the calling (sub)program. When Layout = CblasColMajor, ldbi must be at least max(1, mi); otherwise, ldbi must be at least max(1, ni).

group_count

Specifies the number of groups. Must be at least 0.

group_size

Array of size group_count. The element group_size[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.