-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Hi!
I post here a feature request from the OG taichi repo since it is now moving so slow.
I would like to use setitem when dealing with sparse matrices on the GPU.
EigenSparseMatrix conveniently implements set_element but not CuSparseMatrix which make the code not portable.
One simple solution could be to implement a method very similar to CuSparseMatrix::get_element but that simply set the value instead of returning it.
I do understand that dynamic memory allocation on the GPU is trickier than what is achieved with Eigen but we could have a basic use case which improves current behavior while not adding much code complexity.
I can see 2 cases:
The value already exists 👍🏻. Just update the "CuSparseMatrix::value" array.
The value does not exist 👎🏻. Throw an error just like it does at the moment.
This easy to implement feature would greatly benefit the API and portability while adding coherence to SparseMatrix behavior.
Finally, this feature is highly needed when dealing with implicit simulations and Dirichlet boundary conditions. These conditions require to update the system matrix which API is usually quite straightforward.
If you have a workaround while this feature is developed, I would really appreciate it as this is totally blocking any advancement on my project.
As an answer to your question on the OG feature request:
You can use the already implemented solvers (cuda and eigen) with sparse matrices where you would have to develop them by hand without it. Which takes a lot of time to validate and will probably be never as good as the cuSparseSolver version.
Best regards,
AlbanOdot