|
| integer(c_int) function | rocsparse_gebsr2gebsr_nnz_ (handle, dir, mb, nb, nnzb, descr_a, bsr_row_ptr_a, bsr_col_ind_a, row_block_dim_a, col_block_dim_a, descr_c, bsr_row_ptr_c, row_block_dim_c, col_block_dim_c, nnz_total_dev_host_ptr, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_gebsr2gebsr_nnz_typed (handle, dir, mb, nb, nnzb, descr_a, bsr_row_ptr_a, bsr_col_ind_a, row_block_dim_a, col_block_dim_a, descr_c, bsr_row_ptr_c, row_block_dim_c, col_block_dim_c, nnz_total_dev_host_ptr, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_gebsr2gebsr_nnz_rank_0 (handle, dir, mb, nb, nnzb, descr_a, bsr_row_ptr_a, bsr_col_ind_a, row_block_dim_a, col_block_dim_a, descr_c, bsr_row_ptr_c, row_block_dim_c, col_block_dim_c, nnz_total_dev_host_ptr, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_gebsr2gebsr_nnz_rank_0_devptr (handle, dir, mb, nb, nnzb, descr_a, bsr_row_ptr_a, bsr_col_ind_a, row_block_dim_a, col_block_dim_a, descr_c, bsr_row_ptr_c, row_block_dim_c, col_block_dim_c, nnz_total_dev_host_ptr, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_gebsr2gebsr_nnz_rank_1 (handle, dir, mb, nb, nnzb, descr_a, bsr_row_ptr_a, bsr_col_ind_a, row_block_dim_a, col_block_dim_a, descr_c, bsr_row_ptr_c, row_block_dim_c, col_block_dim_c, nnz_total_dev_host_ptr, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_gebsr2gebsr_nnz_rank_1_devptr (handle, dir, mb, nb, nnzb, descr_a, bsr_row_ptr_a, bsr_col_ind_a, row_block_dim_a, col_block_dim_a, descr_c, bsr_row_ptr_c, row_block_dim_c, col_block_dim_c, nnz_total_dev_host_ptr, temp_buffer) |
| |
This function takes a sparse general BSR matrix as input and computes the block row offset array, bsr_row_ptr_C, and the total number of non-zero blocks, nnz_total_dev_host_ptr, that result from converting the general BSR format input matrix to a general BSR format output matrix. The input and output matrices can have different row and column block dimensions. rocsparse_gebsr2gebsr_nnz is the second step in the conversion and is used in conjunction with rocsparse_Xgebsr2gebsr_buffer_size() and rocsparse_Xgebsr2gebsr().
rocsparse_gebsr2gebsr_nnz accepts both host and device pointers for nnz_total_dev_host_ptr, which can be set by calling rocsparse_set_pointer_mode prior to calling rocsparse_gebsr2gebsr_nnz.
- Note
- This function is blocking with respect to the host.
-
This routine does not support 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_row or rocsparse_direction_column. |
| [in] | mb | - number of block rows of the general BSR sparse matrix \(A\). |
| [in] | nb | - number of block columns of the general BSR sparse matrix \(A\). |
| [in] | nnzb | - number of blocks in the general BSR sparse matrix \(A\). |
| [in] | descr_A | - the descriptor of the general BSR sparse matrix \(A\). The supported matrix type is rocsparse_matrix_type_general and also any valid value of the rocsparse_index_base. |
| [in] | bsr_row_ptr_A | - array of mb+1 elements that point to the start of every block row of the sparse general BSR matrix \(A\). |
| [in] | bsr_col_ind_A | - array of nnzb elements containing the block column indices of the sparse general BSR matrix \(A\). |
| [in] | row_block_dim_A | - row size of the blocks in the sparse general BSR matrix \(A\). |
| [in] | col_block_dim_A | - column size of the blocks in the sparse general BSR matrix \(A\). |
| [in] | descr_C | - the descriptor of the general BSR sparse matrix \(C\). The supported matrix type is rocsparse_matrix_type_general and also any valid value of the rocsparse_index_base. |
| [in] | bsr_row_ptr_C | - array of mb_C+1 elements that point to the start of every block row of the sparse general BSR matrix \(C\) where mb_C=(m+row_block_dim_C-1)/row_block_dim_C. |
| [in] | row_block_dim_C | - row size of the blocks in the sparse general BSR matrix \(C\). |
| [in] | col_block_dim_C | - column size of the blocks in the sparse general BSR matrix \(C\). |
| [out] | nnz_total_dev_host_ptr | - total number of non-zero blocks in general BSR sparse matrix \(C\) stored using device or host memory. |
| [out] | temp_buffer | - buffer allocated by the user whose size is determined by calling rocsparse_Xgebsr2gebsr_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, nnzb, row_block_dim_A, col_block_dim_A, row_block_dim_C, or col_block_dim_C is invalid. |
| rocsparse_status_invalid_pointer | bsr_row_ptr_A, bsr_col_ind_A, bsr_row_ptr_C, descr_A, descr_C, or temp_buffer pointer is invalid. |