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_TRANSPOSEis supported, andblockDim== 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 thanmb.[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_GENERALis supported.[in] bsrVal - array of nnzbblocks of the sparse BSR matrix.[in] bsrMaskPtr - array of sizeOfMaskelements that give the indices of the updated block rows.[in] bsrRowPtr - array of mbelements that point to the start of every block row of the sparse BSR matrix.[in] bsrEndPtr - array of mbelements that point to the end of every block row of the sparse BSR matrix.[in] bsrColInd - array of nnzbelements 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*blockDimelements ( \(op(A) = A\)) ormb*blockDimelements ( \(op(A) = A^T\) or \(op(A) = A^H\)).[in] beta - scalar \(\beta\). [in,out] y - array of mb*blockDimelements ( \(op(A) = A\)) ornb*blockDimelements ( \(op(A) = A^T\) or \(op(A) = A^H\)).
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_NOT_INITIALIZED handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE handle,descr,alpha, orbetais nullptr,mb,nb,nnzb, orsizeOfMaskis negative,sizeOfMaskis greater thanmb,blockDimis less than or equal to 1, orbsrVal,bsrMaskPtr,bsrRowPtr,bsrEndPtr,bsrColInd,x, oryis nullptr.HIPSPARSE_STATUS_ARCH_MISMATCH the device is not supported. HIPSPARSE_STATUS_NOT_SUPPORTED transis notHIPSPARSE_OPERATION_NON_TRANSPOSE, orhipsparseMatrixType_tis notHIPSPARSE_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: