diff --git a/Project.toml b/Project.toml index 322178b..74b6cde 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SimpleNonlinearSolve" uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7" authors = ["SciML"] -version = "1.8.1" +version = "1.8.2" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" @@ -50,7 +50,7 @@ FiniteDiff = "2.22" ForwardDiff = "0.10.36" LinearAlgebra = "1.10" LinearSolve = "2.30" -MaybeInplace = "0.1.1" +MaybeInplace = "0.1.3" NonlinearProblemLibrary = "0.1.2" Pkg = "1.10" PolyesterForwardDiff = "0.1.1" diff --git a/test/core/exotic_type_tests.jl b/test/core/exotic_type_tests.jl new file mode 100644 index 0000000..fff77a3 --- /dev/null +++ b/test/core/exotic_type_tests.jl @@ -0,0 +1,31 @@ +# File for different types of exotic types +@testsetup module SimpleNonlinearSolveExoticTypeTests +using SimpleNonlinearSolve + +fn_iip = NonlinearFunction{true}((du, u, p) -> du .= u .* u .- p) +fn_oop = NonlinearFunction{false}((u, p) -> u .* u .- p) + +u0 = BigFloat[1.0, 1.0, 1.0] +prob_iip_bf = NonlinearProblem{true}(fn_iip, u0, BigFloat(2)) +prob_oop_bf = NonlinearProblem{false}(fn_oop, u0, BigFloat(2)) + +export fn_iip, fn_oop, u0, prob_iip_bf, prob_oop_bf +end + +@testitem "BigFloat Support" tags=[:core] setup=[SimpleNonlinearSolveExoticTypeTests] begin + using SimpleNonlinearSolve, LinearAlgebra + + for alg in [SimpleNewtonRaphson(), SimpleBroyden(), SimpleKlement(), SimpleDFSane(), + SimpleTrustRegion(), SimpleLimitedMemoryBroyden(; threshold = 2), + SimpleHalley()] + sol = solve(prob_oop_bf, alg) + @test norm(sol.resid, Inf) < 1e-6 + @test SciMLBase.successful_retcode(sol.retcode) + + alg isa SimpleHalley && continue + + sol = solve(prob_iip_bf, alg) + @test norm(sol.resid, Inf) < 1e-6 + @test SciMLBase.successful_retcode(sol.retcode) + end +end diff --git a/test/gpu/cuda_tests.jl b/test/gpu/cuda_tests.jl index dae6a87..9d31114 100644 --- a/test/gpu/cuda_tests.jl +++ b/test/gpu/cuda_tests.jl @@ -1,4 +1,4 @@ -@testitem "Solving on GPUs" tags=[:cuda] begin +@testitem "Solving on GPUs" tags=[:cuda] skip=:(using CUDA; !CUDA.functional()) begin using StaticArrays, CUDA CUDA.allowscalar(false) @@ -36,7 +36,7 @@ end end -@testitem "CUDA Kernel Launch Test" tags=[:cuda] begin +@testitem "CUDA Kernel Launch Test" tags=[:cuda] skip=:(using CUDA; !CUDA.functional()) begin using StaticArrays, CUDA CUDA.allowscalar(false)