Skip to content

Commit

Permalink
Gate BijectorsEnzymeExt precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Oct 23, 2024
1 parent 9a19a37 commit 75e3799
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ext/BijectorsEnzymeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,21 @@ else
using ..Bijectors: find_alpha
end

@import_rrule typeof(find_alpha) Real Real Real
@import_frule typeof(find_alpha) Real Real Real
# Julia 1.11.1 caused a change in the ordering of precompilation for extensions.
# https://github.com/TuringLang/Bijectors.jl/issues/332
# See https://github.com/JuliaLang/julia/issues/56204
@static if v"1.11.1" <= VERSION < v"1.12"
function __init__()
if !Base.generating_output()
Base.eval(quote
@import_rrule typeof(find_alpha) Real Real Real
@import_frule typeof(find_alpha) Real Real Real
end)
end
end
else
@import_rrule typeof(find_alpha) Real Real Real
@import_frule typeof(find_alpha) Real Real Real
end

end

0 comments on commit 75e3799

Please sign in to comment.