Skip to content

Commit

Permalink
add some precompile statements (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha authored Feb 23, 2021
1 parent 2b4d542 commit 57c063b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/TimerOutputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ include("TimerOutput.jl")
include("show.jl")
include("utilities.jl")

if Base.VERSION >= v"1.4.2"
include("precompile.jl")
_precompile_()
end

end # module
12 changes: 12 additions & 0 deletions src/precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

function _precompile_()
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
@assert Base.precompile(Tuple{typeof(print_timer), typeof(stdout), TimerOutput})
@assert Base.precompile(Tuple{typeof(print_timer), TimerOutput})
@assert Base.precompile(Tuple{typeof(push!), TimerOutput, String})
@assert Base.precompile(Tuple{typeof(reset_timer!), TimerOutput})
@assert Base.precompile(Tuple{typeof(disable_timer!), TimerOutput})
@assert Base.precompile(Tuple{typeof(enable_timer!), TimerOutput})
@assert Base.precompile(Tuple{typeof(do_accumulate!), TimeData, UInt64, Int64})
@assert Base.precompile(Tuple{Type{TimerOutput}, String})
end

0 comments on commit 57c063b

Please sign in to comment.