MCPcopy
hub / github.com/dmlc/dgl / perform_copy

Function perform_copy

tests/python/pytorch/test_ffi-stream.py:96–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94
95 # Performs the CPU->GPU copy in a background stream
96 def perform_copy():
97 with torch.cuda.stream(stream):
98 tmp = t.copyto(nd.gpu(0))
99 ptr[0] = F.from_dgl_nd(tmp).data_ptr()
100 torch.cuda.current_stream().wait_stream(stream)
101 tmp.record_stream(to_dgl_stream_handle(torch.cuda.current_stream()))
102 torch.cuda._sleep(int(50 * cycles_per_ms)) # delay the copy
103 result.copyfrom(tmp)
104
105 perform_copy()
106 with torch.cuda.stream(stream):

Callers 1

Calls 4

to_dgl_stream_handleFunction · 0.90
copytoMethod · 0.80
copyfromMethod · 0.80
record_streamMethod · 0.45

Tested by

no test coverage detected