rocsparse_sgebsr2gebsc Interface Reference#
Convert a sparse general BSR matrix into a sparse general BSC matrix. More...
Public Member Functions | |
| integer(kind(rocsparse_status_success)) function | rocsparse_sgebsr2gebsc_ (handle, mb, nb, nnzb, bsr_val, bsr_row_ptr, bsr_col_ind, row_block_dim, col_block_dim, bsc_val, bsc_row_ind, bsc_col_ptr, copy_values, idx_base, temp_buffer) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sgebsr2gebsc_rank_0 (handle, mb, nb, nnzb, bsr_val, bsr_row_ptr, bsr_col_ind, row_block_dim, col_block_dim, bsc_val, bsc_row_ind, bsc_col_ptr, copy_values, idx_base, temp_buffer) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sgebsr2gebsc_rank_1 (handle, mb, nb, nnzb, bsr_val, bsr_row_ptr, bsr_col_ind, row_block_dim, col_block_dim, bsc_val, bsc_row_ind, bsc_col_ptr, copy_values, idx_base, temp_buffer) |
Detailed Description
Convert a sparse general BSR matrix into a sparse general BSC matrix.
rocsparse_gebsr2gebsc converts a general BSR matrix into a general BSC matrix. The resulting matrix can also be seen as the transpose of the input matrix. rocsparse_gebsr2gebsc can also be used to convert a general BSC matrix into a general BSR matrix.
The conversion of a sparse matrix from general BSR to general BSC format involves two steps. First, call rocsparse_Xgebsr2gebsc_buffer_size() to determine the size of the required tempory storage buffer. Then allocate this buffer. Secondly, call rocsparse_gebsr2gebsc to complete the conversion. After the conversion is complete, the user must free the temporary buffer.
rocsparse_gebsr2gebsc takes a rocsparse_action parameter as input. This copy_values parameter decides whether bsc_row_ind and bsc_val are filled during conversion (rocsparse_action_numeric) or whether only bsc_row_ind is filled (rocsparse_action_symbolic). Using rocsparse_action_symbolic can be useful, for example, if only the sparsity pattern is required.
- Note
- The resulting matrix can also be seen as the transpose of the input matrix.
- 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] mb - number of rows of the sparse general BSR matrix. [in] nb - number of columns of the sparse general BSR matrix. [in] nnzb - number of non-zero entries of the sparse general BSR matrix. [in] bsr_val - array of nnzb*row_block_dim*col_block_dimelements of the sparse general BSR matrix.[in] bsr_row_ptr - array of mb+1elements that point to the start of every row of the sparse general BSR matrix.[in] bsr_col_ind - array of nnzelements containing the column indices of the sparse general BSR matrix.[in] row_block_dim - row size of the blocks in the sparse general BSR matrix. [in] col_block_dim - col size of the blocks in the sparse general BSR matrix. [out] bsc_val - array of nnzelements of the sparse BSC matrix.[out] bsc_row_ind - array of nnzelements containing the row indices of the sparse BSC matrix.[out] bsc_col_ptr - array of nb+1elements that point to the start of every column of the sparse BSC matrix.[in] copy_values - rocsparse_action_symbolicorrocsparse_action_numeric.[in] idx_base - rocsparse_index_base_zeroorrocsparse_index_base_one.[in] temp_buffer - temporary storage buffer allocated by the user. The size is returned by rocsparse_Xgebsr2gebsc_buffer_size().
- 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, ornnzbis invalid.rocsparse_status_invalid_pointer bsr_val,bsr_row_ptr,bsr_col_ind,bsc_val,bsc_row_ind,bsc_col_ptr, ortemp_bufferpointer is invalid.rocsparse_status_arch_mismatch the device is not supported. rocsparse_status_internal_error an internal error occurred.
- Example
- This example computes the transpose of a general BSR matrix.
Member Function/Subroutine Documentation
◆ rocsparse_sgebsr2gebsc_()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgebsr2gebsc::rocsparse_sgebsr2gebsc_ | ( | type(c_ptr), value | handle, |
| integer(c_int), value | mb, | ||
| integer(c_int), value | nb, | ||
| integer(c_int), value | nnzb, | ||
| 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 | bsc_val, | ||
| type(c_ptr), value | bsc_row_ind, | ||
| type(c_ptr), value | bsc_col_ptr, | ||
| integer(kind(rocsparse_action_symbolic)), value | copy_values, | ||
| integer(kind(rocsparse_index_base_zero)), value | idx_base, | ||
| type(c_ptr), value | temp_buffer | ||
| ) |
◆ rocsparse_sgebsr2gebsc_rank_0()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgebsr2gebsc::rocsparse_sgebsr2gebsc_rank_0 | ( | type(c_ptr) | handle, |
| integer(c_int) | mb, | ||
| integer(c_int) | nb, | ||
| integer(c_int) | nnzb, | ||
| 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, | ||
| real(c_float), target | bsc_val, | ||
| integer(c_int), target | bsc_row_ind, | ||
| integer(c_int), target | bsc_col_ptr, | ||
| integer(kind(rocsparse_action_symbolic)) | copy_values, | ||
| integer(kind(rocsparse_index_base_zero)) | idx_base, | ||
| type(c_ptr) | temp_buffer | ||
| ) |
◆ rocsparse_sgebsr2gebsc_rank_1()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgebsr2gebsc::rocsparse_sgebsr2gebsc_rank_1 | ( | type(c_ptr) | handle, |
| integer(c_int) | mb, | ||
| integer(c_int) | nb, | ||
| integer(c_int) | nnzb, | ||
| 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, | ||
| real(c_float), dimension(:), target | bsc_val, | ||
| integer(c_int), dimension(:), target | bsc_row_ind, | ||
| integer(c_int), dimension(:), target | bsc_col_ptr, | ||
| integer(kind(rocsparse_action_symbolic)) | copy_values, | ||
| integer(kind(rocsparse_index_base_zero)) | idx_base, | ||
| type(c_ptr) | temp_buffer | ||
| ) |
The documentation for this interface was generated from the following file: