-
aoclsparse_status aoclsparse_create_scsr(aoclsparse_matrix *mat, aoclsparse_index_base base, aoclsparse_int M, aoclsparse_int N, aoclsparse_int nnz, aoclsparse_int *row_ptr, aoclsparse_int *col_idx, float *val)#
-
aoclsparse_status aoclsparse_create_dcsr(aoclsparse_matrix *mat, aoclsparse_index_base base, aoclsparse_int M, aoclsparse_int N, aoclsparse_int nnz, aoclsparse_int *row_ptr, aoclsparse_int *col_idx, double *val)#
-
aoclsparse_status aoclsparse_create_ccsr(aoclsparse_matrix *mat, aoclsparse_index_base base, aoclsparse_int M, aoclsparse_int N, aoclsparse_int nnz, aoclsparse_int *row_ptr, aoclsparse_int *col_idx, aoclsparse_float_complex *val)#
-
aoclsparse_status aoclsparse_create_zcsr(aoclsparse_matrix *mat, aoclsparse_index_base base, aoclsparse_int M, aoclsparse_int N, aoclsparse_int nnz, aoclsparse_int *row_ptr, aoclsparse_int *col_idx, aoclsparse_double_complex *val)#
Creates a new aoclsparse_matrix based on CSR (Compressed Sparse Row) format.
aoclsparse_create_?csrcreates aoclsparse_matrix and initializes it with input parameters passed. The input arrays are left unchanged by the library except for the call to aoclsparse_order_mat(), which performs ordering of column indices of the matrix, or aoclsparse_sset_value(), aoclsparse_supdate_values() and variants, which modify the values of a nonzero element. To avoid any changes to the input data, aoclsparse_copy() can be used. To convert any other format to CSR, aoclsparse_convert_csr() can be used. Matrix should be destroyed at the end using aoclsparse_destroy().- Parameters:
mat – [out] the pointer to the CSR sparse matrix allocated in the API.
base – [in] aoclsparse_index_base_zero or aoclsparse_index_base_one.
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.
row_ptr – [in] array of
m+1elements that point to the start of every row of the sparse CSR matrix.col_idx – [in] array of
nnzelements containing the column indices of the sparse CSR matrix.val – [in] array of
nnzelements of the sparse CSR matrix.
- Return values:
aoclsparse_status_success – the operation completed successfully.
aoclsparse_status_invalid_pointer – at least one of
row_ptr,col_idxorvalpointer is NULL.aoclsparse_status_invalid_size – at least one of
M,Nornnzhas a negative value.aoclsparse_status_invalid_index_value – any
col_idxvalue is not within N.aoclsparse_status_memory_error – memory allocation for matrix failed.