You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should explore automatically pinning CPU memory buffers, or async memory copies are really executed synchronously:
using CUDA, LinearAlgebra
functionexpensive_computation(a,b,c)
NVTX.@range"mul!"mul!(c, a, b)
NVTX.@range"broadcast!"broadcast!(sin, c, c)
Array(c) # this cannot be executed asynchronously, because the destination memory can be paged outend# one "iteration", performing the above calculation twice in two tasks# and comparing the output.functioniteration(a,b,c)
results =Vector{Any}(undef, 2)
NVTX.@range"iteration"@syncbegin@asyncbegin
results[1] = NVTX.@range"run 1"expensive_computation(a,b,c)
end@asyncbegin
results[2] = NVTX.@range"run 2"expensive_computation(a,b,c)
endend
results[1] == results[2]
endfunctionmain(N=1024)
a = CUDA.rand(N,N)
b = CUDA.rand(N,N)
c = CUDA.rand(N,N)
synchronize()
NVTX.@range"warmup"iteration(a,b,c)
GC.gc(true)
NVTX.@range"main"iteration(a,b,c)
end
The text was updated successfully, but these errors were encountered:
We should explore automatically pinning CPU memory buffers, or async memory copies are really executed synchronously:
The text was updated successfully, but these errors were encountered: