Memory requirement of cusparseScsr2csc


I am using the function ‘cusparseScsr2csc’ of the CUSPARSE library to convert a matrix from CSR format to CSC format.
The matrix has about 512^3 non-zero single precision floating point values.

The memory for both the input CSR matrix and the output CSC matrix is properly allocated on the GPU but ‘cusparseScsr2csc’ fails with a CUSPARSE_STATUS_ALLOC_FAILED error.

My question: what is the memory overhead required by ‘cusparseScsr2csc’ to compute the conversion? It seems significant…

Thanks for your help,

Hello Olivier,

The CUSPARSE library function csr2csc allocates an extra array of size nnz*sizeof(int) to store temporary data. The nnz stands for the number of non-zero elements and should match the index stored in csrRowPtr[last_row+1] as usual in CSR format.

Also, please let me know which card are you using for testing (to see if the matrix should indeed fit into its memory).

Hope it helps,