Skip to content

Commit

Permalink
Merge pull request #1055 from SciML/revert-1054-mb/use-make-zero
Browse files Browse the repository at this point in the history
Revert "use Enzyme make_zero"
  • Loading branch information
ChrisRackauckas authored Jun 6, 2024
2 parents bc50a2b + fd51d10 commit 5fa2b7c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ext/DiffEqBaseEnzymeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ function Enzyme.EnzymeRules.augmented_primal(config::Enzyme.EnzymeRules.ConfigWi
SciMLBase.EnzymeOriginator(), ntuple(arg_copy, Val(length(args)))...;
kwargs...)

dres = Enzyme.make_zero(res[1])::RT
dres = deepcopy(res[1])::RT
for v in dres.u
v .= 0
end
tup = (dres, res[2])
return Enzyme.EnzymeRules.AugmentedReturn{RT, RT, Any}(res[1], dres, tup::Any)
end
Expand All @@ -49,7 +52,9 @@ function Enzyme.EnzymeRules.reverse(config::Enzyme.EnzymeRules.ConfigWidth{1},
end
ptr.dval .+= darg
end
dres = Enzyme.make_zero(dres)
for v in dres.u
v .= 0
end
return ntuple(_ -> nothing, Val(length(args) + 4))
end

Expand Down

0 comments on commit 5fa2b7c

Please sign in to comment.