aoclsparse_csr2bsr_nnz() - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English
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_nnz computes 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 matrix

  • csr_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 matrix

  • bsr_nnz[out] total number of nonzero elements in device or host memory.

Return values:
  • aoclsparse_status_success – the operation completed successfully.

  • aoclsparse_status_invalid_sizem or n or block_dim is invalid.

  • aoclsparse_status_invalid_pointercsr_row_ptr or csr_col_ind or bsr_row_ptr or bsr_nnz pointer is invalid.