-
aoclsparse_status aoclsparse_scsr2dia(aoclsparse_int m, aoclsparse_int n, const aoclsparse_mat_descr descr, const aoclsparse_int *csr_row_ptr, const aoclsparse_int *csr_col_ind, const float *csr_val, aoclsparse_int dia_num_diag, aoclsparse_int *dia_offset, float *dia_val)#
-
aoclsparse_status aoclsparse_dcsr2dia(aoclsparse_int m, aoclsparse_int n, const aoclsparse_mat_descr descr, const aoclsparse_int *csr_row_ptr, const aoclsparse_int *csr_col_ind, const double *csr_val, aoclsparse_int dia_num_diag, aoclsparse_int *dia_offset, double *dia_val)#
Convert a sparse CSR matrix into a sparse DIA matrix.
aoclsparse_?csr2diaconverts a CSR matrix into an DIA matrix. It is assumed, thatdia_valanddia_offsetare allocated. Allocation size is computed by the number of rows times the number of diagonals. The number of DIA diagonals is obtained by aoclsparse_csr2dia_ndiag().The index base is preserved during the conversion.- Parameters:
m – [in] number of rows of the sparse CSR matrix.
n – [in] number of cols 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.
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.
csr_val – [in] array containing the values of the sparse CSR matrix.
dia_num_diag – [in] number of diagoanls in ELL storage format.
dia_offset – [out] array of
dia_num_diagelements containing the diagonal offsets from main diagonal.dia_val – [out] array of
mtimesdia_num_diagelements of the sparse DIA matrix.
- Return values:
aoclsparse_status_success – the operation completed successfully.
aoclsparse_status_invalid_handle – the library context was not initialized.
aoclsparse_status_invalid_size –
morell_widthis invalid.aoclsparse_status_invalid_pointer –
csr_val,csr_row_ptr,csr_col_ind,ell_valorell_col_indpointer is invalid.