aoclsparse_?csr2csc() - aoclsparse_?csr2csc() - 6.0 English - 68552

AOCL API Guide (68552)

Document_ID
68552
Release_Date
2026-11-10
Version
6.0 English
aoclsparse_status aoclsparse_scsr2csc(aoclsparse_int m, aoclsparse_int n, aoclsparse_int nnz, const aoclsparse_mat_descr descr, aoclsparse_index_base baseCSC, const aoclsparse_int *csr_row_ptr, const aoclsparse_int *csr_col_ind, const float *csr_val, aoclsparse_int *csc_row_ind, aoclsparse_int *csc_col_ptr, float *csc_val)#
aoclsparse_status aoclsparse_dcsr2csc(aoclsparse_int m, aoclsparse_int n, aoclsparse_int nnz, const aoclsparse_mat_descr descr, aoclsparse_index_base baseCSC, const aoclsparse_int *csr_row_ptr, const aoclsparse_int *csr_col_ind, const double *csr_val, aoclsparse_int *csc_row_ind, aoclsparse_int *csc_col_ptr, double *csc_val)#
aoclsparse_status aoclsparse_ccsr2csc(aoclsparse_int m, aoclsparse_int n, aoclsparse_int nnz, const aoclsparse_mat_descr descr, aoclsparse_index_base baseCSC, const aoclsparse_int *csr_row_ptr, const aoclsparse_int *csr_col_ind, const aoclsparse_float_complex *csr_val, aoclsparse_int *csc_row_ind, aoclsparse_int *csc_col_ptr, aoclsparse_float_complex *csc_val)#
aoclsparse_status aoclsparse_zcsr2csc(aoclsparse_int m, aoclsparse_int n, aoclsparse_int nnz, const aoclsparse_mat_descr descr, aoclsparse_index_base baseCSC, const aoclsparse_int *csr_row_ptr, const aoclsparse_int *csr_col_ind, const aoclsparse_double_complex *csr_val, aoclsparse_int *csc_row_ind, aoclsparse_int *csc_col_ptr, aoclsparse_double_complex *csc_val)#

Convert a sparse CSR matrix into a sparse CSC matrix.

aoclsparse_?csr2csc converts a CSR matrix into a CSC matrix. These functions can also be used to convert a CSC matrix into a CSR matrix. The index base can be modified during the conversion.

Note

The resulting matrix can also be seen as the transpose of the input matrix.

Parameters:
  • m – [in] number of rows of the sparse CSR matrix.

  • n – [in] number of columns of the sparse CSR matrix.

  • nnz – [in] number of non-zero entries of 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.

  • baseCSC – [in] the desired index base (zero or one) for the converted matrix.

  • csr_val – [in] array of nnz elements 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 nnz elements containing the column indices of the sparse CSR matrix.

  • csc_val – [out] array of nnz elements of the sparse CSC matrix.

  • csc_row_ind – [out] array of nnz elements containing the row indices of the sparse CSC matrix.

  • csc_col_ptr – [out] array of n +1 elements that point to the start of every column of the sparse CSC matrix. aoclsparse_csr2csc_buffer_size().

Return values:
  • aoclsparse_status_success – the operation completed successfully.

  • aoclsparse_status_invalid_size – m, n or nnz is invalid.

  • aoclsparse_status_invalid_pointer – csr_val, csr_row_ptr, csr_col_ind, csc_val, csc_row_ind, csc_col_ptr is invalid.