diff --git a/src/derivative_wrappers.jl b/src/derivative_wrappers.jl index ec9cee185..d7a9e5177 100644 --- a/src/derivative_wrappers.jl +++ b/src/derivative_wrappers.jl @@ -668,14 +668,14 @@ function _vecjacobian!(dλ, y, λ, p, t, S::TS, isautojacvec::EnzymeVJP, dgrad, ytmp = _tmp5 end - tmp1 .= 0 # should be removed for dλ + Enzyme.make_zero!(tmp1) # should be removed for dλ ytmp .= y #if dgrad !== nothing # tmp2 = dgrad #else dup = if !(tmp2 isa DiffEqBase.NullParameters) - tmp2 .= 0 + Enzyme.make_zero!(tmp2) Enzyme.Duplicated(p, tmp2) else Enzyme.Const(p) @@ -685,7 +685,7 @@ function _vecjacobian!(dλ, y, λ, p, t, S::TS, isautojacvec::EnzymeVJP, dgrad, #if dy !== nothing # tmp3 = dy #else - tmp3 .= 0 + Enzyme.make_zero!(tmp3) #end vec(tmp4) .= vec(λ) diff --git a/src/gauss_adjoint.jl b/src/gauss_adjoint.jl index 87c4747d7..a7713e396 100644 --- a/src/gauss_adjoint.jl +++ b/src/gauss_adjoint.jl @@ -476,7 +476,7 @@ function vec_pjac!(out, λ, y, t, S::GaussIntegrand) tmp3, tmp4, tmp6 = paramjac_config vtmp4 = vec(tmp4) vtmp4 .= λ - out .= 0 + Enzyme.make_zero!(out) Enzyme.make_zero!(tmp6) Enzyme.autodiff( Enzyme.Reverse, Enzyme.Duplicated(pf, tmp6), Enzyme.Const, diff --git a/src/quadrature_adjoint.jl b/src/quadrature_adjoint.jl index 3784a2056..833ef22cc 100644 --- a/src/quadrature_adjoint.jl +++ b/src/quadrature_adjoint.jl @@ -290,7 +290,7 @@ function vec_pjac!(out, λ, y, t, S::AdjointSensitivityIntegrand) elseif sensealg.autojacvec isa EnzymeVJP tmp3, tmp4, tmp6 = paramjac_config tmp4 .= λ - out .= 0 + Enzyme.make_zero!(out) Enzyme.make_zero!(tmp6) Enzyme.autodiff( Enzyme.Reverse, Enzyme.Duplicated(pf, tmp6), Enzyme.Const,