Skip to content

Commit 0c9d301

Browse files
authored
cuda.core.system: Document everything, and make it easier to scale (#1441)
1 parent 2ed3f98 commit 0c9d301

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

cuda_core/cuda/core/system/__init__.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,11 @@
2323
from ._system import *
2424

2525
if CUDA_BINDINGS_NVML_IS_COMPATIBLE:
26-
from ._device import Device, DeviceArchitecture
26+
from ._device import *
27+
from ._device import __all__ as _device_all
2728
from .exceptions import *
2829
from .exceptions import __all__ as _exceptions_all
2930

30-
__all__.extend(
31-
[
32-
"get_nvml_version",
33-
"Device",
34-
"DeviceArchitecture",
35-
]
36-
)
37-
31+
__all__.append("get_nvml_version")
32+
__all__.extend(_device_all)
3833
__all__.extend(_exceptions_all)

cuda_core/cuda/core/system/_device.pyx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ cdef class Device:
175175
"""
176176
Representation of a device.
177177

178-
``cuda.core.system.Device`` provides access to various pieces of metadata
178+
:class:`cuda.core.system.Device` provides access to various pieces of metadata
179179
about devices and their topology, as provided by the NVIDIA Management
180180
Library (NVML). To use CUDA with a device, use :class:`cuda.core.Device`.
181181

@@ -312,3 +312,12 @@ cdef class Device:
312312
board serial identifier.
313313
"""
314314
return nvml.device_get_uuid(self._handle)
315+
316+
317+
__all__ = [
318+
"BAR1MemoryInfo",
319+
"Device",
320+
"DeviceArchitecture",
321+
"MemoryInfo",
322+
"PciInfo",
323+
]

cuda_core/docs/source/api.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ CUDA system information and NVIDIA Management Library (NVML)
7979
:template: autosummary/cyclass.rst
8080

8181
system.Device
82+
system.DeviceArchitecture
83+
system.MemoryInfo
84+
system.BAR1MemoryInfo
85+
system.PciInfo
8286

8387

8488
.. module:: cuda.core.utils

0 commit comments

Comments
 (0)