@@ -259,15 +259,16 @@ cdef class Device:
259259 """
260260 return self.pci_info.bus_id
261261
262- @property
263- def numa_node_id(self ) -> int:
262+ def _get_numa_node_id(self ) -> int:
264263 """
265264 The NUMA node of the given GPU device.
266265
267266 This only applies to platforms where the GPUs are NUMA nodes.
268267 """
269268 return nvml.device_get_numa_node_id(self._handle )
270269
270+ numa_node_id = property(_get_numa_node_id)
271+
271272 @property
272273 def arch(self ) -> DeviceArch:
273274 """
@@ -332,13 +333,14 @@ cdef class Device:
332333 """
333334 return nvml.device_get_minor_number(self._handle )
334335
335- @property
336- def is_c2c_enabled(self ) -> bool:
336+ def _get_is_c2c_enabled(self ) -> bool:
337337 """
338338 Whether the C2C (Chip-to-Chip ) mode is enabled for this device.
339339 """
340340 return bool(nvml.device_get_c2c_mode_info_v(self._handle ).is_c2c_enabled )
341341
342+ is_c2c_enabled = property(_get_is_c2c_enabled)
343+
342344 @property
343345 def is_persistence_mode_enabled(self ) -> bool:
344346 """
@@ -575,8 +577,7 @@ cdef class Device:
575577 """
576578 return ClockInfo(self._handle , clock_type )
577579
578- @property
579- def is_auto_boosted_clocks_enabled(self ) -> tuple[bool , bool]:
580+ def _get_is_auto_boosted_clocks_enabled(self ) -> tuple[bool , bool]:
580581 """
581582 Retrieve the current state of auto boosted clocks on a device.
582583
@@ -601,8 +602,9 @@ cdef class Device:
601602 current , default = nvml.device_get_auto_boosted_clocks_enabled(self ._handle)
602603 return current == nvml.EnableState.FEATURE_ENABLED , default == nvml.EnableState.FEATURE_ENABLED
603604
604- @property
605- def current_clock_event_reasons(self ) -> list[ClocksEventReasons]:
605+ is_auto_boosted_clocks_enabled = property(_get_is_auto_boosted_clocks_enabled)
606+
607+ def _get_current_clock_event_reasons(self ) -> list[ClocksEventReasons]:
606608 """
607609 Retrieves the current :obj:`~ClocksEventReasons`.
608610
@@ -619,8 +621,9 @@ cdef class Device:
619621 output_reasons.append(output_reason)
620622 return output_reasons
621623
622- @property
623- def supported_clock_event_reasons (self ) -> list[ClocksEventReasons]:
624+ current_clock_event_reasons = property(_get_current_clock_event_reasons)
625+
626+ def _get_supported_clock_event_reasons (self ) -> list[ClocksEventReasons]:
624627 """
625628 Retrieves supported :obj:`~ClocksEventReasons` that can be returned by
626629 :meth:`get_current_clock_event_reasons`.
@@ -640,6 +643,8 @@ cdef class Device:
640643 output_reasons.append(output_reason)
641644 return output_reasons
642645
646+ supported_clock_event_reasons = property(_get_supported_clock_event_reasons)
647+
643648 # #########################################################################
644649 # COOLER
645650 # See external class definitions in _cooler.pxi
@@ -655,8 +660,7 @@ cdef class Device:
655660 # DEVICE ATTRIBUTES
656661 # See external class definitions in _device_attributes.pxi
657662
658- @property
659- def attributes(self ) -> DeviceAttributes:
663+ def _get_attributes(self ) -> DeviceAttributes:
660664 """
661665 :obj:`~_device.DeviceAttributes` object with various device attributes.
662666
@@ -665,6 +669,8 @@ cdef class Device:
665669 """
666670 return DeviceAttributes(nvml.device_get_attributes_v2(self._handle ))
667671
672+ attributes = property(_get_attributes)
673+
668674 #########################################################################
669675 # DISPLAY
670676
0 commit comments