|
3 | 3 |
|
4 | 4 | # Ordering is important here. We want to select the first one that is compatible with the
|
5 | 5 | # problem.
|
6 |
| -# XXX: Remove this once Enzyme is properly supported on Julia 1.11+ |
7 |
| -@static if VERSION ≥ v"1.11-" |
8 |
| - const ReverseADs = ( |
9 |
| - ADTypes.AutoZygote(), |
10 |
| - ADTypes.AutoTracker(), |
11 |
| - ADTypes.AutoReverseDiff(; compile = true), |
12 |
| - ADTypes.AutoReverseDiff(), |
13 |
| - ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse), |
14 |
| - ADTypes.AutoFiniteDiff() |
15 |
| - ) |
16 |
| -else |
17 |
| - const ReverseADs = ( |
18 |
| - ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse), |
19 |
| - ADTypes.AutoZygote(), |
20 |
| - ADTypes.AutoTracker(), |
21 |
| - ADTypes.AutoReverseDiff(; compile = true), |
22 |
| - ADTypes.AutoReverseDiff(), |
23 |
| - ADTypes.AutoFiniteDiff() |
24 |
| - ) |
25 |
| -end |
| 6 | +const ReverseADs = ( |
| 7 | + ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse), |
| 8 | + ADTypes.AutoZygote(), |
| 9 | + ADTypes.AutoTracker(), |
| 10 | + ADTypes.AutoReverseDiff(), |
| 11 | + ADTypes.AutoFiniteDiff() |
| 12 | +) |
26 | 13 |
|
27 | 14 | const ForwardADs = (
|
28 | 15 | ADTypes.AutoPolyesterForwardDiff(),
|
@@ -116,14 +103,6 @@ function incompatible_backend_and_problem(
|
116 | 103 | end
|
117 | 104 |
|
118 | 105 | additional_incompatible_backend_check(::AbstractNonlinearProblem, ::AbstractADType) = false
|
119 |
| -function additional_incompatible_backend_check(prob::AbstractNonlinearProblem, |
120 |
| - ::ADTypes.AutoReverseDiff{true}) |
121 |
| - if SciMLBase.isinplace(prob) |
122 |
| - fu = prob.f.resid_prototype === nothing ? zero(prob.u0) : prob.f.resid_prototype |
123 |
| - return hasbranching(prob.f, fu, prob.u0, prob.p) |
124 |
| - end |
125 |
| - return hasbranching(prob.f, prob.u0, prob.p) |
126 |
| -end |
127 | 106 | function additional_incompatible_backend_check(
|
128 | 107 | prob::AbstractNonlinearProblem, ::ADTypes.AutoPolyesterForwardDiff)
|
129 | 108 | prob.u0 isa SArray && return true # promotes to a mutable array
|
|
0 commit comments