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