Add cuSPARSE safe wrapper#569
Conversation
…nd descriptor management
There was a problem hiding this comment.
Code Review
This pull request introduces safe abstractions for cuSPARSE, including high-level wrappers for handles and descriptors with automatic workspace management for SpMV and SpMM operations, alongside low-level FFI wrappers supporting CUDA 11 and 12. Feedback identifies critical safety issues where descriptors must hold a reference to the CUDA context to prevent undefined behavior during destruction. Additionally, several destruction functions in the low-level API contain incorrect type casts for CUDA 12, and safe wrappers for format conversions are currently missing from the implementation.
…se-dense conversions
|
Hey I'm gonna be honest, this PR is way too big for me to review and needs to be split into multiple sub PRs. I appreciate the use of agents, but this is not set up nicely for me. Did you run the tests? |
Add cuSPARSE safe wrapper
cuSPARSE had no
safe.rsand only 2 functions inresult.rs.spmv(),spmm()with automatic workspace management.Tested SpMV and SpMM on RTX 3060 Ti (CUDA 13.0).