Skip to content

Commit

Permalink
Load with Requires on older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
sethaxen authored and wsmoses committed Sep 22, 2023
1 parent 90c44df commit 63a713f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ext/CUDAEnzymeCoreExt.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
module CUDAEnzymeCoreExt
using EnzymeCore
using EnzymeCore.EnzymeRules
using CUDA
if isdefined(Base, :get_extension)
using EnzymeCore
using EnzymeCore.EnzymeRules
using CUDA
else # using Requires
using ..EnzymeCore
using ..EnzymeCore.EnzymeRules
using ..CUDA
end

@inline dedup() = ()
@inline dedup(a::Const, args...) = (typeof(a), a.val, dedup(args...)...)
Expand Down
3 changes: 3 additions & 0 deletions src/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ function __init__()
@require SpecialFunctions="276daf66-3868-5448-9aa4-cd146d93841b" begin
include("../ext/SpecialFunctionsExt.jl")
end
@require EnzymeCore="f151be2c-9106-41f4-ab19-57ee4f262869" begin
include("../ext/CUDAEnzymeCoreExt.jl")
end
end

# ensure that operations executed by the REPL back-end finish before returning,
Expand Down

0 comments on commit 63a713f

Please sign in to comment.