Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?trsm_batch

Solves a triangular matrix equation for a group of matrices.

Syntax

call strsm_batch(side_array, uplo_array, transa_array, diag_array, m_array, n_array, alpha_array, a_array, lda_array, b_array, ldb_array, group_count, group_size)

call dtrsm_batch(side_array, uplo_array, transa_array, diag_array, m_array, n_array, alpha_array, a_array, lda_array, b_array, ldb_array, group_count, group_size)

call ctrsm_batch(side_array, uplo_array, transa_array, diag_array, m_array, n_array, alpha_array, a_array, lda_array, b_array, ldb_array, group_count, group_size)

call ztrsm_batch(side_array, uplo_array, transa_array, diag_array, m_array, n_array, alpha_array, a_array, lda_array, b_array, ldb_array, group_count, group_size)

Include Files
  • mkl.fi, blas.f90
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 = 1
for i = 1..group_count
    alpha in alpha_array(i)
    for j = 1..group_size(i)
        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
side_array

CHARACTER*1. Array of size group_count. For group i, 1 igroup_count, sidei = side_array(i) specifies whether op(A) appears on the left or right of X in the equation:

if sidei = 'L' or 'l', then op(A)*X = alpha*B;

if sidei = 'R' or 'r', then X*op(A) = alpha*B.

uplo_array

CHARACTER*1. Array of size group_count. For group i, 1 igroup_count, uploi = uplo_array(i) specifies whether the matrix A is upper or lower triangular:

uploi = 'U' or 'u'

if uploi = 'L' or 'l', then the matrix is low triangular.

transa_array

CHARACTER*1. Array of size group_count. For group i, 1 igroup_count, transai = transa_array(i) specifies the form of op(A) used in the matrix multiplication:

if transai= 'N' or 'n', then op(A) = A;

if transai= 'T' or 't';

if transai= 'C' or 'c', then op(A) = conjg(A').

diag_array

CHARACTER*1. Array of size group_count. For group i, 1 igroup_count, diagi = diag_array(i) specifies whether the matrix A is unit triangular:

if diagi = 'U' or 'u' then the matrix is unit triangular;

if diagi = 'N' or 'n', then the matrix is not unit triangular.

m_array

INTEGER. Array of size group_count. For group i, 1 igroup_count, mi = m_array(i) specifies the number of rows of B. The value of mi must be at least zero.

n_array

INTEGER. Array of size group_count. For group i, 1 igroup_count, ni = n_array(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, 1 igroup_count, alpha_array(i) specifies the scalar alphai.

a_array

INTEGER*8 for Intel® 64 architecture

INTEGER*4 for IA-32 architecture

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

For group i, 1 igroup_count, k is mi when sidei = 'L' or 'l' and is ni when side = 'R' or 'r' and a is any of the group_size(i) arrays starting with a_array(group_size(1) + group_size(2) + ... + group_size(i - 1) + 1):

Before entry with uploi = 'U' or 'u', 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 = 'L' or 'l' 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 = 'U' or 'u', the diagonal elements of a are not referenced either, but are assumed to be unity.

lda_array

INTEGER. Array of size group_count. For group i, 1 igroup_count, ldai = lda_array(i) specifies the leading dimension of a as declared in the calling (sub)program. When sidei = 'L' or 'l', then ldai must be at least max(1, mi), when sidei = 'R' or 'r', then ldai must be at least max(1, ni).

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, 1 igroup_count, b is any of the group_size(i) arrays starting with b_array(group_size(1) + group_size(2) + ... + group_size(i - 1) + 1):

Before entry, the leading mi-by-ni part of array b must contain the matrix B.

ldb_array

INTEGER. Array of size group_count. Specifies the leading dimension of b as declared in the calling (sub)program. ldb must be at least max(1, m).

INTEGER. Array of size group_count. For group i, 1 igroup_count, ldbi = ldb_array(i) specifies the leading dimension of b as declared in the calling (sub)program. ldbi must be at least max(1, mi).

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) 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

Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see BLAS 95 Interface Conventions.

Specific details for the routine trsm_batch interface are the following:

a_array

Holds pointers to matrices A of size (ma,ma) where ma = mi if side = 'L', ma = ni otherwise.

b_array

Holds pointers to matrices B of size (mi,ni).

m_array

Array indicating the number of rows of matrix C for each group.

n_array

Array indicating the number of columns of matrix B for each group.

group_size

Array indicating the number of matrices for each group. Each element in group_size must be at least zero.

side_array

Array with each element set to either 'L' or 'R'. The default value is 'L'.

uplo_array

Array with each element set to either 'U' or 'L'. The default value is 'U'.

transa_array

Array with each element set to one of 'N', 'C', or 'T'.

The default value is 'N'.

diag_array

Array with each element set to either 'N' or 'U'. The default value is 'N'.

alpha_array

Array of alphavalues. The default value is 1.