I am developing my MEX file for sparse matrix computing with CUDA. I am using CUSP library. I don't know how to return cusp::csr_matrix back to Matlab. For example, I have
cusp::csr_matrix<mwIndex,double,cusp::host_memory> At(m,n,N);
So, it is At matrix in CSR format, which, lets say, I have computed. Now, I have to return it to Matlab. Something like this:
plhs[0] = At;
But, of course, it doesn't work like that, firstly because At is on GPU. I guess I should use At.values and methods for indexes. But, also, how to assign them to host data?
Could somebody suggest how to do all that? :)