Skip to content

Commit

Permalink
make precompilation a bit safer
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Aug 9, 2021
1 parent fd74df4 commit ac3d18f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/DiffEqBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ include("internal_euler.jl")
include("init.jl")
include("forwarddiff.jl")
include("chainrules.jl")

include("precompile.jl")

"""
Expand Down
2 changes: 1 addition & 1 deletion src/linear_nonlinear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ DefaultLinSolve() = DefaultLinSolve(nothing, nothing, nothing)
end

function isopenblas()
@static if VERSION < v"1.7"
@static if VERSION < v"1.7beta"
blas = BLAS.vendor()
blas == :openblas64 || blas == :openblas
else
Expand Down
18 changes: 12 additions & 6 deletions src/precompile.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
_linsolve = DefaultLinSolve()
_testf(du,u,p,t) = du .= u
b = rand(1); x = rand(1)
DEFAULT_LINSOLVE(Val{:init},ODEFunction(_testf),b)
A = rand(1,1)
DEFAULT_LINSOLVE(x,A,b,true)
let
while true
_linsolve = DefaultLinSolve()
_testf(du,u,p,t) = du .= u
b = rand(1); x = rand(1)
_linsolve(Val{:init},ODEFunction(_testf),b)
A = rand(1,1)
_linsolve(x,A,b,true)
_linsolve(x,A,b,false)
break
end
end

0 comments on commit ac3d18f

Please sign in to comment.