Skip to content

Commit e7fdaf5

Browse files
committed
Runic
1 parent 60df893 commit e7fdaf5

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

lib/mkl/wrappers_sparse.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function sparse_release_matrix_handle(A::oneAbstractSparseMatrix)
2-
if A.handle !== nothing
2+
return if A.handle !== nothing
33
try
44
queue = global_queue(context(A.nzVal), device(A.nzVal))
55
handle_ptr = Ref{matrix_handle_t}(A.handle)
@@ -8,7 +8,7 @@ function sparse_release_matrix_handle(A::oneAbstractSparseMatrix)
88
synchronize(queue)
99
catch err
1010
# Don't let finalizer errors crash the program
11-
@warn "Error releasing sparse matrix handle" exception=err
11+
@warn "Error releasing sparse matrix handle" exception = err
1212
end
1313
end
1414
end
@@ -117,10 +117,10 @@ for (fname, elty, intty) in ((:onemklSsparse_set_coo_data , :Float32 , :Int3
117117
queue = global_queue(context(nzVal), device(nzVal))
118118
if m != 0 && n != 0
119119
$fname(sycl_queue(queue), handle_ptr[], m, n, nnzA, 'O', rowInd, colInd, nzVal)
120-
dA = oneSparseMatrixCOO{$elty, $intty}(handle_ptr[], rowInd, colInd, nzVal, (m,n), nnzA)
120+
dA = oneSparseMatrixCOO{$elty, $intty}(handle_ptr[], rowInd, colInd, nzVal, (m, n), nnzA)
121121
finalizer(sparse_release_matrix_handle, dA)
122122
else
123-
dA = oneSparseMatrixCOO{$elty, $intty}(nothing, rowInd, colInd, nzVal, (m,n), nnzA)
123+
dA = oneSparseMatrixCOO{$elty, $intty}(nothing, rowInd, colInd, nzVal, (m, n), nnzA)
124124
end
125125
return dA
126126
end

src/array.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,14 @@ end
348348
## indexing
349349

350350
# Host-accessible arrays can be indexed from CPU, bypassing GPUArrays restrictions
351-
function Base.getindex(x::oneArray{<:Any, <:Any, <:Union{oneL0.HostBuffer,oneL0.SharedBuffer}}, I::Int)
352-
@boundscheck checkbounds(x, I)
353-
unsafe_load(pointer(x, I; type=oneL0.HostBuffer))
351+
function Base.getindex(x::oneArray{<:Any, <:Any, <:Union{oneL0.HostBuffer, oneL0.SharedBuffer}}, I::Int)
352+
@boundscheck checkbounds(x, I)
353+
return unsafe_load(pointer(x, I; type = oneL0.HostBuffer))
354354
end
355355

356-
function Base.setindex!(x::oneArray{<:Any, <:Any, <:Union{oneL0.HostBuffer,oneL0.SharedBuffer}}, v, I::Int)
357-
@boundscheck checkbounds(x, I)
358-
unsafe_store!(pointer(x, I; type=oneL0.HostBuffer), v)
356+
function Base.setindex!(x::oneArray{<:Any, <:Any, <:Union{oneL0.HostBuffer, oneL0.SharedBuffer}}, v, I::Int)
357+
@boundscheck checkbounds(x, I)
358+
return unsafe_store!(pointer(x, I; type = oneL0.HostBuffer), v)
359359
end
360360

361361

src/indexing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ function Base.findall(bools::oneArray{Bool})
2626
ys = oneArray{I}(undef, n)
2727

2828
if n > 0
29-
kernel = @oneapi launch=false _ker!(ys, bools, indices)
29+
kernel = @oneapi launch = false _ker!(ys, bools, indices)
3030
group_size = launch_configuration(kernel)
31-
kernel(ys, bools, indices; items=group_size, groups=cld(length(bools), group_size))
31+
kernel(ys, bools, indices; items = group_size, groups = cld(length(bools), group_size))
3232
end
3333
# unsafe_free!(indices)
3434

0 commit comments

Comments
 (0)