Skip to content

Commit 19a649e

Browse files
committed
mostly fix the documentation oddities
1 parent cefa733 commit 19a649e

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

cuda_core/cuda/core/experimental/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
from cuda.core.experimental._launcher import LaunchConfig, launch
88
from cuda.core.experimental._program import Program
99
from cuda.core.experimental._stream import Stream, StreamOptions
10-
from cuda.core.experimental._system import _system as system
10+
from cuda.core.experimental._system import _system_instance as system

cuda_core/cuda/core/experimental/_system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ def devices(self) -> tuple:
6161
self._devices = tuple(Device(device_id) for device_id in range(total))
6262
return self._devices
6363

64-
_system = System.__new__(System)
64+
_system_instance = System.__new__(System)

cuda_core/docs/source/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CUDA runtime
1616

1717
Device
1818
launch
19+
system
1920

2021
:template: dataclass.rst
2122

cuda_core/docs/source/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ def __getattr__(cls, name):
2525
MOCK_MODULES = ['cuda.core.experimental._system']
2626
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
2727

28+
class SystemMock(MagicMock):
29+
__doc__ = "Singleton instance of :class:`cuda.core.experimental._system.System`"
30+
31+
32+
# Mock the System class within the _system module
33+
sys.modules['cuda.core.experimental._system'].System = SystemMock
34+
35+
# Create a specific mock for the system instance
36+
system_mock = SystemMock()
37+
38+
# Ensure the system instance is correctly mocked
39+
sys.modules['cuda.core.experimental._system']._system_instance = system_mock
2840

2941
# -- Project information -----------------------------------------------------
3042

0 commit comments

Comments
 (0)