File tree Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 7
7
from cuda .core .experimental ._launcher import LaunchConfig , launch
8
8
from cuda .core .experimental ._program import Program
9
9
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
Original file line number Diff line number Diff line change @@ -61,4 +61,4 @@ def devices(self) -> tuple:
61
61
self ._devices = tuple (Device (device_id ) for device_id in range (total ))
62
62
return self ._devices
63
63
64
- _system = System .__new__ (System )
64
+ _system_instance = System .__new__ (System )
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ CUDA runtime
16
16
17
17
Device
18
18
launch
19
+ system
19
20
20
21
:template: dataclass.rst
21
22
Original file line number Diff line number Diff line change @@ -25,6 +25,18 @@ def __getattr__(cls, name):
25
25
MOCK_MODULES = ['cuda.core.experimental._system' ]
26
26
sys .modules .update ((mod_name , Mock ()) for mod_name in MOCK_MODULES )
27
27
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
28
40
29
41
# -- Project information -----------------------------------------------------
30
42
You can’t perform that action at this time.
0 commit comments