hipsparsesbsrxmv Interface Reference

hipsparsesbsrxmv Interface Reference#

HIPFORT API Reference: hipfort_hipsparse::hipsparsesbsrxmv Interface Reference
hipfort_hipsparse::hipsparsesbsrxmv Interface Reference

Sparse matrix vector multiplication with mask operation using the BSR storage format. More...

Public Member Functions

integer(kind(hipsparse_status_success)) function hipsparsesbsrxmv_ (handle, dir, trans, sizeofmask, mb, nb, nnzb, alpha, descr, bsrval, bsrmaskptr, bsrrowptr, bsrendptr, bsrcolind, blockdim, x, beta, y)
 
integer(kind(hipsparse_status_success)) function hipsparsesbsrxmv_rank_0 (handle, dir, trans, sizeofmask, mb, nb, nnzb, alpha, descr, bsrval, bsrmaskptr, bsrrowptr, bsrendptr, bsrcolind, blockdim, x, beta, y)
 
integer(kind(hipsparse_status_success)) function hipsparsesbsrxmv_rank_1 (handle, dir, trans, sizeofmask, mb, nb, nnzb, alpha, descr, bsrval, bsrmaskptr, bsrrowptr, bsrendptr, bsrcolind, blockdim, x, beta, y)
 

Detailed Description

Sparse matrix vector multiplication with mask operation using the BSR storage format.

hipsparseXbsrxmv multiplies the scalar \(\alpha\) with a sparse \((mb \times \text{blockDim}) \times (nb \times \text{blockDim})\) modified matrix, defined in BSR storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that

\[ y := \left( \alpha \cdot op(A) \cdot x + \beta \cdot y \right)\left( \text{mask} \right), \]

with

\[ op(A) = \left\{ \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\% A^T, & \text{if trans == HIPSPARSE_OPERATION_TRANSPOSE} \\% A^H, & \text{if trans == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right. \]

The \(\text{mask}\) is defined as an array of block row indices. The input sparse matrix is defined with a modified BSR storage format where the beginning and the end of each row is defined with two arrays, bsrRowPtr and bsr_end_ptr (both of size mb), rather the usual bsrRowPtr of size mb+1.

Note
This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
Currently, only trans == HIPSPARSE_OPERATION_NON_TRANSPOSE is supported, and blockDim == 1 is not supported.
Deprecated:
This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.
Parameters
[in]handle- handle to the hipSPARSE library context queue.
[in]dir- matrix storage of BSR blocks.
[in]trans- matrix operation type.
[in]sizeOfMask- number of updated block rows of the array y. Must be non-negative and not greater than mb.
[in]mb- number of block rows of the sparse BSR matrix. Must be non-negative.
[in]nb- number of block columns of the sparse BSR matrix. Must be non-negative.
[in]nnzb- number of non-zero blocks of the sparse BSR matrix. Must be non-negative.
[in]alpha- scalar \(\alpha\).
[in]descr- descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.
[in]bsrVal- array of nnzb blocks of the sparse BSR matrix.
[in]bsrMaskPtr- array of sizeOfMask elements that give the indices of the updated block rows.
[in]bsrRowPtr- array of mb elements that point to the start of every block row of the sparse BSR matrix.
[in]bsrEndPtr- array of mb elements that point to the end of every block row of the sparse BSR matrix.
[in]bsrColInd- array of nnzb elements containing the block column indices of the sparse BSR matrix.
[in]blockDim- block dimension of the sparse BSR matrix. Must be greater than 1.
[in]x- array of nb*blockDim elements ( \(op(A) = A\)) or mb*blockDim elements ( \(op(A) = A^T\) or \(op(A) = A^H\)).
[in]beta- scalar \(\beta\).
[in,out]y- array of mb*blockDim elements ( \(op(A) = A\)) or nb*blockDim elements ( \(op(A) = A^T\) or \(op(A) = A^H\)).
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_NOT_INITIALIZEDhandle is not initialized.
HIPSPARSE_STATUS_INVALID_VALUEhandle, descr, alpha, or beta is nullptr, mb, nb, nnzb, or sizeOfMask is negative, sizeOfMask is greater than mb, blockDim is less than or equal to 1, or bsrVal, bsrMaskPtr, bsrRowPtr, bsrEndPtr, bsrColInd, x, or y is nullptr.
HIPSPARSE_STATUS_ARCH_MISMATCHthe device is not supported.
HIPSPARSE_STATUS_NOT_SUPPORTEDtrans is not HIPSPARSE_OPERATION_NON_TRANSPOSE, or hipsparseMatrixType_t is not HIPSPARSE_MATRIX_TYPE_GENERAL.

Member Function/Subroutine Documentation

◆ hipsparsesbsrxmv_()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesbsrxmv::hipsparsesbsrxmv_ ( type(c_ptr), value  handle,
integer(kind(hipsparse_direction_row)), value  dir,
integer(kind(hipsparse_operation_non_transpose)), value  trans,
integer(c_int), value  sizeofmask,
integer(c_int), value  mb,
integer(c_int), value  nb,
integer(c_int), value  nnzb,
real(c_float)  alpha,
type(c_ptr), value  descr,
type(c_ptr), value  bsrval,
type(c_ptr), value  bsrmaskptr,
type(c_ptr), value  bsrrowptr,
type(c_ptr), value  bsrendptr,
type(c_ptr), value  bsrcolind,
integer(c_int), value  blockdim,
type(c_ptr), value  x,
real(c_float)  beta,
type(c_ptr), value  y 
)

◆ hipsparsesbsrxmv_rank_0()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesbsrxmv::hipsparsesbsrxmv_rank_0 ( type(c_ptr)  handle,
integer(kind(hipsparse_direction_row))  dir,
integer(kind(hipsparse_operation_non_transpose))  trans,
integer(c_int)  sizeofmask,
integer(c_int)  mb,
integer(c_int)  nb,
integer(c_int)  nnzb,
real(c_float)  alpha,
type(c_ptr)  descr,
real(c_float), target  bsrval,
integer(c_int), target  bsrmaskptr,
integer(c_int), target  bsrrowptr,
integer(c_int), target  bsrendptr,
integer(c_int), target  bsrcolind,
integer(c_int)  blockdim,
real(c_float), target  x,
real(c_float)  beta,
real(c_float), target  y 
)

◆ hipsparsesbsrxmv_rank_1()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesbsrxmv::hipsparsesbsrxmv_rank_1 ( type(c_ptr)  handle,
integer(kind(hipsparse_direction_row))  dir,
integer(kind(hipsparse_operation_non_transpose))  trans,
integer(c_int)  sizeofmask,
integer(c_int)  mb,
integer(c_int)  nb,
integer(c_int)  nnzb,
real(c_float)  alpha,
type(c_ptr)  descr,
real(c_float), dimension(:), target  bsrval,
integer(c_int), dimension(:), target  bsrmaskptr,
integer(c_int), dimension(:), target  bsrrowptr,
integer(c_int), dimension(:), target  bsrendptr,
integer(c_int), dimension(:), target  bsrcolind,
integer(c_int)  blockdim,
real(c_float), dimension(:), target  x,
real(c_float)  beta,
real(c_float), dimension(:), target  y 
)

The documentation for this interface was generated from the following file: