-
aoclsparse_status aoclsparse_scsr2bsr(aoclsparse_int m, aoclsparse_int n, const aoclsparse_mat_descr descr, const aoclsparse_order block_order, const float *csr_val, const aoclsparse_int *csr_row_ptr, const aoclsparse_int *csr_col_ind, aoclsparse_int block_dim, float *bsr_val, aoclsparse_int *bsr_row_ptr, aoclsparse_int *bsr_col_ind)#
-
aoclsparse_status aoclsparse_dcsr2bsr(aoclsparse_int m, aoclsparse_int n, const aoclsparse_mat_descr descr, const aoclsparse_order block_order, const double *csr_val, const aoclsparse_int *csr_row_ptr, const aoclsparse_int *csr_col_ind, aoclsparse_int block_dim, double *bsr_val, aoclsparse_int *bsr_row_ptr, aoclsparse_int *bsr_col_ind)#
Convert a sparse CSR matrix into a sparse BSR matrix.
aoclsparse_?csr2bsrconverts a CSR matrix into a BSR matrix. It is assumed, thatbsr_val,bsr_col_indandbsr_row_ptrare allocated. Allocation size forbsr_row_ptris computed asmb+1wherembis the number of block rows in the BSR matrix. Allocation size forbsr_valandbsr_col_indis computed using this function which also fills inbsr_row_ptr. The index base is preserved during the conversion.- Parameters:
m – [in] number of rows in the sparse CSR matrix.
n – [in] number of columns in the sparse CSR matrix.
descr – [in] descriptor of the input sparse CSR matrix. Only the base index is used in the conversion process, the remaining descriptor elements are ignored.
block_order – [in] storage order of the elements inside the blocks. Possible options are aoclsparse_order_row and aoclsparse_order_column.
csr_val – [in] array of
nnzelements containing the values of the sparse CSR matrix.csr_row_ptr – [in] array of
m+1 elements that point to the start of every row of the sparse CSR matrix.csr_col_ind – [in] array of
nnzelements containing the column indices of the sparse CSR matrix.block_dim – [in] size of the blocks in the sparse BSR matrix.
bsr_val – [out] array of
nnzb*block_dim*block_dimcontaining the values of the sparse BSR matrix.bsr_row_ptr – [out] array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.bsr_col_ind – [out] array of
nnzbelements containing the block column indices of the sparse BSR matrix.
- Return values:
aoclsparse_status_success – the operation completed successfully.
aoclsparse_status_invalid_size –
m, orn, orblock_dimis invalid.aoclsparse_status_invalid_pointer –
bsr_val,bsr_row_ptr,bsr_col_ind,csr_val,csr_row_ptrorcsr_col_indpointer is invalid.