Skip to content

Commit

Permalink
Merge pull request #224 from SciML/precompile
Browse files Browse the repository at this point in the history
remove precompile on v1.9
  • Loading branch information
ChrisRackauckas authored Oct 2, 2023
2 parents 72a95e5 + f93cd7a commit 41cea21
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions src/NonlinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,22 @@ include("ad.jl")

import PrecompileTools

PrecompileTools.@compile_workload begin
for T in (Float32, Float64)
prob = NonlinearProblem{false}((u, p) -> u .* u .- p, T(0.1), T(2))

precompile_algs = if VERSION v"1.7"
(NewtonRaphson(), TrustRegion(), LevenbergMarquardt())
else
(NewtonRaphson(),)
end

for alg in precompile_algs
solve(prob, alg, abstol = T(1e-2))
end

prob = NonlinearProblem{true}((du, u, p) -> du[1] = u[1] * u[1] - p[1], T[0.1],
T[2])
for alg in precompile_algs
solve(prob, alg, abstol = T(1e-2))
@static if VERSION >= v"1.10"
PrecompileTools.@compile_workload begin
for T in (Float32, Float64)
prob = NonlinearProblem{false}((u, p) -> u .* u .- p, T(0.1), T(2))

precompile_algs = (NewtonRaphson(), TrustRegion(), LevenbergMarquardt())

for alg in precompile_algs
solve(prob, alg, abstol = T(1e-2))
end

prob = NonlinearProblem{true}((du, u, p) -> du[1] = u[1] * u[1] - p[1], T[0.1],
T[2])
for alg in precompile_algs
solve(prob, alg, abstol = T(1e-2))
end
end
end
end
Expand Down

0 comments on commit 41cea21

Please sign in to comment.