Skip to content

Commit f1e630a

Browse files
committed
Fix warnings
1 parent 97f8337 commit f1e630a

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ PreallocationToolsSparseConnectivityTracerExt = "SparseConnectivityTracer"
1818

1919
[compat]
2020
Adapt = "4.1.1"
21+
ADTypes = "1.13"
2122
Aqua = "0.8.11"
2223
ArrayInterface = "7.18.0"
2324
ForwardDiff = "0.10.38"
@@ -38,6 +39,7 @@ Test = "1.10"
3839
julia = "1.10"
3940

4041
[extras]
42+
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
4143
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
4244
LabelledArrays = "2ee39098-c373-598a-b85f-a56591580800"
4345
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -55,4 +57,4 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
5557
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5658

5759
[targets]
58-
test = ["Aqua", "Random", "LabelledArrays", "LinearAlgebra", "OrdinaryDiffEq", "Test", "RecursiveArrayTools", "Pkg", "SafeTestsets", "Optimization", "OptimizationOptimJL", "SparseArrays", "Symbolics", "SparseConnectivityTracer"]
60+
test = ["Aqua", "ADTypes", "Random", "LabelledArrays", "LinearAlgebra", "OrdinaryDiffEq", "Test", "RecursiveArrayTools", "Pkg", "SafeTestsets", "Optimization", "OptimizationOptimJL", "SparseArrays", "Symbolics", "SparseConnectivityTracer"]

test/core_nesteddual.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,13 @@ newtonsol = solve(optprob, Newton())
9090
cache = DiffCache(zeros(ps, ps), [4, 4, 2])
9191
prob = ODEProblem{true, SciMLBase.FullSpecialize}(foo, ones(ps, ps), (0.0, 1.0),
9292
(coeffs, cache))
93-
realsol = solve(prob, TRBDF2(chunk_size = 2), saveat = 0.0:0.1:10.0, reltol = 1e-8)
93+
realsol = solve(prob, TRBDF2(autodiff = AutoForwardDiff(chunksize = 2)),
94+
saveat = 0.0:0.1:10.0, reltol = 1e-8)
9495

9596
function objfun(x, prob, realsol, cache)
9697
prob = remake(prob, u0 = eltype(x).(prob.u0), p = (x, cache))
97-
sol = solve(prob, TRBDF2(chunk_size = 2), saveat = 0.0:0.1:10.0, reltol = 1e-8)
98+
sol = solve(prob, TRBDF2(autodiff = AutoForwardDiff(chunksize = 2)),
99+
saveat = 0.0:0.1:10.0, reltol = 1e-8)
98100

99101
ofv = 0.0
100102
if any((s.retcode != ReturnCode.Success for s in sol))

test/core_odes.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using LinearAlgebra,
22
OrdinaryDiffEq, Test, PreallocationTools, LabelledArrays,
3-
RecursiveArrayTools
3+
RecursiveArrayTools, ADTypes
44

55
#Base array
66
function foo(du, u, (A, tmp), t)
@@ -15,12 +15,12 @@ u0 = ones(5, 5)
1515
A = ones(5, 5)
1616
cache = DiffCache(zeros(5, 5), chunk_size)
1717
prob = ODEProblem{true, SciMLBase.FullSpecialize}(foo, u0, (0.0, 1.0), (A, cache))
18-
sol = solve(prob, Rodas5P(chunk_size = chunk_size))
18+
sol = solve(prob, Rodas5P(autodiff = AutoForwardDiff(chunksize = chunk_size)))
1919
@test sol.retcode == ReturnCode.Success
2020

2121
cache = FixedSizeDiffCache(zeros(5, 5), chunk_size)
2222
prob = ODEProblem{true, SciMLBase.FullSpecialize}(foo, u0, (0.0, 1.0), (A, cache))
23-
sol = solve(prob, Rodas5P(chunk_size = chunk_size))
23+
sol = solve(prob, Rodas5P(autodiff = AutoForwardDiff(chunksize = chunk_size)))
2424
@test sol.retcode == ReturnCode.Success
2525

2626
#with auto-detected chunk_size
@@ -60,7 +60,7 @@ end
6060
chunk_size = 4
6161
prob = ODEProblem{true, SciMLBase.FullSpecialize}(foo, u0, (0.0, 1.0),
6262
(A, DiffCache(c, chunk_size)))
63-
sol = solve(prob, Rodas5P(chunk_size = chunk_size))
63+
sol = solve(prob, Rodas5P(autodiff = AutoForwardDiff(chunksize = chunk_size)))
6464
@test sol.retcode == ReturnCode.Success
6565
#with auto-detected chunk_size
6666
prob = ODEProblem{true, SciMLBase.FullSpecialize}(foo, u0, (0.0, 1.0), (A, DiffCache(c)))

test/gpu_all.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ u0 = cu(rand(10, 10)) #example kept small for test purposes.
6161
A = cu(-randn(10, 10))
6262
cache = DiffCache(cu(zeros(10, 10)), chunk_size)
6363
prob = ODEProblem{true, SciMLBase.FullSpecialize}(foo, u0, (0.0f0, 1.0f0), (A, cache))
64-
sol = solve(prob, TRBDF2(chunk_size = chunk_size))
64+
sol = solve(prob, TRBDF2(autodiff = AutoForwardDiff(chunksize = chunk_size)))
6565
@test sol.retcode == ReturnCode.Success
6666

6767
cache = FixedSizeDiffCache(cu(zeros(10, 10)), chunk_size)
6868
prob = ODEProblem{true, SciMLBase.FullSpecialize}(foo, u0, (0.0f0, 1.0f0), (A, cache))
69-
sol = solve(prob, TRBDF2(chunk_size = chunk_size))
69+
sol = solve(prob, TRBDF2(autodiff = AutoForwardDiff(chunksize = chunk_size)))
7070
@test sol.retcode == ReturnCode.Success
7171

7272
#with auto-detected chunk_size

0 commit comments

Comments
 (0)