Skip to content

Commit c18c157

Browse files
Fixes found with JETLS (#416)
* Some fixes found by JETLS * Whitespace
1 parent 5e840a6 commit c18c157

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

lib/cl/event.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function Base.wait(evts::Vector{AbstractEvent})
153153
isempty(evts) && return evts
154154
evt_ids = [pointer(evt) for evt in evts]
155155
GC.@preserve evts begin
156-
clWaitForEvents(ength(evt_ids), evt_ids)
156+
clWaitForEvents(length(evt_ids), evt_ids)
157157
end
158158
return evts
159159
end

lib/cl/kernel.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ end
311311

312312
# From `julia/base/reflection.jl`, adjusted to add specialization on `t`.
313313
function _to_tuple_type(t)
314-
if isa(t, Tuple) || isa(t, AbstractArray) || isa(t, SimpleVector)
314+
if isa(t, Tuple) || isa(t, AbstractArray) || isa(t, Core.SimpleVector)
315315
t = Tuple{t...}
316316
end
317317
if isa(t, Type) && t <: Tuple

src/device/array.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,17 +236,17 @@ Base.show(io::IO, mime::MIME"text/plain", a::CLDeviceArray) = show(io, a)
236236
end
237237

238238
function Base.reinterpret(::Type{T}, a::CLDeviceArray{S,N,A}) where {T,S,N,A}
239-
err = _reinterpret_exception(T, a)
240-
err === nothing || throw(err)
239+
err = GPUArrays._reinterpret_exception(T, a)
240+
err === nothing || throw(err)
241241

242-
if sizeof(T) == sizeof(S) # fast case
243-
return CLDeviceArray{T,N,A}(size(a), reinterpret(LLVMPtr{T,A}, a.ptr), a.maxsize)
244-
end
242+
if sizeof(T) == sizeof(S) # fast case
243+
return CLDeviceArray{T,N,A}(size(a), reinterpret(LLVMPtr{T,A}, a.ptr), a.maxsize)
244+
end
245245

246-
isize = size(a)
247-
size1 = div(isize[1]*sizeof(S), sizeof(T))
248-
osize = tuple(size1, Base.tail(isize)...)
249-
return CLDeviceArray{T,N,A}(osize, reinterpret(LLVMPtr{T,A}, a.ptr), a.maxsize)
246+
isize = size(a)
247+
size1 = div(isize[1]*sizeof(S), sizeof(T))
248+
osize = tuple(size1, Base.tail(isize)...)
249+
return CLDeviceArray{T,N,A}(osize, reinterpret(LLVMPtr{T,A}, a.ptr), a.maxsize)
250250
end
251251

252252

0 commit comments

Comments
 (0)