Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 11/07/2023
Public

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

Document Table of Contents

?dgmm_batch

Computes groups of matrix-vector product using general matrices.

Syntax

call sdgmm_batch(left_right_array, m_array, n_array, a_array, lda_array, x_array, incx_array, c_array, ldc_array, group_count, group_size)

call ddgmm_batch(left_right_array, m_array, n_array, a_array, lda_array, x_array, incx_array, c_array, ldc_array, group_count, group_size)

call cdgmm_batch(left_right_array, m_array, n_array, a_array, lda_array, x_array, incx_array, c_array, ldc_array, group_count, group_size)

call zdgmm_batch(left_right_array, m_array, n_array, a_array, lda_array, x_array, incx_array, c_array, ldc_array, group_count, group_size)

Include Files

  • mkl.fi

Description

The ?dgmm_batch routines perform a series of diagonal matrix-matrix product. The diagonal matrices are stored as dense vectors and the operations are performed with group of matrices and vectors. .

Each group contains matrices and vectors with the same parameters (size, increments). The operation is defined as:

idx = 0
For i = 0 … group_count – 1
    left_right, m, n, lda, incx, ldc and group_size at position i in left_right_array, m_array, n_array, lda_array, incx_array, ldc_array and group_size_array
    for j = 0 … group_size – 1
        a and c are matrices of size mxn at position idx in a_array and c_array
        x is a vector of size m or n depending on left_right, at position idx in x_array
        if (left_right == oneapi::mkl::side::left) c := diag(x) * a
        else c := a * diag(x)
        idx := idx + 1
    end for
end for

The number of entries in a_array, x_array, and c_array is total_batch_count = the sum of all of the group_size entries.

Input Parameters

left_right_array

CHARACTER*1.

Array of size group_count. For the group i, left_righti = left_right_array[i] specifies the position of the diagonal matrix in the matrix product.

if left_righti = 'L' or 'l' , then C = diag(X) * A.

if left_righti = 'R' or 'r' , then C = A * diag(X).

m_array

INTEGER. Array of size group_count. For the group i, mi = m_array[i] is the number of rows of the matrix A and C.

n_array

INTEGER. Array of size group_count. For the group i, ni = n_array[i] is the number of columns in the matrix A and C.

a_array

INTEGER*8 for Intel® 64 architecture

INTEGER*4 for IA32 architecture

Array of size total_batch_count of pointers used to store A matrices. The array allocated for the A matrices of the group i must be of size at least ldai * ni .

lda_array

INTEGER. Array of size group_count. For the group i, ldai = lda_array[i] is the leading dimension of the matrix A. It must be positive and at least mi .

x_array

INTEGER*8 for Intel® 64 architecture

INTEGER*4 for IA32 architecture

Array of size total_batch_count of pointers used to store x vectors. The array allocated for the x vectors of the group i must be of size at least (1 + leni – 1)*abs(incxi)) where leni is ni if the diagonal matrix is on the right of the product or mi otherwise.

incx_array

INTEGER. Array of size group_count. For the group i, incxi = incx_array[i] is the stride of vector x.

c_array

INTEGER*8 for Intel® 64 architecture

INTEGER*4 for IA32 architecture

Array of size total_batch_count of pointers used to store C matrices. The array allocated for the C matrices of the group i must be of size at least ldci * ni,

ldc_array

INTEGER.

Array of size group_count. For the group i, ldci = ldc_array[i] is the leading dimension of the matrix C. It must be positive and at least mi .

group_count

INTEGER.

Number of groups. Must be at least 0.

group_size

INTEGER.

Array of size group_count. The element group_count[i] is the number of operations in the group i. Each element in group_size must be at least 0.

Output Parameters

c_array
Array of pointers holding the total_batch_count updated matrix C.