Skip to content

Commit 11436ea

Browse files
committed
add a static check
1 parent 52926fb commit 11436ea

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Reactant.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ function set_default_backend(backend::String)
124124
return set_default_backend(XLA.backends[backend])
125125
end
126126

127-
include("precompile.jl")
127+
#HACK: check_bounds is 1 with Pkg.test (and is heavely broken see #353).
128+
#Enable precompilation for normal usage
129+
@static if Base.JLOptions().check_bounds == 0
130+
include("precompile.jl")
131+
end
128132

129133
end # module

src/precompile.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
using PrecompileTools: @setup_workload, @compile_workload
22

33
@setup_workload begin
4-
#HACK: check_bounds is 1 with Pkg.test (and is heavely broken see #353).
5-
#Enable precompilation for normal usage
6-
Base.JLOptions().check_bounds == 0 || return nothing
74
@compile_workload begin
85
Reactant.__init__()
96
cpu = XLA.CPUClient()

0 commit comments

Comments
 (0)