|
| integer(kind(rocsparse_status_success)) function | rocsparse_csr2bsr_nnz_ (handle, dir, m, n, csr_descr, csr_row_ptr, csr_col_ind, block_dim, bsr_descr, bsr_row_ptr, bsr_nnz) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_csr2bsr_nnz_rank_0 (handle, dir, m, n, csr_descr, csr_row_ptr, csr_col_ind, block_dim, bsr_descr, bsr_row_ptr, bsr_nnz) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_csr2bsr_nnz_rank_1 (handle, dir, m, n, csr_descr, csr_row_ptr, csr_col_ind, block_dim, bsr_descr, bsr_row_ptr, bsr_nnz) |
| |
This function takes a sparse CSR matrix as input and computes the block row offset array, bsr_row_ptr, and the total number of non-zero blocks, bsr_nnz, that will result from converting the CSR format input matrix to a BSR format output matrix. This function is the first step in the conversion and is used in conjunction with rocsparse_Xcsr2bsr().
- Note
- The routine supports asynchronous execution if the pointer mode is set to device.
-
This routine does not support execution in a hipGraph context.
- Parameters
-
| [in] | handle | - handle to the rocSPARSE library context queue. |
| [in] | dir | - direction that specifies whether to count non-zero elements by rocsparse_direction_row or by rocsparse_direction_column. |
| [in] | m | - number of rows of the sparse CSR matrix. |
| [in] | n | - number of columns of the sparse CSR matrix. |
| [in] | csr_descr | - descriptor of the sparse CSR matrix. Currently, only rocsparse_matrix_type_general is supported. |
| [in] | csr_row_ptr | - integer array containing m+1 elements that point to the start of each row of the CSR matrix. |
| [in] | csr_col_ind | - integer array of the column indices for each non-zero element in the CSR matrix. |
| [in] | block_dim | - the block dimension of the BSR matrix. Between 1 and min(m, n). |
| [in] | bsr_descr | - descriptor of the sparse BSR matrix. Currently, only rocsparse_matrix_type_general is supported. |
| [out] | bsr_row_ptr | - integer array containing mb+1 elements that point to the start of each block row of the BSR matrix. |
| [out] | bsr_nnz | - total number of non-zero elements in device or host memory. |
- Return values
-
| rocsparse_status_success | the operation completed successfully. |
| rocsparse_status_invalid_handle | the library context was not initialized. |
| rocsparse_status_invalid_size | m, n, or block_dim is invalid. |
| rocsparse_status_invalid_pointer | csr_row_ptr, csr_col_ind, bsr_row_ptr, or bsr_nnz pointer is invalid. |