A high-performance general-purpose compute library

Convert an existing sparse array into a different storage format. More...

Functions

AFAPI array sparseConvertTo (const array in, const af::storage destStrorage)
 
AFAPI af_err af_sparse_convert_to (af_array *out, const af_array in, const af_storage destStorage)
 

Detailed Description

Convert an existing sparse array into a different storage format.

Converting storage formats is allowed between AF_STORAGE_CSR, AF_STORAGE_COO and AF_STORAGE_DENSE.

When converting to AF_STORAGE_DENSE, a dense array is returned.

Note
AF_STORAGE_CSC is currently not supported.

Function Documentation

◆ af_sparse_convert_to()

AFAPI af_err af_sparse_convert_to ( af_array out,
const af_array  in,
const af_storage  destStorage 
)
Parameters
[out]outaf_array for the sparse array with the given storage type
[in]inis the source sparse matrix to be converted
[in]destStorageis the storage format of the output sparse array
Returns
AF_SUCCESS if the execution completes properly

◆ sparseConvertTo()

AFAPI array sparseConvertTo ( const array  in,
const af::storage  destStrorage 
)
Parameters
[in]inis the source sparse matrix to be converted
[in]destStrorageis the storage format of the output sparse array
Returns
af::array for the sparse array with the given storage type