Skip to content

Commit a89988e

Browse files
committed
Print allocator and pool statistics on exit with JULIA_DEBUG set.
1 parent 5430e07 commit a89988e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/pool.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,16 @@ function __init_pool__()
649649
TimerOutputs.reset_timer!(alloc_to)
650650
TimerOutputs.reset_timer!(PoolUtils.to)
651651

652+
if isdebug(:init, CUDA)
653+
TimerOutputs.enable_debug_timings(CUDA)
654+
atexit() do
655+
println("Memory pool timings:")
656+
pool_timings()
657+
println("Allocator timings:")
658+
alloc_timings()
659+
end
660+
end
661+
652662
if isinteractive()
653663
@async @pooled pool_cleanup()
654664
end

src/pool/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export @pool_timeit
103103
const to = TimerOutput()
104104

105105
macro pool_timeit(args...)
106-
TimerOutputs.timer_expr(CUDA, true, :($CUDA.to), args...)
106+
TimerOutputs.timer_expr(CUDA, true, :($PoolUtils.to), args...)
107107
end
108108

109109
end

0 commit comments

Comments
 (0)