Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 3/31/2023
Public

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

Document Table of Contents

mkl_?omatcopy_batch

Computes a group of out of place scaled matrix copy or transposition operations on general matrices.

Syntax

call mkl_somatcopy_batch(layout, trans_array, rows_array, cols_array, alpha_array, A_array, lda_array, B_array, ldb_array, group_count, group_size)

call mkl_domatcopy_batch(layout, trans_array, rows_array, cols_array, alpha_array, A_array, lda_array, B_array, ldb_array, group_count, group_size)

call mkl_comatcopy_batch(layout, trans_array, rows_array, cols_array, alpha_array, A_array, lda_array, B_array, ldb_array, group_count, group_size)

call mkl_zomatcopy_batch(layout, trans_array, rows_array, cols_array, alpha_array, A_array, lda_array, B_array, ldb_array, group_count, group_size)

Description

The mkl_?omatcopy_batch routine performs a series of out-of-place scaled matrix copies or transpositions. They are similar to the mkl_?omatcopy routine counterparts, but the mkl_?omatcopy_batch routine performs matrix operations with groups of matrices. Each group has the same parameters (matrix size, leading dimension, and scaling parameter), but a single call to mkl_?omatcopy_batch operates on multiple groups, and each group can have different parameters, unlike the related mkl_?omatcopy_batch_strided routines.

The operation is defined as

idx = 0
for i = 0..group_count - 1
     m in rows_array[i], n in cols_array[i], and alpha in alpha_array[i]
     for j = 0..group_size[i] - 1 
          A and B matrices in a_array[idx] and b_array[idx], respectively
          B := alpha*op(A)
          idx = idx + 1
     end for
end for

Where op(X) is one of op(X)=X, op(X)=X, op(X)=conjg(X’), or op(X)=conjg(X). A is a m-by-n matrix such that m and n are elements of rows_array and cols_array.

A and B represent matrices stored at addresses pointed to by A_array and B_array. The number of entries in A_array and B_array is total_batch_count = the sum of all of the group_size entries.

Input Parameters
layout

CHARACTER*1.

Specifies whether two-dimensional array storage is row-major (R) or column-major (C).

trans_array

CHARACTER*1.

Array of size group_count. For the group i, trans = trans_array[i] specifies the form of op(A), the transposition operation applied to the A matrix:

If trans = 'N' or 'n', op(A)=A.

If trans = 'T' or 't', op(A)=A'

If trans = 'C' or 'c', op(A)=conjg(A')

If trans = 'R' or 'r', op(A)=conjg(A)

rows_array

INTEGER. Array of size group_count. Specifies the number of rows of the matrix A. The value of each element must be at least zero.

cols_array

INTEGER. Array of size group_count. Specifies the number of columns of the matrix A. The value of each element must be at least zero.

alpha_array

REAL for mkl_somatcopy_batch.

DOUBLE PRECISION for mkl_domatcopy_batch.

COMPLEX for mkl_comatcopy_batch.

DOUBLE COMPLEX for mkl_zomatcopy_batch.

Array of size group_count. Specifies the scalar alpha.

A_array

INTEGER*8 for Intel® 64 architecture.

INTEGER*4 for IA-32 architecture.

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

lda_array

INTEGER. Array of size group_count. The leading dimension of the input matrix A. It must be positive and at least m if column major layout is used or at least n if row major layout is used.

ldb_array

INTEGER. Array of size group_count. The leading dimension of the output matrix B. It must be positive and at least

m if column major layout is used and op(A) = A or conjg(A)

n if row major layout is used and op(A) = A’ or conjg(A’)

n otherwise

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

INTEGER*8 for Intel® 64 architecture.

INTEGER*4 for IA-32 architecture.

Output array of size total_batch_count, holding pointers to arrays used to store the B output matrices, the contents of which are overwritten by the operation of the form alpha*op(A).