Skip to content

Commit b77b9bb

Browse files
committed
More zero size sparse matrix
1 parent 6750b0f commit b77b9bb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/mkl/wrappers_sparse.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
function sparse_release_matrix_handle(A::oneAbstractSparseMatrix)
22
queue = global_queue(context(A.nzVal), device(A.nzVal))
3-
handle_ptr = Ref{matrix_handle_t}(A.handle)
4-
onemklXsparse_release_matrix_handle(sycl_queue(queue), handle_ptr)
3+
m, n = size(A)
4+
if m != 0 && n != 0
5+
handle_ptr = Ref{matrix_handle_t}(A.handle)
6+
onemklXsparse_release_matrix_handle(sycl_queue(queue), handle_ptr)
7+
end
58
end
69

710
for (fname, elty, intty) in ((:onemklSsparse_set_csr_data , :Float32 , :Int32),
@@ -164,7 +167,10 @@ for SparseMatrix in (:oneSparseMatrixCSC,)
164167
y::oneStridedVector{$elty})
165168

166169
queue = global_queue(context(x), device(x))
167-
$fname(sycl_queue(queue), flip_trans(trans), alpha, A.handle, x, beta, y)
170+
m, n = size(A)
171+
if m != 0 && n != 0
172+
$fname(sycl_queue(queue), flip_trans(trans), alpha, A.handle, x, beta, y)
173+
end
168174
y
169175
end
170176
end

0 commit comments

Comments
 (0)