Skip to content

Commit b102d26

Browse files
committed
test(cuda.core): request init_cuda for test_latchkernel
test_latchkernel constructed 3 DummyUnifiedMemoryResource instances (via make_scratch_buffer) plus a LegacyPinnedMemoryResource (via LatchKernel) without init_cuda. On Windows and aarch64 the ctypes-pointer/Buffer/MR chains form cycles that survive refcounting, so the live-MemoryResource count stays elevated past the test and the next init_cuda test (test_oom_diagnostics_probe_basics_is_live_and_cheap) is blamed by the leftover check (UnreleasedMemoryResourceWarning, escalated to an error). Migrating to init_cuda lets the teardown gate collect the cyclic leftovers, matching the pattern from 68f832c for the other MR-constructing tests.
1 parent f50ec59 commit b102d26

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎cuda_core/tests/test_helpers.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@
3333

3434
@pytest.mark.skipif(Device().compute_capability.major < 7, reason="__nanosleep is only available starting Volta (sm70)")
3535
@pytest.mark.thread_unsafe(reason="requires a barrier wait to avoid overlapping pinned latch allocations")
36-
def test_latchkernel():
36+
def test_latchkernel(init_cuda):
3737
"""Test LatchKernel."""
3838
log = TimestampedLogger(enabled=ENABLE_LOGGING)
3939
log("begin")
40-
device = Device()
41-
device.set_current()
40+
device = init_cuda
4241
stream = device.create_stream()
4342
target = make_scratch_buffer(device, 0, NBYTES)
4443
zeros = make_scratch_buffer(device, 0, NBYTES)

0 commit comments

Comments
 (0)