MCPcopy Index your code
hub / github.com/dmlc/dgl / test_set_get_stream

Function test_set_get_stream

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

Source from the content-addressed store, hash-verified

67 F._default_context_str == "cpu", reason="stream only runs on GPU."
68)
69def test_set_get_stream():
70 current_stream = torch.cuda.current_stream()
71 # test setting another stream
72 s = torch.cuda.Stream(device=F.ctx())
73 torch.cuda.set_stream(s)
74 assert (
75 to_dgl_stream_handle(s).value
76 == _dgl_get_stream(to_dgl_context(F.ctx())).value
77 )
78 # revert to default stream
79 torch.cuda.set_stream(current_stream)
80
81
82@unittest.skipIf(

Callers 1

test_ffi-stream.pyFile · 0.85

Calls 4

to_dgl_stream_handleFunction · 0.90
_dgl_get_streamFunction · 0.90
to_dgl_contextFunction · 0.90
ctxMethod · 0.45

Tested by

no test coverage detected