Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit b31ed38

Browse files
committed
Dont default to Polyester
1 parent fd7d216 commit b31ed38

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

src/nlsolve/halley.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SimpleHalley, args...;
3333
fx = _get_fx(prob, x)
3434
T = eltype(x)
3535

36-
autodiff = __get_concrete_autodiff(prob, alg.autodiff; polyester = Val(false))
36+
autodiff = __get_concrete_autodiff(prob, alg.autodiff)
3737
abstol, reltol, tc_cache = init_termination_cache(abstol, reltol, fx, x,
3838
termination_condition)
3939

src/utils.jl

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -365,18 +365,9 @@ end
365365

366366
# Decide which AD backend to use
367367
@inline __get_concrete_autodiff(prob, ad::ADTypes.AbstractADType; kwargs...) = ad
368-
@inline function __get_concrete_autodiff(prob, ::Nothing; polyester::Val{P} = Val(true),
369-
kwargs...) where {P}
370-
if ForwardDiff.can_dual(eltype(prob.u0))
371-
if P && __is_extension_loaded(Val(:PolyesterForwardDiff)) &&
372-
!(prob.u0 isa Number) && ArrayInterface.can_setindex(prob.u0)
373-
return AutoPolyesterForwardDiff()
374-
else
375-
return AutoForwardDiff()
376-
end
377-
else
378-
return AutoFiniteDiff()
379-
end
368+
@inline function __get_concrete_autodiff(prob, ::Nothing; kwargs...)
369+
return ifelse(
370+
ForwardDiff.can_dual(eltype(prob.u0)), AutoForwardDiff(), AutoFiniteDiff())
380371
end
381372

382373
@inline __reshape(x::Number, args...) = x

0 commit comments

Comments
 (0)