rocsparse_gebsr2gebsr_nnz Interface Reference#
Public Member Functions | |
| integer(kind(rocsparse_status_success)) 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) |
Detailed Description
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_roworrocsparse_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_generaland also any valid value of therocsparse_index_base.[in] bsr_row_ptr_A - array of mb+1elements that point to the start of every block row of the sparse general BSR matrix \(A\).[in] bsr_col_ind_A - array of nnzbelements 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_generaland also any valid value of therocsparse_index_base.[in] bsr_row_ptr_C - array of mb_C+1elements that point to the start of every block row of the sparse general BSR matrix \(C\) wheremb_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, orcol_block_dim_Cis invalid.rocsparse_status_invalid_pointer bsr_row_ptr_A,bsr_col_ind_A,bsr_row_ptr_C,descr_A,descr_C, ortemp_bufferpointer is invalid.
Member Function/Subroutine Documentation
◆ rocsparse_gebsr2gebsr_nnz_()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_gebsr2gebsr_nnz::rocsparse_gebsr2gebsr_nnz_ | ( | type(c_ptr), value | handle, |
| integer(kind(rocsparse_direction_row)), value | dir, | ||
| integer(c_int), value | mb, | ||
| integer(c_int), value | nb, | ||
| integer(c_int), value | nnzb, | ||
| type(c_ptr), value | descr_a, | ||
| type(c_ptr), value | bsr_row_ptr_a, | ||
| type(c_ptr), value | bsr_col_ind_a, | ||
| integer(c_int), value | row_block_dim_a, | ||
| integer(c_int), value | col_block_dim_a, | ||
| type(c_ptr), value | descr_c, | ||
| type(c_ptr), value | bsr_row_ptr_c, | ||
| integer(c_int), value | row_block_dim_c, | ||
| integer(c_int), value | col_block_dim_c, | ||
| integer(c_int) | nnz_total_dev_host_ptr, | ||
| type(c_ptr), value | temp_buffer | ||
| ) |
The documentation for this interface was generated from the following file: