Skip to content

Commit 03bc7d4

Browse files
committed
Don't test enzyme on windows
1 parent 87750c4 commit 03bc7d4

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

test/core/rootfind.jl

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
using BenchmarkTools, LinearSolve, NonlinearSolve, StaticArrays, Random, LinearAlgebra,
22
Test, ForwardDiff, Zygote, Enzyme, SparseDiffTools, DiffEqBase
33

4+
# Enzyme stalls on windows. Just swap it with something else
5+
function __autosparseenzyme()
6+
if Sys.iswindows()
7+
return AutoSparseFiniteDiff()
8+
else
9+
return AutoSparseEnzyme()
10+
end
11+
end
12+
413
_nameof(x) = applicable(nameof, x) ? nameof(x) : _nameof(typeof(x))
514

615
quadratic_f(u, p) = u .* u .- p
@@ -95,7 +104,7 @@ const TERMINATION_CONDITIONS = [
95104
@test nlprob_iterator_interface(quadratic_f!, p, Val(true)) sqrt.(p)
96105

97106
@testset "ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (AutoSparseForwardDiff(),
98-
AutoSparseFiniteDiff(), AutoZygote(), AutoSparseZygote(), AutoSparseEnzyme()), u0 in (1.0, [1.0, 1.0])
107+
AutoSparseFiniteDiff(), AutoZygote(), AutoSparseZygote(), __autosparseenzyme()), u0 in (1.0, [1.0, 1.0])
99108
probN = NonlinearProblem(quadratic_f, u0, 2.0)
100109
@test all(solve(probN, NewtonRaphson(; autodiff)).u .≈ sqrt(2.0))
101110
end
@@ -175,7 +184,7 @@ end
175184
@test nlprob_iterator_interface(quadratic_f!, p, Val(true)) sqrt.(p)
176185

177186
@testset "ADType: $(autodiff) u0: $(_nameof(u0)) radius_update_scheme: $(radius_update_scheme)" for autodiff in (AutoSparseForwardDiff(),
178-
AutoSparseFiniteDiff(), AutoZygote(), AutoSparseZygote(), AutoSparseEnzyme()), u0 in (1.0, [1.0, 1.0]),
187+
AutoSparseFiniteDiff(), AutoZygote(), AutoSparseZygote(), __autosparseenzyme()), u0 in (1.0, [1.0, 1.0]),
179188
radius_update_scheme in radius_update_schemes
180189

181190
probN = NonlinearProblem(quadratic_f, u0, 2.0)
@@ -279,7 +288,7 @@ end
279288
end
280289

281290
@testset "ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (AutoSparseForwardDiff(),
282-
AutoSparseFiniteDiff(), AutoZygote(), AutoSparseZygote(), AutoSparseEnzyme()), u0 in (1.0, [1.0, 1.0])
291+
AutoSparseFiniteDiff(), AutoZygote(), AutoSparseZygote(), __autosparseenzyme()), u0 in (1.0, [1.0, 1.0])
283292
probN = NonlinearProblem(quadratic_f, u0, 2.0)
284293
@test all(solve(probN, LevenbergMarquardt(; autodiff); abstol = 1e-9,
285294
reltol = 1e-9).u .≈ sqrt(2.0))
@@ -494,7 +503,7 @@ end
494503
@test nlprob_iterator_interface(quadratic_f!, p, Val(true)) sqrt.(p)
495504

496505
@testset "ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (AutoSparseForwardDiff(),
497-
AutoSparseFiniteDiff(), AutoZygote(), AutoSparseZygote(), AutoSparseEnzyme()), u0 in (1.0, [1.0, 1.0])
506+
AutoSparseFiniteDiff(), AutoZygote(), AutoSparseZygote(), __autosparseenzyme()), u0 in (1.0, [1.0, 1.0])
498507
probN = NonlinearProblem(quadratic_f, u0, 2.0)
499508
@test all(solve(probN, PseudoTransient(; alpha_initial = 10.0, autodiff)).u .≈
500509
sqrt(2.0))

0 commit comments

Comments
 (0)