Skip to content

Add dispatches to access device matrix data via SparseArrays interface #2738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

termi-official
Copy link
Contributor

@Abdelrahman912 Can you check if that is sufficient for the preconditioners on CSC?

Copy link

codecov bot commented Apr 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.35%. Comparing base (591f61d) to head (94ba3f1).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2738       +/-   ##
===========================================
- Coverage   88.86%   74.35%   -14.51%     
===========================================
  Files         153      153               
  Lines       13153    13020      -133     
===========================================
- Hits        11688     9681     -2007     
- Misses       1465     3339     +1874     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@termi-official termi-official marked this pull request as ready for review April 14, 2025 17:39
Copy link
Contributor

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic master) to apply these changes.

Click here to view the suggested changes.
diff --git a/lib/cusparse/device.jl b/lib/cusparse/device.jl
index b81fb57a6..8345426be 100644
--- a/lib/cusparse/device.jl
+++ b/lib/cusparse/device.jl
@@ -37,7 +37,7 @@ SparseArrays.nnz(g::CuSparseDeviceMatrixCSC) = g.nnz
 SparseArrays.rowvals(g::CuSparseDeviceMatrixCSC) = g.rowVal
 SparseArrays.getcolptr(g::CuSparseDeviceMatrixCSC) = g.colPtr
 SparseArrays.getnzval(g::CuSparseDeviceMatrixCSC) = g.nzVal
-SparseArrays.nzrange(g::CuSparseDeviceMatrixCSC, col::Integer) = SparseArrays.getcolptr(g)[col]:(SparseArrays.getcolptr(g)[col+1]-1)
+SparseArrays.nzrange(g::CuSparseDeviceMatrixCSC, col::Integer) = SparseArrays.getcolptr(g)[col]:(SparseArrays.getcolptr(g)[col + 1] - 1)
 
 struct CuSparseDeviceMatrixCSR{Tv,Ti,A} <: AbstractSparseMatrix{Tv,Ti}
     rowPtr::CuDeviceVector{Ti, A}

@termi-official
Copy link
Contributor Author

This should be ready for merge on our end.

@maleadt maleadt merged commit 4d748fb into JuliaGPU:master Apr 15, 2025
4 checks passed
@termi-official termi-official deleted the do/devicetypes-sparsearrays-compat branch April 15, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants