diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceForwardDiffExt/onearg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceForwardDiffExt/onearg.jl index 338a49469..323f78865 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceForwardDiffExt/onearg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceForwardDiffExt/onearg.jl @@ -311,6 +311,24 @@ function DI.value_derivative_and_second_derivative!( return y, der, der2 end +## HVP + +function DI.prepare_hvp(f::F, backend::AutoForwardDiff, x, tx::Tangents) where {F} + return DI.prepare_hvp(f, SecondOrder(backend, backend), x, tx) +end + +function DI.hvp( + f::F, extras::HVPExtras, backend::AutoForwardDiff, x, tx::Tangents +) where {F} + return DI.hvp(f, extras, SecondOrder(backend, backend), x, tx) +end + +function DI.hvp!( + f::F, tg::Tangents, extras::HVPExtras, backend::AutoForwardDiff, x, tx::Tangents +) where {F} + return DI.hvp!(f, tg, extras, SecondOrder(backend, backend), x, tx) +end + ## Hessian ### Unprepared diff --git a/DifferentiationInterface/test/Back/ForwardDiff/test.jl b/DifferentiationInterface/test/Back/ForwardDiff/test.jl index 385f208e4..0ef6e1095 100644 --- a/DifferentiationInterface/test/Back/ForwardDiff/test.jl +++ b/DifferentiationInterface/test/Back/ForwardDiff/test.jl @@ -27,15 +27,12 @@ end ## Dense backends -test_differentiation(dense_backends, default_scenarios(); logging=LOGGING); +test_differentiation( + dense_backends, default_scenarios(; include_constantified=true); logging=LOGGING +); test_differentiation( - dense_backends, - default_scenarios(; include_constantified=true); - correctness=false, - type_stability=true, - second_order=false, - logging=LOGGING, + dense_backends; correctness=false, type_stability=true, logging=LOGGING ); test_differentiation(