-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move overrides into a separate file
- Loading branch information
Showing
3 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# NOTE: We are placing all the reactant_overrides here to avoid incompatibilities with | ||
# Revise.jl. Essentially files that contain reactant_overrides cannot be revised | ||
# correctly. Once that (https://github.com/timholy/Revise.jl/issues/646) is resolved | ||
# we should move all the reactant_overrides to relevant files. | ||
|
||
# Compiling within a compile should return simply the original function | ||
@reactant_override function Compiler.compile( | ||
f, args; client=nothing, optimize=true, sync=false | ||
) | ||
return f | ||
end | ||
|
||
# Enzyme overrides | ||
@reactant_override @noinline function Enzyme.autodiff_deferred( | ||
rmode::Enzyme.Mode, f::FA, rt::Type{A}, args::Vararg{Annotation,Nargs} | ||
) where {FA<:Annotation,A<:Annotation,Nargs} | ||
return overload_autodiff(rmode, f, rt, args...) | ||
end | ||
|
||
@reactant_override @noinline function Enzyme.autodiff( | ||
rmode::Enzyme.Mode, f::FA, rt::Type{A}, args::Vararg{Annotation,Nargs} | ||
) where {FA<:Annotation,A<:Annotation,Nargs} | ||
return overload_autodiff(rmode, f, rt, args...) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters