Skip to content

Commit e31eae4

Browse files
Update cuda_core/tests/conftest.py
Co-authored-by: Leo Fang <leof@nvidia.com>
1 parent bd1ef45 commit e31eae4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cuda_core/tests/conftest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ def init_cuda():
2020
device = Device()
2121
device.set_current()
2222
yield
23+
_device_unset_current()
24+
25+
def _device_unset_current():
2326
handle_return(driver.cuCtxPopCurrent())
2427
with _device._tls_lock:
2528
del _device._tls.devices
2629

2730
@pytest.fixture(scope="function")
2831
def deinit_cuda():
2932
yield
30-
handle_return(driver.cuCtxPopCurrent())
31-
with _device._tls_lock:
32-
del _device._tls.devices
33+
_device_unset_current()

0 commit comments

Comments
 (0)