Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions cuda_core/cuda/core/system/_device.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ class _NvlinkInfoMeta(type):
To find the actual number of Nvlinks available on a device, use
:py:attr:`Device.get_nvlink_count`.

.. version-deprecated:: 1.1.0
.. deprecated:: 1.1.0
This property is deprecated and will be removed in a future release.
Use :py:attr:`Device.get_nvlink_count` instead.
"""
Expand Down Expand Up @@ -1484,15 +1484,15 @@ class Device:

def get_cpu_affinity(self, scope: AffinityScope | str=...) -> list[int]:
"""
Retrieves a list of indices of NUMA nodes or CPU sockets with the ideal
CPU affinity for the device.
Retrieves a list of logical CPU indices with the ideal CPU affinity for
the device.

For Kepler™ or newer fully supported devices.

Supported on Linux only.

If requested scope is not applicable to the target topology, the API
will fall back to reporting the memory affinity for the immediate non-I/O
will fall back to reporting the CPU affinity for the immediate non-I/O
ancestor of the device.

Parameters
Expand All @@ -1504,8 +1504,9 @@ class Device:
Returns
-------
list[int]
A list of indices of NUMA nodes or CPU sockets with the ideal memory
affinity for the device.
A list of logical CPU indices with the ideal CPU affinity for the
device. Contrast :meth:`get_memory_affinity`, which returns NUMA
node / CPU socket indices.
"""

def set_cpu_affinity(self) -> None:
Expand Down Expand Up @@ -1743,7 +1744,7 @@ class Device:

For devices with NVLink support.

.. version-changed:: 1.1.0
.. versionchanged:: 1.1.0
Any link number not supported by this specific device will raise a `ValueError`.
"""

Expand All @@ -1753,7 +1754,7 @@ class Device:

For devices with NVLink support.

.. version-added:: 1.1.0
.. versionadded:: 1.1.0
"""

def get_nvlinks(self) -> Iterable[NvlinkInfo]:
Expand All @@ -1762,7 +1763,7 @@ class Device:

For devices with NVLink support.

.. version-added:: 1.1.0
.. versionadded:: 1.1.0
"""

@property
Expand Down
17 changes: 9 additions & 8 deletions cuda_core/cuda/core/system/_device.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,15 @@ cdef class Device:

def get_cpu_affinity(self, scope: AffinityScope | str=AffinityScope.NODE) -> list[int]:
"""
Retrieves a list of indices of NUMA nodes or CPU sockets with the ideal
CPU affinity for the device.
Retrieves a list of logical CPU indices with the ideal CPU affinity for
the device.

For Kepler™ or newer fully supported devices.

Supported on Linux only.

If requested scope is not applicable to the target topology, the API
will fall back to reporting the memory affinity for the immediate non-I/O
will fall back to reporting the CPU affinity for the immediate non-I/O
ancestor of the device.

Parameters
Expand All @@ -541,8 +541,9 @@ cdef class Device:
Returns
-------
list[int]
A list of indices of NUMA nodes or CPU sockets with the ideal memory
affinity for the device.
A list of logical CPU indices with the ideal CPU affinity for the
device. Contrast :meth:`get_memory_affinity`, which returns NUMA
node / CPU socket indices.
"""
try:
scope = _AFFINITY_SCOPE_MAPPING[scope]
Expand Down Expand Up @@ -892,7 +893,7 @@ cdef class Device:

For devices with NVLink support.

.. version-changed:: 1.1.0
.. versionchanged:: 1.1.0
Any link number not supported by this specific device will raise a `ValueError`.
"""
link_count = self.get_nvlink_count()
Expand All @@ -906,7 +907,7 @@ cdef class Device:

For devices with NVLink support.

.. version-added:: 1.1.0
.. versionadded:: 1.1.0
"""
return self.get_field_values([FieldId.DEV_NVLINK_LINK_COUNT])[0].value

Expand All @@ -916,7 +917,7 @@ cdef class Device:

For devices with NVLink support.

.. version-added:: 1.1.0
.. versionadded:: 1.1.0
"""
for link in range(self.get_nvlink_count()):
yield self.get_nvlink(link)
Expand Down
2 changes: 1 addition & 1 deletion cuda_core/cuda/core/system/_nvlink.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _NvlinkInfoMeta(type):
To find the actual number of Nvlinks available on a device, use
:py:attr:`Device.get_nvlink_count`.

.. version-deprecated:: 1.1.0
.. deprecated:: 1.1.0
This property is deprecated and will be removed in a future release.
Use :py:attr:`Device.get_nvlink_count` instead.
"""
Expand Down
6 changes: 4 additions & 2 deletions cuda_core/cuda/core/system/_system_events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ def register_events(events: SystemEventType | str | list[SystemEventType | str])
Examples
--------
>>> from cuda.core import system
>>> from cuda.core.system.typing import SystemEventType
>>> events = system.register_events([SystemEventType.UNBIND])
>>> while event := events.wait(timeout_ms=10000):
... print(f"Event {event.event_type} occurred.")
>>> while batch := events.wait(timeout_ms=10000):
... for i in range(len(batch)):
... print(f"Event {batch[i].event_type} occurred.")

Parameters
----------
Expand Down
6 changes: 4 additions & 2 deletions cuda_core/cuda/core/system/_system_events.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,11 @@ def register_events(events: SystemEventType | str | list[SystemEventType | str])
Examples
--------
>>> from cuda.core import system
>>> from cuda.core.system.typing import SystemEventType
>>> events = system.register_events([SystemEventType.UNBIND])
>>> while event := events.wait(timeout_ms=10000):
... print(f"Event {event.event_type} occurred.")
>>> while batch := events.wait(timeout_ms=10000):
... for i in range(len(batch)):
... print(f"Event {batch[i].event_type} occurred.")

Parameters
----------
Expand Down
Loading