rocsparse_sbsrxmv Interface Reference#
Sparse matrix vector multiplication with mask operation using the BSR storage format. More...
Public Member Functions | |
| integer(kind(rocsparse_status_success)) function | rocsparse_sbsrxmv_ (handle, dir, trans, size_of_mask, mb, nb, nnzb, alpha, descr, bsr_val, bsr_mask_ptr, bsr_row_ptr, bsr_end_ptr, bsr_col_ind, block_dim, x, beta, y) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sbsrxmv_rank_0 (handle, dir, trans, size_of_mask, mb, nb, nnzb, alpha, descr, bsr_val, bsr_mask_ptr, bsr_row_ptr, bsr_end_ptr, bsr_col_ind, block_dim, x, beta, y) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sbsrxmv_rank_1 (handle, dir, trans, size_of_mask, mb, nb, nnzb, alpha, descr, bsr_val, bsr_mask_ptr, bsr_row_ptr, bsr_end_ptr, bsr_col_ind, block_dim, x, beta, y) |
Detailed Description
Sparse matrix vector multiplication with mask operation using the BSR storage format.
rocsparse_bsrxmv multiplies the scalar \(\alpha\) with a sparse \(m \times n\) 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 == rocsparse_operation_none} \end{array} \right. \]
and where \(m = mb \times block\_dim\) and \(n = nb \times block\_dim\).
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, bsr_row_ptr and bsr_end_ptr (both of size mb), rather the usual bsr_row_ptr 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==rocsparse_operation_noneis supported. Currently,block_dim==1is not supported. - This routine supports execution in a hipGraph context.
- Parameters
-
[in] handle - handle to the rocSPARSE library context queue. [in] dir - matrix storage of BSR blocks. [in] trans - matrix operation type. [in] size_of_mask - number of updated block rows of the array y.[in] mb - number of block rows of the sparse BSR matrix. [in] nb - number of block columns of the sparse BSR matrix. [in] nnzb - number of non-zero blocks of the sparse BSR matrix. [in] alpha - scalar \(\alpha\). [in] descr - descriptor of the sparse BSR matrix. Currently, only rocsparse_matrix_type_generalis supported.[in] bsr_val - array of nnzbblocks of the sparse BSR matrix.[in] bsr_mask_ptr - array of size_of_maskelements that give the indices of the updated block rows.[in] bsr_row_ptr - array of mbelements that point to the start of every block row of the sparse BSR matrix.[in] bsr_end_ptr - array of mbelements that point to the end of every block row of the sparse BSR matrix.[in] bsr_col_ind - array of nnzbelements containing the block column indices of the sparse BSR matrix.[in] block_dim - block dimension of the sparse BSR matrix. [in] x - array of nb*block_dimelements ( \(op(A) = A\)) ormb*block_dimelements ( \(op(A) = A^T\) or \(op(A) = A^H\)).[in] beta - scalar \(\beta\). [in,out] y - array of mb*block_dimelements ( \(op(A) = A\)) ornb*block_dimelements ( \(op(A) = A^T\) or \(op(A) = A^H\)).
- Return values
-
rocsparse_status_success the operation completed successfully. rocsparse_status_invalid_handle the library context was not initialized. rocsparse_status_invalid_size mb,nb,nnzb,block_dim, orsize_of_maskis invalid.rocsparse_status_invalid_value size_of_maskis greater thanmb.rocsparse_status_invalid_pointer descr,alpha,bsr_val,bsr_row_ind,bsr_col_ind,x,beta, orypointer is invalid.rocsparse_status_arch_mismatch the device is not supported. rocsparse_status_not_implemented block_dim==1,trans!=rocsparse_operation_noneorrocsparse_matrix_type!=rocsparse_matrix_type_general.
Member Function/Subroutine Documentation
◆ rocsparse_sbsrxmv_()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsrxmv::rocsparse_sbsrxmv_ | ( | type(c_ptr), value | handle, |
| integer(kind(rocsparse_direction_row)), value | dir, | ||
| integer(kind(rocsparse_operation_none)), value | trans, | ||
| integer(c_int), value | size_of_mask, | ||
| 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 | bsr_val, | ||
| type(c_ptr), value | bsr_mask_ptr, | ||
| type(c_ptr), value | bsr_row_ptr, | ||
| type(c_ptr), value | bsr_end_ptr, | ||
| type(c_ptr), value | bsr_col_ind, | ||
| integer(c_int), value | block_dim, | ||
| type(c_ptr), value | x, | ||
| real(c_float) | beta, | ||
| type(c_ptr), value | y | ||
| ) |
◆ rocsparse_sbsrxmv_rank_0()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsrxmv::rocsparse_sbsrxmv_rank_0 | ( | type(c_ptr) | handle, |
| integer(kind(rocsparse_direction_row)) | dir, | ||
| integer(kind(rocsparse_operation_none)) | trans, | ||
| integer(c_int) | size_of_mask, | ||
| integer(c_int) | mb, | ||
| integer(c_int) | nb, | ||
| integer(c_int) | nnzb, | ||
| real(c_float) | alpha, | ||
| type(c_ptr) | descr, | ||
| real(c_float), target | bsr_val, | ||
| integer(c_int), target | bsr_mask_ptr, | ||
| integer(c_int), target | bsr_row_ptr, | ||
| integer(c_int), target | bsr_end_ptr, | ||
| integer(c_int), target | bsr_col_ind, | ||
| integer(c_int) | block_dim, | ||
| real(c_float), target | x, | ||
| real(c_float) | beta, | ||
| real(c_float), target | y | ||
| ) |
◆ rocsparse_sbsrxmv_rank_1()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsrxmv::rocsparse_sbsrxmv_rank_1 | ( | type(c_ptr) | handle, |
| integer(kind(rocsparse_direction_row)) | dir, | ||
| integer(kind(rocsparse_operation_none)) | trans, | ||
| integer(c_int) | size_of_mask, | ||
| 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 | bsr_val, | ||
| integer(c_int), dimension(:), target | bsr_mask_ptr, | ||
| integer(c_int), dimension(:), target | bsr_row_ptr, | ||
| integer(c_int), dimension(:), target | bsr_end_ptr, | ||
| integer(c_int), dimension(:), target | bsr_col_ind, | ||
| integer(c_int) | block_dim, | ||
| 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: