Skip to content

Commit 80516b6

Browse files
committed
WIP
1 parent 0f299dc commit 80516b6

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

lib/mkl/wrappers_sparse.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
function sparse_release_matrix_handle(A::oneAbstractSparseMatrix)
2-
return if A.handle !== nothing
3-
queue = global_queue(context(A.nzVal), device(A.nzVal))
4-
oneL0.synchronize(queue)
5-
handle_ptr = Ref{matrix_handle_t}(A.handle)
6-
onemklXsparse_release_matrix_handle(sycl_queue(queue), handle_ptr)
2+
if A.handle !== nothing
3+
try
4+
queue = global_queue(context(A.nzVal), device(A.nzVal))
5+
handle_ptr = Ref{matrix_handle_t}(A.handle)
6+
onemklXsparse_release_matrix_handle(sycl_queue(queue), handle_ptr)
7+
# Only synchronize after successful release to ensure completion
8+
synchronize(queue)
9+
catch err
10+
# Don't let finalizer errors crash the program
11+
@warn "Error releasing sparse matrix handle" exception=err
12+
end
713
end
814
end
915

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1919
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2020
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2121
libigc_jll = "94295238-5935-5bd7-bb0f-b00942e9bdd5"
22+
oneAPI = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b"
2223
oneAPI_Support_jll = "b049733a-a71d-5ed3-8eba-7d323ac00b36"

0 commit comments

Comments
 (0)