示例#1
0
 def f(self):
     self._result0 = driver.ctxGetCurrent()
     cupy.arange(1)
     self._result1 = driver.ctxGetCurrent()
示例#2
0
 def test_ctxGetCurrent(self):
     # Make sure to create context.
     cupy.arange(1)
     assert 0 != driver.ctxGetCurrent()
示例#3
0
 def f(self):
     self._result0 = driver.ctxGetCurrent()
     cupy.cuda.Device().use()
     cupy.arange(1)
     self._result1 = driver.ctxGetCurrent()
示例#4
0
 def test_streamGetCtx(self):
     s = cupy.cuda.Stream()
     ctx = driver.streamGetCtx(s.ptr)
     ctx2 = driver.ctxGetCurrent()
     assert ctx == ctx2
示例#5
0
 def test_ctxGetCurrent(self):
     # Make sure to create context.
     cupy.arange(1)
     self.assertNotEqual(0, driver.ctxGetCurrent())