Skip to content

Commit fce71d7

Browse files
committed
Mark _evaluate!! as noinline
1 parent eed80e5 commit fce71d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/model.jl

+5-1
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,11 @@ end
931931
932932
Evaluate the `model` with the arguments matching the given `context` and `varinfo` object.
933933
"""
934-
function _evaluate!!(model::Model, varinfo::AbstractVarInfo, context::AbstractContext)
934+
@noinline function _evaluate!!(model::Model, varinfo::AbstractVarInfo, context::AbstractContext)
935+
# NOTE(penelopeysm): This @noinline is a workaround for
936+
# https://github.com/EnzymeAD/Enzyme.jl/issues/2337 and only really affects
937+
# the smallest models (e.g. those with a single parameter). It can be
938+
# removed once that is fixed
935939
args, kwargs = make_evaluate_args_and_kwargs(model, varinfo, context)
936940
return model.f(args...; kwargs...)
937941
end

0 commit comments

Comments
 (0)