aoclsparse_csr2dia_ndiag() - aoclsparse_csr2dia_ndiag() - 5.3 English - 68552

AOCL API Guide (68552)

Document_ID
68552
Release_Date
2026-05-13
Version
5.3 English
aoclsparse_status aoclsparse_csr2dia_ndiag(aoclsparse_int m, aoclsparse_int n, const aoclsparse_mat_descr descr, aoclsparse_int nnz, const aoclsparse_int *csr_row_ptr, const aoclsparse_int *csr_col_ind, aoclsparse_int *dia_num_diag)#

Convert a sparse CSR matrix into a sparse DIA matrix.

aoclsparse_csr2dia_ndiag computes number of diagonals for a given CSR matrix.

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 diagonals, the remaining descriptor elements are ignored.

  • nnz – [in] number of non-zero entries 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 containing the column indices of the sparse CSR matrix.

  • dia_num_diag – [out] pointer to the number of diagonals with non-zeroes in DIA storage format.

Return values:
  • aoclsparse_status_success – the operation completed successfully.

  • aoclsparse_status_invalid_size – m is invalid.

  • aoclsparse_status_invalid_pointer – csr_row_ptr, or ell_width pointer is invalid.

  • aoclsparse_status_internal_error – an internal error occurred.