Skip to content

Commit 1870218

Browse files
committed
Simplify CUDAKernels.
1 parent 16fe42d commit 1870218

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

src/CUDAKernels.jl

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module CUDAKernels
22

33
import KernelAbstractions
44
import CUDA
5+
import CUDA: @device_override
56
import UnsafeAtomicsLLVM
67
import GPUCompiler
78

@@ -147,34 +148,6 @@ function (obj::Kernel{CUDABackend})(args...; ndrange=nothing, workgroupsize=noth
147148
return nothing
148149
end
149150

150-
# list of overrides (only for Julia 1.6)
151-
const overrides = Expr[]
152-
153-
macro device_override(ex)
154-
ex = macroexpand(__module__, ex)
155-
if Meta.isexpr(ex, :call)
156-
@show ex = eval(ex)
157-
error()
158-
end
159-
code = quote
160-
Base.Experimental.@overlay($CUDA.method_table, $ex)
161-
end
162-
if isdefined(Base.Experimental, Symbol("@overlay"))
163-
return esc(code)
164-
else
165-
push!(overrides, code)
166-
return
167-
end
168-
end
169-
170-
function __init__()
171-
precompiling = ccall(:jl_generating_output, Cint, ()) != 0
172-
precompiling && return
173-
# register device overrides
174-
eval(Expr(:block, overrides...))
175-
empty!(overrides)
176-
end
177-
178151
import KernelAbstractions: CompilerMetadata, DynamicCheck, LinearIndices
179152
import KernelAbstractions: __index_Local_Linear, __index_Group_Linear, __index_Global_Linear, __index_Local_Cartesian, __index_Group_Cartesian, __index_Global_Cartesian, __validindex, __print
180153
import KernelAbstractions: mkcontext, expand, __iterspace, __ndrange, __dynamic_checkbounds

0 commit comments

Comments
 (0)