aoclsparse_convert_bsr() - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English
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_bsr converts 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_valuesrc_mat or block_dim contains invalid value

  • aoclsparse_status_invalid_pointer – pointers in src_mat or dest_mat are invalid

  • aoclsparse_status_not_implemented – conversion of the src_mat format given is not implemented

  • aoclsparse_status_memory_error – memory allocation for destination matrix failed