Skip to content

Commit 947fb85

Browse files
committed
fix: remaining tests from the migration
1 parent a25aec4 commit 947fb85

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/core/generalized_first_order.jl

+4
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ function SciMLBase.__init(
202202
linesearch_ad = alg.forward_ad === nothing ?
203203
(alg.reverse_ad === nothing ? alg.jacobian_ad :
204204
alg.reverse_ad) : alg.forward_ad
205+
if linesearch_ad !== nothing && iip && !DI.check_inplace(linesearch_ad)
206+
@warn "$(linesearch_ad) doesn't support in-place problems."
207+
linesearch_ad = nothing
208+
end
205209
linesearch_ad = get_concrete_forward_ad(
206210
linesearch_ad, prob, False; check_forward_mode = false)
207211
linesearch_cache = init(

test/gpu/core_tests.jl

+11-5
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@
1212

1313
prob = NonlinearProblem(linear_f, u0)
1414

15-
SOLVERS = (NewtonRaphson(), LevenbergMarquardt(; linsolve = QRFactorization()),
16-
LevenbergMarquardt(; linsolve = KrylovJL_GMRES()), PseudoTransient(),
17-
Klement(), Broyden(; linesearch = LiFukushimaLineSearch()),
15+
SOLVERS = (
16+
NewtonRaphson(),
17+
LevenbergMarquardt(; linsolve = QRFactorization()),
18+
LevenbergMarquardt(; linsolve = KrylovJL_GMRES()),
19+
PseudoTransient(),
20+
Klement(),
21+
Broyden(; linesearch = LiFukushimaLineSearch()),
1822
LimitedMemoryBroyden(; threshold = 2, linesearch = LiFukushimaLineSearch()),
19-
DFSane(), TrustRegion(; linsolve = QRFactorization()),
23+
DFSane(),
24+
TrustRegion(; linsolve = QRFactorization()),
2025
TrustRegion(; linsolve = KrylovJL_GMRES(), concrete_jac = true), # Needed if Zygote not loaded
21-
nothing)
26+
nothing
27+
)
2228

2329
@testset "[IIP] GPU Solvers" begin
2430
for alg in SOLVERS

0 commit comments

Comments
 (0)