-
Couldn't load subscription status.
- Fork 29
Add sorting, sparse constructor, and device ownership #534
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
base: ms/sparse_fix
Are you sure you want to change the base?
Conversation
|
Your PR requires formatting changes to meet the project's style guidelines. 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)
|
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
570e801 to
5c833a7
Compare
sort!andsortpermdevice(x)ownership in global queue calls of MKLoneSparseMatrixCSR(rowptr, colptr, nzval, dims)constructor