You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have a vector (u), we can easily convert it into a sparse diagonal matrix using the command spdiagm(u).
If we want to do the same operation on the GPU using CUDA where u is defined as CuArray(u). The command spdiagm(u) gives the scalar indexing error and therefore it does not work.
CuSparseMatrixCSC(Diagonal(u)) works but it is quite slow. Is there a way to perform this task efficiently?
Regards
The text was updated successfully, but these errors were encountered:
Thank you for your reply.
After understanding the way sparse matrices are stored, one can easily build a diagonal sparse matrix of size N with vector u as diagonal as follows:
If we have a vector (u), we can easily convert it into a sparse diagonal matrix using the command spdiagm(u).
If we want to do the same operation on the GPU using CUDA where u is defined as CuArray(u). The command spdiagm(u) gives the scalar indexing error and therefore it does not work.
CuSparseMatrixCSC(Diagonal(u)) works but it is quite slow. Is there a way to perform this task efficiently?
Regards
The text was updated successfully, but these errors were encountered: