From ab12c5bd2a5878f453dec06b697560eb580ce38f Mon Sep 17 00:00:00 2001 From: William Moses Date: Tue, 17 Sep 2024 16:48:40 -0500 Subject: [PATCH] Update QuadGKEnzymeExt.jl --- ext/QuadGKEnzymeExt.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/QuadGKEnzymeExt.jl b/ext/QuadGKEnzymeExt.jl index a59ccea..9d4c9b7 100644 --- a/ext/QuadGKEnzymeExt.jl +++ b/ext/QuadGKEnzymeExt.jl @@ -90,18 +90,21 @@ end function Base.:+(a::CV, b::CV) where {CV <: MixedClosureVector} res = deepcopy(a)::CV - Enzyme.Compiler.recursive_accumulate(res, b, identity)::CV + Enzyme.Compiler.recursive_accumulate(res, b, identity) + res end function Base.:-(a::CV, b::CV) where {CV <: MixedClosureVector} res = deepcopy(a)::CV - Enzyme.Compiler.recursive_accumulate(res, b, x->-x)::CV + Enzyme.Compiler.recursive_accumulate(res, b, x->-x) + res end function Base.:*(a::Number, b::CV) where {CV <: MixedClosureVector} # b + (a-1) * b = a * b res = deepcopy(b)::CV - Enzyme.Compiler.recursive_accumulate(res, b, x->(a-1)*x)::CV + Enzyme.Compiler.recursive_accumulate(res, b, x->(a-1)*x) + res end function Base.:*(a::MixedClosureVector, b::Number)