Skip to content

Commit f1e15c9

Browse files
jumerckxwsmoses
authored andcommitted
!defer_within_autodiff -> within_autodiff_rewrite
1 parent 0e53314 commit f1e15c9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/compiler/interpreter.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ struct EnzymeInterpreter{T} <: AbstractInterpreter
132132
inactive_rules::Bool
133133
broadcast_rewrite::Bool
134134

135-
# When true, leave the check for within_autodiff to the handler.
136-
defer_within_autodiff::Bool
135+
# When false, leave the check for within_autodiff to the handler.
136+
within_autodiff_rewrite::Bool
137137

138138
handler::T
139139
end
@@ -173,7 +173,7 @@ function EnzymeInterpreter(
173173
reverse_rules::Bool,
174174
inactive_rules::Bool,
175175
broadcast_rewrite::Bool = true,
176-
defer_within_autodiff::Bool = false,
176+
within_autodiff_rewrite::Bool = true,
177177
handler = nothing
178178
)
179179
@assert world <= Base.get_world_counter()
@@ -234,7 +234,7 @@ function EnzymeInterpreter(
234234
reverse_rules::Bool,
235235
inactive_rules::Bool,
236236
broadcast_rewrite::Bool,
237-
defer_within_autodiff::Bool,
237+
within_autodiff_rewrite::Bool,
238238
handler
239239
)
240240
end
@@ -246,9 +246,9 @@ EnzymeInterpreter(
246246
mode::API.CDerivativeMode,
247247
inactive_rules::Bool,
248248
broadcast_rewrite::Bool = true,
249-
defer_within_autodiff::Bool = false,
249+
within_autodiff_rewrite::Bool = true,
250250
handler = nothing
251-
) = EnzymeInterpreter(cache_or_token, mt, world, mode == API.DEM_ForwardMode, mode == API.DEM_ReverseModeCombined || mode == API.DEM_ReverseModePrimal || mode == API.DEM_ReverseModeGradient, inactive_rules, broadcast_rewrite, defer_within_autodiff, handler)
251+
) = EnzymeInterpreter(cache_or_token, mt, world, mode == API.DEM_ForwardMode, mode == API.DEM_ReverseModeCombined || mode == API.DEM_ReverseModePrimal || mode == API.DEM_ReverseModeGradient, inactive_rules, broadcast_rewrite, within_autodiff_rewrite, handler)
252252

253253
function EnzymeInterpreter(interp::EnzymeInterpreter;
254254
cache_or_token = (@static if HAS_INTEGRATED_CACHE
@@ -265,7 +265,7 @@ function EnzymeInterpreter(interp::EnzymeInterpreter;
265265
reverse_rules = interp.reverse_rules,
266266
inactive_rules = interp.inactive_rules,
267267
broadcast_rewrite = interp.broadcast_rewrite,
268-
defer_within_autodiff = interp.defer_within_autodiff,
268+
within_autodiff_rewrite = interp.within_autodiff_rewrite,
269269
handler = interp.handler)
270270
return EnzymeInterpreter(
271271
cache_or_token,
@@ -278,7 +278,7 @@ function EnzymeInterpreter(interp::EnzymeInterpreter;
278278
reverse_rules,
279279
inactive_rules,
280280
broadcast_rewrite,
281-
defer_within_autodiff,
281+
within_autodiff_rewrite,
282282
handler
283283
)
284284
end
@@ -973,7 +973,7 @@ function abstract_call_known(
973973

974974
(; fargs, argtypes) = arginfo
975975

976-
if !(interp.defer_within_autodiff) && f === Enzyme.within_autodiff
976+
if interp.within_autodiff_rewrite && f === Enzyme.within_autodiff
977977
if length(argtypes) != 1
978978
@static if VERSION < v"1.11.0-"
979979
return CallMeta(Union{}, Effects(), NoCallInfo())

0 commit comments

Comments
 (0)