Skip to content

Commit afc5283

Browse files
committed
Adapt CUDA device enumeration to current main
Update the newer foreign-context test to use the CUDA-visible device count and regenerate the Device stub after applying the original public PR #2533 change.
1 parent 590c430 commit afc5283

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎cuda_core/cuda/core/_device.pyi‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,8 @@ class Device:
500500
tuple of Device
501501
A tuple containing instances of available devices.
502502
"""
503+
@classmethod
504+
def _get_all_devices_from_cuda_driver(cls): ...
503505
def to_system_device(self) -> cuda.core.system.Device:
504506
"""
505507
Get the corresponding :class:`cuda.core.system.Device` (which is used

‎cuda_core/tests/test_memory.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ def test_mr_deallocation_without_current_context(init_cuda, capsys, replace_stre
757757
@pytest.mark.parametrize("replace_stream", [False, True])
758758
def test_mr_deallocation_with_foreign_context(capsys, replace_stream):
759759
"""MR-backed Buffer teardown switches away from an unrelated current context."""
760-
if ccx_system.get_num_devices() < 2:
760+
if len(Device.get_all_devices()) < 2:
761761
pytest.skip("Test requires at least 2 GPUs")
762762

763763
alloc_dev = Device(0)

0 commit comments

Comments
 (0)