-
aoclsparse_status aoclsparse_csr2bsr_nnz(aoclsparse_int m, aoclsparse_int n, const aoclsparse_mat_descr descr, const aoclsparse_int *csr_row_ptr, const aoclsparse_int *csr_col_ind, aoclsparse_int block_dim, aoclsparse_int *bsr_row_ptr, aoclsparse_int *bsr_nnz)#
aoclsparse_csr2bsr_nnzcomputes the number of nonzero block columns per row and the total number of nonzero blocks in a sparse BSR matrix given a sparse CSR matrix as input.- Parameters:
m – [in] number of rows of the sparse CSR matrix.
n – [in] number of columns of the sparse CSR matrix.
descr – [in] descriptor of the input sparse CSR matrix. Only the base index is used in computing the nnz blocks, the remaining descriptor elements are ignored.
csr_row_ptr – [in] integer array containing
m+1 elements that point to the start of each row of the CSR matrixcsr_col_ind – [in] integer array of the column indices for each non-zero element in the CSR matrix
block_dim – [in] the block dimension of the BSR matrix. Between 1 and min(m, n)
bsr_row_ptr – [out] integer array containing
mb+1 elements that point to the start of each block row of the BSR matrixbsr_nnz – [out] total number of nonzero elements in device or host memory.
- Return values:
aoclsparse_status_success – the operation completed successfully.
aoclsparse_status_invalid_size –
mornorblock_dimis invalid.aoclsparse_status_invalid_pointer –
csr_row_ptrorcsr_col_indorbsr_row_ptrorbsr_nnzpointer is invalid.