Skip to content

Commit

Permalink
Remove 1.6-era override mechanism. (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt authored Aug 18, 2023
1 parent 827be2f commit 35adfde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
17 changes: 2 additions & 15 deletions src/device/utils.jl
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
# local method table for device functions
@static if isdefined(Base.Experimental, Symbol("@overlay"))
Base.Experimental.@MethodTable(method_table)
else
const method_table = nothing
end

# list of overrides (only for Julia 1.6)
const overrides = Expr[]

macro device_override(ex)
ex = macroexpand(__module__, ex)
if Meta.isexpr(ex, :call)
ex = eval(ex)
error()
end
code = quote
esc(quote
$GPUCompiler.@override($method_table, $ex)
end
if isdefined(Base.Experimental, Symbol("@overlay"))
return esc(code)
else
push!(overrides, code)
return
end
end)
end

macro device_function(ex)
Expand Down
6 changes: 0 additions & 6 deletions src/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,9 @@ function __init__()
push!(Base.active_repl_backend.ast_transforms, synchronize_metal_tasks)
end

# register device overrides
eval(Expr(:block, overrides...))
empty!(overrides)

@static if !isdefined(Base, :get_extension)
@require SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" begin
include("../ext/SpecialFunctionsExt.jl")
eval(Expr(:block, overrides...))
empty!(overrides)
end
end
end
Expand Down

0 comments on commit 35adfde

Please sign in to comment.