diff --git a/lib/NonlinearSolveBase/src/autodiff.jl b/lib/NonlinearSolveBase/src/autodiff.jl index 83b6aa1f7..3747d2149 100644 --- a/lib/NonlinearSolveBase/src/autodiff.jl +++ b/lib/NonlinearSolveBase/src/autodiff.jl @@ -3,21 +3,39 @@ # Ordering is important here. We want to select the first one that is compatible with the # problem. -const ReverseADs = ( - ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse), - ADTypes.AutoZygote(), - ADTypes.AutoTracker(), - ADTypes.AutoReverseDiff(; compile = true), - ADTypes.AutoReverseDiff(), - ADTypes.AutoFiniteDiff() -) +@static if !Sys.iswindows() + const ReverseADs = ( + ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse), + ADTypes.AutoZygote(), + ADTypes.AutoTracker(), + ADTypes.AutoReverseDiff(; compile = true), + ADTypes.AutoReverseDiff(), + ADTypes.AutoFiniteDiff() + ) -const ForwardADs = ( - ADTypes.AutoEnzyme(; mode = EnzymeCore.Forward), - ADTypes.AutoPolyesterForwardDiff(), - ADTypes.AutoForwardDiff(), - ADTypes.AutoFiniteDiff() -) + const ForwardADs = ( + ADTypes.AutoEnzyme(; mode = EnzymeCore.Forward), + ADTypes.AutoPolyesterForwardDiff(), + ADTypes.AutoForwardDiff(), + ADTypes.AutoFiniteDiff() + ) +else + const ReverseADs = ( + ADTypes.AutoZygote(), + ADTypes.AutoTracker(), + ADTypes.AutoReverseDiff(; compile = true), + ADTypes.AutoReverseDiff(), + ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse), + ADTypes.AutoFiniteDiff() + ) + + const ForwardADs = ( + ADTypes.AutoPolyesterForwardDiff(), + ADTypes.AutoForwardDiff(), + ADTypes.AutoEnzyme(; mode = EnzymeCore.Forward), + ADTypes.AutoFiniteDiff() + ) +end # TODO: Handle Sparsity diff --git a/lib/SimpleNonlinearSolve/test/core/qa_tests.jl b/lib/SimpleNonlinearSolve/test/core/qa_tests.jl index d6a5a9b8e..cef74ac38 100644 --- a/lib/SimpleNonlinearSolve/test/core/qa_tests.jl +++ b/lib/SimpleNonlinearSolve/test/core/qa_tests.jl @@ -12,8 +12,7 @@ end import ReverseDiff, Tracker, StaticArrays, Zygote using ExplicitImports, SimpleNonlinearSolve - @test check_no_implicit_imports( - SimpleNonlinearSolve; skip = (Base, Core, SciMLBase)) === nothing + @test check_no_implicit_imports(SimpleNonlinearSolve; skip = (Base, Core)) === nothing @test check_no_stale_explicit_imports(SimpleNonlinearSolve) === nothing @test check_all_qualified_accesses_via_owners(SimpleNonlinearSolve) === nothing end