rocsparse_sgebsr2csr Interface Reference#
hipfort_rocsparse::rocsparse_sgebsr2csr Interface Reference
Convert a sparse general BSR matrix into a sparse CSR matrix. More...
Public Member Functions | |
| integer(kind(rocsparse_status_success)) function | rocsparse_sgebsr2csr_ (handle, dir, mb, nb, bsr_descr, bsr_val, bsr_row_ptr, bsr_col_ind, row_block_dim, col_block_dim, csr_descr, csr_val, csr_row_ptr, csr_col_ind) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sgebsr2csr_rank_0 (handle, dir, mb, nb, bsr_descr, bsr_val, bsr_row_ptr, bsr_col_ind, row_block_dim, col_block_dim, csr_descr, csr_val, csr_row_ptr, csr_col_ind) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sgebsr2csr_rank_1 (handle, dir, mb, nb, bsr_descr, bsr_val, bsr_row_ptr, bsr_col_ind, row_block_dim, col_block_dim, csr_descr, csr_val, csr_row_ptr, csr_col_ind) |
Detailed Description
Convert a sparse general BSR matrix into a sparse CSR matrix.
rocsparse_gebsr2csr converts a BSR matrix into a CSR matrix. The input matrix is assumed to be allocated such that array bsr_row_ptr has length mb+1, bsr_col_ind has length nnzb, and bsr_val has length nnzb*row_block_dim*col_block_dim. The output matrix is assumed to be allocated such that array csr_row_ptr has length m+1, csr_col_ind has length nnz, and csr_val has length nnz where:
\[ m = mb * row\_block\_dim \\% n = nb * col\_block\_dim \\% nnz = nnzb * row\_block\_dim * col\_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 general BSR matrix. [in] nb - number of block columns in the sparse general BSR matrix. [in] bsr_descr - descriptor of the sparse general BSR matrix. Currently, only rocsparse_matrix_type_generalis supported.[in] bsr_val - array of nnzb*row_block_dim*col_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] row_block_dim - row size of the blocks in the sparse general BSR matrix. [in] col_block_dim - column size of the blocks in the sparse general BSR matrix. [in] csr_descr - descriptor of the sparse CSR matrix. Currently, only rocsparse_matrix_type_generalis supported.[out] csr_val - array of nnzb*row_block_dim*col_block_dimelements containing the values of the sparse CSR matrix.[out] csr_row_ptr - array of m+1wherem=mb*row_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 general BSR matrix into an CSR matrix.
Member Function/Subroutine Documentation
◆ rocsparse_sgebsr2csr_()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgebsr2csr::rocsparse_sgebsr2csr_ | ( | 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 | row_block_dim, | ||
| integer(c_int), value | col_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_sgebsr2csr_rank_0()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgebsr2csr::rocsparse_sgebsr2csr_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) | row_block_dim, | ||
| integer(c_int) | col_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_sgebsr2csr_rank_1()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgebsr2csr::rocsparse_sgebsr2csr_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) | row_block_dim, | ||
| integer(c_int) | col_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: