rocsparse_sbsr2csr Interface Reference#
hipfort_rocsparse::rocsparse_sbsr2csr Interface Reference
Convert a sparse BSR matrix into a sparse CSR matrix. More...
Public Member Functions | |
| integer(kind(rocsparse_status_success)) function | rocsparse_sbsr2csr_ (handle, dir, mb, nb, bsr_descr, bsr_val, bsr_row_ptr, bsr_col_ind, block_dim, csr_descr, csr_val, csr_row_ptr, csr_col_ind) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sbsr2csr_rank_0 (handle, dir, mb, nb, bsr_descr, bsr_val, bsr_row_ptr, bsr_col_ind, block_dim, csr_descr, csr_val, csr_row_ptr, csr_col_ind) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sbsr2csr_rank_1 (handle, dir, mb, nb, bsr_descr, bsr_val, bsr_row_ptr, bsr_col_ind, block_dim, csr_descr, csr_val, csr_row_ptr, csr_col_ind) |
Detailed Description
Convert a sparse BSR matrix into a sparse CSR matrix.
rocsparse_bsr2csr converts a BSR matrix into a CSR matrix. It is assumed that csr_val, csr_col_ind, and csr_row_ptr are allocated. The allocation size for csr_row_ptr is m+1 where:
\[ m = mb * block\_dim \\% n = nb * block\_dim \]
Allocation for csr_val and csr_col_ind is computed by the the number of blocks in the BSR matrix multiplied by the block dimension squared:
\[ nnz = nnzb * block\_dim * block\_dim \]
- Note
- This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
- This routine supports execution in a hipGraph context.
- Parameters
-
[in] handle - handle to the rocSPARSE library context queue. [in] dir - the storage format of the blocks, rocsparse_direction_roworrocsparse_direction_column.[in] mb - number of block rows in the sparse BSR matrix. [in] nb - number of block columns in the sparse BSR matrix. [in] bsr_descr - descriptor of the sparse BSR matrix. Currently, only rocsparse_matrix_type_generalis supported.[in] bsr_val - array of nnzb*block_dim*block_dimcontaining the values of the sparse BSR matrix.[in] bsr_row_ptr - array of mb+1elements that point to the start 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 - size of the blocks in the sparse BSR matrix. [in] csr_descr - descriptor of the sparse CSR matrix. Currently, only rocsparse_matrix_type_generalis supported.[out] csr_val - array of nnzb*block_dim*block_dimelements containing the values of the sparse CSR matrix.[out] csr_row_ptr - array of m+1wherem=mb*block_dimelements that point to the start of every row of the sparse CSR matrix.[out] csr_col_ind - array of nnzb*block_dim*block_dimelements containing the column indices of the sparse CSR matrix.
- 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, orblock_dimis invalid.rocsparse_status_invalid_pointer bsr_val,bsr_row_ptr,bsr_col_ind,csr_val,csr_row_ptr, orcsr_col_indpointer is invalid.
- Example
- This example converts a BSR matrix into an CSR matrix.
Member Function/Subroutine Documentation
◆ rocsparse_sbsr2csr_()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsr2csr::rocsparse_sbsr2csr_ | ( | type(c_ptr), value | handle, |
| integer(kind(rocsparse_direction_row)), value | dir, | ||
| integer(c_int), value | mb, | ||
| integer(c_int), value | nb, | ||
| type(c_ptr), value | bsr_descr, | ||
| type(c_ptr), value | bsr_val, | ||
| type(c_ptr), value | bsr_row_ptr, | ||
| type(c_ptr), value | bsr_col_ind, | ||
| integer(c_int), value | block_dim, | ||
| type(c_ptr), value | csr_descr, | ||
| type(c_ptr), value | csr_val, | ||
| type(c_ptr), value | csr_row_ptr, | ||
| type(c_ptr), value | csr_col_ind | ||
| ) |
◆ rocsparse_sbsr2csr_rank_0()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsr2csr::rocsparse_sbsr2csr_rank_0 | ( | type(c_ptr) | handle, |
| integer(kind(rocsparse_direction_row)) | dir, | ||
| integer(c_int) | mb, | ||
| integer(c_int) | nb, | ||
| type(c_ptr) | bsr_descr, | ||
| real(c_float), target | bsr_val, | ||
| integer(c_int), target | bsr_row_ptr, | ||
| integer(c_int), target | bsr_col_ind, | ||
| integer(c_int) | block_dim, | ||
| type(c_ptr) | csr_descr, | ||
| real(c_float), target | csr_val, | ||
| integer(c_int), target | csr_row_ptr, | ||
| integer(c_int), target | csr_col_ind | ||
| ) |
◆ rocsparse_sbsr2csr_rank_1()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsr2csr::rocsparse_sbsr2csr_rank_1 | ( | type(c_ptr) | handle, |
| integer(kind(rocsparse_direction_row)) | dir, | ||
| integer(c_int) | mb, | ||
| integer(c_int) | nb, | ||
| type(c_ptr) | bsr_descr, | ||
| real(c_float), dimension(:), target | bsr_val, | ||
| integer(c_int), dimension(:), target | bsr_row_ptr, | ||
| integer(c_int), dimension(:), target | bsr_col_ind, | ||
| integer(c_int) | block_dim, | ||
| type(c_ptr) | csr_descr, | ||
| real(c_float), dimension(:), target | csr_val, | ||
| integer(c_int), dimension(:), target | csr_row_ptr, | ||
| integer(c_int), dimension(:), target | csr_col_ind | ||
| ) |
The documentation for this interface was generated from the following file: