Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
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

mkl_?omatcopy_batch

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

Syntax

void mkl_somatcopy_batch (char layout, const char * trans_array, const size_t * rows_array, const size_t * cols_array, const float * alpha_array, float ** A_array, const size_t * lda_array, float ** B_array, const size_t * ldb_array, size_t group_count, const size_t * group_size);

void mkl_domatcopy_batch (char layout, const char * trans_array, const size_t * rows_array, const size_t * cols_array, const double * alpha_array, float ** A_array, const size_t * lda_array, double ** B_array, const size_t * ldb_array, size_t group_count, const size_t * group_size);

void mkl_comatcopy_batch (char layout, const char * trans_array, const size_t * rows_array, const size_t * cols_array, const MKL_Complex8 * alpha_array, MKL_Complex8 ** A_array, const size_t * lda_array, MKL_Complex8 ** B_array, const size_t * ldb_array, size_t group_count, const size_t * group_size);

void mkl_zomatcopy_batch (char layout, const char * trans_array, const size_t * rows_array, const size_t * cols_array, const MKL_Complex16 * alpha_array, MKL_Complex16 ** A_array, const size_t * lda_array, MKL_Complex16 ** B_array, const size_t * ldb_array, size_t group_count, const size_t * 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

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

trans_array

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

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

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

Array of size group_count. Specifies the scalar alpha.

A_array

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

lda_array

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

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

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

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