Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Commit

Permalink
Avoid ugly rounding issues when printing pool stats.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Aug 20, 2019
1 parent d729323 commit 7913633
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/memory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ function pool_status()

pool_ratio = (used_pool_bytes + avail_pool_bytes) / used_bytes

println("Total GPU memory usage: $(100*round(used_ratio; digits=2))% ($(Base.format_bytes(used_bytes))/$(Base.format_bytes(total_bytes)))")
println("CuArrays.jl pool usage: $(100*round(pool_ratio; digits=2))% ($(Base.format_bytes(used_pool_bytes)) in use by $used_pool_buffers buffer(s), $(Base.format_bytes(avail_pool_bytes)) idle)")
@printf("Total GPU memory usage: %.2f%% (%s/%s)\n", 100*used_ratio, Base.format_bytes(used_bytes), Base.format_bytes(total_bytes))
@printf("CuArrays.jl pool usage: %.2f%% (%s in use by %d buffers, %s idle)\n", 100*pool_ratio, Base.format_bytes(used_pool_bytes), used_pool_buffers, Base.format_bytes(avail_pool_bytes))

return
end
Expand Down

0 comments on commit 7913633

Please sign in to comment.