Skip to content

Conversation

michel2323
Copy link
Member

@michel2323 michel2323 commented Sep 26, 2025

  • Adding sort! and sortperm
  • Add explicit device(x) ownership in global queue calls of MKL
  • Add oneSparseMatrixCSR(rowptr, colptr, nzval, dims) constructor

Copy link
Contributor

github-actions bot commented Sep 26, 2025

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

Click here to view the suggested changes.
diff --git a/lib/mkl/wrappers_sparse.jl b/lib/mkl/wrappers_sparse.jl
index 6b06c00..ffa19df 100644
--- a/lib/mkl/wrappers_sparse.jl
+++ b/lib/mkl/wrappers_sparse.jl
@@ -1,5 +1,5 @@
 function sparse_release_matrix_handle(A::oneAbstractSparseMatrix)
-    if A.handle !== nothing
+    return if A.handle !== nothing
         try
             queue = global_queue(context(A.nzVal), device(A.nzVal))
             handle_ptr = Ref{matrix_handle_t}(A.handle)
@@ -8,7 +8,7 @@ function sparse_release_matrix_handle(A::oneAbstractSparseMatrix)
             synchronize(queue)
         catch err
             # Don't let finalizer errors crash the program
-            @warn "Error releasing sparse matrix handle" exception=err
+            @warn "Error releasing sparse matrix handle" exception = err
         end
     end
 end
@@ -115,10 +115,10 @@ for (fname, elty, intty) in ((:onemklSsparse_set_coo_data   , :Float32   , :Int3
             queue = global_queue(context(nzVal), device(nzVal))
             if m != 0 && n != 0
                 $fname(sycl_queue(queue), handle_ptr[], m, n, nnzA, 'O', rowInd, colInd, nzVal)
-                dA = oneSparseMatrixCOO{$elty, $intty}(handle_ptr[], rowInd, colInd, nzVal, (m,n), nnzA)
+                dA = oneSparseMatrixCOO{$elty, $intty}(handle_ptr[], rowInd, colInd, nzVal, (m, n), nnzA)
                 finalizer(sparse_release_matrix_handle, dA)
             else
-                dA = oneSparseMatrixCOO{$elty, $intty}(nothing, rowInd, colInd, nzVal, (m,n), nnzA)
+                dA = oneSparseMatrixCOO{$elty, $intty}(nothing, rowInd, colInd, nzVal, (m, n), nnzA)
             end
             return dA
         end
diff --git a/src/indexing.jl b/src/indexing.jl
index d46c67b..13d1947 100644
--- a/src/indexing.jl
+++ b/src/indexing.jl
@@ -26,9 +26,9 @@ function Base.findall(bools::oneArray{Bool})
     ys = oneArray{I}(undef, n)
 
     if n > 0
-        kernel = @oneapi launch=false _ker!(ys, bools, indices)
+        kernel = @oneapi launch = false _ker!(ys, bools, indices)
         group_size = launch_configuration(kernel)
-        kernel(ys, bools, indices; items=group_size, groups=cld(length(bools), group_size))
+        kernel(ys, bools, indices; items = group_size, groups = cld(length(bools), group_size))
     end
     # unsafe_free!(indices)
 

Copy link

codecov bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 91.50943% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.14%. Comparing base (5c833a7) to head (80d24c2).

Files with missing lines Patch % Lines
lib/mkl/wrappers_sparse.jl 90.90% 5 Missing ⚠️
lib/mkl/wrappers_blas.jl 90.47% 4 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           ms/sparse_fix     #534      +/-   ##
=================================================
+ Coverage          77.08%   77.14%   +0.05%     
=================================================
  Files                 47       48       +1     
  Lines               3168     3185      +17     
=================================================
+ Hits                2442     2457      +15     
- Misses               726      728       +2     

☔ 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.

@michel2323 michel2323 changed the base branch from master to ms/sparse_fix October 1, 2025 16:03
@michel2323 michel2323 force-pushed the ms/sparse_fix branch 2 times, most recently from 570e801 to 5c833a7 Compare October 1, 2025 16:32
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