-
aoclsparse_status aoclsparse_convert_bsr(const aoclsparse_matrix src_mat, aoclsparse_int block_dim, aoclsparse_order block_order, aoclsparse_operation op, aoclsparse_matrix *dest_mat)#
Convert internal representation of matrix into a sparse BSR matrix.
aoclsparse_convert_bsrconverts the supported matrix format into a BSR format and returns it as a new aoclsparse_matrix. The input matrix can also be transposed, or conjugated and transposed before the conversion. The newly created matrix should be freed by calling aoclsparse_destroy(). Currently, the API supports a source matrix stored in CSR storage format with the matrix type aoclsparse_matrix_type_general. The source matrix needs to be initialized using aoclsparse_create_csr().- Parameters:
src_mat – [in] source matrix used for conversion.
block_dim – [in] size of the non-zero blocks of the BSR matrix.
block_order – [in] storage order of the elements inside the blocks. Possible options are aoclsparse_order_row and aoclsparse_order_column.
op – [in] operation to be performed on the input matrix.
dest_mat – [out] output destination matrix in BSR format.
- Return values:
aoclsparse_status_success – the operation completed successfully
aoclsparse_status_invalid_size – matrix dimensions are invalid
aoclsparse_status_invalid_value –
src_matorblock_dimcontains invalid valueaoclsparse_status_invalid_pointer – pointers in
src_matordest_matare invalidaoclsparse_status_not_implemented – conversion of the src_mat format given is not implemented
aoclsparse_status_memory_error – memory allocation for destination matrix failed