1- import SnoopPrecompile : @precompile_all_calls , @precompile_setup
1+ import PrecompileTools : @compile_workload , @setup_workload
22
33macro ignore_domain_error (ex)
44 return esc (
@@ -163,9 +163,9 @@ function test_functions_on_trees(::Type{T}, operators) where {T}
163163 return nothing
164164end
165165
166- macro maybe_precompile_setup (mode, ex)
166+ macro maybe_setup_workload (mode, ex)
167167 precompile_ex = Expr (
168- :macrocall , Symbol (" @precompile_setup " ), LineNumberNode (@__LINE__ ), ex
168+ :macrocall , Symbol (" @setup_workload " ), LineNumberNode (@__LINE__ ), ex
169169 )
170170 return quote
171171 if $ (esc (mode)) == :compile
@@ -178,9 +178,9 @@ macro maybe_precompile_setup(mode, ex)
178178 end
179179end
180180
181- macro maybe_precompile_all_calls (mode, ex)
181+ macro maybe_compile_workload (mode, ex)
182182 precompile_ex = Expr (
183- :macrocall , Symbol (" @precompile_all_calls " ), LineNumberNode (@__LINE__ ), ex
183+ :macrocall , Symbol (" @compile_workload " ), LineNumberNode (@__LINE__ ), ex
184184 )
185185 return quote
186186 if $ (esc (mode)) == :compile
@@ -195,12 +195,12 @@ end
195195
196196""" `mode=:precompile` will use `@precompile_*` directives; `mode=:compile` runs."""
197197function do_precompilation (; mode= :precompile )
198- @maybe_precompile_setup mode begin
198+ @maybe_setup_workload mode begin
199199 binary_operators = [[+ , - , * , / ]]
200200 unary_operators = [[sin, cos]]
201201 turbo = [false ]
202202 types = [Float32, Float64]
203- @maybe_precompile_all_calls mode begin
203+ @maybe_compile_workload mode begin
204204 test_all_combinations (;
205205 binary_operators= binary_operators,
206206 unary_operators= unary_operators,
@@ -216,7 +216,7 @@ function do_precompilation(; mode=:precompile)
216216 # Want to precompile all above calls.
217217 types = [Float32, Float64]
218218 for T in types
219- @maybe_precompile_all_calls mode begin
219+ @maybe_compile_workload mode begin
220220 test_functions_on_trees (T, operators)
221221 end
222222 end
0 commit comments