Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
?gemv_batch
Computes groups of matrix-vector product with general matrices.
Syntax
call sgemv_batch(trans_array, m_array, n_array, alpha_array, a_array, lda_array, x_array,
incx_array, beta_array, y_array, incy_array, group_count, group_size)
call dgemv_batch(trans_array, m_array, n_array, alpha_array, a_array, lda_array, x_array,
incx_array, beta_array, y_array, incy_array, group_count, group_size)
call cgemv_batch(trans_array, m_array, n_array, alpha_array, a_array, lda_array, x_array,
incx_array, beta_array, y_array, incy_array, group_count, group_size)
call zgemv_batch(trans_array, m_array, n_array, alpha_array, a_array, lda_array, x_array,
incx_array, beta_array, y_array, incy_array, group_count, group_size)
Include Files
mkl.fi
Description
The ?gemv_batchcblas_?gemv_batch routines perform a series of matrix-vector product added to a scaled vector. They are similar to the ?gemvcblas_?gemv routine counterparts, but the ?gemv_batchcblas_?gemv_batch routines perform matrix-vector operations with groups 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
trans, m, n, alpha, lda, incx, beta, incy and group_size at position i in trans_array, m_array, n_array, alpha_array, lda_array, incx_array, beta_array, incy_array and group_size_array
for j = 0 … group_size – 1
a is a matrix of size mxn at position idx in a_array
x and y are vectors of size m or n depending on trans, at position idx in x_array and y_array
y := alpha * op(a) * x + beta * y
idx := idx + 1
end for
end for
The number of entries in a_array , x_array , and y_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 (CblasRowMajor) or column-major (CblasColMajor).
trans_array
CHARACTER*1 .
Array of size group_count . For the group i , transi = trans_array [i] specifies the transposition operation applied to A .
if trans = ‘N’ or ‘n’ , then op(A) = A;
if trans = ‘T’ or ‘t’ , then op(A) = A’;
if trans = ‘C’ or ‘c’ , then op(A) = conjg(A’).
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 .
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 .
- alpha_array
-
REAL for sgemv_batch DOUBLE PRECISION for dgemv_batch COMPLEX for cgemv_batch DOUBLE COMPLEX for zgemv_batch Array of size group_count . For the group i , alphai = alpha_array [i] is the scalar alpha .
- a_array
-
INTEGER*8 for Intel® 64 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 if column major layout is used or at least ldai * mi is row major layout is used.
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 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 A matrix is not transposed 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 . Must not be zero.
- beta_array
-
REAL for sgemv_batch DOUBLE PRECISION for dgemv_batch COMPLEX for cgemv_batch DOUBLE COMPLEX for zgemv_batch Array of size group_count . For the group i , betai = beta_array [i] is the scalar beta .
- y_array
-
INTEGER*8 for Intel® 64 architecture Array of size total_batch_count of pointers used to store y vectors. The array allocated for the y vectors of the group i must be of size at least (1 + leni – 1)*abs( incyi )) where leni is mi if the A matrix is not transposed or ni otherwise.
- incy_array
-
INTEGER . Array of size group_count . For the group i , incyi = incy_array [i] is the stride of vector y . Must not be zero.
- 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_count must be at least 0.
Output Parameters
- y_array
-
Array of pointers holding the total_batch_count updated vector y .