diff --git a/cuda_bindings_12/cuda/bindings/cufile.pyx b/cuda_bindings_12/cuda/bindings/cufile.pyx index e1f99ee1056..273e24581ba 100644 --- a/cuda_bindings_12/cuda/bindings/cufile.pyx +++ b/cuda_bindings_12/cuda/bindings/cufile.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated with version 12.9.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=11c0f6874dbbca1b98aa2e0d38e44146556d4d1a4ce5a5584cbad9c5792792c2 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5c0f0ede5957fb7cbd597e6b23620fecb7128a0740b00a6313f8a4b1c79846f3 # <<<< PREAMBLE CONTENT >>>> @@ -97,16 +97,21 @@ from cuda.bindings.driver import CUresult as pyCUresult ############################################################################### cdef _get__py_anon_pod1_dtype_offsets(): - cdef cuda_bindings_cufile__anon_pod1 pod - return _numpy.dtype({ - 'names': ['fd', 'handle'], - 'formats': [_numpy.int32, _numpy.intp], - 'offsets': [ - (&(pod.fd)) - (&pod), - (&(pod.handle)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_cufile__anon_pod1), - }) + cdef cuda_bindings_cufile__anon_pod1 *pod = _cyb_calloc(1, sizeof(cuda_bindings_cufile__anon_pod1)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_cufile__anon_pod1") + try: + return _numpy.dtype({ + 'names': ['fd', 'handle'], + 'formats': [_numpy.int32, _numpy.intp], + 'offsets': [ + (&(pod.fd)) - (pod), + (&(pod.handle)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_cufile__anon_pod1), + }) + finally: + _cyb_free(pod) _py_anon_pod1_dtype = _get__py_anon_pod1_dtype_offsets() @@ -246,18 +251,23 @@ cdef class _py_anon_pod1: cdef _get__py_anon_pod3_dtype_offsets(): - cdef cuda_bindings_cufile__anon_pod3 pod - return _numpy.dtype({ - 'names': ['dev_ptr_base', 'file_offset', 'dev_ptr_offset', 'size_'], - 'formats': [_numpy.intp, _numpy.int64, _numpy.int64, _numpy.uint64], - 'offsets': [ - (&(pod.devPtr_base)) - (&pod), - (&(pod.file_offset)) - (&pod), - (&(pod.devPtr_offset)) - (&pod), - (&(pod.size)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_cufile__anon_pod3), - }) + cdef cuda_bindings_cufile__anon_pod3 *pod = _cyb_calloc(1, sizeof(cuda_bindings_cufile__anon_pod3)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_cufile__anon_pod3") + try: + return _numpy.dtype({ + 'names': ['dev_ptr_base', 'file_offset', 'dev_ptr_offset', 'size_'], + 'formats': [_numpy.intp, _numpy.int64, _numpy.int64, _numpy.uint64], + 'offsets': [ + (&(pod.devPtr_base)) - (pod), + (&(pod.file_offset)) - (pod), + (&(pod.devPtr_offset)) - (pod), + (&(pod.size)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_cufile__anon_pod3), + }) + finally: + _cyb_free(pod) _py_anon_pod3_dtype = _get__py_anon_pod3_dtype_offsets() @@ -419,17 +429,22 @@ cdef class _py_anon_pod3: cdef _get_io_events_dtype_offsets(): - cdef CUfileIOEvents_t pod - return _numpy.dtype({ - 'names': ['cookie', 'status', 'ret'], - 'formats': [_numpy.intp, _numpy.int32, _numpy.uint64], - 'offsets': [ - (&(pod.cookie)) - (&pod), - (&(pod.status)) - (&pod), - (&(pod.ret)) - (&pod), - ], - 'itemsize': sizeof(CUfileIOEvents_t), - }) + cdef CUfileIOEvents_t *pod = _cyb_calloc(1, sizeof(CUfileIOEvents_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfileIOEvents_t") + try: + return _numpy.dtype({ + 'names': ['cookie', 'status', 'ret'], + 'formats': [_numpy.intp, _numpy.int32, _numpy.uint64], + 'offsets': [ + (&(pod.cookie)) - (pod), + (&(pod.status)) - (pod), + (&(pod.ret)) - (pod), + ], + 'itemsize': sizeof(CUfileIOEvents_t), + }) + finally: + _cyb_free(pod) io_events_dtype = _get_io_events_dtype_offsets() cdef object io_events_dtype_record = _numpy.dtype((_numpy.record, io_events_dtype)) @@ -601,17 +616,22 @@ cdef class IOEvents: cdef _get_descr_dtype_offsets(): - cdef CUfileDescr_t pod - return _numpy.dtype({ - 'names': ['type', 'handle', 'fs_ops'], - 'formats': [_numpy.int32, _py_anon_pod1_dtype, _numpy.intp], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.handle)) - (&pod), - (&(pod.fs_ops)) - (&pod), - ], - 'itemsize': sizeof(CUfileDescr_t), - }) + cdef CUfileDescr_t *pod = _cyb_calloc(1, sizeof(CUfileDescr_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfileDescr_t") + try: + return _numpy.dtype({ + 'names': ['type', 'handle', 'fs_ops'], + 'formats': [_numpy.int32, _py_anon_pod1_dtype, _numpy.intp], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.handle)) - (pod), + (&(pod.fs_ops)) - (pod), + ], + 'itemsize': sizeof(CUfileDescr_t), + }) + finally: + _cyb_free(pod) descr_dtype = _get_descr_dtype_offsets() cdef object descr_dtype_record = _numpy.dtype((_numpy.record, descr_dtype)) @@ -781,15 +801,20 @@ cdef class Descr: cdef _get__py_anon_pod2_dtype_offsets(): - cdef cuda_bindings_cufile__anon_pod2 pod - return _numpy.dtype({ - 'names': ['batch'], - 'formats': [_py_anon_pod3_dtype], - 'offsets': [ - (&(pod.batch)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_cufile__anon_pod2), - }) + cdef cuda_bindings_cufile__anon_pod2 *pod = _cyb_calloc(1, sizeof(cuda_bindings_cufile__anon_pod2)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_cufile__anon_pod2") + try: + return _numpy.dtype({ + 'names': ['batch'], + 'formats': [_py_anon_pod3_dtype], + 'offsets': [ + (&(pod.batch)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_cufile__anon_pod2), + }) + finally: + _cyb_free(pod) _py_anon_pod2_dtype = _get__py_anon_pod2_dtype_offsets() @@ -923,19 +948,24 @@ cdef class _py_anon_pod2: cdef _get_io_params_dtype_offsets(): - cdef CUfileIOParams_t pod - return _numpy.dtype({ - 'names': ['mode', 'u', 'fh', 'opcode', 'cookie'], - 'formats': [_numpy.int32, _py_anon_pod2_dtype, _numpy.intp, _numpy.int32, _numpy.intp], - 'offsets': [ - (&(pod.mode)) - (&pod), - (&(pod.u)) - (&pod), - (&(pod.fh)) - (&pod), - (&(pod.opcode)) - (&pod), - (&(pod.cookie)) - (&pod), - ], - 'itemsize': sizeof(CUfileIOParams_t), - }) + cdef CUfileIOParams_t *pod = _cyb_calloc(1, sizeof(CUfileIOParams_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfileIOParams_t") + try: + return _numpy.dtype({ + 'names': ['mode', 'u', 'fh', 'opcode', 'cookie'], + 'formats': [_numpy.int32, _py_anon_pod2_dtype, _numpy.intp, _numpy.int32, _numpy.intp], + 'offsets': [ + (&(pod.mode)) - (pod), + (&(pod.u)) - (pod), + (&(pod.fh)) - (pod), + (&(pod.opcode)) - (pod), + (&(pod.cookie)) - (pod), + ], + 'itemsize': sizeof(CUfileIOParams_t), + }) + finally: + _cyb_free(pod) io_params_dtype = _get_io_params_dtype_offsets() cdef object io_params_dtype_record = _numpy.dtype((_numpy.record, io_params_dtype)) diff --git a/cuda_bindings_12/cuda/bindings/driver.pyx b/cuda_bindings_12/cuda/bindings/driver.pyx index c625773b038..b2208732f35 100644 --- a/cuda_bindings_12/cuda/bindings/driver.pyx +++ b/cuda_bindings_12/cuda/bindings/driver.pyx @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # This code was automatically generated with version 12.9.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=67ecc286b7f346fb9026fcdb8fb0914b5d44e31a61570a0f9733513db0a4c81a +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e99438cba367ec2bee3420a771067ba7d33770c5c4cb189b770f59d56e8ace8c from typing import Any, Optional import cython import ctypes @@ -22160,7 +22160,7 @@ cdef class anon_union15: def pArray(self): return [CUarray(init_value=_pArray) for _pArray in self._pvt_ptr[0].frame.pArray] @pArray.setter - def pArray(self, pArray : list[CUarray]): + def pArray(self, pArray : list[CUarray | int]): if len(pArray) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pArray)) pArray = [int(_pArray) for _pArray in pArray] diff --git a/cuda_bindings_12/cuda/bindings/nvml.pyx b/cuda_bindings_12/cuda/bindings/nvml.pyx index 402428b5e6f..54a3dddfbd0 100644 --- a/cuda_bindings_12/cuda/bindings/nvml.pyx +++ b/cuda_bindings_12/cuda/bindings/nvml.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=41c2a2147ee34ceed11d38eb00faa851b5c1d5f10c215a0df65f85b22a41757c +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=82df971c247cf6ab3e4aed0e3fa58bcfc88508a419b3dcd9f099182445ca41cd # <<<< PREAMBLE CONTENT >>>> @@ -3102,23 +3102,28 @@ cpdef int check_status_size(int status) except 1 nogil: cdef _get_pci_info_ext_v1_dtype_offsets(): - cdef nvmlPciInfoExt_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'domain', 'bus', 'device_', 'pci_device_id', 'pci_sub_system_id', 'base_class', 'sub_class', 'bus_id'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 32)], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.domain)) - (&pod), - (&(pod.bus)) - (&pod), - (&(pod.device)) - (&pod), - (&(pod.pciDeviceId)) - (&pod), - (&(pod.pciSubSystemId)) - (&pod), - (&(pod.baseClass)) - (&pod), - (&(pod.subClass)) - (&pod), - (&(pod.busId)) - (&pod), - ], - 'itemsize': sizeof(nvmlPciInfoExt_v1_t), - }) + cdef nvmlPciInfoExt_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPciInfoExt_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPciInfoExt_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'domain', 'bus', 'device_', 'pci_device_id', 'pci_sub_system_id', 'base_class', 'sub_class', 'bus_id'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 32)], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.domain)) - (pod), + (&(pod.bus)) - (pod), + (&(pod.device)) - (pod), + (&(pod.pciDeviceId)) - (pod), + (&(pod.pciSubSystemId)) - (pod), + (&(pod.baseClass)) - (pod), + (&(pod.subClass)) - (pod), + (&(pod.busId)) - (pod), + ], + 'itemsize': sizeof(nvmlPciInfoExt_v1_t), + }) + finally: + _cyb_free(pod) pci_info_ext_v1_dtype = _get_pci_info_ext_v1_dtype_offsets() @@ -3327,21 +3332,26 @@ cdef class PciInfoExt_v1: cdef _get_pci_info_dtype_offsets(): - cdef nvmlPciInfo_t pod - return _numpy.dtype({ - 'names': ['bus_id_legacy', 'domain', 'bus', 'device_', 'pci_device_id', 'pci_sub_system_id', 'bus_id'], - 'formats': [(_numpy.int8, 16), _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 32)], - 'offsets': [ - (&(pod.busIdLegacy)) - (&pod), - (&(pod.domain)) - (&pod), - (&(pod.bus)) - (&pod), - (&(pod.device)) - (&pod), - (&(pod.pciDeviceId)) - (&pod), - (&(pod.pciSubSystemId)) - (&pod), - (&(pod.busId)) - (&pod), - ], - 'itemsize': sizeof(nvmlPciInfo_t), - }) + cdef nvmlPciInfo_t *pod = _cyb_calloc(1, sizeof(nvmlPciInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPciInfo_t") + try: + return _numpy.dtype({ + 'names': ['bus_id_legacy', 'domain', 'bus', 'device_', 'pci_device_id', 'pci_sub_system_id', 'bus_id'], + 'formats': [(_numpy.int8, 16), _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 32)], + 'offsets': [ + (&(pod.busIdLegacy)) - (pod), + (&(pod.domain)) - (pod), + (&(pod.bus)) - (pod), + (&(pod.device)) - (pod), + (&(pod.pciDeviceId)) - (pod), + (&(pod.pciSubSystemId)) - (pod), + (&(pod.busId)) - (pod), + ], + 'itemsize': sizeof(nvmlPciInfo_t), + }) + finally: + _cyb_free(pod) pci_info_dtype = _get_pci_info_dtype_offsets() @@ -3544,16 +3554,21 @@ cdef class PciInfo: cdef _get_utilization_dtype_offsets(): - cdef nvmlUtilization_t pod - return _numpy.dtype({ - 'names': ['gpu', 'memory'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.gpu)) - (&pod), - (&(pod.memory)) - (&pod), - ], - 'itemsize': sizeof(nvmlUtilization_t), - }) + cdef nvmlUtilization_t *pod = _cyb_calloc(1, sizeof(nvmlUtilization_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlUtilization_t") + try: + return _numpy.dtype({ + 'names': ['gpu', 'memory'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.gpu)) - (pod), + (&(pod.memory)) - (pod), + ], + 'itemsize': sizeof(nvmlUtilization_t), + }) + finally: + _cyb_free(pod) utilization_dtype = _get_utilization_dtype_offsets() @@ -3681,17 +3696,22 @@ cdef class Utilization: cdef _get_memory_dtype_offsets(): - cdef nvmlMemory_t pod - return _numpy.dtype({ - 'names': ['total', 'free', 'used'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.total)) - (&pod), - (&(pod.free)) - (&pod), - (&(pod.used)) - (&pod), - ], - 'itemsize': sizeof(nvmlMemory_t), - }) + cdef nvmlMemory_t *pod = _cyb_calloc(1, sizeof(nvmlMemory_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlMemory_t") + try: + return _numpy.dtype({ + 'names': ['total', 'free', 'used'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.total)) - (pod), + (&(pod.free)) - (pod), + (&(pod.used)) - (pod), + ], + 'itemsize': sizeof(nvmlMemory_t), + }) + finally: + _cyb_free(pod) memory_dtype = _get_memory_dtype_offsets() @@ -3830,19 +3850,24 @@ cdef class Memory: cdef _get_memory_v2_dtype_offsets(): - cdef nvmlMemory_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'total', 'reserved', 'free', 'used'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.total)) - (&pod), - (&(pod.reserved)) - (&pod), - (&(pod.free)) - (&pod), - (&(pod.used)) - (&pod), - ], - 'itemsize': sizeof(nvmlMemory_v2_t), - }) + cdef nvmlMemory_v2_t *pod = _cyb_calloc(1, sizeof(nvmlMemory_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlMemory_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'total', 'reserved', 'free', 'used'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.total)) - (pod), + (&(pod.reserved)) - (pod), + (&(pod.free)) - (pod), + (&(pod.used)) - (pod), + ], + 'itemsize': sizeof(nvmlMemory_v2_t), + }) + finally: + _cyb_free(pod) memory_v2_dtype = _get_memory_v2_dtype_offsets() @@ -4003,17 +4028,22 @@ cdef class Memory_v2: cdef _get_ba_r1memory_dtype_offsets(): - cdef nvmlBAR1Memory_t pod - return _numpy.dtype({ - 'names': ['bar1_total', 'bar1_free', 'bar1_used'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.bar1Total)) - (&pod), - (&(pod.bar1Free)) - (&pod), - (&(pod.bar1Used)) - (&pod), - ], - 'itemsize': sizeof(nvmlBAR1Memory_t), - }) + cdef nvmlBAR1Memory_t *pod = _cyb_calloc(1, sizeof(nvmlBAR1Memory_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlBAR1Memory_t") + try: + return _numpy.dtype({ + 'names': ['bar1_total', 'bar1_free', 'bar1_used'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.bar1Total)) - (pod), + (&(pod.bar1Free)) - (pod), + (&(pod.bar1Used)) - (pod), + ], + 'itemsize': sizeof(nvmlBAR1Memory_t), + }) + finally: + _cyb_free(pod) ba_r1memory_dtype = _get_ba_r1memory_dtype_offsets() @@ -4152,18 +4182,23 @@ cdef class BAR1Memory: cdef _get_process_info_dtype_offsets(): - cdef nvmlProcessInfo_t pod - return _numpy.dtype({ - 'names': ['pid', 'used_gpu_memory', 'gpu_instance_id', 'compute_instance_id'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.pid)) - (&pod), - (&(pod.usedGpuMemory)) - (&pod), - (&(pod.gpuInstanceId)) - (&pod), - (&(pod.computeInstanceId)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessInfo_t), - }) + cdef nvmlProcessInfo_t *pod = _cyb_calloc(1, sizeof(nvmlProcessInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessInfo_t") + try: + return _numpy.dtype({ + 'names': ['pid', 'used_gpu_memory', 'gpu_instance_id', 'compute_instance_id'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.pid)) - (pod), + (&(pod.usedGpuMemory)) - (pod), + (&(pod.gpuInstanceId)) - (pod), + (&(pod.computeInstanceId)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessInfo_t), + }) + finally: + _cyb_free(pod) process_info_dtype = _get_process_info_dtype_offsets() cdef object process_info_dtype_record = _numpy.dtype((_numpy.record, process_info_dtype)) @@ -4348,19 +4383,24 @@ cdef class ProcessInfo: cdef _get_process_detail_v1_dtype_offsets(): - cdef nvmlProcessDetail_v1_t pod - return _numpy.dtype({ - 'names': ['pid', 'used_gpu_memory', 'gpu_instance_id', 'compute_instance_id', 'used_gpu_cc_protected_memory'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint64], - 'offsets': [ - (&(pod.pid)) - (&pod), - (&(pod.usedGpuMemory)) - (&pod), - (&(pod.gpuInstanceId)) - (&pod), - (&(pod.computeInstanceId)) - (&pod), - (&(pod.usedGpuCcProtectedMemory)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessDetail_v1_t), - }) + cdef nvmlProcessDetail_v1_t *pod = _cyb_calloc(1, sizeof(nvmlProcessDetail_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessDetail_v1_t") + try: + return _numpy.dtype({ + 'names': ['pid', 'used_gpu_memory', 'gpu_instance_id', 'compute_instance_id', 'used_gpu_cc_protected_memory'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.pid)) - (pod), + (&(pod.usedGpuMemory)) - (pod), + (&(pod.gpuInstanceId)) - (pod), + (&(pod.computeInstanceId)) - (pod), + (&(pod.usedGpuCcProtectedMemory)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessDetail_v1_t), + }) + finally: + _cyb_free(pod) process_detail_v1_dtype = _get_process_detail_v1_dtype_offsets() cdef object process_detail_v1_dtype_record = _numpy.dtype((_numpy.record, process_detail_v1_dtype)) @@ -4558,23 +4598,28 @@ cdef class ProcessDetail_v1: cdef _get_device_attributes_dtype_offsets(): - cdef nvmlDeviceAttributes_t pod - return _numpy.dtype({ - 'names': ['multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'gpu_instance_slice_count', 'compute_instance_slice_count', 'memory_size_mb'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64], - 'offsets': [ - (&(pod.multiprocessorCount)) - (&pod), - (&(pod.sharedCopyEngineCount)) - (&pod), - (&(pod.sharedDecoderCount)) - (&pod), - (&(pod.sharedEncoderCount)) - (&pod), - (&(pod.sharedJpegCount)) - (&pod), - (&(pod.sharedOfaCount)) - (&pod), - (&(pod.gpuInstanceSliceCount)) - (&pod), - (&(pod.computeInstanceSliceCount)) - (&pod), - (&(pod.memorySizeMB)) - (&pod), - ], - 'itemsize': sizeof(nvmlDeviceAttributes_t), - }) + cdef nvmlDeviceAttributes_t *pod = _cyb_calloc(1, sizeof(nvmlDeviceAttributes_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlDeviceAttributes_t") + try: + return _numpy.dtype({ + 'names': ['multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'gpu_instance_slice_count', 'compute_instance_slice_count', 'memory_size_mb'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.multiprocessorCount)) - (pod), + (&(pod.sharedCopyEngineCount)) - (pod), + (&(pod.sharedDecoderCount)) - (pod), + (&(pod.sharedEncoderCount)) - (pod), + (&(pod.sharedJpegCount)) - (pod), + (&(pod.sharedOfaCount)) - (pod), + (&(pod.gpuInstanceSliceCount)) - (pod), + (&(pod.computeInstanceSliceCount)) - (pod), + (&(pod.memorySizeMB)) - (pod), + ], + 'itemsize': sizeof(nvmlDeviceAttributes_t), + }) + finally: + _cyb_free(pod) device_attributes_dtype = _get_device_attributes_dtype_offsets() @@ -4779,15 +4824,20 @@ cdef class DeviceAttributes: cdef _get_c2c_mode_info_v1_dtype_offsets(): - cdef nvmlC2cModeInfo_v1_t pod - return _numpy.dtype({ - 'names': ['is_c2c_enabled'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.isC2cEnabled)) - (&pod), - ], - 'itemsize': sizeof(nvmlC2cModeInfo_v1_t), - }) + cdef nvmlC2cModeInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlC2cModeInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlC2cModeInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['is_c2c_enabled'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.isC2cEnabled)) - (pod), + ], + 'itemsize': sizeof(nvmlC2cModeInfo_v1_t), + }) + finally: + _cyb_free(pod) c2c_mode_info_v1_dtype = _get_c2c_mode_info_v1_dtype_offsets() @@ -4904,19 +4954,24 @@ cdef class C2cModeInfo_v1: cdef _get_row_remapper_histogram_values_dtype_offsets(): - cdef nvmlRowRemapperHistogramValues_t pod - return _numpy.dtype({ - 'names': ['max_', 'high', 'partial', 'low', 'none'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.max)) - (&pod), - (&(pod.high)) - (&pod), - (&(pod.partial)) - (&pod), - (&(pod.low)) - (&pod), - (&(pod.none)) - (&pod), - ], - 'itemsize': sizeof(nvmlRowRemapperHistogramValues_t), - }) + cdef nvmlRowRemapperHistogramValues_t *pod = _cyb_calloc(1, sizeof(nvmlRowRemapperHistogramValues_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlRowRemapperHistogramValues_t") + try: + return _numpy.dtype({ + 'names': ['max_', 'high', 'partial', 'low', 'none'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.max)) - (pod), + (&(pod.high)) - (pod), + (&(pod.partial)) - (pod), + (&(pod.low)) - (pod), + (&(pod.none)) - (pod), + ], + 'itemsize': sizeof(nvmlRowRemapperHistogramValues_t), + }) + finally: + _cyb_free(pod) row_remapper_histogram_values_dtype = _get_row_remapper_histogram_values_dtype_offsets() @@ -5077,16 +5132,21 @@ cdef class RowRemapperHistogramValues: cdef _get_bridge_chip_info_dtype_offsets(): - cdef nvmlBridgeChipInfo_t pod - return _numpy.dtype({ - 'names': ['type', 'fw_version'], - 'formats': [_numpy.int32, _numpy.uint32], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.fwVersion)) - (&pod), - ], - 'itemsize': sizeof(nvmlBridgeChipInfo_t), - }) + cdef nvmlBridgeChipInfo_t *pod = _cyb_calloc(1, sizeof(nvmlBridgeChipInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlBridgeChipInfo_t") + try: + return _numpy.dtype({ + 'names': ['type', 'fw_version'], + 'formats': [_numpy.int32, _numpy.uint32], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.fwVersion)) - (pod), + ], + 'itemsize': sizeof(nvmlBridgeChipInfo_t), + }) + finally: + _cyb_free(pod) bridge_chip_info_dtype = _get_bridge_chip_info_dtype_offsets() cdef object bridge_chip_info_dtype_record = _numpy.dtype((_numpy.record, bridge_chip_info_dtype)) @@ -5245,21 +5305,26 @@ cdef class BridgeChipInfo: cdef _get_value_dtype_offsets(): - cdef nvmlValue_t pod - return _numpy.dtype({ - 'names': ['d_val', 'si_val', 'ui_val', 'ul_val', 'ull_val', 'sll_val', 'us_val'], - 'formats': [_numpy.float64, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.int64, _numpy.uint16], - 'offsets': [ - (&(pod.dVal)) - (&pod), - (&(pod.siVal)) - (&pod), - (&(pod.uiVal)) - (&pod), - (&(pod.ulVal)) - (&pod), - (&(pod.ullVal)) - (&pod), - (&(pod.sllVal)) - (&pod), - (&(pod.usVal)) - (&pod), - ], - 'itemsize': sizeof(nvmlValue_t), - }) + cdef nvmlValue_t *pod = _cyb_calloc(1, sizeof(nvmlValue_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlValue_t") + try: + return _numpy.dtype({ + 'names': ['d_val', 'si_val', 'ui_val', 'ul_val', 'ull_val', 'sll_val', 'us_val'], + 'formats': [_numpy.float64, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.int64, _numpy.uint16], + 'offsets': [ + (&(pod.dVal)) - (pod), + (&(pod.siVal)) - (pod), + (&(pod.uiVal)) - (pod), + (&(pod.ulVal)) - (pod), + (&(pod.ullVal)) - (pod), + (&(pod.sllVal)) - (pod), + (&(pod.usVal)) - (pod), + ], + 'itemsize': sizeof(nvmlValue_t), + }) + finally: + _cyb_free(pod) value_dtype = _get_value_dtype_offsets() @@ -5454,19 +5519,24 @@ cdef class Value: cdef _get__py_anon_pod0_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod0 pod - return _numpy.dtype({ - 'names': ['controller', 'default_min_temp', 'default_max_temp', 'current_temp', 'target'], - 'formats': [_numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.controller)) - (&pod), - (&(pod.defaultMinTemp)) - (&pod), - (&(pod.defaultMaxTemp)) - (&pod), - (&(pod.currentTemp)) - (&pod), - (&(pod.target)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod0), - }) + cdef cuda_bindings_nvml__anon_pod0 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod0)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod0") + try: + return _numpy.dtype({ + 'names': ['controller', 'default_min_temp', 'default_max_temp', 'current_temp', 'target'], + 'formats': [_numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.controller)) - (pod), + (&(pod.defaultMinTemp)) - (pod), + (&(pod.defaultMaxTemp)) - (pod), + (&(pod.currentTemp)) - (pod), + (&(pod.target)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod0), + }) + finally: + _cyb_free(pod) _py_anon_pod0_dtype = _get__py_anon_pod0_dtype_offsets() cdef object _py_anon_pod0_dtype_record = _numpy.dtype((_numpy.record, _py_anon_pod0_dtype)) @@ -5664,18 +5734,23 @@ cdef class _py_anon_pod0: cdef _get_cooler_info_v1_dtype_offsets(): - cdef nvmlCoolerInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'index', 'signal_type', 'target'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.index)) - (&pod), - (&(pod.signalType)) - (&pod), - (&(pod.target)) - (&pod), - ], - 'itemsize': sizeof(nvmlCoolerInfo_v1_t), - }) + cdef nvmlCoolerInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlCoolerInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlCoolerInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'index', 'signal_type', 'target'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.index)) - (pod), + (&(pod.signalType)) - (pod), + (&(pod.target)) - (pod), + ], + 'itemsize': sizeof(nvmlCoolerInfo_v1_t), + }) + finally: + _cyb_free(pod) cooler_info_v1_dtype = _get_cooler_info_v1_dtype_offsets() @@ -5825,16 +5900,21 @@ cdef class CoolerInfo_v1: cdef _get_clk_mon_fault_info_dtype_offsets(): - cdef nvmlClkMonFaultInfo_t pod - return _numpy.dtype({ - 'names': ['clk_api_domain', 'clk_domain_fault_mask'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.clkApiDomain)) - (&pod), - (&(pod.clkDomainFaultMask)) - (&pod), - ], - 'itemsize': sizeof(nvmlClkMonFaultInfo_t), - }) + cdef nvmlClkMonFaultInfo_t *pod = _cyb_calloc(1, sizeof(nvmlClkMonFaultInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlClkMonFaultInfo_t") + try: + return _numpy.dtype({ + 'names': ['clk_api_domain', 'clk_domain_fault_mask'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.clkApiDomain)) - (pod), + (&(pod.clkDomainFaultMask)) - (pod), + ], + 'itemsize': sizeof(nvmlClkMonFaultInfo_t), + }) + finally: + _cyb_free(pod) clk_mon_fault_info_dtype = _get_clk_mon_fault_info_dtype_offsets() cdef object clk_mon_fault_info_dtype_record = _numpy.dtype((_numpy.record, clk_mon_fault_info_dtype)) @@ -5993,20 +6073,25 @@ cdef class ClkMonFaultInfo: cdef _get_clock_offset_v1_dtype_offsets(): - cdef nvmlClockOffset_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'type', 'pstate', 'clock_offset_m_hz', 'min_clock_offset_m_hz', 'max_clock_offset_m_hz'], - 'formats': [_numpy.uint32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.type)) - (&pod), - (&(pod.pstate)) - (&pod), - (&(pod.clockOffsetMHz)) - (&pod), - (&(pod.minClockOffsetMHz)) - (&pod), - (&(pod.maxClockOffsetMHz)) - (&pod), - ], - 'itemsize': sizeof(nvmlClockOffset_v1_t), - }) + cdef nvmlClockOffset_v1_t *pod = _cyb_calloc(1, sizeof(nvmlClockOffset_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlClockOffset_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'type', 'pstate', 'clock_offset_m_hz', 'min_clock_offset_m_hz', 'max_clock_offset_m_hz'], + 'formats': [_numpy.uint32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.type)) - (pod), + (&(pod.pstate)) - (pod), + (&(pod.clockOffsetMHz)) - (pod), + (&(pod.minClockOffsetMHz)) - (pod), + (&(pod.maxClockOffsetMHz)) - (pod), + ], + 'itemsize': sizeof(nvmlClockOffset_v1_t), + }) + finally: + _cyb_free(pod) clock_offset_v1_dtype = _get_clock_offset_v1_dtype_offsets() @@ -6178,20 +6263,25 @@ cdef class ClockOffset_v1: cdef _get_process_utilization_sample_dtype_offsets(): - cdef nvmlProcessUtilizationSample_t pod - return _numpy.dtype({ - 'names': ['pid', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.pid)) - (&pod), - (&(pod.timeStamp)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessUtilizationSample_t), - }) + cdef nvmlProcessUtilizationSample_t *pod = _cyb_calloc(1, sizeof(nvmlProcessUtilizationSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessUtilizationSample_t") + try: + return _numpy.dtype({ + 'names': ['pid', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.pid)) - (pod), + (&(pod.timeStamp)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessUtilizationSample_t), + }) + finally: + _cyb_free(pod) process_utilization_sample_dtype = _get_process_utilization_sample_dtype_offsets() cdef object process_utilization_sample_dtype_record = _numpy.dtype((_numpy.record, process_utilization_sample_dtype)) @@ -6402,22 +6492,27 @@ cdef class ProcessUtilizationSample: cdef _get_process_utilization_info_v1_dtype_offsets(): - cdef nvmlProcessUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['time_stamp', 'pid', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], - 'formats': [_numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.timeStamp)) - (&pod), - (&(pod.pid)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - (&(pod.jpgUtil)) - (&pod), - (&(pod.ofaUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessUtilizationInfo_v1_t), - }) + cdef nvmlProcessUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlProcessUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['time_stamp', 'pid', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], + 'formats': [_numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.timeStamp)) - (pod), + (&(pod.pid)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + (&(pod.jpgUtil)) - (pod), + (&(pod.ofaUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) process_utilization_info_v1_dtype = _get_process_utilization_info_v1_dtype_offsets() cdef object process_utilization_info_v1_dtype_record = _numpy.dtype((_numpy.record, process_utilization_info_v1_dtype)) @@ -6654,27 +6749,32 @@ cdef class ProcessUtilizationInfo_v1: cdef _get_ecc_sram_error_status_v1_dtype_offsets(): - cdef nvmlEccSramErrorStatus_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'aggregate_unc_parity', 'aggregate_unc_sec_ded', 'aggregate_cor', 'volatile_unc_parity', 'volatile_unc_sec_ded', 'volatile_cor', 'aggregate_unc_bucket_l2', 'aggregate_unc_bucket_sm', 'aggregate_unc_bucket_pcie', 'aggregate_unc_bucket_mcu', 'aggregate_unc_bucket_other', 'b_threshold_exceeded'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.aggregateUncParity)) - (&pod), - (&(pod.aggregateUncSecDed)) - (&pod), - (&(pod.aggregateCor)) - (&pod), - (&(pod.volatileUncParity)) - (&pod), - (&(pod.volatileUncSecDed)) - (&pod), - (&(pod.volatileCor)) - (&pod), - (&(pod.aggregateUncBucketL2)) - (&pod), - (&(pod.aggregateUncBucketSm)) - (&pod), - (&(pod.aggregateUncBucketPcie)) - (&pod), - (&(pod.aggregateUncBucketMcu)) - (&pod), - (&(pod.aggregateUncBucketOther)) - (&pod), - (&(pod.bThresholdExceeded)) - (&pod), - ], - 'itemsize': sizeof(nvmlEccSramErrorStatus_v1_t), - }) + cdef nvmlEccSramErrorStatus_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEccSramErrorStatus_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEccSramErrorStatus_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'aggregate_unc_parity', 'aggregate_unc_sec_ded', 'aggregate_cor', 'volatile_unc_parity', 'volatile_unc_sec_ded', 'volatile_cor', 'aggregate_unc_bucket_l2', 'aggregate_unc_bucket_sm', 'aggregate_unc_bucket_pcie', 'aggregate_unc_bucket_mcu', 'aggregate_unc_bucket_other', 'b_threshold_exceeded'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.aggregateUncParity)) - (pod), + (&(pod.aggregateUncSecDed)) - (pod), + (&(pod.aggregateCor)) - (pod), + (&(pod.volatileUncParity)) - (pod), + (&(pod.volatileUncSecDed)) - (pod), + (&(pod.volatileCor)) - (pod), + (&(pod.aggregateUncBucketL2)) - (pod), + (&(pod.aggregateUncBucketSm)) - (pod), + (&(pod.aggregateUncBucketPcie)) - (pod), + (&(pod.aggregateUncBucketMcu)) - (pod), + (&(pod.aggregateUncBucketOther)) - (pod), + (&(pod.bThresholdExceeded)) - (pod), + ], + 'itemsize': sizeof(nvmlEccSramErrorStatus_v1_t), + }) + finally: + _cyb_free(pod) ecc_sram_error_status_v1_dtype = _get_ecc_sram_error_status_v1_dtype_offsets() @@ -6923,22 +7023,27 @@ cdef class EccSramErrorStatus_v1: cdef _get_platform_info_v1_dtype_offsets(): - cdef nvmlPlatformInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'ib_guid', 'rack_guid', 'chassis_physical_slot_number', 'compute_slot_index', 'node_index', 'peer_type', 'module_id'], - 'formats': [_numpy.uint32, (_numpy.uint8, 16), (_numpy.uint8, 16), _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.ibGuid)) - (&pod), - (&(pod.rackGuid)) - (&pod), - (&(pod.chassisPhysicalSlotNumber)) - (&pod), - (&(pod.computeSlotIndex)) - (&pod), - (&(pod.nodeIndex)) - (&pod), - (&(pod.peerType)) - (&pod), - (&(pod.moduleId)) - (&pod), - ], - 'itemsize': sizeof(nvmlPlatformInfo_v1_t), - }) + cdef nvmlPlatformInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPlatformInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPlatformInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'ib_guid', 'rack_guid', 'chassis_physical_slot_number', 'compute_slot_index', 'node_index', 'peer_type', 'module_id'], + 'formats': [_numpy.uint32, (_numpy.uint8, 16), (_numpy.uint8, 16), _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.ibGuid)) - (pod), + (&(pod.rackGuid)) - (pod), + (&(pod.chassisPhysicalSlotNumber)) - (pod), + (&(pod.computeSlotIndex)) - (pod), + (&(pod.nodeIndex)) - (pod), + (&(pod.peerType)) - (pod), + (&(pod.moduleId)) - (pod), + ], + 'itemsize': sizeof(nvmlPlatformInfo_v1_t), + }) + finally: + _cyb_free(pod) platform_info_v1_dtype = _get_platform_info_v1_dtype_offsets() @@ -7144,22 +7249,27 @@ cdef class PlatformInfo_v1: cdef _get_platform_info_v2_dtype_offsets(): - cdef nvmlPlatformInfo_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'ib_guid', 'chassis_serial_number', 'slot_number', 'tray_index', 'host_id', 'peer_type', 'module_id'], - 'formats': [_numpy.uint32, (_numpy.uint8, 16), (_numpy.uint8, 16), _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.ibGuid)) - (&pod), - (&(pod.chassisSerialNumber)) - (&pod), - (&(pod.slotNumber)) - (&pod), - (&(pod.trayIndex)) - (&pod), - (&(pod.hostId)) - (&pod), - (&(pod.peerType)) - (&pod), - (&(pod.moduleId)) - (&pod), - ], - 'itemsize': sizeof(nvmlPlatformInfo_v2_t), - }) + cdef nvmlPlatformInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlPlatformInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPlatformInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'ib_guid', 'chassis_serial_number', 'slot_number', 'tray_index', 'host_id', 'peer_type', 'module_id'], + 'formats': [_numpy.uint32, (_numpy.uint8, 16), (_numpy.uint8, 16), _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.ibGuid)) - (pod), + (&(pod.chassisSerialNumber)) - (pod), + (&(pod.slotNumber)) - (pod), + (&(pod.trayIndex)) - (pod), + (&(pod.hostId)) - (pod), + (&(pod.peerType)) - (pod), + (&(pod.moduleId)) - (pod), + ], + 'itemsize': sizeof(nvmlPlatformInfo_v2_t), + }) + finally: + _cyb_free(pod) platform_info_v2_dtype = _get_platform_info_v2_dtype_offsets() @@ -7365,18 +7475,23 @@ cdef class PlatformInfo_v2: cdef _get__py_anon_pod1_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod1 pod - return _numpy.dtype({ - 'names': ['b_is_present', 'percentage', 'inc_threshold', 'dec_threshold'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.bIsPresent)) - (&pod), - (&(pod.percentage)) - (&pod), - (&(pod.incThreshold)) - (&pod), - (&(pod.decThreshold)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod1), - }) + cdef cuda_bindings_nvml__anon_pod1 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod1)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod1") + try: + return _numpy.dtype({ + 'names': ['b_is_present', 'percentage', 'inc_threshold', 'dec_threshold'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.bIsPresent)) - (pod), + (&(pod.percentage)) - (pod), + (&(pod.incThreshold)) - (pod), + (&(pod.decThreshold)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod1), + }) + finally: + _cyb_free(pod) _py_anon_pod1_dtype = _get__py_anon_pod1_dtype_offsets() cdef object _py_anon_pod1_dtype_record = _numpy.dtype((_numpy.record, _py_anon_pod1_dtype)) @@ -7561,19 +7676,24 @@ cdef class _py_anon_pod1: cdef _get_vgpu_placement_list_v2_dtype_offsets(): - cdef nvmlVgpuPlacementList_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'placement_size', 'count', 'placement_ids', 'mode'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.placementSize)) - (&pod), - (&(pod.count)) - (&pod), - (&(pod.placementIds)) - (&pod), - (&(pod.mode)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuPlacementList_v2_t), - }) + cdef nvmlVgpuPlacementList_v2_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuPlacementList_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuPlacementList_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'placement_size', 'count', 'placement_ids', 'mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.placementSize)) - (pod), + (&(pod.count)) - (pod), + (&(pod.placementIds)) - (pod), + (&(pod.mode)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuPlacementList_v2_t), + }) + finally: + _cyb_free(pod) vgpu_placement_list_v2_dtype = _get_vgpu_placement_list_v2_dtype_offsets() @@ -7734,16 +7854,21 @@ cdef class VgpuPlacementList_v2: cdef _get_vgpu_type_bar1info_v1_dtype_offsets(): - cdef nvmlVgpuTypeBar1Info_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'bar1size'], - 'formats': [_numpy.uint32, _numpy.uint64], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.bar1Size)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuTypeBar1Info_v1_t), - }) + cdef nvmlVgpuTypeBar1Info_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuTypeBar1Info_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuTypeBar1Info_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'bar1size'], + 'formats': [_numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.bar1Size)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuTypeBar1Info_v1_t), + }) + finally: + _cyb_free(pod) vgpu_type_bar1info_v1_dtype = _get_vgpu_type_bar1info_v1_dtype_offsets() @@ -7871,22 +7996,27 @@ cdef class VgpuTypeBar1Info_v1: cdef _get_vgpu_process_utilization_sample_dtype_offsets(): - cdef nvmlVgpuProcessUtilizationSample_t pod - return _numpy.dtype({ - 'names': ['vgpu_instance', 'pid', 'process_name', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], - 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 64), _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.vgpuInstance)) - (&pod), - (&(pod.pid)) - (&pod), - (&(pod.processName)) - (&pod), - (&(pod.timeStamp)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuProcessUtilizationSample_t), - }) + cdef nvmlVgpuProcessUtilizationSample_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuProcessUtilizationSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuProcessUtilizationSample_t") + try: + return _numpy.dtype({ + 'names': ['vgpu_instance', 'pid', 'process_name', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], + 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 64), _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.vgpuInstance)) - (pod), + (&(pod.pid)) - (pod), + (&(pod.processName)) - (pod), + (&(pod.timeStamp)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuProcessUtilizationSample_t), + }) + finally: + _cyb_free(pod) vgpu_process_utilization_sample_dtype = _get_vgpu_process_utilization_sample_dtype_offsets() cdef object vgpu_process_utilization_sample_dtype_record = _numpy.dtype((_numpy.record, vgpu_process_utilization_sample_dtype)) @@ -8121,24 +8251,29 @@ cdef class VgpuProcessUtilizationSample: cdef _get_vgpu_process_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuProcessUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['process_name', 'time_stamp', 'vgpu_instance', 'pid', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], - 'formats': [(_numpy.int8, 64), _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.processName)) - (&pod), - (&(pod.timeStamp)) - (&pod), - (&(pod.vgpuInstance)) - (&pod), - (&(pod.pid)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - (&(pod.jpgUtil)) - (&pod), - (&(pod.ofaUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuProcessUtilizationInfo_v1_t), - }) + cdef nvmlVgpuProcessUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuProcessUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuProcessUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['process_name', 'time_stamp', 'vgpu_instance', 'pid', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], + 'formats': [(_numpy.int8, 64), _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.processName)) - (pod), + (&(pod.timeStamp)) - (pod), + (&(pod.vgpuInstance)) - (pod), + (&(pod.pid)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + (&(pod.jpgUtil)) - (pod), + (&(pod.ofaUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuProcessUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_process_utilization_info_v1_dtype = _get_vgpu_process_utilization_info_v1_dtype_offsets() cdef object vgpu_process_utilization_info_v1_dtype_record = _numpy.dtype((_numpy.record, vgpu_process_utilization_info_v1_dtype)) @@ -8399,16 +8534,21 @@ cdef class VgpuProcessUtilizationInfo_v1: cdef _get__py_anon_pod2_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod2 pod - return _numpy.dtype({ - 'names': ['avg_factor', 'timeslice'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.avgFactor)) - (&pod), - (&(pod.timeslice)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod2), - }) + cdef cuda_bindings_nvml__anon_pod2 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod2)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod2") + try: + return _numpy.dtype({ + 'names': ['avg_factor', 'timeslice'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.avgFactor)) - (pod), + (&(pod.timeslice)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod2), + }) + finally: + _cyb_free(pod) _py_anon_pod2_dtype = _get__py_anon_pod2_dtype_offsets() @@ -8548,15 +8688,20 @@ cdef class _py_anon_pod2: cdef _get__py_anon_pod3_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod3 pod - return _numpy.dtype({ - 'names': ['timeslice'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.timeslice)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod3), - }) + cdef cuda_bindings_nvml__anon_pod3 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod3)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod3") + try: + return _numpy.dtype({ + 'names': ['timeslice'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.timeslice)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod3), + }) + finally: + _cyb_free(pod) _py_anon_pod3_dtype = _get__py_anon_pod3_dtype_offsets() @@ -8685,20 +8830,25 @@ cdef class _py_anon_pod3: cdef _get_vgpu_scheduler_log_entry_dtype_offsets(): - cdef nvmlVgpuSchedulerLogEntry_t pod - return _numpy.dtype({ - 'names': ['timestamp', 'time_run_total', 'time_run', 'sw_runlist_id', 'target_time_slice', 'cumulative_preemption_time'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.timestamp)) - (&pod), - (&(pod.timeRunTotal)) - (&pod), - (&(pod.timeRun)) - (&pod), - (&(pod.swRunlistId)) - (&pod), - (&(pod.targetTimeSlice)) - (&pod), - (&(pod.cumulativePreemptionTime)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogEntry_t), - }) + cdef nvmlVgpuSchedulerLogEntry_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogEntry_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerLogEntry_t") + try: + return _numpy.dtype({ + 'names': ['timestamp', 'time_run_total', 'time_run', 'sw_runlist_id', 'target_time_slice', 'cumulative_preemption_time'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.timestamp)) - (pod), + (&(pod.timeRunTotal)) - (pod), + (&(pod.timeRun)) - (pod), + (&(pod.swRunlistId)) - (pod), + (&(pod.targetTimeSlice)) - (pod), + (&(pod.cumulativePreemptionTime)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogEntry_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_log_entry_dtype = _get_vgpu_scheduler_log_entry_dtype_offsets() cdef object vgpu_scheduler_log_entry_dtype_record = _numpy.dtype((_numpy.record, vgpu_scheduler_log_entry_dtype)) @@ -8909,16 +9059,21 @@ cdef class VgpuSchedulerLogEntry: cdef _get__py_anon_pod4_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod4 pod - return _numpy.dtype({ - 'names': ['avg_factor', 'frequency'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.avgFactor)) - (&pod), - (&(pod.frequency)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod4), - }) + cdef cuda_bindings_nvml__anon_pod4 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod4)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod4") + try: + return _numpy.dtype({ + 'names': ['avg_factor', 'frequency'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.avgFactor)) - (pod), + (&(pod.frequency)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod4), + }) + finally: + _cyb_free(pod) _py_anon_pod4_dtype = _get__py_anon_pod4_dtype_offsets() @@ -9058,15 +9213,20 @@ cdef class _py_anon_pod4: cdef _get__py_anon_pod5_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod5 pod - return _numpy.dtype({ - 'names': ['timeslice'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.timeslice)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod5), - }) + cdef cuda_bindings_nvml__anon_pod5 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod5)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod5") + try: + return _numpy.dtype({ + 'names': ['timeslice'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.timeslice)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod5), + }) + finally: + _cyb_free(pod) _py_anon_pod5_dtype = _get__py_anon_pod5_dtype_offsets() @@ -9195,22 +9355,27 @@ cdef class _py_anon_pod5: cdef _get_vgpu_scheduler_capabilities_dtype_offsets(): - cdef nvmlVgpuSchedulerCapabilities_t pod - return _numpy.dtype({ - 'names': ['supported_schedulers', 'max_timeslice', 'min_timeslice', 'is_arr_mode_supported', 'max_frequency_for_arr', 'min_frequency_for_arr', 'max_avg_factor_for_arr', 'min_avg_factor_for_arr'], - 'formats': [(_numpy.uint32, 3), _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.supportedSchedulers)) - (&pod), - (&(pod.maxTimeslice)) - (&pod), - (&(pod.minTimeslice)) - (&pod), - (&(pod.isArrModeSupported)) - (&pod), - (&(pod.maxFrequencyForARR)) - (&pod), - (&(pod.minFrequencyForARR)) - (&pod), - (&(pod.maxAvgFactorForARR)) - (&pod), - (&(pod.minAvgFactorForARR)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerCapabilities_t), - }) + cdef nvmlVgpuSchedulerCapabilities_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerCapabilities_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerCapabilities_t") + try: + return _numpy.dtype({ + 'names': ['supported_schedulers', 'max_timeslice', 'min_timeslice', 'is_arr_mode_supported', 'max_frequency_for_arr', 'min_frequency_for_arr', 'max_avg_factor_for_arr', 'min_avg_factor_for_arr'], + 'formats': [(_numpy.uint32, 3), _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.supportedSchedulers)) - (pod), + (&(pod.maxTimeslice)) - (pod), + (&(pod.minTimeslice)) - (pod), + (&(pod.isArrModeSupported)) - (pod), + (&(pod.maxFrequencyForARR)) - (pod), + (&(pod.minFrequencyForARR)) - (pod), + (&(pod.maxAvgFactorForARR)) - (pod), + (&(pod.minAvgFactorForARR)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerCapabilities_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_capabilities_dtype = _get_vgpu_scheduler_capabilities_dtype_offsets() @@ -9410,21 +9575,26 @@ cdef class VgpuSchedulerCapabilities: cdef _get_vgpu_license_expiry_dtype_offsets(): - cdef nvmlVgpuLicenseExpiry_t pod - return _numpy.dtype({ - 'names': ['year', 'month', 'day', 'hour', 'min_', 'sec', 'status'], - 'formats': [_numpy.uint32, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint8], - 'offsets': [ - (&(pod.year)) - (&pod), - (&(pod.month)) - (&pod), - (&(pod.day)) - (&pod), - (&(pod.hour)) - (&pod), - (&(pod.min)) - (&pod), - (&(pod.sec)) - (&pod), - (&(pod.status)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuLicenseExpiry_t), - }) + cdef nvmlVgpuLicenseExpiry_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuLicenseExpiry_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuLicenseExpiry_t") + try: + return _numpy.dtype({ + 'names': ['year', 'month', 'day', 'hour', 'min_', 'sec', 'status'], + 'formats': [_numpy.uint32, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint8], + 'offsets': [ + (&(pod.year)) - (pod), + (&(pod.month)) - (pod), + (&(pod.day)) - (pod), + (&(pod.hour)) - (pod), + (&(pod.min)) - (pod), + (&(pod.sec)) - (pod), + (&(pod.status)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuLicenseExpiry_t), + }) + finally: + _cyb_free(pod) vgpu_license_expiry_dtype = _get_vgpu_license_expiry_dtype_offsets() @@ -9619,21 +9789,26 @@ cdef class VgpuLicenseExpiry: cdef _get_grid_license_expiry_dtype_offsets(): - cdef nvmlGridLicenseExpiry_t pod - return _numpy.dtype({ - 'names': ['year', 'month', 'day', 'hour', 'min_', 'sec', 'status'], - 'formats': [_numpy.uint32, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint8], - 'offsets': [ - (&(pod.year)) - (&pod), - (&(pod.month)) - (&pod), - (&(pod.day)) - (&pod), - (&(pod.hour)) - (&pod), - (&(pod.min)) - (&pod), - (&(pod.sec)) - (&pod), - (&(pod.status)) - (&pod), - ], - 'itemsize': sizeof(nvmlGridLicenseExpiry_t), - }) + cdef nvmlGridLicenseExpiry_t *pod = _cyb_calloc(1, sizeof(nvmlGridLicenseExpiry_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGridLicenseExpiry_t") + try: + return _numpy.dtype({ + 'names': ['year', 'month', 'day', 'hour', 'min_', 'sec', 'status'], + 'formats': [_numpy.uint32, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint8], + 'offsets': [ + (&(pod.year)) - (pod), + (&(pod.month)) - (pod), + (&(pod.day)) - (pod), + (&(pod.hour)) - (pod), + (&(pod.min)) - (pod), + (&(pod.sec)) - (pod), + (&(pod.status)) - (pod), + ], + 'itemsize': sizeof(nvmlGridLicenseExpiry_t), + }) + finally: + _cyb_free(pod) grid_license_expiry_dtype = _get_grid_license_expiry_dtype_offsets() @@ -9828,17 +10003,22 @@ cdef class GridLicenseExpiry: cdef _get_vgpu_type_id_info_v1_dtype_offsets(): - cdef nvmlVgpuTypeIdInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'vgpu_count', 'vgpu_type_ids'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.vgpuCount)) - (&pod), - (&(pod.vgpuTypeIds)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuTypeIdInfo_v1_t), - }) + cdef nvmlVgpuTypeIdInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuTypeIdInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuTypeIdInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'vgpu_count', 'vgpu_type_ids'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.vgpuCount)) - (pod), + (&(pod.vgpuTypeIds)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuTypeIdInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_type_id_info_v1_dtype = _get_vgpu_type_id_info_v1_dtype_offsets() @@ -9977,17 +10157,22 @@ cdef class VgpuTypeIdInfo_v1: cdef _get_active_vgpu_instance_info_v1_dtype_offsets(): - cdef nvmlActiveVgpuInstanceInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'vgpu_count', 'vgpu_instances'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.vgpuCount)) - (&pod), - (&(pod.vgpuInstances)) - (&pod), - ], - 'itemsize': sizeof(nvmlActiveVgpuInstanceInfo_v1_t), - }) + cdef nvmlActiveVgpuInstanceInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlActiveVgpuInstanceInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'vgpu_count', 'vgpu_instances'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.vgpuCount)) - (pod), + (&(pod.vgpuInstances)) - (pod), + ], + 'itemsize': sizeof(nvmlActiveVgpuInstanceInfo_v1_t), + }) + finally: + _cyb_free(pod) active_vgpu_instance_info_v1_dtype = _get_active_vgpu_instance_info_v1_dtype_offsets() @@ -10126,19 +10311,24 @@ cdef class ActiveVgpuInstanceInfo_v1: cdef _get_vgpu_creatable_placement_info_v1_dtype_offsets(): - cdef nvmlVgpuCreatablePlacementInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'vgpu_type_id', 'count', 'placement_ids', 'placement_size'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.vgpuTypeId)) - (&pod), - (&(pod.count)) - (&pod), - (&(pod.placementIds)) - (&pod), - (&(pod.placementSize)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuCreatablePlacementInfo_v1_t), - }) + cdef nvmlVgpuCreatablePlacementInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuCreatablePlacementInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'vgpu_type_id', 'count', 'placement_ids', 'placement_size'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.vgpuTypeId)) - (pod), + (&(pod.count)) - (pod), + (&(pod.placementIds)) - (pod), + (&(pod.placementSize)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuCreatablePlacementInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_creatable_placement_info_v1_dtype = _get_vgpu_creatable_placement_info_v1_dtype_offsets() @@ -10299,16 +10489,21 @@ cdef class VgpuCreatablePlacementInfo_v1: cdef _get_hwbc_entry_dtype_offsets(): - cdef nvmlHwbcEntry_t pod - return _numpy.dtype({ - 'names': ['hwbc_id', 'firmware_version'], - 'formats': [_numpy.uint32, (_numpy.int8, 32)], - 'offsets': [ - (&(pod.hwbcId)) - (&pod), - (&(pod.firmwareVersion)) - (&pod), - ], - 'itemsize': sizeof(nvmlHwbcEntry_t), - }) + cdef nvmlHwbcEntry_t *pod = _cyb_calloc(1, sizeof(nvmlHwbcEntry_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlHwbcEntry_t") + try: + return _numpy.dtype({ + 'names': ['hwbc_id', 'firmware_version'], + 'formats': [_numpy.uint32, (_numpy.int8, 32)], + 'offsets': [ + (&(pod.hwbcId)) - (pod), + (&(pod.firmwareVersion)) - (pod), + ], + 'itemsize': sizeof(nvmlHwbcEntry_t), + }) + finally: + _cyb_free(pod) hwbc_entry_dtype = _get_hwbc_entry_dtype_offsets() cdef object hwbc_entry_dtype_record = _numpy.dtype((_numpy.record, hwbc_entry_dtype)) @@ -10465,16 +10660,21 @@ cdef class HwbcEntry: cdef _get_led_state_dtype_offsets(): - cdef nvmlLedState_t pod - return _numpy.dtype({ - 'names': ['cause', 'color'], - 'formats': [(_numpy.int8, 256), _numpy.int32], - 'offsets': [ - (&(pod.cause)) - (&pod), - (&(pod.color)) - (&pod), - ], - 'itemsize': sizeof(nvmlLedState_t), - }) + cdef nvmlLedState_t *pod = _cyb_calloc(1, sizeof(nvmlLedState_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlLedState_t") + try: + return _numpy.dtype({ + 'names': ['cause', 'color'], + 'formats': [(_numpy.int8, 256), _numpy.int32], + 'offsets': [ + (&(pod.cause)) - (pod), + (&(pod.color)) - (pod), + ], + 'itemsize': sizeof(nvmlLedState_t), + }) + finally: + _cyb_free(pod) led_state_dtype = _get_led_state_dtype_offsets() @@ -10606,18 +10806,23 @@ cdef class LedState: cdef _get_unit_info_dtype_offsets(): - cdef nvmlUnitInfo_t pod - return _numpy.dtype({ - 'names': ['name', 'id', 'serial', 'firmware_version'], - 'formats': [(_numpy.int8, 96), (_numpy.int8, 96), (_numpy.int8, 96), (_numpy.int8, 96)], - 'offsets': [ - (&(pod.name)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.serial)) - (&pod), - (&(pod.firmwareVersion)) - (&pod), - ], - 'itemsize': sizeof(nvmlUnitInfo_t), - }) + cdef nvmlUnitInfo_t *pod = _cyb_calloc(1, sizeof(nvmlUnitInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlUnitInfo_t") + try: + return _numpy.dtype({ + 'names': ['name', 'id', 'serial', 'firmware_version'], + 'formats': [(_numpy.int8, 96), (_numpy.int8, 96), (_numpy.int8, 96), (_numpy.int8, 96)], + 'offsets': [ + (&(pod.name)) - (pod), + (&(pod.id)) - (pod), + (&(pod.serial)) - (pod), + (&(pod.firmwareVersion)) - (pod), + ], + 'itemsize': sizeof(nvmlUnitInfo_t), + }) + finally: + _cyb_free(pod) unit_info_dtype = _get_unit_info_dtype_offsets() @@ -10783,18 +10988,23 @@ cdef class UnitInfo: cdef _get_psu_info_dtype_offsets(): - cdef nvmlPSUInfo_t pod - return _numpy.dtype({ - 'names': ['state', 'current', 'voltage', 'power'], - 'formats': [(_numpy.int8, 256), _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.state)) - (&pod), - (&(pod.current)) - (&pod), - (&(pod.voltage)) - (&pod), - (&(pod.power)) - (&pod), - ], - 'itemsize': sizeof(nvmlPSUInfo_t), - }) + cdef nvmlPSUInfo_t *pod = _cyb_calloc(1, sizeof(nvmlPSUInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPSUInfo_t") + try: + return _numpy.dtype({ + 'names': ['state', 'current', 'voltage', 'power'], + 'formats': [(_numpy.int8, 256), _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.state)) - (pod), + (&(pod.current)) - (pod), + (&(pod.voltage)) - (pod), + (&(pod.power)) - (pod), + ], + 'itemsize': sizeof(nvmlPSUInfo_t), + }) + finally: + _cyb_free(pod) psu_info_dtype = _get_psu_info_dtype_offsets() @@ -10948,16 +11158,21 @@ cdef class PSUInfo: cdef _get_unit_fan_info_dtype_offsets(): - cdef nvmlUnitFanInfo_t pod - return _numpy.dtype({ - 'names': ['speed', 'state'], - 'formats': [_numpy.uint32, _numpy.int32], - 'offsets': [ - (&(pod.speed)) - (&pod), - (&(pod.state)) - (&pod), - ], - 'itemsize': sizeof(nvmlUnitFanInfo_t), - }) + cdef nvmlUnitFanInfo_t *pod = _cyb_calloc(1, sizeof(nvmlUnitFanInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlUnitFanInfo_t") + try: + return _numpy.dtype({ + 'names': ['speed', 'state'], + 'formats': [_numpy.uint32, _numpy.int32], + 'offsets': [ + (&(pod.speed)) - (pod), + (&(pod.state)) - (pod), + ], + 'itemsize': sizeof(nvmlUnitFanInfo_t), + }) + finally: + _cyb_free(pod) unit_fan_info_dtype = _get_unit_fan_info_dtype_offsets() cdef object unit_fan_info_dtype_record = _numpy.dtype((_numpy.record, unit_fan_info_dtype)) @@ -11116,19 +11331,24 @@ cdef class UnitFanInfo: cdef _get_event_data_dtype_offsets(): - cdef nvmlEventData_t pod - return _numpy.dtype({ - 'names': ['device_', 'event_type', 'event_data', 'gpu_instance_id', 'compute_instance_id'], - 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.device)) - (&pod), - (&(pod.eventType)) - (&pod), - (&(pod.eventData)) - (&pod), - (&(pod.gpuInstanceId)) - (&pod), - (&(pod.computeInstanceId)) - (&pod), - ], - 'itemsize': sizeof(nvmlEventData_t), - }) + cdef nvmlEventData_t *pod = _cyb_calloc(1, sizeof(nvmlEventData_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEventData_t") + try: + return _numpy.dtype({ + 'names': ['device_', 'event_type', 'event_data', 'gpu_instance_id', 'compute_instance_id'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.device)) - (pod), + (&(pod.eventType)) - (pod), + (&(pod.eventData)) - (pod), + (&(pod.gpuInstanceId)) - (pod), + (&(pod.computeInstanceId)) - (pod), + ], + 'itemsize': sizeof(nvmlEventData_t), + }) + finally: + _cyb_free(pod) event_data_dtype = _get_event_data_dtype_offsets() @@ -11289,16 +11509,21 @@ cdef class EventData: cdef _get_system_event_data_v1_dtype_offsets(): - cdef nvmlSystemEventData_v1_t pod - return _numpy.dtype({ - 'names': ['event_type', 'gpu_id'], - 'formats': [_numpy.uint64, _numpy.uint32], - 'offsets': [ - (&(pod.eventType)) - (&pod), - (&(pod.gpuId)) - (&pod), - ], - 'itemsize': sizeof(nvmlSystemEventData_v1_t), - }) + cdef nvmlSystemEventData_v1_t *pod = _cyb_calloc(1, sizeof(nvmlSystemEventData_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlSystemEventData_v1_t") + try: + return _numpy.dtype({ + 'names': ['event_type', 'gpu_id'], + 'formats': [_numpy.uint64, _numpy.uint32], + 'offsets': [ + (&(pod.eventType)) - (pod), + (&(pod.gpuId)) - (pod), + ], + 'itemsize': sizeof(nvmlSystemEventData_v1_t), + }) + finally: + _cyb_free(pod) system_event_data_v1_dtype = _get_system_event_data_v1_dtype_offsets() cdef object system_event_data_v1_dtype_record = _numpy.dtype((_numpy.record, system_event_data_v1_dtype)) @@ -11457,21 +11682,26 @@ cdef class SystemEventData_v1: cdef _get_accounting_stats_dtype_offsets(): - cdef nvmlAccountingStats_t pod - return _numpy.dtype({ - 'names': ['gpu_utilization', 'memory_utilization', 'max_memory_usage', 'time', 'start_time', 'is_running', 'reserved'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, (_numpy.uint32, 5)], - 'offsets': [ - (&(pod.gpuUtilization)) - (&pod), - (&(pod.memoryUtilization)) - (&pod), - (&(pod.maxMemoryUsage)) - (&pod), - (&(pod.time)) - (&pod), - (&(pod.startTime)) - (&pod), - (&(pod.isRunning)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(nvmlAccountingStats_t), - }) + cdef nvmlAccountingStats_t *pod = _cyb_calloc(1, sizeof(nvmlAccountingStats_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlAccountingStats_t") + try: + return _numpy.dtype({ + 'names': ['gpu_utilization', 'memory_utilization', 'max_memory_usage', 'time', 'start_time', 'is_running', 'reserved'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, (_numpy.uint32, 5)], + 'offsets': [ + (&(pod.gpuUtilization)) - (pod), + (&(pod.memoryUtilization)) - (pod), + (&(pod.maxMemoryUsage)) - (pod), + (&(pod.time)) - (pod), + (&(pod.startTime)) - (pod), + (&(pod.isRunning)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(nvmlAccountingStats_t), + }) + finally: + _cyb_free(pod) accounting_stats_dtype = _get_accounting_stats_dtype_offsets() @@ -11643,22 +11873,27 @@ cdef class AccountingStats: cdef _get_encoder_session_info_dtype_offsets(): - cdef nvmlEncoderSessionInfo_t pod - return _numpy.dtype({ - 'names': ['session_id', 'pid', 'vgpu_instance', 'codec_type', 'h_resolution', 'v_resolution', 'average_fps', 'average_latency'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.sessionId)) - (&pod), - (&(pod.pid)) - (&pod), - (&(pod.vgpuInstance)) - (&pod), - (&(pod.codecType)) - (&pod), - (&(pod.hResolution)) - (&pod), - (&(pod.vResolution)) - (&pod), - (&(pod.averageFps)) - (&pod), - (&(pod.averageLatency)) - (&pod), - ], - 'itemsize': sizeof(nvmlEncoderSessionInfo_t), - }) + cdef nvmlEncoderSessionInfo_t *pod = _cyb_calloc(1, sizeof(nvmlEncoderSessionInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEncoderSessionInfo_t") + try: + return _numpy.dtype({ + 'names': ['session_id', 'pid', 'vgpu_instance', 'codec_type', 'h_resolution', 'v_resolution', 'average_fps', 'average_latency'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.sessionId)) - (pod), + (&(pod.pid)) - (pod), + (&(pod.vgpuInstance)) - (pod), + (&(pod.codecType)) - (pod), + (&(pod.hResolution)) - (pod), + (&(pod.vResolution)) - (pod), + (&(pod.averageFps)) - (pod), + (&(pod.averageLatency)) - (pod), + ], + 'itemsize': sizeof(nvmlEncoderSessionInfo_t), + }) + finally: + _cyb_free(pod) encoder_session_info_dtype = _get_encoder_session_info_dtype_offsets() cdef object encoder_session_info_dtype_record = _numpy.dtype((_numpy.record, encoder_session_info_dtype)) @@ -11895,17 +12130,22 @@ cdef class EncoderSessionInfo: cdef _get_fbc_stats_dtype_offsets(): - cdef nvmlFBCStats_t pod - return _numpy.dtype({ - 'names': ['sessions_count', 'average_fps', 'average_latency'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.sessionsCount)) - (&pod), - (&(pod.averageFPS)) - (&pod), - (&(pod.averageLatency)) - (&pod), - ], - 'itemsize': sizeof(nvmlFBCStats_t), - }) + cdef nvmlFBCStats_t *pod = _cyb_calloc(1, sizeof(nvmlFBCStats_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlFBCStats_t") + try: + return _numpy.dtype({ + 'names': ['sessions_count', 'average_fps', 'average_latency'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.sessionsCount)) - (pod), + (&(pod.averageFPS)) - (pod), + (&(pod.averageLatency)) - (pod), + ], + 'itemsize': sizeof(nvmlFBCStats_t), + }) + finally: + _cyb_free(pod) fbc_stats_dtype = _get_fbc_stats_dtype_offsets() @@ -12044,26 +12284,31 @@ cdef class FBCStats: cdef _get_fbc_session_info_dtype_offsets(): - cdef nvmlFBCSessionInfo_t pod - return _numpy.dtype({ - 'names': ['session_id', 'pid', 'vgpu_instance', 'display_ordinal', 'session_type', 'session_flags', 'h_max_resolution', 'v_max_resolution', 'h_resolution', 'v_resolution', 'average_fps', 'average_latency'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.sessionId)) - (&pod), - (&(pod.pid)) - (&pod), - (&(pod.vgpuInstance)) - (&pod), - (&(pod.displayOrdinal)) - (&pod), - (&(pod.sessionType)) - (&pod), - (&(pod.sessionFlags)) - (&pod), - (&(pod.hMaxResolution)) - (&pod), - (&(pod.vMaxResolution)) - (&pod), - (&(pod.hResolution)) - (&pod), - (&(pod.vResolution)) - (&pod), - (&(pod.averageFPS)) - (&pod), - (&(pod.averageLatency)) - (&pod), - ], - 'itemsize': sizeof(nvmlFBCSessionInfo_t), - }) + cdef nvmlFBCSessionInfo_t *pod = _cyb_calloc(1, sizeof(nvmlFBCSessionInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlFBCSessionInfo_t") + try: + return _numpy.dtype({ + 'names': ['session_id', 'pid', 'vgpu_instance', 'display_ordinal', 'session_type', 'session_flags', 'h_max_resolution', 'v_max_resolution', 'h_resolution', 'v_resolution', 'average_fps', 'average_latency'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.sessionId)) - (pod), + (&(pod.pid)) - (pod), + (&(pod.vgpuInstance)) - (pod), + (&(pod.displayOrdinal)) - (pod), + (&(pod.sessionType)) - (pod), + (&(pod.sessionFlags)) - (pod), + (&(pod.hMaxResolution)) - (pod), + (&(pod.vMaxResolution)) - (pod), + (&(pod.hResolution)) - (pod), + (&(pod.vResolution)) - (pod), + (&(pod.averageFPS)) - (pod), + (&(pod.averageLatency)) - (pod), + ], + 'itemsize': sizeof(nvmlFBCSessionInfo_t), + }) + finally: + _cyb_free(pod) fbc_session_info_dtype = _get_fbc_session_info_dtype_offsets() cdef object fbc_session_info_dtype_record = _numpy.dtype((_numpy.record, fbc_session_info_dtype)) @@ -12352,16 +12597,21 @@ cdef class FBCSessionInfo: cdef _get_conf_compute_system_caps_dtype_offsets(): - cdef nvmlConfComputeSystemCaps_t pod - return _numpy.dtype({ - 'names': ['cpu_caps', 'gpus_caps'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.cpuCaps)) - (&pod), - (&(pod.gpusCaps)) - (&pod), - ], - 'itemsize': sizeof(nvmlConfComputeSystemCaps_t), - }) + cdef nvmlConfComputeSystemCaps_t *pod = _cyb_calloc(1, sizeof(nvmlConfComputeSystemCaps_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlConfComputeSystemCaps_t") + try: + return _numpy.dtype({ + 'names': ['cpu_caps', 'gpus_caps'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.cpuCaps)) - (pod), + (&(pod.gpusCaps)) - (pod), + ], + 'itemsize': sizeof(nvmlConfComputeSystemCaps_t), + }) + finally: + _cyb_free(pod) conf_compute_system_caps_dtype = _get_conf_compute_system_caps_dtype_offsets() @@ -12489,17 +12739,22 @@ cdef class ConfComputeSystemCaps: cdef _get_conf_compute_system_state_dtype_offsets(): - cdef nvmlConfComputeSystemState_t pod - return _numpy.dtype({ - 'names': ['environment', 'cc_feature', 'dev_tools_mode'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.environment)) - (&pod), - (&(pod.ccFeature)) - (&pod), - (&(pod.devToolsMode)) - (&pod), - ], - 'itemsize': sizeof(nvmlConfComputeSystemState_t), - }) + cdef nvmlConfComputeSystemState_t *pod = _cyb_calloc(1, sizeof(nvmlConfComputeSystemState_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlConfComputeSystemState_t") + try: + return _numpy.dtype({ + 'names': ['environment', 'cc_feature', 'dev_tools_mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.environment)) - (pod), + (&(pod.ccFeature)) - (pod), + (&(pod.devToolsMode)) - (pod), + ], + 'itemsize': sizeof(nvmlConfComputeSystemState_t), + }) + finally: + _cyb_free(pod) conf_compute_system_state_dtype = _get_conf_compute_system_state_dtype_offsets() @@ -12638,19 +12893,24 @@ cdef class ConfComputeSystemState: cdef _get_system_conf_compute_settings_v1_dtype_offsets(): - cdef nvmlSystemConfComputeSettings_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'environment', 'cc_feature', 'dev_tools_mode', 'multi_gpu_mode'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.environment)) - (&pod), - (&(pod.ccFeature)) - (&pod), - (&(pod.devToolsMode)) - (&pod), - (&(pod.multiGpuMode)) - (&pod), - ], - 'itemsize': sizeof(nvmlSystemConfComputeSettings_v1_t), - }) + cdef nvmlSystemConfComputeSettings_v1_t *pod = _cyb_calloc(1, sizeof(nvmlSystemConfComputeSettings_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlSystemConfComputeSettings_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'environment', 'cc_feature', 'dev_tools_mode', 'multi_gpu_mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.environment)) - (pod), + (&(pod.ccFeature)) - (pod), + (&(pod.devToolsMode)) - (pod), + (&(pod.multiGpuMode)) - (pod), + ], + 'itemsize': sizeof(nvmlSystemConfComputeSettings_v1_t), + }) + finally: + _cyb_free(pod) system_conf_compute_settings_v1_dtype = _get_system_conf_compute_settings_v1_dtype_offsets() @@ -12811,16 +13071,21 @@ cdef class SystemConfComputeSettings_v1: cdef _get_conf_compute_mem_size_info_dtype_offsets(): - cdef nvmlConfComputeMemSizeInfo_t pod - return _numpy.dtype({ - 'names': ['protected_mem_size_kib', 'unprotected_mem_size_kib'], - 'formats': [_numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.protectedMemSizeKib)) - (&pod), - (&(pod.unprotectedMemSizeKib)) - (&pod), - ], - 'itemsize': sizeof(nvmlConfComputeMemSizeInfo_t), - }) + cdef nvmlConfComputeMemSizeInfo_t *pod = _cyb_calloc(1, sizeof(nvmlConfComputeMemSizeInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlConfComputeMemSizeInfo_t") + try: + return _numpy.dtype({ + 'names': ['protected_mem_size_kib', 'unprotected_mem_size_kib'], + 'formats': [_numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.protectedMemSizeKib)) - (pod), + (&(pod.unprotectedMemSizeKib)) - (pod), + ], + 'itemsize': sizeof(nvmlConfComputeMemSizeInfo_t), + }) + finally: + _cyb_free(pod) conf_compute_mem_size_info_dtype = _get_conf_compute_mem_size_info_dtype_offsets() @@ -12948,18 +13213,23 @@ cdef class ConfComputeMemSizeInfo: cdef _get_conf_compute_gpu_certificate_dtype_offsets(): - cdef nvmlConfComputeGpuCertificate_t pod - return _numpy.dtype({ - 'names': ['cert_chain_size', 'attestation_cert_chain_size', 'cert_chain', 'attestation_cert_chain'], - 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.uint8, 4096), (_numpy.uint8, 5120)], - 'offsets': [ - (&(pod.certChainSize)) - (&pod), - (&(pod.attestationCertChainSize)) - (&pod), - (&(pod.certChain)) - (&pod), - (&(pod.attestationCertChain)) - (&pod), - ], - 'itemsize': sizeof(nvmlConfComputeGpuCertificate_t), - }) + cdef nvmlConfComputeGpuCertificate_t *pod = _cyb_calloc(1, sizeof(nvmlConfComputeGpuCertificate_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlConfComputeGpuCertificate_t") + try: + return _numpy.dtype({ + 'names': ['cert_chain_size', 'attestation_cert_chain_size', 'cert_chain', 'attestation_cert_chain'], + 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.uint8, 4096), (_numpy.uint8, 5120)], + 'offsets': [ + (&(pod.certChainSize)) - (pod), + (&(pod.attestationCertChainSize)) - (pod), + (&(pod.certChain)) - (pod), + (&(pod.attestationCertChain)) - (pod), + ], + 'itemsize': sizeof(nvmlConfComputeGpuCertificate_t), + }) + finally: + _cyb_free(pod) conf_compute_gpu_certificate_dtype = _get_conf_compute_gpu_certificate_dtype_offsets() @@ -13109,20 +13379,25 @@ cdef class ConfComputeGpuCertificate: cdef _get_conf_compute_gpu_attestation_report_dtype_offsets(): - cdef nvmlConfComputeGpuAttestationReport_t pod - return _numpy.dtype({ - 'names': ['is_cec_attestation_report_present', 'attestation_report_size', 'cec_attestation_report_size', 'nonce', 'attestation_report', 'cec_attestation_report'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.uint8, 32), (_numpy.uint8, 8192), (_numpy.uint8, 4096)], - 'offsets': [ - (&(pod.isCecAttestationReportPresent)) - (&pod), - (&(pod.attestationReportSize)) - (&pod), - (&(pod.cecAttestationReportSize)) - (&pod), - (&(pod.nonce)) - (&pod), - (&(pod.attestationReport)) - (&pod), - (&(pod.cecAttestationReport)) - (&pod), - ], - 'itemsize': sizeof(nvmlConfComputeGpuAttestationReport_t), - }) + cdef nvmlConfComputeGpuAttestationReport_t *pod = _cyb_calloc(1, sizeof(nvmlConfComputeGpuAttestationReport_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlConfComputeGpuAttestationReport_t") + try: + return _numpy.dtype({ + 'names': ['is_cec_attestation_report_present', 'attestation_report_size', 'cec_attestation_report_size', 'nonce', 'attestation_report', 'cec_attestation_report'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.uint8, 32), (_numpy.uint8, 8192), (_numpy.uint8, 4096)], + 'offsets': [ + (&(pod.isCecAttestationReportPresent)) - (pod), + (&(pod.attestationReportSize)) - (pod), + (&(pod.cecAttestationReportSize)) - (pod), + (&(pod.nonce)) - (pod), + (&(pod.attestationReport)) - (pod), + (&(pod.cecAttestationReport)) - (pod), + ], + 'itemsize': sizeof(nvmlConfComputeGpuAttestationReport_t), + }) + finally: + _cyb_free(pod) conf_compute_gpu_attestation_report_dtype = _get_conf_compute_gpu_attestation_report_dtype_offsets() @@ -13300,20 +13575,25 @@ cdef class ConfComputeGpuAttestationReport: cdef _get_gpu_fabric_info_v2_dtype_offsets(): - cdef nvmlGpuFabricInfo_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'cluster_uuid', 'status', 'clique_id', 'state', 'health_mask'], - 'formats': [_numpy.uint32, (_numpy.uint8, 16), _numpy.int32, _numpy.uint32, _numpy.uint8, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.clusterUuid)) - (&pod), - (&(pod.status)) - (&pod), - (&(pod.cliqueId)) - (&pod), - (&(pod.state)) - (&pod), - (&(pod.healthMask)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuFabricInfo_v2_t), - }) + cdef nvmlGpuFabricInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlGpuFabricInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuFabricInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'cluster_uuid', 'status', 'clique_id', 'state', 'health_mask'], + 'formats': [_numpy.uint32, (_numpy.uint8, 16), _numpy.int32, _numpy.uint32, _numpy.uint8, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.clusterUuid)) - (pod), + (&(pod.status)) - (pod), + (&(pod.cliqueId)) - (pod), + (&(pod.state)) - (pod), + (&(pod.healthMask)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuFabricInfo_v2_t), + }) + finally: + _cyb_free(pod) gpu_fabric_info_v2_dtype = _get_gpu_fabric_info_v2_dtype_offsets() @@ -13491,17 +13771,22 @@ cdef class GpuFabricInfo_v2: cdef _get_nvlink_supported_bw_modes_v1_dtype_offsets(): - cdef nvmlNvlinkSupportedBwModes_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'bw_modes', 'total_bw_modes'], - 'formats': [_numpy.uint32, (_numpy.uint8, 23), _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.bwModes)) - (&pod), - (&(pod.totalBwModes)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkSupportedBwModes_v1_t), - }) + cdef nvmlNvlinkSupportedBwModes_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkSupportedBwModes_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'bw_modes', 'total_bw_modes'], + 'formats': [_numpy.uint32, (_numpy.uint8, 23), _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.bwModes)) - (pod), + (&(pod.totalBwModes)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkSupportedBwModes_v1_t), + }) + finally: + _cyb_free(pod) nvlink_supported_bw_modes_v1_dtype = _get_nvlink_supported_bw_modes_v1_dtype_offsets() @@ -13640,17 +13925,22 @@ cdef class NvlinkSupportedBwModes_v1: cdef _get_nvlink_get_bw_mode_v1_dtype_offsets(): - cdef nvmlNvlinkGetBwMode_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'b_is_best', 'bw_mode'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.bIsBest)) - (&pod), - (&(pod.bwMode)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkGetBwMode_v1_t), - }) + cdef nvmlNvlinkGetBwMode_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkGetBwMode_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkGetBwMode_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'b_is_best', 'bw_mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.bIsBest)) - (pod), + (&(pod.bwMode)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkGetBwMode_v1_t), + }) + finally: + _cyb_free(pod) nvlink_get_bw_mode_v1_dtype = _get_nvlink_get_bw_mode_v1_dtype_offsets() @@ -13789,17 +14079,22 @@ cdef class NvlinkGetBwMode_v1: cdef _get_nvlink_set_bw_mode_v1_dtype_offsets(): - cdef nvmlNvlinkSetBwMode_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'b_set_best', 'bw_mode'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.bSetBest)) - (&pod), - (&(pod.bwMode)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkSetBwMode_v1_t), - }) + cdef nvmlNvlinkSetBwMode_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkSetBwMode_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkSetBwMode_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'b_set_best', 'bw_mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.bSetBest)) - (pod), + (&(pod.bwMode)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkSetBwMode_v1_t), + }) + finally: + _cyb_free(pod) nvlink_set_bw_mode_v1_dtype = _get_nvlink_set_bw_mode_v1_dtype_offsets() @@ -13938,16 +14233,21 @@ cdef class NvlinkSetBwMode_v1: cdef _get_vgpu_version_dtype_offsets(): - cdef nvmlVgpuVersion_t pod - return _numpy.dtype({ - 'names': ['min_version', 'max_version'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.minVersion)) - (&pod), - (&(pod.maxVersion)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuVersion_t), - }) + cdef nvmlVgpuVersion_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuVersion_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuVersion_t") + try: + return _numpy.dtype({ + 'names': ['min_version', 'max_version'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.minVersion)) - (pod), + (&(pod.maxVersion)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuVersion_t), + }) + finally: + _cyb_free(pod) vgpu_version_dtype = _get_vgpu_version_dtype_offsets() @@ -14087,24 +14387,29 @@ cdef class VgpuVersion: cdef _get_vgpu_metadata_dtype_offsets(): - cdef nvmlVgpuMetadata_t pod - return _numpy.dtype({ - 'names': ['version', 'revision', 'guest_info_state', 'guest_driver_version', 'host_driver_version', 'reserved', 'vgpu_virtualization_caps', 'guest_vgpu_version', 'opaque_data_size', 'opaque_data'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int32, (_numpy.int8, 80), (_numpy.int8, 80), (_numpy.uint32, 6), _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 4)], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.revision)) - (&pod), - (&(pod.guestInfoState)) - (&pod), - (&(pod.guestDriverVersion)) - (&pod), - (&(pod.hostDriverVersion)) - (&pod), - (&(pod.reserved)) - (&pod), - (&(pod.vgpuVirtualizationCaps)) - (&pod), - (&(pod.guestVgpuVersion)) - (&pod), - (&(pod.opaqueDataSize)) - (&pod), - (&(pod.opaqueData)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuMetadata_t), - }) + cdef nvmlVgpuMetadata_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuMetadata_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuMetadata_t") + try: + return _numpy.dtype({ + 'names': ['version', 'revision', 'guest_info_state', 'guest_driver_version', 'host_driver_version', 'reserved', 'vgpu_virtualization_caps', 'guest_vgpu_version', 'opaque_data_size', 'opaque_data'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int32, (_numpy.int8, 80), (_numpy.int8, 80), (_numpy.uint32, 6), _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 4)], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.revision)) - (pod), + (&(pod.guestInfoState)) - (pod), + (&(pod.guestDriverVersion)) - (pod), + (&(pod.hostDriverVersion)) - (pod), + (&(pod.reserved)) - (pod), + (&(pod.vgpuVirtualizationCaps)) - (pod), + (&(pod.guestVgpuVersion)) - (pod), + (&(pod.opaqueDataSize)) - (pod), + (&(pod.opaqueData)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuMetadata_t), + }) + finally: + _cyb_free(pod) vgpu_metadata_dtype = _get_vgpu_metadata_dtype_offsets() @@ -14321,16 +14626,21 @@ cdef class VgpuMetadata: cdef _get_vgpu_pgpu_compatibility_dtype_offsets(): - cdef nvmlVgpuPgpuCompatibility_t pod - return _numpy.dtype({ - 'names': ['vgpu_vm_compatibility', 'compatibility_limit_code'], - 'formats': [_numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.vgpuVmCompatibility)) - (&pod), - (&(pod.compatibilityLimitCode)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuPgpuCompatibility_t), - }) + cdef nvmlVgpuPgpuCompatibility_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuPgpuCompatibility_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuPgpuCompatibility_t") + try: + return _numpy.dtype({ + 'names': ['vgpu_vm_compatibility', 'compatibility_limit_code'], + 'formats': [_numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.vgpuVmCompatibility)) - (pod), + (&(pod.compatibilityLimitCode)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuPgpuCompatibility_t), + }) + finally: + _cyb_free(pod) vgpu_pgpu_compatibility_dtype = _get_vgpu_pgpu_compatibility_dtype_offsets() @@ -14458,16 +14768,21 @@ cdef class VgpuPgpuCompatibility: cdef _get_gpu_instance_placement_dtype_offsets(): - cdef nvmlGpuInstancePlacement_t pod - return _numpy.dtype({ - 'names': ['start', 'size_'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.start)) - (&pod), - (&(pod.size)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuInstancePlacement_t), - }) + cdef nvmlGpuInstancePlacement_t *pod = _cyb_calloc(1, sizeof(nvmlGpuInstancePlacement_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuInstancePlacement_t") + try: + return _numpy.dtype({ + 'names': ['start', 'size_'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.start)) - (pod), + (&(pod.size)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuInstancePlacement_t), + }) + finally: + _cyb_free(pod) gpu_instance_placement_dtype = _get_gpu_instance_placement_dtype_offsets() cdef object gpu_instance_placement_dtype_record = _numpy.dtype((_numpy.record, gpu_instance_placement_dtype)) @@ -14626,27 +14941,32 @@ cdef class GpuInstancePlacement: cdef _get_gpu_instance_profile_info_v3_dtype_offsets(): - cdef nvmlGpuInstanceProfileInfo_v3_t pod - return _numpy.dtype({ - 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'copy_engine_count', 'decoder_count', 'encoder_count', 'jpeg_count', 'ofa_count', 'memory_size_mb', 'name', 'capabilities'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64, (_numpy.int8, 96), _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.sliceCount)) - (&pod), - (&(pod.instanceCount)) - (&pod), - (&(pod.multiprocessorCount)) - (&pod), - (&(pod.copyEngineCount)) - (&pod), - (&(pod.decoderCount)) - (&pod), - (&(pod.encoderCount)) - (&pod), - (&(pod.jpegCount)) - (&pod), - (&(pod.ofaCount)) - (&pod), - (&(pod.memorySizeMB)) - (&pod), - (&(pod.name)) - (&pod), - (&(pod.capabilities)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuInstanceProfileInfo_v3_t), - }) + cdef nvmlGpuInstanceProfileInfo_v3_t *pod = _cyb_calloc(1, sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuInstanceProfileInfo_v3_t") + try: + return _numpy.dtype({ + 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'copy_engine_count', 'decoder_count', 'encoder_count', 'jpeg_count', 'ofa_count', 'memory_size_mb', 'name', 'capabilities'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64, (_numpy.int8, 96), _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.id)) - (pod), + (&(pod.sliceCount)) - (pod), + (&(pod.instanceCount)) - (pod), + (&(pod.multiprocessorCount)) - (pod), + (&(pod.copyEngineCount)) - (pod), + (&(pod.decoderCount)) - (pod), + (&(pod.encoderCount)) - (pod), + (&(pod.jpegCount)) - (pod), + (&(pod.ofaCount)) - (pod), + (&(pod.memorySizeMB)) - (pod), + (&(pod.name)) - (pod), + (&(pod.capabilities)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuInstanceProfileInfo_v3_t), + }) + finally: + _cyb_free(pod) gpu_instance_profile_info_v3_dtype = _get_gpu_instance_profile_info_v3_dtype_offsets() @@ -14899,16 +15219,21 @@ cdef class GpuInstanceProfileInfo_v3: cdef _get_compute_instance_placement_dtype_offsets(): - cdef nvmlComputeInstancePlacement_t pod - return _numpy.dtype({ - 'names': ['start', 'size_'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.start)) - (&pod), - (&(pod.size)) - (&pod), - ], - 'itemsize': sizeof(nvmlComputeInstancePlacement_t), - }) + cdef nvmlComputeInstancePlacement_t *pod = _cyb_calloc(1, sizeof(nvmlComputeInstancePlacement_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlComputeInstancePlacement_t") + try: + return _numpy.dtype({ + 'names': ['start', 'size_'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.start)) - (pod), + (&(pod.size)) - (pod), + ], + 'itemsize': sizeof(nvmlComputeInstancePlacement_t), + }) + finally: + _cyb_free(pod) compute_instance_placement_dtype = _get_compute_instance_placement_dtype_offsets() cdef object compute_instance_placement_dtype_record = _numpy.dtype((_numpy.record, compute_instance_placement_dtype)) @@ -15067,25 +15392,30 @@ cdef class ComputeInstancePlacement: cdef _get_compute_instance_profile_info_v2_dtype_offsets(): - cdef nvmlComputeInstanceProfileInfo_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'name'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 96)], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.sliceCount)) - (&pod), - (&(pod.instanceCount)) - (&pod), - (&(pod.multiprocessorCount)) - (&pod), - (&(pod.sharedCopyEngineCount)) - (&pod), - (&(pod.sharedDecoderCount)) - (&pod), - (&(pod.sharedEncoderCount)) - (&pod), - (&(pod.sharedJpegCount)) - (&pod), - (&(pod.sharedOfaCount)) - (&pod), - (&(pod.name)) - (&pod), - ], - 'itemsize': sizeof(nvmlComputeInstanceProfileInfo_v2_t), - }) + cdef nvmlComputeInstanceProfileInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlComputeInstanceProfileInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlComputeInstanceProfileInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'name'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 96)], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.id)) - (pod), + (&(pod.sliceCount)) - (pod), + (&(pod.instanceCount)) - (pod), + (&(pod.multiprocessorCount)) - (pod), + (&(pod.sharedCopyEngineCount)) - (pod), + (&(pod.sharedDecoderCount)) - (pod), + (&(pod.sharedEncoderCount)) - (pod), + (&(pod.sharedJpegCount)) - (pod), + (&(pod.sharedOfaCount)) - (pod), + (&(pod.name)) - (pod), + ], + 'itemsize': sizeof(nvmlComputeInstanceProfileInfo_v2_t), + }) + finally: + _cyb_free(pod) compute_instance_profile_info_v2_dtype = _get_compute_instance_profile_info_v2_dtype_offsets() @@ -15316,26 +15646,31 @@ cdef class ComputeInstanceProfileInfo_v2: cdef _get_compute_instance_profile_info_v3_dtype_offsets(): - cdef nvmlComputeInstanceProfileInfo_v3_t pod - return _numpy.dtype({ - 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'name', 'capabilities'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 96), _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.sliceCount)) - (&pod), - (&(pod.instanceCount)) - (&pod), - (&(pod.multiprocessorCount)) - (&pod), - (&(pod.sharedCopyEngineCount)) - (&pod), - (&(pod.sharedDecoderCount)) - (&pod), - (&(pod.sharedEncoderCount)) - (&pod), - (&(pod.sharedJpegCount)) - (&pod), - (&(pod.sharedOfaCount)) - (&pod), - (&(pod.name)) - (&pod), - (&(pod.capabilities)) - (&pod), - ], - 'itemsize': sizeof(nvmlComputeInstanceProfileInfo_v3_t), - }) + cdef nvmlComputeInstanceProfileInfo_v3_t *pod = _cyb_calloc(1, sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlComputeInstanceProfileInfo_v3_t") + try: + return _numpy.dtype({ + 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'name', 'capabilities'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 96), _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.id)) - (pod), + (&(pod.sliceCount)) - (pod), + (&(pod.instanceCount)) - (pod), + (&(pod.multiprocessorCount)) - (pod), + (&(pod.sharedCopyEngineCount)) - (pod), + (&(pod.sharedDecoderCount)) - (pod), + (&(pod.sharedEncoderCount)) - (pod), + (&(pod.sharedJpegCount)) - (pod), + (&(pod.sharedOfaCount)) - (pod), + (&(pod.name)) - (pod), + (&(pod.capabilities)) - (pod), + ], + 'itemsize': sizeof(nvmlComputeInstanceProfileInfo_v3_t), + }) + finally: + _cyb_free(pod) compute_instance_profile_info_v3_dtype = _get_compute_instance_profile_info_v3_dtype_offsets() @@ -15577,16 +15912,21 @@ cdef class ComputeInstanceProfileInfo_v3: cdef _get_device_addressing_mode_v1_dtype_offsets(): - cdef nvmlDeviceAddressingMode_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'value'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.value)) - (&pod), - ], - 'itemsize': sizeof(nvmlDeviceAddressingMode_v1_t), - }) + cdef nvmlDeviceAddressingMode_v1_t *pod = _cyb_calloc(1, sizeof(nvmlDeviceAddressingMode_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlDeviceAddressingMode_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'value'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.value)) - (pod), + ], + 'itemsize': sizeof(nvmlDeviceAddressingMode_v1_t), + }) + finally: + _cyb_free(pod) device_addressing_mode_v1_dtype = _get_device_addressing_mode_v1_dtype_offsets() @@ -15714,17 +16054,22 @@ cdef class DeviceAddressingMode_v1: cdef _get_repair_status_v1_dtype_offsets(): - cdef nvmlRepairStatus_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'b_channel_repair_pending', 'b_tpc_repair_pending'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.bChannelRepairPending)) - (&pod), - (&(pod.bTpcRepairPending)) - (&pod), - ], - 'itemsize': sizeof(nvmlRepairStatus_v1_t), - }) + cdef nvmlRepairStatus_v1_t *pod = _cyb_calloc(1, sizeof(nvmlRepairStatus_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlRepairStatus_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'b_channel_repair_pending', 'b_tpc_repair_pending'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.bChannelRepairPending)) - (pod), + (&(pod.bTpcRepairPending)) - (pod), + ], + 'itemsize': sizeof(nvmlRepairStatus_v1_t), + }) + finally: + _cyb_free(pod) repair_status_v1_dtype = _get_repair_status_v1_dtype_offsets() @@ -15863,17 +16208,22 @@ cdef class RepairStatus_v1: cdef _get_device_power_mizer_modes_v1_dtype_offsets(): - cdef nvmlDevicePowerMizerModes_v1_t pod - return _numpy.dtype({ - 'names': ['current_mode', 'mode', 'supported_power_mizer_modes'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.currentMode)) - (&pod), - (&(pod.mode)) - (&pod), - (&(pod.supportedPowerMizerModes)) - (&pod), - ], - 'itemsize': sizeof(nvmlDevicePowerMizerModes_v1_t), - }) + cdef nvmlDevicePowerMizerModes_v1_t *pod = _cyb_calloc(1, sizeof(nvmlDevicePowerMizerModes_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlDevicePowerMizerModes_v1_t") + try: + return _numpy.dtype({ + 'names': ['current_mode', 'mode', 'supported_power_mizer_modes'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.currentMode)) - (pod), + (&(pod.mode)) - (pod), + (&(pod.supportedPowerMizerModes)) - (pod), + ], + 'itemsize': sizeof(nvmlDevicePowerMizerModes_v1_t), + }) + finally: + _cyb_free(pod) device_power_mizer_modes_v1_dtype = _get_device_power_mizer_modes_v1_dtype_offsets() @@ -16012,21 +16362,26 @@ cdef class DevicePowerMizerModes_v1: cdef _get_ecc_sram_unique_uncorrected_error_entry_v1_dtype_offsets(): - cdef nvmlEccSramUniqueUncorrectedErrorEntry_v1_t pod - return _numpy.dtype({ - 'names': ['unit', 'location', 'sublocation', 'extlocation', 'address', 'is_parity', 'count'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.unit)) - (&pod), - (&(pod.location)) - (&pod), - (&(pod.sublocation)) - (&pod), - (&(pod.extlocation)) - (&pod), - (&(pod.address)) - (&pod), - (&(pod.isParity)) - (&pod), - (&(pod.count)) - (&pod), - ], - 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorEntry_v1_t), - }) + cdef nvmlEccSramUniqueUncorrectedErrorEntry_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEccSramUniqueUncorrectedErrorEntry_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEccSramUniqueUncorrectedErrorEntry_v1_t") + try: + return _numpy.dtype({ + 'names': ['unit', 'location', 'sublocation', 'extlocation', 'address', 'is_parity', 'count'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.unit)) - (pod), + (&(pod.location)) - (pod), + (&(pod.sublocation)) - (pod), + (&(pod.extlocation)) - (pod), + (&(pod.address)) - (pod), + (&(pod.isParity)) - (pod), + (&(pod.count)) - (pod), + ], + 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorEntry_v1_t), + }) + finally: + _cyb_free(pod) ecc_sram_unique_uncorrected_error_entry_v1_dtype = _get_ecc_sram_unique_uncorrected_error_entry_v1_dtype_offsets() cdef object ecc_sram_unique_uncorrected_error_entry_v1_dtype_record = _numpy.dtype((_numpy.record, ecc_sram_unique_uncorrected_error_entry_v1_dtype)) @@ -16250,21 +16605,26 @@ cdef class EccSramUniqueUncorrectedErrorEntry_v1: cdef _get_gpu_fabric_info_v3_dtype_offsets(): - cdef nvmlGpuFabricInfo_v3_t pod - return _numpy.dtype({ - 'names': ['version', 'cluster_uuid', 'status', 'clique_id', 'state', 'health_mask', 'health_summary'], - 'formats': [_numpy.uint32, (_numpy.uint8, 16), _numpy.int32, _numpy.uint32, _numpy.uint8, _numpy.uint32, _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.clusterUuid)) - (&pod), - (&(pod.status)) - (&pod), - (&(pod.cliqueId)) - (&pod), - (&(pod.state)) - (&pod), - (&(pod.healthMask)) - (&pod), - (&(pod.healthSummary)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuFabricInfo_v3_t), - }) + cdef nvmlGpuFabricInfo_v3_t *pod = _cyb_calloc(1, sizeof(nvmlGpuFabricInfo_v3_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuFabricInfo_v3_t") + try: + return _numpy.dtype({ + 'names': ['version', 'cluster_uuid', 'status', 'clique_id', 'state', 'health_mask', 'health_summary'], + 'formats': [_numpy.uint32, (_numpy.uint8, 16), _numpy.int32, _numpy.uint32, _numpy.uint8, _numpy.uint32, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.clusterUuid)) - (pod), + (&(pod.status)) - (pod), + (&(pod.cliqueId)) - (pod), + (&(pod.state)) - (pod), + (&(pod.healthMask)) - (pod), + (&(pod.healthSummary)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuFabricInfo_v3_t), + }) + finally: + _cyb_free(pod) gpu_fabric_info_v3_dtype = _get_gpu_fabric_info_v3_dtype_offsets() @@ -16453,16 +16813,21 @@ cdef class GpuFabricInfo_v3: cdef _get_nv_link_info_v1_dtype_offsets(): - cdef nvmlNvLinkInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'is_nvle_enabled'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.isNvleEnabled)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvLinkInfo_v1_t), - }) + cdef nvmlNvLinkInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvLinkInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'is_nvle_enabled'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.isNvleEnabled)) - (pod), + ], + 'itemsize': sizeof(nvmlNvLinkInfo_v1_t), + }) + finally: + _cyb_free(pod) nv_link_info_v1_dtype = _get_nv_link_info_v1_dtype_offsets() @@ -16590,18 +16955,23 @@ cdef class NvLinkInfo_v1: cdef _get_nvlink_firmware_version_dtype_offsets(): - cdef nvmlNvlinkFirmwareVersion_t pod - return _numpy.dtype({ - 'names': ['ucode_type', 'major', 'minor', 'sub_minor'], - 'formats': [_numpy.uint8, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.ucodeType)) - (&pod), - (&(pod.major)) - (&pod), - (&(pod.minor)) - (&pod), - (&(pod.subMinor)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkFirmwareVersion_t), - }) + cdef nvmlNvlinkFirmwareVersion_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkFirmwareVersion_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkFirmwareVersion_t") + try: + return _numpy.dtype({ + 'names': ['ucode_type', 'major', 'minor', 'sub_minor'], + 'formats': [_numpy.uint8, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.ucodeType)) - (pod), + (&(pod.major)) - (pod), + (&(pod.minor)) - (pod), + (&(pod.subMinor)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkFirmwareVersion_t), + }) + finally: + _cyb_free(pod) nvlink_firmware_version_dtype = _get_nvlink_firmware_version_dtype_offsets() cdef object nvlink_firmware_version_dtype_record = _numpy.dtype((_numpy.record, nvlink_firmware_version_dtype)) @@ -16786,15 +17156,20 @@ cdef class NvlinkFirmwareVersion: cdef _get_prm_counter_input_v1_dtype_offsets(): - cdef nvmlPRMCounterInput_v1_t pod - return _numpy.dtype({ - 'names': ['local_port'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.localPort)) - (&pod), - ], - 'itemsize': sizeof(nvmlPRMCounterInput_v1_t), - }) + cdef nvmlPRMCounterInput_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPRMCounterInput_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPRMCounterInput_v1_t") + try: + return _numpy.dtype({ + 'names': ['local_port'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.localPort)) - (pod), + ], + 'itemsize': sizeof(nvmlPRMCounterInput_v1_t), + }) + finally: + _cyb_free(pod) prm_counter_input_v1_dtype = _get_prm_counter_input_v1_dtype_offsets() @@ -16923,18 +17298,23 @@ cdef class PRMCounterInput_v1: cdef _get_vgpu_scheduler_state_info_v2_dtype_offsets(): - cdef nvmlVgpuSchedulerStateInfo_v2_t pod - return _numpy.dtype({ - 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.avgFactor)) - (&pod), - (&(pod.timeslice)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v2_t), - }) + cdef nvmlVgpuSchedulerStateInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerStateInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.avgFactor)) - (pod), + (&(pod.timeslice)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v2_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_state_info_v2_dtype = _get_vgpu_scheduler_state_info_v2_dtype_offsets() @@ -17084,21 +17464,26 @@ cdef class VgpuSchedulerStateInfo_v2: cdef _get_vgpu_scheduler_log_entry_v2_dtype_offsets(): - cdef nvmlVgpuSchedulerLogEntry_v2_t pod - return _numpy.dtype({ - 'names': ['timestamp', 'time_run_total', 'time_run', 'sw_runlist_id', 'target_time_slice', 'cumulative_preemption_time', 'weight'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint32], - 'offsets': [ - (&(pod.timestamp)) - (&pod), - (&(pod.timeRunTotal)) - (&pod), - (&(pod.timeRun)) - (&pod), - (&(pod.swRunlistId)) - (&pod), - (&(pod.targetTimeSlice)) - (&pod), - (&(pod.cumulativePreemptionTime)) - (&pod), - (&(pod.weight)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogEntry_v2_t), - }) + cdef nvmlVgpuSchedulerLogEntry_v2_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogEntry_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerLogEntry_v2_t") + try: + return _numpy.dtype({ + 'names': ['timestamp', 'time_run_total', 'time_run', 'sw_runlist_id', 'target_time_slice', 'cumulative_preemption_time', 'weight'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint32], + 'offsets': [ + (&(pod.timestamp)) - (pod), + (&(pod.timeRunTotal)) - (pod), + (&(pod.timeRun)) - (pod), + (&(pod.swRunlistId)) - (pod), + (&(pod.targetTimeSlice)) - (pod), + (&(pod.cumulativePreemptionTime)) - (pod), + (&(pod.weight)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogEntry_v2_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_log_entry_v2_dtype = _get_vgpu_scheduler_log_entry_v2_dtype_offsets() cdef object vgpu_scheduler_log_entry_v2_dtype_record = _numpy.dtype((_numpy.record, vgpu_scheduler_log_entry_v2_dtype)) @@ -17322,18 +17707,23 @@ cdef class VgpuSchedulerLogEntry_v2: cdef _get_vgpu_scheduler_state_v2_dtype_offsets(): - cdef nvmlVgpuSchedulerState_v2_t pod - return _numpy.dtype({ - 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'frequency'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.avgFactor)) - (&pod), - (&(pod.frequency)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerState_v2_t), - }) + cdef nvmlVgpuSchedulerState_v2_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerState_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerState_v2_t") + try: + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'frequency'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.avgFactor)) - (pod), + (&(pod.frequency)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerState_v2_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_state_v2_dtype = _get_vgpu_scheduler_state_v2_dtype_offsets() @@ -17483,15 +17873,20 @@ cdef class VgpuSchedulerState_v2: cdef _get_bbx_time_data_v1_dtype_offsets(): - cdef nvmlBBXTimeData_v1_t pod - return _numpy.dtype({ - 'names': ['time_run'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.timeRun)) - (&pod), - ], - 'itemsize': sizeof(nvmlBBXTimeData_v1_t), - }) + cdef nvmlBBXTimeData_v1_t *pod = _cyb_calloc(1, sizeof(nvmlBBXTimeData_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlBBXTimeData_v1_t") + try: + return _numpy.dtype({ + 'names': ['time_run'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.timeRun)) - (pod), + ], + 'itemsize': sizeof(nvmlBBXTimeData_v1_t), + }) + finally: + _cyb_free(pod) bbx_time_data_v1_dtype = _get_bbx_time_data_v1_dtype_offsets() @@ -17608,20 +18003,25 @@ cdef class BBXTimeData_v1: cdef _get_remapped_rows_info_v2_dtype_offsets(): - cdef nvmlRemappedRowsInfo_v2_t pod - return _numpy.dtype({ - 'names': ['corr_active_remaps', 'corr_inactive_remaps', 'unc_active_remaps', 'unc_inactive_remaps', 'b_pending', 'b_failure_occurred'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.corrActiveRemaps)) - (&pod), - (&(pod.corrInactiveRemaps)) - (&pod), - (&(pod.uncActiveRemaps)) - (&pod), - (&(pod.uncInactiveRemaps)) - (&pod), - (&(pod.bPending)) - (&pod), - (&(pod.bFailureOccurred)) - (&pod), - ], - 'itemsize': sizeof(nvmlRemappedRowsInfo_v2_t), - }) + cdef nvmlRemappedRowsInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlRemappedRowsInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlRemappedRowsInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['corr_active_remaps', 'corr_inactive_remaps', 'unc_active_remaps', 'unc_inactive_remaps', 'b_pending', 'b_failure_occurred'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.corrActiveRemaps)) - (pod), + (&(pod.corrInactiveRemaps)) - (pod), + (&(pod.uncActiveRemaps)) - (pod), + (&(pod.uncInactiveRemaps)) - (pod), + (&(pod.bPending)) - (pod), + (&(pod.bFailureOccurred)) - (pod), + ], + 'itemsize': sizeof(nvmlRemappedRowsInfo_v2_t), + }) + finally: + _cyb_free(pod) remapped_rows_info_v2_dtype = _get_remapped_rows_info_v2_dtype_offsets() @@ -17793,24 +18193,29 @@ cdef class RemappedRowsInfo_v2: cdef _get_accounting_stats_v2_dtype_offsets(): - cdef nvmlAccountingStats_v2_t pod - return _numpy.dtype({ - 'names': ['pid', 'is_running', 'gpu_utilization', 'memory_utilization', 'max_memory_usage', 'sample_count', 'sum_gpu_util', 'sum_fb_util', 'time', 'start_time'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.pid)) - (&pod), - (&(pod.isRunning)) - (&pod), - (&(pod.gpuUtilization)) - (&pod), - (&(pod.memoryUtilization)) - (&pod), - (&(pod.maxMemoryUsage)) - (&pod), - (&(pod.sampleCount)) - (&pod), - (&(pod.sumGpuUtil)) - (&pod), - (&(pod.sumFbUtil)) - (&pod), - (&(pod.time)) - (&pod), - (&(pod.startTime)) - (&pod), - ], - 'itemsize': sizeof(nvmlAccountingStats_v2_t), - }) + cdef nvmlAccountingStats_v2_t *pod = _cyb_calloc(1, sizeof(nvmlAccountingStats_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlAccountingStats_v2_t") + try: + return _numpy.dtype({ + 'names': ['pid', 'is_running', 'gpu_utilization', 'memory_utilization', 'max_memory_usage', 'sample_count', 'sum_gpu_util', 'sum_fb_util', 'time', 'start_time'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.pid)) - (pod), + (&(pod.isRunning)) - (pod), + (&(pod.gpuUtilization)) - (pod), + (&(pod.memoryUtilization)) - (pod), + (&(pod.maxMemoryUsage)) - (pod), + (&(pod.sampleCount)) - (pod), + (&(pod.sumGpuUtil)) - (pod), + (&(pod.sumFbUtil)) - (pod), + (&(pod.time)) - (pod), + (&(pod.startTime)) - (pod), + ], + 'itemsize': sizeof(nvmlAccountingStats_v2_t), + }) + finally: + _cyb_free(pod) accounting_stats_v2_dtype = _get_accounting_stats_v2_dtype_offsets() @@ -18026,17 +18431,22 @@ cdef class AccountingStats_v2: cdef _get_cper_cursor_v1_dtype_offsets(): - cdef nvmlCPERCursor_v1_t pod - return _numpy.dtype({ - 'names': ['cper_type_mask', 'uuid', 'handle'], - 'formats': [_numpy.uint32, (_numpy.int8, 80), _numpy.uint64], - 'offsets': [ - (&(pod.cperTypeMask)) - (&pod), - (&(pod.uuid)) - (&pod), - (&(pod.handle)) - (&pod), - ], - 'itemsize': sizeof(nvmlCPERCursor_v1_t), - }) + cdef nvmlCPERCursor_v1_t *pod = _cyb_calloc(1, sizeof(nvmlCPERCursor_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlCPERCursor_v1_t") + try: + return _numpy.dtype({ + 'names': ['cper_type_mask', 'uuid', 'handle'], + 'formats': [_numpy.uint32, (_numpy.int8, 80), _numpy.uint64], + 'offsets': [ + (&(pod.cperTypeMask)) - (pod), + (&(pod.uuid)) - (pod), + (&(pod.handle)) - (pod), + ], + 'itemsize': sizeof(nvmlCPERCursor_v1_t), + }) + finally: + _cyb_free(pod) cper_cursor_v1_dtype = _get_cper_cursor_v1_dtype_offsets() @@ -18191,17 +18601,22 @@ cdef class CPERCursor_v1: cdef _get_set_memory_limits_v1_dtype_offsets(): - cdef nvmlSetMemoryLimits_v1_t pod - return _numpy.dtype({ - 'names': ['name_space', 'soft_limit', 'hard_limit'], - 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.nameSpace)) - (&pod), - (&(pod.softLimit)) - (&pod), - (&(pod.hardLimit)) - (&pod), - ], - 'itemsize': sizeof(nvmlSetMemoryLimits_v1_t), - }) + cdef nvmlSetMemoryLimits_v1_t *pod = _cyb_calloc(1, sizeof(nvmlSetMemoryLimits_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlSetMemoryLimits_v1_t") + try: + return _numpy.dtype({ + 'names': ['name_space', 'soft_limit', 'hard_limit'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.nameSpace)) - (pod), + (&(pod.softLimit)) - (pod), + (&(pod.hardLimit)) - (pod), + ], + 'itemsize': sizeof(nvmlSetMemoryLimits_v1_t), + }) + finally: + _cyb_free(pod) set_memory_limits_v1_dtype = _get_set_memory_limits_v1_dtype_offsets() @@ -18349,18 +18764,23 @@ cdef class SetMemoryLimits_v1: cdef _get_get_memory_limits_v1_dtype_offsets(): - cdef nvmlGetMemoryLimits_v1_t pod - return _numpy.dtype({ - 'names': ['name_space', 'soft_limit', 'hard_limit', 'current_used'], - 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.nameSpace)) - (&pod), - (&(pod.softLimit)) - (&pod), - (&(pod.hardLimit)) - (&pod), - (&(pod.currentUsed)) - (&pod), - ], - 'itemsize': sizeof(nvmlGetMemoryLimits_v1_t), - }) + cdef nvmlGetMemoryLimits_v1_t *pod = _cyb_calloc(1, sizeof(nvmlGetMemoryLimits_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGetMemoryLimits_v1_t") + try: + return _numpy.dtype({ + 'names': ['name_space', 'soft_limit', 'hard_limit', 'current_used'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.nameSpace)) - (pod), + (&(pod.softLimit)) - (pod), + (&(pod.hardLimit)) - (pod), + (&(pod.currentUsed)) - (pod), + ], + 'itemsize': sizeof(nvmlGetMemoryLimits_v1_t), + }) + finally: + _cyb_free(pod) get_memory_limits_v1_dtype = _get_get_memory_limits_v1_dtype_offsets() @@ -18519,15 +18939,20 @@ cdef class GetMemoryLimits_v1: cdef _get_pmgr_pwr_tuple_dtype_offsets(): - cdef nvmlPmgrPwrTuple_t pod - return _numpy.dtype({ - 'names': ['pwrm_w'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.pwrmW)) - (&pod), - ], - 'itemsize': sizeof(nvmlPmgrPwrTuple_t), - }) + cdef nvmlPmgrPwrTuple_t *pod = _cyb_calloc(1, sizeof(nvmlPmgrPwrTuple_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPmgrPwrTuple_t") + try: + return _numpy.dtype({ + 'names': ['pwrm_w'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.pwrmW)) - (pod), + ], + 'itemsize': sizeof(nvmlPmgrPwrTuple_t), + }) + finally: + _cyb_free(pod) pmgr_pwr_tuple_dtype = _get_pmgr_pwr_tuple_dtype_offsets() cdef object pmgr_pwr_tuple_dtype_record = _numpy.dtype((_numpy.record, pmgr_pwr_tuple_dtype)) @@ -18673,16 +19098,21 @@ cdef class PmgrPwrTuple: cdef _get_rail_metrics_dtype_offsets(): - cdef nvmlRailMetrics_t pod - return _numpy.dtype({ - 'names': ['freqk_hz', 'util_pct'], - 'formats': [_numpy.uint32, _numpy.uint64], - 'offsets': [ - (&(pod.freqkHz)) - (&pod), - (&(pod.utilPct)) - (&pod), - ], - 'itemsize': sizeof(nvmlRailMetrics_t), - }) + cdef nvmlRailMetrics_t *pod = _cyb_calloc(1, sizeof(nvmlRailMetrics_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlRailMetrics_t") + try: + return _numpy.dtype({ + 'names': ['freqk_hz', 'util_pct'], + 'formats': [_numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.freqkHz)) - (pod), + (&(pod.utilPct)) - (pod), + ], + 'itemsize': sizeof(nvmlRailMetrics_t), + }) + finally: + _cyb_free(pod) rail_metrics_dtype = _get_rail_metrics_dtype_offsets() cdef object rail_metrics_dtype_record = _numpy.dtype((_numpy.record, rail_metrics_dtype)) @@ -18841,15 +19271,20 @@ cdef class RailMetrics: cdef _get_pwr_model_metrics_dlppm1x_perf_dtype_offsets(): - cdef nvmlPwrModelMetricsDlppm1xPerf_t pod - return _numpy.dtype({ - 'names': ['perfms'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.perfms)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xPerf_t), - }) + cdef nvmlPwrModelMetricsDlppm1xPerf_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelMetricsDlppm1xPerf_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelMetricsDlppm1xPerf_t") + try: + return _numpy.dtype({ + 'names': ['perfms'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.perfms)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xPerf_t), + }) + finally: + _cyb_free(pod) pwr_model_metrics_dlppm1x_perf_dtype = _get_pwr_model_metrics_dlppm1x_perf_dtype_offsets() cdef object pwr_model_metrics_dlppm1x_perf_dtype_record = _numpy.dtype((_numpy.record, pwr_model_metrics_dlppm1x_perf_dtype)) @@ -18995,16 +19430,21 @@ cdef class PwrModelMetricsDlppm1xPerf: cdef _get_pwr_model_metrics_sample_pfpp1x_dtype_offsets(): - cdef nvmlPwrModelMetricsSamplePfpp1x_t pod - return _numpy.dtype({ - 'names': ['freqk_hz', 'est_tgp_pwrm_w'], - 'formats': [(_numpy.uint32, 16), _numpy.uint32], - 'offsets': [ - (&(pod.freqkHz)) - (&pod), - (&(pod.estTgpPwrmW)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelMetricsSamplePfpp1x_t), - }) + cdef nvmlPwrModelMetricsSamplePfpp1x_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelMetricsSamplePfpp1x_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelMetricsSamplePfpp1x_t") + try: + return _numpy.dtype({ + 'names': ['freqk_hz', 'est_tgp_pwrm_w'], + 'formats': [(_numpy.uint32, 16), _numpy.uint32], + 'offsets': [ + (&(pod.freqkHz)) - (pod), + (&(pod.estTgpPwrmW)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelMetricsSamplePfpp1x_t), + }) + finally: + _cyb_free(pod) pwr_model_metrics_sample_pfpp1x_dtype = _get_pwr_model_metrics_sample_pfpp1x_dtype_offsets() cdef object pwr_model_metrics_sample_pfpp1x_dtype_record = _numpy.dtype((_numpy.record, pwr_model_metrics_sample_pfpp1x_dtype)) @@ -19161,16 +19601,21 @@ cdef class PwrModelMetricsSamplePfpp1x: cdef _get_pwr_model_operating_point_pfpp1x_dtype_offsets(): - cdef nvmlPwrModelOperatingPointPfpp1x_t pod - return _numpy.dtype({ - 'names': ['freqk_hz', 'pwrm_w'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.freqkHz)) - (&pod), - (&(pod.pwrmW)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelOperatingPointPfpp1x_t), - }) + cdef nvmlPwrModelOperatingPointPfpp1x_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelOperatingPointPfpp1x_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelOperatingPointPfpp1x_t") + try: + return _numpy.dtype({ + 'names': ['freqk_hz', 'pwrm_w'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.freqkHz)) - (pod), + (&(pod.pwrmW)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelOperatingPointPfpp1x_t), + }) + finally: + _cyb_free(pod) pwr_model_operating_point_pfpp1x_dtype = _get_pwr_model_operating_point_pfpp1x_dtype_offsets() cdef object pwr_model_operating_point_pfpp1x_dtype_record = _numpy.dtype((_numpy.record, pwr_model_operating_point_pfpp1x_dtype)) @@ -19329,19 +19774,24 @@ cdef class PwrModelOperatingPointPfpp1x: cdef _get_adaptive_tgp_mode_info_v1_dtype_offsets(): - cdef nvmlAdaptiveTgpModeInfo_v1_t pod - return _numpy.dtype({ - 'names': ['in_band_enable_request', 'feature_allowed_by_admin', 'admin_override_enabled', 'enablement_status', 'adjusted_limit_mw'], - 'formats': [_numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.uint32], - 'offsets': [ - (&(pod.inBandEnableRequest)) - (&pod), - (&(pod.featureAllowedByAdmin)) - (&pod), - (&(pod.adminOverrideEnabled)) - (&pod), - (&(pod.enablementStatus)) - (&pod), - (&(pod.adjustedLimitMw)) - (&pod), - ], - 'itemsize': sizeof(nvmlAdaptiveTgpModeInfo_v1_t), - }) + cdef nvmlAdaptiveTgpModeInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlAdaptiveTgpModeInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlAdaptiveTgpModeInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['in_band_enable_request', 'feature_allowed_by_admin', 'admin_override_enabled', 'enablement_status', 'adjusted_limit_mw'], + 'formats': [_numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.uint32], + 'offsets': [ + (&(pod.inBandEnableRequest)) - (pod), + (&(pod.featureAllowedByAdmin)) - (pod), + (&(pod.adminOverrideEnabled)) - (pod), + (&(pod.enablementStatus)) - (pod), + (&(pod.adjustedLimitMw)) - (pod), + ], + 'itemsize': sizeof(nvmlAdaptiveTgpModeInfo_v1_t), + }) + finally: + _cyb_free(pod) adaptive_tgp_mode_info_v1_dtype = _get_adaptive_tgp_mode_info_v1_dtype_offsets() @@ -19502,15 +19952,20 @@ cdef class AdaptiveTgpModeInfo_v1: cdef _get_event_set_get_context_count_v1_dtype_offsets(): - cdef nvmlEventSetGetContextCount_v1_t pod - return _numpy.dtype({ - 'names': ['count'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.count)) - (&pod), - ], - 'itemsize': sizeof(nvmlEventSetGetContextCount_v1_t), - }) + cdef nvmlEventSetGetContextCount_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEventSetGetContextCount_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEventSetGetContextCount_v1_t") + try: + return _numpy.dtype({ + 'names': ['count'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.count)) - (pod), + ], + 'itemsize': sizeof(nvmlEventSetGetContextCount_v1_t), + }) + finally: + _cyb_free(pod) event_set_get_context_count_v1_dtype = _get_event_set_get_context_count_v1_dtype_offsets() @@ -19627,19 +20082,24 @@ cdef class EventSetGetContextCount_v1: cdef _get_event_set_get_context_info_v1_dtype_offsets(): - cdef nvmlEventSetGetContextInfo_v1_t pod - return _numpy.dtype({ - 'names': ['index', 'nvml_gpu_operational_event_context_type', 'source_event_context_type', 'data_size', 'data_format_version'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint16], - 'offsets': [ - (&(pod.index)) - (&pod), - (&(pod.nvmlGpuOperationalEventContextType)) - (&pod), - (&(pod.sourceEventContextType)) - (&pod), - (&(pod.dataSize)) - (&pod), - (&(pod.dataFormatVersion)) - (&pod), - ], - 'itemsize': sizeof(nvmlEventSetGetContextInfo_v1_t), - }) + cdef nvmlEventSetGetContextInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEventSetGetContextInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEventSetGetContextInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['index', 'nvml_gpu_operational_event_context_type', 'source_event_context_type', 'data_size', 'data_format_version'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint16], + 'offsets': [ + (&(pod.index)) - (pod), + (&(pod.nvmlGpuOperationalEventContextType)) - (pod), + (&(pod.sourceEventContextType)) - (pod), + (&(pod.dataSize)) - (pod), + (&(pod.dataFormatVersion)) - (pod), + ], + 'itemsize': sizeof(nvmlEventSetGetContextInfo_v1_t), + }) + finally: + _cyb_free(pod) event_set_get_context_info_v1_dtype = _get_event_set_get_context_info_v1_dtype_offsets() @@ -19800,16 +20260,21 @@ cdef class EventSetGetContextInfo_v1: cdef _get_event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype_offsets(): - cdef nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t pod - return _numpy.dtype({ - 'names': ['index', 'xid_code'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.index)) - (&pod), - (&(pod.xidCode)) - (&pod), - ], - 'itemsize': sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t), - }) + cdef nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t") + try: + return _numpy.dtype({ + 'names': ['index', 'xid_code'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.index)) - (pod), + (&(pod.xidCode)) - (pod), + ], + 'itemsize': sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t), + }) + finally: + _cyb_free(pod) event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype = _get_event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype_offsets() @@ -19937,16 +20402,21 @@ cdef class EventSetGetGpuOperationalEventContextLegacyXid_v1: cdef _get_gpu_fabric_clique_v1_dtype_offsets(): - cdef nvmlGpuFabricClique_v1_t pod - return _numpy.dtype({ - 'names': ['type', 'id'], - 'formats': [_numpy.uint8, _numpy.uint32], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.id)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuFabricClique_v1_t), - }) + cdef nvmlGpuFabricClique_v1_t *pod = _cyb_calloc(1, sizeof(nvmlGpuFabricClique_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuFabricClique_v1_t") + try: + return _numpy.dtype({ + 'names': ['type', 'id'], + 'formats': [_numpy.uint8, _numpy.uint32], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.id)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuFabricClique_v1_t), + }) + finally: + _cyb_free(pod) gpu_fabric_clique_v1_dtype = _get_gpu_fabric_clique_v1_dtype_offsets() @@ -20086,17 +20556,22 @@ cdef class GpuFabricClique_v1: cdef _get_gpu_operational_event_config_v1_dtype_offsets(): - cdef nvmlGpuOperationalEventConfig_v1_t pod - return _numpy.dtype({ - 'names': ['uuid', 'min_log_level', 'min_severity'], - 'formats': [(_numpy.int8, 96), _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.uuid)) - (&pod), - (&(pod.minLogLevel)) - (&pod), - (&(pod.minSeverity)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuOperationalEventConfig_v1_t), - }) + cdef nvmlGpuOperationalEventConfig_v1_t *pod = _cyb_calloc(1, sizeof(nvmlGpuOperationalEventConfig_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuOperationalEventConfig_v1_t") + try: + return _numpy.dtype({ + 'names': ['uuid', 'min_log_level', 'min_severity'], + 'formats': [(_numpy.int8, 96), _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.uuid)) - (pod), + (&(pod.minLogLevel)) - (pod), + (&(pod.minSeverity)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuOperationalEventConfig_v1_t), + }) + finally: + _cyb_free(pod) gpu_operational_event_config_v1_dtype = _get_gpu_operational_event_config_v1_dtype_offsets() @@ -20239,39 +20714,44 @@ cdef class GpuOperationalEventConfig_v1: cdef _get_event_set_wait_v3_dtype_offsets(): - cdef nvmlEventSetWait_v3_t pod - return _numpy.dtype({ - 'names': ['timeout_ms', 'data_type', 'uuid', 'source_module', 'event_type', 'event_data', 'group_cursor', 'instance_id', 'timestamp_usec', 'trace_id', 'gpu_instance_id', 'compute_instance_id', 'severity', 'category_id', 'module_event_code', 'scope', 'originator', 'module_instance', 'chiplet_id', 'log_level', 'attributes', 'group_cper_size', 'group_attributes', 'group_size', 'group_index'], - 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 96), (_numpy.int8, 16), _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint8, _numpy.uint8], - 'offsets': [ - (&(pod.timeoutMs)) - (&pod), - (&(pod.dataType)) - (&pod), - (&(pod.uuid)) - (&pod), - (&(pod.sourceModule)) - (&pod), - (&(pod.eventType)) - (&pod), - (&(pod.eventData)) - (&pod), - (&(pod.groupCursor)) - (&pod), - (&(pod.instanceId)) - (&pod), - (&(pod.timestampUsec)) - (&pod), - (&(pod.traceId)) - (&pod), - (&(pod.gpuInstanceId)) - (&pod), - (&(pod.computeInstanceId)) - (&pod), - (&(pod.severity)) - (&pod), - (&(pod.categoryId)) - (&pod), - (&(pod.moduleEventCode)) - (&pod), - (&(pod.scope)) - (&pod), - (&(pod.originator)) - (&pod), - (&(pod.moduleInstance)) - (&pod), - (&(pod.chipletId)) - (&pod), - (&(pod.logLevel)) - (&pod), - (&(pod.attributes)) - (&pod), - (&(pod.groupCperSize)) - (&pod), - (&(pod.groupAttributes)) - (&pod), - (&(pod.groupSize)) - (&pod), - (&(pod.groupIndex)) - (&pod), - ], - 'itemsize': sizeof(nvmlEventSetWait_v3_t), - }) + cdef nvmlEventSetWait_v3_t *pod = _cyb_calloc(1, sizeof(nvmlEventSetWait_v3_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEventSetWait_v3_t") + try: + return _numpy.dtype({ + 'names': ['timeout_ms', 'data_type', 'uuid', 'source_module', 'event_type', 'event_data', 'group_cursor', 'instance_id', 'timestamp_usec', 'trace_id', 'gpu_instance_id', 'compute_instance_id', 'severity', 'category_id', 'module_event_code', 'scope', 'originator', 'module_instance', 'chiplet_id', 'log_level', 'attributes', 'group_cper_size', 'group_attributes', 'group_size', 'group_index'], + 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 96), (_numpy.int8, 16), _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint8, _numpy.uint8], + 'offsets': [ + (&(pod.timeoutMs)) - (pod), + (&(pod.dataType)) - (pod), + (&(pod.uuid)) - (pod), + (&(pod.sourceModule)) - (pod), + (&(pod.eventType)) - (pod), + (&(pod.eventData)) - (pod), + (&(pod.groupCursor)) - (pod), + (&(pod.instanceId)) - (pod), + (&(pod.timestampUsec)) - (pod), + (&(pod.traceId)) - (pod), + (&(pod.gpuInstanceId)) - (pod), + (&(pod.computeInstanceId)) - (pod), + (&(pod.severity)) - (pod), + (&(pod.categoryId)) - (pod), + (&(pod.moduleEventCode)) - (pod), + (&(pod.scope)) - (pod), + (&(pod.originator)) - (pod), + (&(pod.moduleInstance)) - (pod), + (&(pod.chipletId)) - (pod), + (&(pod.logLevel)) - (pod), + (&(pod.attributes)) - (pod), + (&(pod.groupCperSize)) - (pod), + (&(pod.groupAttributes)) - (pod), + (&(pod.groupSize)) - (pod), + (&(pod.groupIndex)) - (pod), + ], + 'itemsize': sizeof(nvmlEventSetWait_v3_t), + }) + finally: + _cyb_free(pod) event_set_wait_v3_dtype = _get_event_set_wait_v3_dtype_offsets() @@ -20660,17 +21140,22 @@ cdef class EventSetWait_v3: cdef _get_nvlink_set_bw_mode_async_v1_dtype_offsets(): - cdef nvmlNvlinkSetBwModeAsync_v1_t pod - return _numpy.dtype({ - 'names': ['b_set_best', 'bw_mode', 'async_poll_timeout_ms'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.bSetBest)) - (&pod), - (&(pod.bwMode)) - (&pod), - (&(pod.asyncPollTimeoutMs)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkSetBwModeAsync_v1_t), - }) + cdef nvmlNvlinkSetBwModeAsync_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkSetBwModeAsync_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkSetBwModeAsync_v1_t") + try: + return _numpy.dtype({ + 'names': ['b_set_best', 'bw_mode', 'async_poll_timeout_ms'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.bSetBest)) - (pod), + (&(pod.bwMode)) - (pod), + (&(pod.asyncPollTimeoutMs)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkSetBwModeAsync_v1_t), + }) + finally: + _cyb_free(pod) nvlink_set_bw_mode_async_v1_dtype = _get_nvlink_set_bw_mode_async_v1_dtype_offsets() @@ -20809,19 +21294,24 @@ cdef class NvlinkSetBwModeAsync_v1: cdef _get_nvlink_telemetry_sample_v1_dtype_offsets(): - cdef nvmlNvlinkTelemetrySample_v1_t pod - return _numpy.dtype({ - 'names': ['link_id', 'sample_type', 'sample_count', 'samples', 'nvml_return'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.int32], - 'offsets': [ - (&(pod.linkId)) - (&pod), - (&(pod.sampleType)) - (&pod), - (&(pod.sampleCount)) - (&pod), - (&(pod.samples)) - (&pod), - (&(pod.nvmlReturn)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkTelemetrySample_v1_t), - }) + cdef nvmlNvlinkTelemetrySample_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkTelemetrySample_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkTelemetrySample_v1_t") + try: + return _numpy.dtype({ + 'names': ['link_id', 'sample_type', 'sample_count', 'samples', 'nvml_return'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.int32], + 'offsets': [ + (&(pod.linkId)) - (pod), + (&(pod.sampleType)) - (pod), + (&(pod.sampleCount)) - (pod), + (&(pod.samples)) - (pod), + (&(pod.nvmlReturn)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkTelemetrySample_v1_t), + }) + finally: + _cyb_free(pod) nvlink_telemetry_sample_v1_dtype = _get_nvlink_telemetry_sample_v1_dtype_offsets() cdef object nvlink_telemetry_sample_v1_dtype_record = _numpy.dtype((_numpy.record, nvlink_telemetry_sample_v1_dtype)) @@ -21019,16 +21509,21 @@ cdef class NvlinkTelemetrySample_v1: cdef _get_ecc_bank_remapper_histogram_v1_dtype_offsets(): - cdef nvmlEccBankRemapperHistogram_v1_t pod - return _numpy.dtype({ - 'names': ['max_spare_group_count', 'no_spare_group_count'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.maxSpareGroupCount)) - (&pod), - (&(pod.noSpareGroupCount)) - (&pod), - ], - 'itemsize': sizeof(nvmlEccBankRemapperHistogram_v1_t), - }) + cdef nvmlEccBankRemapperHistogram_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEccBankRemapperHistogram_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEccBankRemapperHistogram_v1_t") + try: + return _numpy.dtype({ + 'names': ['max_spare_group_count', 'no_spare_group_count'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.maxSpareGroupCount)) - (pod), + (&(pod.noSpareGroupCount)) - (pod), + ], + 'itemsize': sizeof(nvmlEccBankRemapperHistogram_v1_t), + }) + finally: + _cyb_free(pod) ecc_bank_remapper_histogram_v1_dtype = _get_ecc_bank_remapper_histogram_v1_dtype_offsets() @@ -21168,15 +21663,20 @@ cdef class EccBankRemapperHistogram_v1: cdef _get_gpu_uptime_v1_dtype_offsets(): - cdef nvmlGpuUptime_v1_t pod - return _numpy.dtype({ - 'names': ['uptime'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.uptime)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuUptime_v1_t), - }) + cdef nvmlGpuUptime_v1_t *pod = _cyb_calloc(1, sizeof(nvmlGpuUptime_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuUptime_v1_t") + try: + return _numpy.dtype({ + 'names': ['uptime'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.uptime)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuUptime_v1_t), + }) + finally: + _cyb_free(pod) gpu_uptime_v1_dtype = _get_gpu_uptime_v1_dtype_offsets() @@ -21293,20 +21793,25 @@ cdef class GpuUptime_v1: cdef _get_system_conf_compute_settings_v2_dtype_offsets(): - cdef nvmlSystemConfComputeSettings_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'environment', 'cc_feature', 'dev_tools_mode', 'multi_gpu_mode', 'tdisp_state'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.environment)) - (&pod), - (&(pod.ccFeature)) - (&pod), - (&(pod.devToolsMode)) - (&pod), - (&(pod.multiGpuMode)) - (&pod), - (&(pod.tdispState)) - (&pod), - ], - 'itemsize': sizeof(nvmlSystemConfComputeSettings_v2_t), - }) + cdef nvmlSystemConfComputeSettings_v2_t *pod = _cyb_calloc(1, sizeof(nvmlSystemConfComputeSettings_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlSystemConfComputeSettings_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'environment', 'cc_feature', 'dev_tools_mode', 'multi_gpu_mode', 'tdisp_state'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.environment)) - (pod), + (&(pod.ccFeature)) - (pod), + (&(pod.devToolsMode)) - (pod), + (&(pod.multiGpuMode)) - (pod), + (&(pod.tdispState)) - (pod), + ], + 'itemsize': sizeof(nvmlSystemConfComputeSettings_v2_t), + }) + finally: + _cyb_free(pod) system_conf_compute_settings_v2_dtype = _get_system_conf_compute_settings_v2_dtype_offsets() @@ -21478,18 +21983,23 @@ cdef class SystemConfComputeSettings_v2: cdef _get_nvlink_get_remap_table_info_v1_dtype_offsets(): - cdef nvmlNvlinkGetRemapTableInfo_v1_t pod - return _numpy.dtype({ - 'names': ['alid', 'fla_remap_tab_addr', 'gpa_remap_tab_addr', 'remap_tab_size'], - 'formats': [_numpy.uint32, (_numpy.uint32, 4096), (_numpy.uint32, 4096), _numpy.uint32], - 'offsets': [ - (&(pod.alid)) - (&pod), - (&(pod.flaRemapTabAddr)) - (&pod), - (&(pod.gpaRemapTabAddr)) - (&pod), - (&(pod.remapTabSize)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkGetRemapTableInfo_v1_t), - }) + cdef nvmlNvlinkGetRemapTableInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkGetRemapTableInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkGetRemapTableInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['alid', 'fla_remap_tab_addr', 'gpa_remap_tab_addr', 'remap_tab_size'], + 'formats': [_numpy.uint32, (_numpy.uint32, 4096), (_numpy.uint32, 4096), _numpy.uint32], + 'offsets': [ + (&(pod.alid)) - (pod), + (&(pod.flaRemapTabAddr)) - (pod), + (&(pod.gpaRemapTabAddr)) - (pod), + (&(pod.remapTabSize)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkGetRemapTableInfo_v1_t), + }) + finally: + _cyb_free(pod) nvlink_get_remap_table_info_v1_dtype = _get_nvlink_get_remap_table_info_v1_dtype_offsets() @@ -21650,15 +22160,20 @@ cdef class NvlinkGetRemapTableInfo_v1: cdef _get_nvlink_set_nvle_ready_v1_dtype_offsets(): - cdef nvmlNvlinkSetNvleReady_v1_t pod - return _numpy.dtype({ - 'names': ['b_nvle_ready'], - 'formats': [_numpy.uint8], - 'offsets': [ - (&(pod.bNvleReady)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkSetNvleReady_v1_t), - }) + cdef nvmlNvlinkSetNvleReady_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkSetNvleReady_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkSetNvleReady_v1_t") + try: + return _numpy.dtype({ + 'names': ['b_nvle_ready'], + 'formats': [_numpy.uint8], + 'offsets': [ + (&(pod.bNvleReady)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkSetNvleReady_v1_t), + }) + finally: + _cyb_free(pod) nvlink_set_nvle_ready_v1_dtype = _get_nvlink_set_nvle_ready_v1_dtype_offsets() @@ -21775,16 +22290,21 @@ cdef class NvlinkSetNvleReady_v1: cdef _get_nvlink_lock_remap_table_v1_dtype_offsets(): - cdef nvmlNvlinkLockRemapTable_v1_t pod - return _numpy.dtype({ - 'names': ['b_remap_table_locked', 'b_remap_table_lock_disabled'], - 'formats': [_numpy.uint8, _numpy.uint8], - 'offsets': [ - (&(pod.bRemapTableLocked)) - (&pod), - (&(pod.bRemapTableLockDisabled)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkLockRemapTable_v1_t), - }) + cdef nvmlNvlinkLockRemapTable_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkLockRemapTable_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkLockRemapTable_v1_t") + try: + return _numpy.dtype({ + 'names': ['b_remap_table_locked', 'b_remap_table_lock_disabled'], + 'formats': [_numpy.uint8, _numpy.uint8], + 'offsets': [ + (&(pod.bRemapTableLocked)) - (pod), + (&(pod.bRemapTableLockDisabled)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkLockRemapTable_v1_t), + }) + finally: + _cyb_free(pod) nvlink_lock_remap_table_v1_dtype = _get_nvlink_lock_remap_table_v1_dtype_offsets() @@ -21912,16 +22432,21 @@ cdef class NvlinkLockRemapTable_v1: cdef _get_nvlink_nvle_private_info_v1_dtype_offsets(): - cdef nvmlNvlinkNvlePrivateInfo_v1_t pod - return _numpy.dtype({ - 'names': ['data_', 'size_'], - 'formats': [(_numpy.uint8, 256), _numpy.uint32], - 'offsets': [ - (&(pod.data)) - (&pod), - (&(pod.size)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkNvlePrivateInfo_v1_t), - }) + cdef nvmlNvlinkNvlePrivateInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkNvlePrivateInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkNvlePrivateInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['data_', 'size_'], + 'formats': [(_numpy.uint8, 256), _numpy.uint32], + 'offsets': [ + (&(pod.data)) - (pod), + (&(pod.size)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkNvlePrivateInfo_v1_t), + }) + finally: + _cyb_free(pod) nvlink_nvle_private_info_v1_dtype = _get_nvlink_nvle_private_info_v1_dtype_offsets() @@ -22061,16 +22586,21 @@ cdef class NvlinkNvlePrivateInfo_v1: cdef _get_excluded_device_info_dtype_offsets(): - cdef nvmlExcludedDeviceInfo_t pod - return _numpy.dtype({ - 'names': ['pci_info', 'uuid'], - 'formats': [pci_info_dtype, (_numpy.int8, 80)], - 'offsets': [ - (&(pod.pciInfo)) - (&pod), - (&(pod.uuid)) - (&pod), - ], - 'itemsize': sizeof(nvmlExcludedDeviceInfo_t), - }) + cdef nvmlExcludedDeviceInfo_t *pod = _cyb_calloc(1, sizeof(nvmlExcludedDeviceInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlExcludedDeviceInfo_t") + try: + return _numpy.dtype({ + 'names': ['pci_info', 'uuid'], + 'formats': [pci_info_dtype, (_numpy.int8, 80)], + 'offsets': [ + (&(pod.pciInfo)) - (pod), + (&(pod.uuid)) - (pod), + ], + 'itemsize': sizeof(nvmlExcludedDeviceInfo_t), + }) + finally: + _cyb_free(pod) excluded_device_info_dtype = _get_excluded_device_info_dtype_offsets() @@ -22207,18 +22737,23 @@ cdef class ExcludedDeviceInfo: cdef _get_process_detail_list_v1_dtype_offsets(): - cdef nvmlProcessDetailList_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'mode', 'num_proc_array_entries', 'proc_array'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.mode)) - (&pod), - (&(pod.numProcArrayEntries)) - (&pod), - (&(pod.procArray)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessDetailList_v1_t), - }) + cdef nvmlProcessDetailList_v1_t *pod = _cyb_calloc(1, sizeof(nvmlProcessDetailList_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessDetailList_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'mode', 'num_proc_array_entries', 'proc_array'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.mode)) - (pod), + (&(pod.numProcArrayEntries)) - (pod), + (&(pod.procArray)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessDetailList_v1_t), + }) + finally: + _cyb_free(pod) process_detail_list_v1_dtype = _get_process_detail_list_v1_dtype_offsets() @@ -22370,16 +22905,21 @@ cdef class ProcessDetailList_v1: cdef _get_bridge_chip_hierarchy_dtype_offsets(): - cdef nvmlBridgeChipHierarchy_t pod - return _numpy.dtype({ - 'names': ['bridge_count', 'bridge_chip_info'], - 'formats': [_numpy.uint8, (bridge_chip_info_dtype, 128)], - 'offsets': [ - (&(pod.bridgeCount)) - (&pod), - (&(pod.bridgeChipInfo)) - (&pod), - ], - 'itemsize': sizeof(nvmlBridgeChipHierarchy_t), - }) + cdef nvmlBridgeChipHierarchy_t *pod = _cyb_calloc(1, sizeof(nvmlBridgeChipHierarchy_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlBridgeChipHierarchy_t") + try: + return _numpy.dtype({ + 'names': ['bridge_count', 'bridge_chip_info'], + 'formats': [_numpy.uint8, (bridge_chip_info_dtype, 128)], + 'offsets': [ + (&(pod.bridgeCount)) - (pod), + (&(pod.bridgeChipInfo)) - (pod), + ], + 'itemsize': sizeof(nvmlBridgeChipHierarchy_t), + }) + finally: + _cyb_free(pod) bridge_chip_hierarchy_dtype = _get_bridge_chip_hierarchy_dtype_offsets() @@ -22507,16 +23047,21 @@ cdef class BridgeChipHierarchy: cdef _get_sample_dtype_offsets(): - cdef nvmlSample_t pod - return _numpy.dtype({ - 'names': ['time_stamp', 'sample_value'], - 'formats': [_numpy.uint64, value_dtype], - 'offsets': [ - (&(pod.timeStamp)) - (&pod), - (&(pod.sampleValue)) - (&pod), - ], - 'itemsize': sizeof(nvmlSample_t), - }) + cdef nvmlSample_t *pod = _cyb_calloc(1, sizeof(nvmlSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlSample_t") + try: + return _numpy.dtype({ + 'names': ['time_stamp', 'sample_value'], + 'formats': [_numpy.uint64, value_dtype], + 'offsets': [ + (&(pod.timeStamp)) - (pod), + (&(pod.sampleValue)) - (pod), + ], + 'itemsize': sizeof(nvmlSample_t), + }) + finally: + _cyb_free(pod) sample_dtype = _get_sample_dtype_offsets() cdef object sample_dtype_record = _numpy.dtype((_numpy.record, sample_dtype)) @@ -22673,20 +23218,25 @@ cdef class Sample: cdef _get_vgpu_instance_utilization_sample_dtype_offsets(): - cdef nvmlVgpuInstanceUtilizationSample_t pod - return _numpy.dtype({ - 'names': ['vgpu_instance', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], - 'formats': [_numpy.uint32, _numpy.uint64, value_dtype, value_dtype, value_dtype, value_dtype], - 'offsets': [ - (&(pod.vgpuInstance)) - (&pod), - (&(pod.timeStamp)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuInstanceUtilizationSample_t), - }) + cdef nvmlVgpuInstanceUtilizationSample_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuInstanceUtilizationSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuInstanceUtilizationSample_t") + try: + return _numpy.dtype({ + 'names': ['vgpu_instance', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], + 'formats': [_numpy.uint32, _numpy.uint64, value_dtype, value_dtype, value_dtype, value_dtype], + 'offsets': [ + (&(pod.vgpuInstance)) - (pod), + (&(pod.timeStamp)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuInstanceUtilizationSample_t), + }) + finally: + _cyb_free(pod) vgpu_instance_utilization_sample_dtype = _get_vgpu_instance_utilization_sample_dtype_offsets() cdef object vgpu_instance_utilization_sample_dtype_record = _numpy.dtype((_numpy.record, vgpu_instance_utilization_sample_dtype)) @@ -22889,22 +23439,27 @@ cdef class VgpuInstanceUtilizationSample: cdef _get_vgpu_instance_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuInstanceUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['time_stamp', 'vgpu_instance', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], - 'formats': [_numpy.uint64, _numpy.uint32, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype], - 'offsets': [ - (&(pod.timeStamp)) - (&pod), - (&(pod.vgpuInstance)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - (&(pod.jpgUtil)) - (&pod), - (&(pod.ofaUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t), - }) + cdef nvmlVgpuInstanceUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuInstanceUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['time_stamp', 'vgpu_instance', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], + 'formats': [_numpy.uint64, _numpy.uint32, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype], + 'offsets': [ + (&(pod.timeStamp)) - (pod), + (&(pod.vgpuInstance)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + (&(pod.jpgUtil)) - (pod), + (&(pod.ofaUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_instance_utilization_info_v1_dtype = _get_vgpu_instance_utilization_info_v1_dtype_offsets() cdef object vgpu_instance_utilization_info_v1_dtype_record = _numpy.dtype((_numpy.record, vgpu_instance_utilization_info_v1_dtype)) @@ -23129,21 +23684,26 @@ cdef class VgpuInstanceUtilizationInfo_v1: cdef _get_field_value_dtype_offsets(): - cdef nvmlFieldValue_t pod - return _numpy.dtype({ - 'names': ['field_id', 'scope_id', 'timestamp', 'latency_usec', 'value_type', 'nvml_return', 'value'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int64, _numpy.int64, _numpy.int32, _numpy.int32, value_dtype], - 'offsets': [ - (&(pod.fieldId)) - (&pod), - (&(pod.scopeId)) - (&pod), - (&(pod.timestamp)) - (&pod), - (&(pod.latencyUsec)) - (&pod), - (&(pod.valueType)) - (&pod), - (&(pod.nvmlReturn)) - (&pod), - (&(pod.value)) - (&pod), - ], - 'itemsize': sizeof(nvmlFieldValue_t), - }) + cdef nvmlFieldValue_t *pod = _cyb_calloc(1, sizeof(nvmlFieldValue_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlFieldValue_t") + try: + return _numpy.dtype({ + 'names': ['field_id', 'scope_id', 'timestamp', 'latency_usec', 'value_type', 'nvml_return', 'value'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int64, _numpy.int64, _numpy.int32, _numpy.int32, value_dtype], + 'offsets': [ + (&(pod.fieldId)) - (pod), + (&(pod.scopeId)) - (pod), + (&(pod.timestamp)) - (pod), + (&(pod.latencyUsec)) - (pod), + (&(pod.valueType)) - (pod), + (&(pod.nvmlReturn)) - (pod), + (&(pod.value)) - (pod), + ], + 'itemsize': sizeof(nvmlFieldValue_t), + }) + finally: + _cyb_free(pod) field_value_dtype = _get_field_value_dtype_offsets() cdef object field_value_dtype_record = _numpy.dtype((_numpy.record, field_value_dtype)) @@ -23365,17 +23925,22 @@ cdef class FieldValue: cdef _get_prm_counter_value_v1_dtype_offsets(): - cdef nvmlPRMCounterValue_v1_t pod - return _numpy.dtype({ - 'names': ['status', 'output_type', 'output_value'], - 'formats': [_numpy.int32, _numpy.int32, value_dtype], - 'offsets': [ - (&(pod.status)) - (&pod), - (&(pod.outputType)) - (&pod), - (&(pod.outputValue)) - (&pod), - ], - 'itemsize': sizeof(nvmlPRMCounterValue_v1_t), - }) + cdef nvmlPRMCounterValue_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPRMCounterValue_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPRMCounterValue_v1_t") + try: + return _numpy.dtype({ + 'names': ['status', 'output_type', 'output_value'], + 'formats': [_numpy.int32, _numpy.int32, value_dtype], + 'offsets': [ + (&(pod.status)) - (pod), + (&(pod.outputType)) - (pod), + (&(pod.outputValue)) - (pod), + ], + 'itemsize': sizeof(nvmlPRMCounterValue_v1_t), + }) + finally: + _cyb_free(pod) prm_counter_value_v1_dtype = _get_prm_counter_value_v1_dtype_offsets() @@ -23531,16 +24096,21 @@ cdef class PRMCounterValue_v1: cdef _get_gpu_thermal_settings_dtype_offsets(): - cdef nvmlGpuThermalSettings_t pod - return _numpy.dtype({ - 'names': ['count', 'sensor'], - 'formats': [_numpy.uint32, (_py_anon_pod0_dtype, 3)], - 'offsets': [ - (&(pod.count)) - (&pod), - (&(pod.sensor)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuThermalSettings_t), - }) + cdef nvmlGpuThermalSettings_t *pod = _cyb_calloc(1, sizeof(nvmlGpuThermalSettings_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuThermalSettings_t") + try: + return _numpy.dtype({ + 'names': ['count', 'sensor'], + 'formats': [_numpy.uint32, (_py_anon_pod0_dtype, 3)], + 'offsets': [ + (&(pod.count)) - (pod), + (&(pod.sensor)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuThermalSettings_t), + }) + finally: + _cyb_free(pod) gpu_thermal_settings_dtype = _get_gpu_thermal_settings_dtype_offsets() @@ -23676,17 +24246,22 @@ cdef class GpuThermalSettings: cdef _get_clk_mon_status_dtype_offsets(): - cdef nvmlClkMonStatus_t pod - return _numpy.dtype({ - 'names': ['b_global_status', 'clk_mon_list_size', 'clk_mon_list'], - 'formats': [_numpy.uint32, _numpy.uint32, (clk_mon_fault_info_dtype, 32)], - 'offsets': [ - (&(pod.bGlobalStatus)) - (&pod), - (&(pod.clkMonListSize)) - (&pod), - (&(pod.clkMonList)) - (&pod), - ], - 'itemsize': sizeof(nvmlClkMonStatus_t), - }) + cdef nvmlClkMonStatus_t *pod = _cyb_calloc(1, sizeof(nvmlClkMonStatus_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlClkMonStatus_t") + try: + return _numpy.dtype({ + 'names': ['b_global_status', 'clk_mon_list_size', 'clk_mon_list'], + 'formats': [_numpy.uint32, _numpy.uint32, (clk_mon_fault_info_dtype, 32)], + 'offsets': [ + (&(pod.bGlobalStatus)) - (pod), + (&(pod.clkMonListSize)) - (pod), + (&(pod.clkMonList)) - (pod), + ], + 'itemsize': sizeof(nvmlClkMonStatus_t), + }) + finally: + _cyb_free(pod) clk_mon_status_dtype = _get_clk_mon_status_dtype_offsets() @@ -23825,18 +24400,23 @@ cdef class ClkMonStatus: cdef _get_processes_utilization_info_v1_dtype_offsets(): - cdef nvmlProcessesUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'process_samples_count', 'last_seen_time_stamp', 'proc_util_array'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.processSamplesCount)) - (&pod), - (&(pod.lastSeenTimeStamp)) - (&pod), - (&(pod.procUtilArray)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessesUtilizationInfo_v1_t), - }) + cdef nvmlProcessesUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessesUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'process_samples_count', 'last_seen_time_stamp', 'proc_util_array'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.processSamplesCount)) - (pod), + (&(pod.lastSeenTimeStamp)) - (pod), + (&(pod.procUtilArray)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessesUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) processes_utilization_info_v1_dtype = _get_processes_utilization_info_v1_dtype_offsets() @@ -23988,16 +24568,21 @@ cdef class ProcessesUtilizationInfo_v1: cdef _get_gpu_dynamic_pstates_info_dtype_offsets(): - cdef nvmlGpuDynamicPstatesInfo_t pod - return _numpy.dtype({ - 'names': ['flags_', 'utilization'], - 'formats': [_numpy.uint32, (_py_anon_pod1_dtype, 8)], - 'offsets': [ - (&(pod.flags)) - (&pod), - (&(pod.utilization)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuDynamicPstatesInfo_t), - }) + cdef nvmlGpuDynamicPstatesInfo_t *pod = _cyb_calloc(1, sizeof(nvmlGpuDynamicPstatesInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuDynamicPstatesInfo_t") + try: + return _numpy.dtype({ + 'names': ['flags_', 'utilization'], + 'formats': [_numpy.uint32, (_py_anon_pod1_dtype, 8)], + 'offsets': [ + (&(pod.flags)) - (pod), + (&(pod.utilization)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuDynamicPstatesInfo_t), + }) + finally: + _cyb_free(pod) gpu_dynamic_pstates_info_dtype = _get_gpu_dynamic_pstates_info_dtype_offsets() @@ -24133,18 +24718,23 @@ cdef class GpuDynamicPstatesInfo: cdef _get_vgpu_processes_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuProcessesUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'vgpu_process_count', 'last_seen_time_stamp', 'vgpu_proc_util_array'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.vgpuProcessCount)) - (&pod), - (&(pod.lastSeenTimeStamp)) - (&pod), - (&(pod.vgpuProcUtilArray)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), - }) + cdef nvmlVgpuProcessesUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuProcessesUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'vgpu_process_count', 'last_seen_time_stamp', 'vgpu_proc_util_array'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.vgpuProcessCount)) - (pod), + (&(pod.lastSeenTimeStamp)) - (pod), + (&(pod.vgpuProcUtilArray)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_processes_utilization_info_v1_dtype = _get_vgpu_processes_utilization_info_v1_dtype_offsets() @@ -24296,16 +24886,21 @@ cdef class VgpuProcessesUtilizationInfo_v1: cdef _get_vgpu_scheduler_params_dtype_offsets(): - cdef nvmlVgpuSchedulerParams_t pod - return _numpy.dtype({ - 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], - 'formats': [_py_anon_pod2_dtype, _py_anon_pod3_dtype], - 'offsets': [ - (&(pod.vgpuSchedDataWithARR)) - (&pod), - (&(pod.vgpuSchedData)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerParams_t), - }) + cdef nvmlVgpuSchedulerParams_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerParams_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerParams_t") + try: + return _numpy.dtype({ + 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], + 'formats': [_py_anon_pod2_dtype, _py_anon_pod3_dtype], + 'offsets': [ + (&(pod.vgpuSchedDataWithARR)) - (pod), + (&(pod.vgpuSchedData)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerParams_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_params_dtype = _get_vgpu_scheduler_params_dtype_offsets() @@ -24455,16 +25050,21 @@ cdef class VgpuSchedulerParams: cdef _get_vgpu_scheduler_set_params_dtype_offsets(): - cdef nvmlVgpuSchedulerSetParams_t pod - return _numpy.dtype({ - 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], - 'formats': [_py_anon_pod4_dtype, _py_anon_pod5_dtype], - 'offsets': [ - (&(pod.vgpuSchedDataWithARR)) - (&pod), - (&(pod.vgpuSchedData)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerSetParams_t), - }) + cdef nvmlVgpuSchedulerSetParams_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerSetParams_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerSetParams_t") + try: + return _numpy.dtype({ + 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], + 'formats': [_py_anon_pod4_dtype, _py_anon_pod5_dtype], + 'offsets': [ + (&(pod.vgpuSchedDataWithARR)) - (pod), + (&(pod.vgpuSchedData)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerSetParams_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_set_params_dtype = _get_vgpu_scheduler_set_params_dtype_offsets() @@ -24614,17 +25214,22 @@ cdef class VgpuSchedulerSetParams: cdef _get_vgpu_license_info_dtype_offsets(): - cdef nvmlVgpuLicenseInfo_t pod - return _numpy.dtype({ - 'names': ['is_licensed', 'license_expiry', 'current_state'], - 'formats': [_numpy.uint8, vgpu_license_expiry_dtype, _numpy.uint32], - 'offsets': [ - (&(pod.isLicensed)) - (&pod), - (&(pod.licenseExpiry)) - (&pod), - (&(pod.currentState)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuLicenseInfo_t), - }) + cdef nvmlVgpuLicenseInfo_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuLicenseInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuLicenseInfo_t") + try: + return _numpy.dtype({ + 'names': ['is_licensed', 'license_expiry', 'current_state'], + 'formats': [_numpy.uint8, vgpu_license_expiry_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.isLicensed)) - (pod), + (&(pod.licenseExpiry)) - (pod), + (&(pod.currentState)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuLicenseInfo_t), + }) + finally: + _cyb_free(pod) vgpu_license_info_dtype = _get_vgpu_license_info_dtype_offsets() @@ -24768,20 +25373,25 @@ cdef class VgpuLicenseInfo: cdef _get_grid_licensable_feature_dtype_offsets(): - cdef nvmlGridLicensableFeature_t pod - return _numpy.dtype({ - 'names': ['feature_code', 'feature_state', 'license_info', 'product_name', 'feature_enabled', 'license_expiry'], - 'formats': [_numpy.int32, _numpy.uint32, (_numpy.int8, 128), (_numpy.int8, 128), _numpy.uint32, grid_license_expiry_dtype], - 'offsets': [ - (&(pod.featureCode)) - (&pod), - (&(pod.featureState)) - (&pod), - (&(pod.licenseInfo)) - (&pod), - (&(pod.productName)) - (&pod), - (&(pod.featureEnabled)) - (&pod), - (&(pod.licenseExpiry)) - (&pod), - ], - 'itemsize': sizeof(nvmlGridLicensableFeature_t), - }) + cdef nvmlGridLicensableFeature_t *pod = _cyb_calloc(1, sizeof(nvmlGridLicensableFeature_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGridLicensableFeature_t") + try: + return _numpy.dtype({ + 'names': ['feature_code', 'feature_state', 'license_info', 'product_name', 'feature_enabled', 'license_expiry'], + 'formats': [_numpy.int32, _numpy.uint32, (_numpy.int8, 128), (_numpy.int8, 128), _numpy.uint32, grid_license_expiry_dtype], + 'offsets': [ + (&(pod.featureCode)) - (pod), + (&(pod.featureState)) - (pod), + (&(pod.licenseInfo)) - (pod), + (&(pod.productName)) - (pod), + (&(pod.featureEnabled)) - (pod), + (&(pod.licenseExpiry)) - (pod), + ], + 'itemsize': sizeof(nvmlGridLicensableFeature_t), + }) + finally: + _cyb_free(pod) grid_licensable_feature_dtype = _get_grid_licensable_feature_dtype_offsets() cdef object grid_licensable_feature_dtype_record = _numpy.dtype((_numpy.record, grid_licensable_feature_dtype)) @@ -24986,16 +25596,21 @@ cdef class GridLicensableFeature: cdef _get_unit_fan_speeds_dtype_offsets(): - cdef nvmlUnitFanSpeeds_t pod - return _numpy.dtype({ - 'names': ['fans', 'count'], - 'formats': [(unit_fan_info_dtype, 24), _numpy.uint32], - 'offsets': [ - (&(pod.fans)) - (&pod), - (&(pod.count)) - (&pod), - ], - 'itemsize': sizeof(nvmlUnitFanSpeeds_t), - }) + cdef nvmlUnitFanSpeeds_t *pod = _cyb_calloc(1, sizeof(nvmlUnitFanSpeeds_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlUnitFanSpeeds_t") + try: + return _numpy.dtype({ + 'names': ['fans', 'count'], + 'formats': [(unit_fan_info_dtype, 24), _numpy.uint32], + 'offsets': [ + (&(pod.fans)) - (pod), + (&(pod.count)) - (pod), + ], + 'itemsize': sizeof(nvmlUnitFanSpeeds_t), + }) + finally: + _cyb_free(pod) unit_fan_speeds_dtype = _get_unit_fan_speeds_dtype_offsets() @@ -25131,22 +25746,27 @@ cdef class UnitFanSpeeds: cdef _get_vgpu_pgpu_metadata_dtype_offsets(): - cdef nvmlVgpuPgpuMetadata_t pod - return _numpy.dtype({ - 'names': ['version', 'revision', 'host_driver_version', 'pgpu_virtualization_caps', 'reserved', 'host_supported_vgpu_range', 'opaque_data_size', 'opaque_data'], - 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 80), _numpy.uint32, (_numpy.uint32, 5), vgpu_version_dtype, _numpy.uint32, (_numpy.int8, 4)], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.revision)) - (&pod), - (&(pod.hostDriverVersion)) - (&pod), - (&(pod.pgpuVirtualizationCaps)) - (&pod), - (&(pod.reserved)) - (&pod), - (&(pod.hostSupportedVgpuRange)) - (&pod), - (&(pod.opaqueDataSize)) - (&pod), - (&(pod.opaqueData)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuPgpuMetadata_t), - }) + cdef nvmlVgpuPgpuMetadata_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuPgpuMetadata_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuPgpuMetadata_t") + try: + return _numpy.dtype({ + 'names': ['version', 'revision', 'host_driver_version', 'pgpu_virtualization_caps', 'reserved', 'host_supported_vgpu_range', 'opaque_data_size', 'opaque_data'], + 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 80), _numpy.uint32, (_numpy.uint32, 5), vgpu_version_dtype, _numpy.uint32, (_numpy.int8, 4)], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.revision)) - (pod), + (&(pod.hostDriverVersion)) - (pod), + (&(pod.pgpuVirtualizationCaps)) - (pod), + (&(pod.reserved)) - (pod), + (&(pod.hostSupportedVgpuRange)) - (pod), + (&(pod.opaqueDataSize)) - (pod), + (&(pod.opaqueData)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuPgpuMetadata_t), + }) + finally: + _cyb_free(pod) vgpu_pgpu_metadata_dtype = _get_vgpu_pgpu_metadata_dtype_offsets() @@ -25342,18 +25962,23 @@ cdef class VgpuPgpuMetadata: cdef _get_gpu_instance_info_dtype_offsets(): - cdef nvmlGpuInstanceInfo_t pod - return _numpy.dtype({ - 'names': ['device_', 'id', 'profile_id', 'placement'], - 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, gpu_instance_placement_dtype], - 'offsets': [ - (&(pod.device)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.profileId)) - (&pod), - (&(pod.placement)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuInstanceInfo_t), - }) + cdef nvmlGpuInstanceInfo_t *pod = _cyb_calloc(1, sizeof(nvmlGpuInstanceInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuInstanceInfo_t") + try: + return _numpy.dtype({ + 'names': ['device_', 'id', 'profile_id', 'placement'], + 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, gpu_instance_placement_dtype], + 'offsets': [ + (&(pod.device)) - (pod), + (&(pod.id)) - (pod), + (&(pod.profileId)) - (pod), + (&(pod.placement)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuInstanceInfo_t), + }) + finally: + _cyb_free(pod) gpu_instance_info_dtype = _get_gpu_instance_info_dtype_offsets() @@ -25509,19 +26134,24 @@ cdef class GpuInstanceInfo: cdef _get_compute_instance_info_dtype_offsets(): - cdef nvmlComputeInstanceInfo_t pod - return _numpy.dtype({ - 'names': ['device_', 'gpu_instance', 'id', 'profile_id', 'placement'], - 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.uint32, compute_instance_placement_dtype], - 'offsets': [ - (&(pod.device)) - (&pod), - (&(pod.gpuInstance)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.profileId)) - (&pod), - (&(pod.placement)) - (&pod), - ], - 'itemsize': sizeof(nvmlComputeInstanceInfo_t), - }) + cdef nvmlComputeInstanceInfo_t *pod = _cyb_calloc(1, sizeof(nvmlComputeInstanceInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlComputeInstanceInfo_t") + try: + return _numpy.dtype({ + 'names': ['device_', 'gpu_instance', 'id', 'profile_id', 'placement'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.uint32, compute_instance_placement_dtype], + 'offsets': [ + (&(pod.device)) - (pod), + (&(pod.gpuInstance)) - (pod), + (&(pod.id)) - (pod), + (&(pod.profileId)) - (pod), + (&(pod.placement)) - (pod), + ], + 'itemsize': sizeof(nvmlComputeInstanceInfo_t), + }) + finally: + _cyb_free(pod) compute_instance_info_dtype = _get_compute_instance_info_dtype_offsets() @@ -25688,17 +26318,22 @@ cdef class ComputeInstanceInfo: cdef _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets(): - cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'entry_count', 'entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.entryCount)) - (&pod), - (&(pod.entries)) - (&pod), - ], - 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), - }) + cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEccSramUniqueUncorrectedErrorCounts_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'entry_count', 'entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.entryCount)) - (pod), + (&(pod.entries)) - (pod), + ], + 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), + }) + finally: + _cyb_free(pod) ecc_sram_unique_uncorrected_error_counts_v1_dtype = _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets() @@ -25839,16 +26474,21 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: cdef _get_nvlink_firmware_info_dtype_offsets(): - cdef nvmlNvlinkFirmwareInfo_t pod - return _numpy.dtype({ - 'names': ['firmware_version', 'num_valid_entries'], - 'formats': [(nvlink_firmware_version_dtype, 100), _numpy.uint32], - 'offsets': [ - (&(pod.firmwareVersion)) - (&pod), - (&(pod.numValidEntries)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkFirmwareInfo_t), - }) + cdef nvmlNvlinkFirmwareInfo_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkFirmwareInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkFirmwareInfo_t") + try: + return _numpy.dtype({ + 'names': ['firmware_version', 'num_valid_entries'], + 'formats': [(nvlink_firmware_version_dtype, 100), _numpy.uint32], + 'offsets': [ + (&(pod.firmwareVersion)) - (pod), + (&(pod.numValidEntries)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkFirmwareInfo_t), + }) + finally: + _cyb_free(pod) nvlink_firmware_info_dtype = _get_nvlink_firmware_info_dtype_offsets() @@ -25988,20 +26628,25 @@ cdef class NvlinkFirmwareInfo: cdef _get_vgpu_scheduler_log_info_v2_dtype_offsets(): - cdef nvmlVgpuSchedulerLogInfo_v2_t pod - return _numpy.dtype({ - 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice', 'entries_count', 'log_entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (vgpu_scheduler_log_entry_v2_dtype, 200)], - 'offsets': [ - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.avgFactor)) - (&pod), - (&(pod.timeslice)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v2_t), - }) + cdef nvmlVgpuSchedulerLogInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerLogInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice', 'entries_count', 'log_entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (vgpu_scheduler_log_entry_v2_dtype, 200)], + 'offsets': [ + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.avgFactor)) - (pod), + (&(pod.timeslice)) - (pod), + (&(pod.entriesCount)) - (pod), + (&(pod.logEntries)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v2_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_log_info_v2_dtype = _get_vgpu_scheduler_log_info_v2_dtype_offsets() @@ -26181,17 +26826,22 @@ cdef class VgpuSchedulerLogInfo_v2: cdef _get_get_cper_v1_dtype_offsets(): - cdef nvmlGetCPER_v1_t pod - return _numpy.dtype({ - 'names': ['cursor', 'buffer', 'buffer_size'], - 'formats': [cper_cursor_v1_dtype, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.cursor)) - (&pod), - (&(pod.buffer)) - (&pod), - (&(pod.bufferSize)) - (&pod), - ], - 'itemsize': sizeof(nvmlGetCPER_v1_t), - }) + cdef nvmlGetCPER_v1_t *pod = _cyb_calloc(1, sizeof(nvmlGetCPER_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGetCPER_v1_t") + try: + return _numpy.dtype({ + 'names': ['cursor', 'buffer', 'buffer_size'], + 'formats': [cper_cursor_v1_dtype, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.cursor)) - (pod), + (&(pod.buffer)) - (pod), + (&(pod.bufferSize)) - (pod), + ], + 'itemsize': sizeof(nvmlGetCPER_v1_t), + }) + finally: + _cyb_free(pod) get_cper_v1_dtype = _get_get_cper_v1_dtype_offsets() @@ -26335,15 +26985,20 @@ cdef class GetCPER_v1: cdef _get_core_rail_metrics_dtype_offsets(): - cdef nvmlCoreRailMetrics_t pod - return _numpy.dtype({ - 'names': ['rails'], - 'formats': [(rail_metrics_dtype, 2)], - 'offsets': [ - (&(pod.rails)) - (&pod), - ], - 'itemsize': sizeof(nvmlCoreRailMetrics_t), - }) + cdef nvmlCoreRailMetrics_t *pod = _cyb_calloc(1, sizeof(nvmlCoreRailMetrics_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlCoreRailMetrics_t") + try: + return _numpy.dtype({ + 'names': ['rails'], + 'formats': [(rail_metrics_dtype, 2)], + 'offsets': [ + (&(pod.rails)) - (pod), + ], + 'itemsize': sizeof(nvmlCoreRailMetrics_t), + }) + finally: + _cyb_free(pod) core_rail_metrics_dtype = _get_core_rail_metrics_dtype_offsets() cdef object core_rail_metrics_dtype_record = _numpy.dtype((_numpy.record, core_rail_metrics_dtype)) @@ -26487,20 +27142,25 @@ cdef class CoreRailMetrics: cdef _get_pwr_model_metrics_pfpp1x_dtype_offsets(): - cdef nvmlPwrModelMetricsPfpp1x_t pod - return _numpy.dtype({ - 'names': ['num_vf_points', 'estimated_metrics', 'b_valid', 'max_perf_per_watt_point', 'fmax_at_vmax_point', 'tgp_headroomm_w'], - 'formats': [_numpy.uint8, (pwr_model_metrics_sample_pfpp1x_dtype, 32), _numpy.uint8, pwr_model_operating_point_pfpp1x_dtype, pwr_model_operating_point_pfpp1x_dtype, _numpy.uint32], - 'offsets': [ - (&(pod.numVfPoints)) - (&pod), - (&(pod.estimatedMetrics)) - (&pod), - (&(pod.bValid)) - (&pod), - (&(pod.maxPerfPerWattPoint)) - (&pod), - (&(pod.fmaxAtVmaxPoint)) - (&pod), - (&(pod.tgpHeadroommW)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelMetricsPfpp1x_t), - }) + cdef nvmlPwrModelMetricsPfpp1x_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelMetricsPfpp1x_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelMetricsPfpp1x_t") + try: + return _numpy.dtype({ + 'names': ['num_vf_points', 'estimated_metrics', 'b_valid', 'max_perf_per_watt_point', 'fmax_at_vmax_point', 'tgp_headroomm_w'], + 'formats': [_numpy.uint8, (pwr_model_metrics_sample_pfpp1x_dtype, 32), _numpy.uint8, pwr_model_operating_point_pfpp1x_dtype, pwr_model_operating_point_pfpp1x_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.numVfPoints)) - (pod), + (&(pod.estimatedMetrics)) - (pod), + (&(pod.bValid)) - (pod), + (&(pod.maxPerfPerWattPoint)) - (pod), + (&(pod.fmaxAtVmaxPoint)) - (pod), + (&(pod.tgpHeadroommW)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelMetricsPfpp1x_t), + }) + finally: + _cyb_free(pod) pwr_model_metrics_pfpp1x_dtype = _get_pwr_model_metrics_pfpp1x_dtype_offsets() cdef object pwr_model_metrics_pfpp1x_dtype_record = _numpy.dtype((_numpy.record, pwr_model_metrics_pfpp1x_dtype)) @@ -26702,21 +27362,26 @@ cdef class PwrModelMetricsPfpp1x: cdef _get_gpu_fabric_info_v4_dtype_offsets(): - cdef nvmlGpuFabricInfo_v4_t pod - return _numpy.dtype({ - 'names': ['cluster_uuid', 'status', 'cliques', 'num_cliques', 'state', 'health_mask', 'health_summary'], - 'formats': [(_numpy.uint8, 16), _numpy.int32, (gpu_fabric_clique_v1_dtype, 64), _numpy.uint32, _numpy.uint8, _numpy.uint32, _numpy.uint8], - 'offsets': [ - (&(pod.clusterUuid)) - (&pod), - (&(pod.status)) - (&pod), - (&(pod.cliques)) - (&pod), - (&(pod.numCliques)) - (&pod), - (&(pod.state)) - (&pod), - (&(pod.healthMask)) - (&pod), - (&(pod.healthSummary)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuFabricInfo_v4_t), - }) + cdef nvmlGpuFabricInfo_v4_t *pod = _cyb_calloc(1, sizeof(nvmlGpuFabricInfo_v4_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuFabricInfo_v4_t") + try: + return _numpy.dtype({ + 'names': ['cluster_uuid', 'status', 'cliques', 'num_cliques', 'state', 'health_mask', 'health_summary'], + 'formats': [(_numpy.uint8, 16), _numpy.int32, (gpu_fabric_clique_v1_dtype, 64), _numpy.uint32, _numpy.uint8, _numpy.uint32, _numpy.uint8], + 'offsets': [ + (&(pod.clusterUuid)) - (pod), + (&(pod.status)) - (pod), + (&(pod.cliques)) - (pod), + (&(pod.numCliques)) - (pod), + (&(pod.state)) - (pod), + (&(pod.healthMask)) - (pod), + (&(pod.healthSummary)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuFabricInfo_v4_t), + }) + finally: + _cyb_free(pod) gpu_fabric_info_v4_dtype = _get_gpu_fabric_info_v4_dtype_offsets() @@ -26912,16 +27577,21 @@ cdef class GpuFabricInfo_v4: cdef _get_nvlink_telemetry_samples_v1_dtype_offsets(): - cdef nvmlNvlinkTelemetrySamples_v1_t pod - return _numpy.dtype({ - 'names': ['telemetry_count', 'telemetry_samples'], - 'formats': [_numpy.uint32, _numpy.intp], - 'offsets': [ - (&(pod.telemetryCount)) - (&pod), - (&(pod.telemetrySamples)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkTelemetrySamples_v1_t), - }) + cdef nvmlNvlinkTelemetrySamples_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkTelemetrySamples_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkTelemetrySamples_v1_t") + try: + return _numpy.dtype({ + 'names': ['telemetry_count', 'telemetry_samples'], + 'formats': [_numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.telemetryCount)) - (pod), + (&(pod.telemetrySamples)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkTelemetrySamples_v1_t), + }) + finally: + _cyb_free(pod) nvlink_telemetry_samples_v1_dtype = _get_nvlink_telemetry_samples_v1_dtype_offsets() @@ -27051,18 +27721,23 @@ cdef class NvlinkTelemetrySamples_v1: cdef _get_ecc_bank_remapper_status_v1_dtype_offsets(): - cdef nvmlEccBankRemapperStatus_v1_t pod - return _numpy.dtype({ - 'names': ['active_remappings', 'inactive_remappings', 'b_pending', 'histogram'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, ecc_bank_remapper_histogram_v1_dtype], - 'offsets': [ - (&(pod.activeRemappings)) - (&pod), - (&(pod.inactiveRemappings)) - (&pod), - (&(pod.bPending)) - (&pod), - (&(pod.histogram)) - (&pod), - ], - 'itemsize': sizeof(nvmlEccBankRemapperStatus_v1_t), - }) + cdef nvmlEccBankRemapperStatus_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEccBankRemapperStatus_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEccBankRemapperStatus_v1_t") + try: + return _numpy.dtype({ + 'names': ['active_remappings', 'inactive_remappings', 'b_pending', 'histogram'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, ecc_bank_remapper_histogram_v1_dtype], + 'offsets': [ + (&(pod.activeRemappings)) - (pod), + (&(pod.inactiveRemappings)) - (pod), + (&(pod.bPending)) - (pod), + (&(pod.histogram)) - (pod), + ], + 'itemsize': sizeof(nvmlEccBankRemapperStatus_v1_t), + }) + finally: + _cyb_free(pod) ecc_bank_remapper_status_v1_dtype = _get_ecc_bank_remapper_status_v1_dtype_offsets() @@ -27217,19 +27892,24 @@ cdef class EccBankRemapperStatus_v1: cdef _get_nvlink_setup_nvle_encryption_key_v1_dtype_offsets(): - cdef nvmlNvlinkSetupNvleEncryptionKey_v1_t pod - return _numpy.dtype({ - 'names': ['nvle_key', 'local_gpu_alid', 'remote_gpu_alid', 'local_gpu_nvle_private_info', 'remote_gpu_nvle_private_info'], - 'formats': [(_numpy.uint8, 32), _numpy.uint32, _numpy.uint32, nvlink_nvle_private_info_v1_dtype, nvlink_nvle_private_info_v1_dtype], - 'offsets': [ - (&(pod.nvleKey)) - (&pod), - (&(pod.localGpuAlid)) - (&pod), - (&(pod.remoteGpuAlid)) - (&pod), - (&(pod.localGpuNvlePrivateInfo)) - (&pod), - (&(pod.remoteGpuNvlePrivateInfo)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t), - }) + cdef nvmlNvlinkSetupNvleEncryptionKey_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkSetupNvleEncryptionKey_v1_t") + try: + return _numpy.dtype({ + 'names': ['nvle_key', 'local_gpu_alid', 'remote_gpu_alid', 'local_gpu_nvle_private_info', 'remote_gpu_nvle_private_info'], + 'formats': [(_numpy.uint8, 32), _numpy.uint32, _numpy.uint32, nvlink_nvle_private_info_v1_dtype, nvlink_nvle_private_info_v1_dtype], + 'offsets': [ + (&(pod.nvleKey)) - (pod), + (&(pod.localGpuAlid)) - (pod), + (&(pod.remoteGpuAlid)) - (pod), + (&(pod.localGpuNvlePrivateInfo)) - (pod), + (&(pod.remoteGpuNvlePrivateInfo)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t), + }) + finally: + _cyb_free(pod) nvlink_setup_nvle_encryption_key_v1_dtype = _get_nvlink_setup_nvle_encryption_key_v1_dtype_offsets() @@ -27406,19 +28086,24 @@ cdef class NvlinkSetupNvleEncryptionKey_v1: cdef _get_vgpu_instances_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuInstancesUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'sample_val_type', 'vgpu_instance_count', 'last_seen_time_stamp', 'vgpu_util_array'], - 'formats': [_numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint64, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.sampleValType)) - (&pod), - (&(pod.vgpuInstanceCount)) - (&pod), - (&(pod.lastSeenTimeStamp)) - (&pod), - (&(pod.vgpuUtilArray)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), - }) + cdef nvmlVgpuInstancesUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuInstancesUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'sample_val_type', 'vgpu_instance_count', 'last_seen_time_stamp', 'vgpu_util_array'], + 'formats': [_numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.sampleValType)) - (pod), + (&(pod.vgpuInstanceCount)) - (pod), + (&(pod.lastSeenTimeStamp)) - (pod), + (&(pod.vgpuUtilArray)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_instances_utilization_info_v1_dtype = _get_vgpu_instances_utilization_info_v1_dtype_offsets() @@ -27581,17 +28266,22 @@ cdef class VgpuInstancesUtilizationInfo_v1: cdef _get_prm_counter_v1_dtype_offsets(): - cdef nvmlPRMCounter_v1_t pod - return _numpy.dtype({ - 'names': ['counter_id', 'in_data', 'counter_value'], - 'formats': [_numpy.uint32, prm_counter_input_v1_dtype, prm_counter_value_v1_dtype], - 'offsets': [ - (&(pod.counterId)) - (&pod), - (&(pod.inData)) - (&pod), - (&(pod.counterValue)) - (&pod), - ], - 'itemsize': sizeof(nvmlPRMCounter_v1_t), - }) + cdef nvmlPRMCounter_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPRMCounter_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPRMCounter_v1_t") + try: + return _numpy.dtype({ + 'names': ['counter_id', 'in_data', 'counter_value'], + 'formats': [_numpy.uint32, prm_counter_input_v1_dtype, prm_counter_value_v1_dtype], + 'offsets': [ + (&(pod.counterId)) - (pod), + (&(pod.inData)) - (pod), + (&(pod.counterValue)) - (pod), + ], + 'itemsize': sizeof(nvmlPRMCounter_v1_t), + }) + finally: + _cyb_free(pod) prm_counter_v1_dtype = _get_prm_counter_v1_dtype_offsets() cdef object prm_counter_v1_dtype_record = _numpy.dtype((_numpy.record, prm_counter_v1_dtype)) @@ -27759,20 +28449,25 @@ cdef class PRMCounter_v1: cdef _get_vgpu_scheduler_log_dtype_offsets(): - cdef nvmlVgpuSchedulerLog_t pod - return _numpy.dtype({ - 'names': ['engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], - 'offsets': [ - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerLog_t), - }) + cdef nvmlVgpuSchedulerLog_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLog_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerLog_t") + try: + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], + 'offsets': [ + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.arrMode)) - (pod), + (&(pod.schedulerParams)) - (pod), + (&(pod.entriesCount)) - (pod), + (&(pod.logEntries)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLog_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_log_dtype = _get_vgpu_scheduler_log_dtype_offsets() @@ -27957,17 +28652,22 @@ cdef class VgpuSchedulerLog: cdef _get_vgpu_scheduler_get_state_dtype_offsets(): - cdef nvmlVgpuSchedulerGetState_t pod - return _numpy.dtype({ - 'names': ['scheduler_policy', 'arr_mode', 'scheduler_params'], - 'formats': [_numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], - 'offsets': [ - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerGetState_t), - }) + cdef nvmlVgpuSchedulerGetState_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerGetState_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerGetState_t") + try: + return _numpy.dtype({ + 'names': ['scheduler_policy', 'arr_mode', 'scheduler_params'], + 'formats': [_numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], + 'offsets': [ + (&(pod.schedulerPolicy)) - (pod), + (&(pod.arrMode)) - (pod), + (&(pod.schedulerParams)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerGetState_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_get_state_dtype = _get_vgpu_scheduler_get_state_dtype_offsets() @@ -28111,19 +28811,24 @@ cdef class VgpuSchedulerGetState: cdef _get_vgpu_scheduler_state_info_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerStateInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v1_t), - }) + cdef nvmlVgpuSchedulerStateInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerStateInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.arrMode)) - (pod), + (&(pod.schedulerParams)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_state_info_v1_dtype = _get_vgpu_scheduler_state_info_v1_dtype_offsets() @@ -28289,21 +28994,26 @@ cdef class VgpuSchedulerStateInfo_v1: cdef _get_vgpu_scheduler_log_info_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerLogInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v1_t), - }) + cdef nvmlVgpuSchedulerLogInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerLogInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.arrMode)) - (pod), + (&(pod.schedulerParams)) - (pod), + (&(pod.entriesCount)) - (pod), + (&(pod.logEntries)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_log_info_v1_dtype = _get_vgpu_scheduler_log_info_v1_dtype_offsets() @@ -28499,19 +29209,24 @@ cdef class VgpuSchedulerLogInfo_v1: cdef _get_vgpu_scheduler_state_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerState_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'engine_id', 'scheduler_policy', 'enable_arr_mode', 'scheduler_params'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_set_params_dtype], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.enableARRMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerState_v1_t), - }) + cdef nvmlVgpuSchedulerState_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerState_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerState_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'engine_id', 'scheduler_policy', 'enable_arr_mode', 'scheduler_params'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_set_params_dtype], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.enableARRMode)) - (pod), + (&(pod.schedulerParams)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerState_v1_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_state_v1_dtype = _get_vgpu_scheduler_state_v1_dtype_offsets() @@ -28677,17 +29392,22 @@ cdef class VgpuSchedulerState_v1: cdef _get_grid_licensable_features_dtype_offsets(): - cdef nvmlGridLicensableFeatures_t pod - return _numpy.dtype({ - 'names': ['is_grid_license_supported', 'licensable_features_count', 'grid_licensable_features'], - 'formats': [_numpy.int32, _numpy.uint32, (grid_licensable_feature_dtype, 3)], - 'offsets': [ - (&(pod.isGridLicenseSupported)) - (&pod), - (&(pod.licensableFeaturesCount)) - (&pod), - (&(pod.gridLicensableFeatures)) - (&pod), - ], - 'itemsize': sizeof(nvmlGridLicensableFeatures_t), - }) + cdef nvmlGridLicensableFeatures_t *pod = _cyb_calloc(1, sizeof(nvmlGridLicensableFeatures_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGridLicensableFeatures_t") + try: + return _numpy.dtype({ + 'names': ['is_grid_license_supported', 'licensable_features_count', 'grid_licensable_features'], + 'formats': [_numpy.int32, _numpy.uint32, (grid_licensable_feature_dtype, 3)], + 'offsets': [ + (&(pod.isGridLicenseSupported)) - (pod), + (&(pod.licensableFeaturesCount)) - (pod), + (&(pod.gridLicensableFeatures)) - (pod), + ], + 'itemsize': sizeof(nvmlGridLicensableFeatures_t), + }) + finally: + _cyb_free(pod) grid_licensable_features_dtype = _get_grid_licensable_features_dtype_offsets() @@ -28826,17 +29546,22 @@ cdef class GridLicensableFeatures: cdef _get_nv_link_info_v2_dtype_offsets(): - cdef nvmlNvLinkInfo_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'is_nvle_enabled', 'firmware_info'], - 'formats': [_numpy.uint32, _numpy.uint32, nvlink_firmware_info_dtype], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.isNvleEnabled)) - (&pod), - (&(pod.firmwareInfo)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvLinkInfo_v2_t), - }) + cdef nvmlNvLinkInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvLinkInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'is_nvle_enabled', 'firmware_info'], + 'formats': [_numpy.uint32, _numpy.uint32, nvlink_firmware_info_dtype], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.isNvleEnabled)) - (pod), + (&(pod.firmwareInfo)) - (pod), + ], + 'itemsize': sizeof(nvmlNvLinkInfo_v2_t), + }) + finally: + _cyb_free(pod) nv_link_info_v2_dtype = _get_nv_link_info_v2_dtype_offsets() @@ -28980,17 +29705,22 @@ cdef class NvLinkInfo_v2: cdef _get_nv_link_info_v3_dtype_offsets(): - cdef nvmlNvLinkInfo_v3_t pod - return _numpy.dtype({ - 'names': ['is_nvle_enabled', 'firmware_info', 'is_nvle_ready'], - 'formats': [_numpy.uint32, nvlink_firmware_info_dtype, _numpy.uint32], - 'offsets': [ - (&(pod.isNvleEnabled)) - (&pod), - (&(pod.firmwareInfo)) - (&pod), - (&(pod.isNvleReady)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvLinkInfo_v3_t), - }) + cdef nvmlNvLinkInfo_v3_t *pod = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v3_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvLinkInfo_v3_t") + try: + return _numpy.dtype({ + 'names': ['is_nvle_enabled', 'firmware_info', 'is_nvle_ready'], + 'formats': [_numpy.uint32, nvlink_firmware_info_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.isNvleEnabled)) - (pod), + (&(pod.firmwareInfo)) - (pod), + (&(pod.isNvleReady)) - (pod), + ], + 'itemsize': sizeof(nvmlNvLinkInfo_v3_t), + }) + finally: + _cyb_free(pod) nv_link_info_v3_dtype = _get_nv_link_info_v3_dtype_offsets() @@ -29134,19 +29864,24 @@ cdef class NvLinkInfo_v3: cdef _get_pwr_model_metrics_dlppm1x_dtype_offsets(): - cdef nvmlPwrModelMetricsDlppm1x_t pod - return _numpy.dtype({ - 'names': ['b_valid', 'core_rail', 'fb_rail', 'tgp_pwr_tuple', 'perf_metrics'], - 'formats': [_numpy.uint8, core_rail_metrics_dtype, rail_metrics_dtype, pmgr_pwr_tuple_dtype, pwr_model_metrics_dlppm1x_perf_dtype], - 'offsets': [ - (&(pod.bValid)) - (&pod), - (&(pod.coreRail)) - (&pod), - (&(pod.fbRail)) - (&pod), - (&(pod.tgpPwrTuple)) - (&pod), - (&(pod.perfMetrics)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1x_t), - }) + cdef nvmlPwrModelMetricsDlppm1x_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelMetricsDlppm1x_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelMetricsDlppm1x_t") + try: + return _numpy.dtype({ + 'names': ['b_valid', 'core_rail', 'fb_rail', 'tgp_pwr_tuple', 'perf_metrics'], + 'formats': [_numpy.uint8, core_rail_metrics_dtype, rail_metrics_dtype, pmgr_pwr_tuple_dtype, pwr_model_metrics_dlppm1x_perf_dtype], + 'offsets': [ + (&(pod.bValid)) - (pod), + (&(pod.coreRail)) - (pod), + (&(pod.fbRail)) - (pod), + (&(pod.tgpPwrTuple)) - (pod), + (&(pod.perfMetrics)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1x_t), + }) + finally: + _cyb_free(pod) pwr_model_metrics_dlppm1x_dtype = _get_pwr_model_metrics_dlppm1x_dtype_offsets() cdef object pwr_model_metrics_dlppm1x_dtype_record = _numpy.dtype((_numpy.record, pwr_model_metrics_dlppm1x_dtype)) @@ -29336,15 +30071,20 @@ cdef class PwrModelMetricsDlppm1x: cdef _get_perf_metrics_pfpp1x_sample_dtype_offsets(): - cdef nvmlPerfMetricsPfpp1xSample_t pod - return _numpy.dtype({ - 'names': ['estimated_metrics'], - 'formats': [pwr_model_metrics_pfpp1x_dtype], - 'offsets': [ - (&(pod.estimatedMetrics)) - (&pod), - ], - 'itemsize': sizeof(nvmlPerfMetricsPfpp1xSample_t), - }) + cdef nvmlPerfMetricsPfpp1xSample_t *pod = _cyb_calloc(1, sizeof(nvmlPerfMetricsPfpp1xSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPerfMetricsPfpp1xSample_t") + try: + return _numpy.dtype({ + 'names': ['estimated_metrics'], + 'formats': [pwr_model_metrics_pfpp1x_dtype], + 'offsets': [ + (&(pod.estimatedMetrics)) - (pod), + ], + 'itemsize': sizeof(nvmlPerfMetricsPfpp1xSample_t), + }) + finally: + _cyb_free(pod) perf_metrics_pfpp1x_sample_dtype = _get_perf_metrics_pfpp1x_sample_dtype_offsets() cdef object perf_metrics_pfpp1x_sample_dtype_record = _numpy.dtype((_numpy.record, perf_metrics_pfpp1x_sample_dtype)) @@ -29488,16 +30228,21 @@ cdef class PerfMetricsPfpp1xSample: cdef _get_pwr_model_metrics_dlppm1x_dramclk_estimates_dtype_offsets(): - cdef nvmlPwrModelMetricsDlppm1xDramclkEstimates_t pod - return _numpy.dtype({ - 'names': ['estimated_metrics', 'num_estimated_metrics'], - 'formats': [(pwr_model_metrics_dlppm1x_dtype, 8), _numpy.uint8], - 'offsets': [ - (&(pod.estimatedMetrics)) - (&pod), - (&(pod.numEstimatedMetrics)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xDramclkEstimates_t), - }) + cdef nvmlPwrModelMetricsDlppm1xDramclkEstimates_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelMetricsDlppm1xDramclkEstimates_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelMetricsDlppm1xDramclkEstimates_t") + try: + return _numpy.dtype({ + 'names': ['estimated_metrics', 'num_estimated_metrics'], + 'formats': [(pwr_model_metrics_dlppm1x_dtype, 8), _numpy.uint8], + 'offsets': [ + (&(pod.estimatedMetrics)) - (pod), + (&(pod.numEstimatedMetrics)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xDramclkEstimates_t), + }) + finally: + _cyb_free(pod) pwr_model_metrics_dlppm1x_dramclk_estimates_dtype = _get_pwr_model_metrics_dlppm1x_dramclk_estimates_dtype_offsets() cdef object pwr_model_metrics_dlppm1x_dramclk_estimates_dtype_record = _numpy.dtype((_numpy.record, pwr_model_metrics_dlppm1x_dramclk_estimates_dtype)) @@ -29651,20 +30396,25 @@ cdef class PwrModelMetricsDlppm1xDramclkEstimates: cdef _get_observed_metrics_dtype_offsets(): - cdef nvmlObservedMetrics_t pod - return _numpy.dtype({ - 'names': ['initial_dramclk_est', 'b_valid', 'core_rail', 'fb_rail', 'tgp_pwr_tuple', 'perf_metrics'], - 'formats': [(pwr_model_metrics_dlppm1x_dramclk_estimates_dtype, 3), _numpy.uint8, core_rail_metrics_dtype, rail_metrics_dtype, pmgr_pwr_tuple_dtype, pwr_model_metrics_dlppm1x_perf_dtype], - 'offsets': [ - (&(pod.initialDramclkEst)) - (&pod), - (&(pod.bValid)) - (&pod), - (&(pod.coreRail)) - (&pod), - (&(pod.fbRail)) - (&pod), - (&(pod.tgpPwrTuple)) - (&pod), - (&(pod.perfMetrics)) - (&pod), - ], - 'itemsize': sizeof(nvmlObservedMetrics_t), - }) + cdef nvmlObservedMetrics_t *pod = _cyb_calloc(1, sizeof(nvmlObservedMetrics_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlObservedMetrics_t") + try: + return _numpy.dtype({ + 'names': ['initial_dramclk_est', 'b_valid', 'core_rail', 'fb_rail', 'tgp_pwr_tuple', 'perf_metrics'], + 'formats': [(pwr_model_metrics_dlppm1x_dramclk_estimates_dtype, 3), _numpy.uint8, core_rail_metrics_dtype, rail_metrics_dtype, pmgr_pwr_tuple_dtype, pwr_model_metrics_dlppm1x_perf_dtype], + 'offsets': [ + (&(pod.initialDramclkEst)) - (pod), + (&(pod.bValid)) - (pod), + (&(pod.coreRail)) - (pod), + (&(pod.fbRail)) - (pod), + (&(pod.tgpPwrTuple)) - (pod), + (&(pod.perfMetrics)) - (pod), + ], + 'itemsize': sizeof(nvmlObservedMetrics_t), + }) + finally: + _cyb_free(pod) observed_metrics_dtype = _get_observed_metrics_dtype_offsets() cdef object observed_metrics_dtype_record = _numpy.dtype((_numpy.record, observed_metrics_dtype)) @@ -29865,15 +30615,20 @@ cdef class ObservedMetrics: cdef _get_perf_metrics_dlppc2x_sample_dtype_offsets(): - cdef nvmlPerfMetricsDlppc2xSample_t pod - return _numpy.dtype({ - 'names': ['observed_metrics'], - 'formats': [observed_metrics_dtype], - 'offsets': [ - (&(pod.observedMetrics)) - (&pod), - ], - 'itemsize': sizeof(nvmlPerfMetricsDlppc2xSample_t), - }) + cdef nvmlPerfMetricsDlppc2xSample_t *pod = _cyb_calloc(1, sizeof(nvmlPerfMetricsDlppc2xSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPerfMetricsDlppc2xSample_t") + try: + return _numpy.dtype({ + 'names': ['observed_metrics'], + 'formats': [observed_metrics_dtype], + 'offsets': [ + (&(pod.observedMetrics)) - (pod), + ], + 'itemsize': sizeof(nvmlPerfMetricsDlppc2xSample_t), + }) + finally: + _cyb_free(pod) perf_metrics_dlppc2x_sample_dtype = _get_perf_metrics_dlppc2x_sample_dtype_offsets() cdef object perf_metrics_dlppc2x_sample_dtype_record = _numpy.dtype((_numpy.record, perf_metrics_dlppc2x_sample_dtype)) @@ -30017,16 +30772,21 @@ cdef class PerfMetricsDlppc2xSample: cdef _get__py_anon_pod8_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod8 pod - return _numpy.dtype({ - 'names': ['dlppc2x', 'pfpp1x'], - 'formats': [perf_metrics_dlppc2x_sample_dtype, perf_metrics_pfpp1x_sample_dtype], - 'offsets': [ - (&(pod.dlppc2x)) - (&pod), - (&(pod.pfpp1x)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod8), - }) + cdef cuda_bindings_nvml__anon_pod8 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod8)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod8") + try: + return _numpy.dtype({ + 'names': ['dlppc2x', 'pfpp1x'], + 'formats': [perf_metrics_dlppc2x_sample_dtype, perf_metrics_pfpp1x_sample_dtype], + 'offsets': [ + (&(pod.dlppc2x)) - (pod), + (&(pod.pfpp1x)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod8), + }) + finally: + _cyb_free(pod) _py_anon_pod8_dtype = _get__py_anon_pod8_dtype_offsets() @@ -30178,16 +30938,21 @@ cdef class _py_anon_pod8: cdef _get_perf_metric_controller_sample_dtype_offsets(): - cdef nvmlPerfMetricControllerSample_t pod - return _numpy.dtype({ - 'names': ['controller_type', 'data_'], - 'formats': [_numpy.uint32, _py_anon_pod8_dtype], - 'offsets': [ - (&(pod.controllerType)) - (&pod), - (&(pod.data)) - (&pod), - ], - 'itemsize': sizeof(nvmlPerfMetricControllerSample_t), - }) + cdef nvmlPerfMetricControllerSample_t *pod = _cyb_calloc(1, sizeof(nvmlPerfMetricControllerSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPerfMetricControllerSample_t") + try: + return _numpy.dtype({ + 'names': ['controller_type', 'data_'], + 'formats': [_numpy.uint32, _py_anon_pod8_dtype], + 'offsets': [ + (&(pod.controllerType)) - (pod), + (&(pod.data)) - (pod), + ], + 'itemsize': sizeof(nvmlPerfMetricControllerSample_t), + }) + finally: + _cyb_free(pod) perf_metric_controller_sample_dtype = _get_perf_metric_controller_sample_dtype_offsets() cdef object perf_metric_controller_sample_dtype_record = _numpy.dtype((_numpy.record, perf_metric_controller_sample_dtype)) @@ -30344,16 +31109,21 @@ cdef class PerfMetricControllerSample: cdef _get_perf_metrics_sample_dtype_offsets(): - cdef nvmlPerfMetricsSample_t pod - return _numpy.dtype({ - 'names': ['num_controller_data', 'controller_data'], - 'formats': [_numpy.uint8, (perf_metric_controller_sample_dtype, 4)], - 'offsets': [ - (&(pod.numControllerData)) - (&pod), - (&(pod.controllerData)) - (&pod), - ], - 'itemsize': sizeof(nvmlPerfMetricsSample_t), - }) + cdef nvmlPerfMetricsSample_t *pod = _cyb_calloc(1, sizeof(nvmlPerfMetricsSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPerfMetricsSample_t") + try: + return _numpy.dtype({ + 'names': ['num_controller_data', 'controller_data'], + 'formats': [_numpy.uint8, (perf_metric_controller_sample_dtype, 4)], + 'offsets': [ + (&(pod.numControllerData)) - (pod), + (&(pod.controllerData)) - (pod), + ], + 'itemsize': sizeof(nvmlPerfMetricsSample_t), + }) + finally: + _cyb_free(pod) perf_metrics_sample_dtype = _get_perf_metrics_sample_dtype_offsets() cdef object perf_metrics_sample_dtype_record = _numpy.dtype((_numpy.record, perf_metrics_sample_dtype)) @@ -30507,16 +31277,21 @@ cdef class PerfMetricsSample: cdef _get_perf_metrics_samples_v1_dtype_offsets(): - cdef nvmlPerfMetricsSamples_v1_t pod - return _numpy.dtype({ - 'names': ['num_samples', 'samples'], - 'formats': [_numpy.uint32, (perf_metrics_sample_dtype, 13)], - 'offsets': [ - (&(pod.numSamples)) - (&pod), - (&(pod.samples)) - (&pod), - ], - 'itemsize': sizeof(nvmlPerfMetricsSamples_v1_t), - }) + cdef nvmlPerfMetricsSamples_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPerfMetricsSamples_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPerfMetricsSamples_v1_t") + try: + return _numpy.dtype({ + 'names': ['num_samples', 'samples'], + 'formats': [_numpy.uint32, (perf_metrics_sample_dtype, 13)], + 'offsets': [ + (&(pod.numSamples)) - (pod), + (&(pod.samples)) - (pod), + ], + 'itemsize': sizeof(nvmlPerfMetricsSamples_v1_t), + }) + finally: + _cyb_free(pod) perf_metrics_samples_v1_dtype = _get_perf_metrics_samples_v1_dtype_offsets() @@ -33145,8 +33920,8 @@ cpdef unsigned long long device_get_total_ecc_errors(intptr_t device, int error_ device (intptr_t): The identifier of the target device. error_type (MemoryErrorType): Flag that specifies the type of the errors. - counter_type (EccCounterType): Flag that specifies the counter- - type of the errors. + counter_type (EccCounterType): Flag that specifies the + counter-type of the errors. Returns: unsigned long long: Reference in which to return the specified ECC @@ -33179,8 +33954,8 @@ cpdef unsigned long long device_get_memory_error_counter(intptr_t device, int er device (intptr_t): The identifier of the target device. error_type (MemoryErrorType): Flag that specifies the type of error. - counter_type (EccCounterType): Flag that specifies the counter- - type of the errors. + counter_type (EccCounterType): Flag that specifies the + counter-type of the errors. location_type (MemoryLocation): Specifies the location of the counter. @@ -33189,8 +33964,8 @@ cpdef unsigned long long device_get_memory_error_counter(intptr_t device, int er .. note:: On MIG-enabled GPUs, per instance information can be queried using specific MIG - device handles. Per instance information is currently only supported for non- - DRAM uncorrectable volatile errors. Querying volatile errors using device + device handles. Per instance information is currently only supported for + non-DRAM uncorrectable volatile errors. Querying volatile errors using device handles is currently not supported. .. seealso:: `nvmlDeviceGetMemoryErrorCounter` """ @@ -33590,9 +34365,9 @@ cpdef object device_get_compute_running_processes_v3(intptr_t device): .. note:: In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance - information can be queried by using specific MIG device handles. Querying per- - instance information using MIG device handles is not supported if the device is - in vGPU Host virtualization mode. + information can be queried by using specific MIG device handles. Querying + per-instance information using MIG device handles is not supported if the + device is in vGPU Host virtualization mode. .. seealso:: `nvmlDeviceGetComputeRunningProcesses_v3` """ cdef unsigned int[1] info_count = [0] @@ -33633,9 +34408,9 @@ cpdef object device_get_graphics_running_processes_v3(intptr_t device): .. note:: In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance - information can be queried by using specific MIG device handles. Querying per- - instance information using MIG device handles is not supported if the device is - in vGPU Host virtualization mode. + information can be queried by using specific MIG device handles. Querying + per-instance information using MIG device handles is not supported if the + device is in vGPU Host virtualization mode. .. seealso:: `nvmlDeviceGetGraphicsRunningProcesses_v3` """ cdef unsigned int[1] info_count = [0] @@ -33677,9 +34452,9 @@ cpdef object device_get_mps_compute_running_processes_v3(intptr_t device): .. note:: In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance - information can be queried by using specific MIG device handles. Querying per- - instance information using MIG device handles is not supported if the device is - in vGPU Host virtualization mode. + information can be queried by using specific MIG device handles. Querying + per-instance information using MIG device handles is not supported if the + device is in vGPU Host virtualization mode. .. seealso:: `nvmlDeviceGetMPSComputeRunningProcesses_v3` """ cdef unsigned int[1] info_count = [0] @@ -35951,8 +36726,8 @@ cpdef str vgpu_type_get_license(unsigned int vgpu_type_id): The license type and version required to run the specified vGPU type is returned as an alphanumeric string, in the form ",", for example "GRID-Virtual-PC,2.0". If a vGPU is runnable with* more than one type - of license, the licenses are delimited by a semicolon, for example "GRID- - Virtual-PC,2.0;GRID-Virtual-WS,2.0;GRID-Virtual-WS-Ext,2.0". + of license, the licenses are delimited by a semicolon, for example + "GRID-Virtual-PC,2.0;GRID-Virtual-WS,2.0;GRID-Virtual-WS-Ext,2.0". The total length of the returned string will not exceed 128 characters, including the NUL terminator. See nvmlVgpuConstants::NVML_GRID_LICENSE_BUFFER_SIZE. @@ -36823,13 +37598,13 @@ cpdef tuple device_get_vgpu_utilization(intptr_t device, unsigned long long last For Kepler ™️ or newer fully supported devices. Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder for vGPU instances running on a device. Utilization values - are returned as an array of utilization sample structures in the caller- - supplied buffer pointed at by ``utilization_samples``. One utilization sample - structure is returned per vGPU instance, and includes the CPU timestamp at - which the samples were recorded. Individual utilization values are returned as - "unsigned int" values in ``nvmlValue_t`` unions. The function sets the caller- - supplied ``sample_val_type`` to NVML_VALUE_TYPE_UNSIGNED_INT to indicate the - returned value type. + are returned as an array of utilization sample structures in the + caller-supplied buffer pointed at by ``utilization_samples``. One utilization + sample structure is returned per vGPU instance, and includes the CPU timestamp + at which the samples were recorded. Individual utilization values are returned + as "unsigned int" values in ``nvmlValue_t`` unions. The function sets the + caller-supplied ``sample_val_type`` to NVML_VALUE_TYPE_UNSIGNED_INT to indicate + the returned value type. To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with ``utilization_samples`` set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current vGPU diff --git a/cuda_bindings_12/cuda/bindings/nvvm.pyx b/cuda_bindings_12/cuda/bindings/nvvm.pyx index 52bfa173b5f..7b3664caac8 100644 --- a/cuda_bindings_12/cuda/bindings/nvvm.pyx +++ b/cuda_bindings_12/cuda/bindings/nvvm.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=737e7153c4954ec8a2b0dedd50729ee160589ccef13b0e3f512b6c7645d83f62 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=404e6696c1e11fe6b1854c8b341bfba192fb90689ae0a69b3110c86d7c51ac5f # <<<< PREAMBLE CONTENT >>>> @@ -303,13 +303,13 @@ cpdef compile_program(intptr_t prog, int num_options, options): - -prec-sqrt=. - 0 (use a faster approximation for single-precision floating-point square root). - - 1 (default, use IEEE round-to-nearest mode for single-precision floating- - point square root). + - 1 (default, use IEEE round-to-nearest mode for single-precision + floating-point square root). - -prec-div=. - 0 (use a faster approximation for single-precision floating-point division and reciprocals). - - 1 (default, use IEEE round-to-nearest mode for single-precision floating- - point division and reciprocals). + - 1 (default, use IEEE round-to-nearest mode for single-precision + floating-point division and reciprocals). - -fma=. - 0 (disable FMA contraction). - 1 (default, enable FMA contraction). diff --git a/cuda_bindings_12/cuda/bindings/runtime.pyx b/cuda_bindings_12/cuda/bindings/runtime.pyx index 65463e6cece..215191ef316 100644 --- a/cuda_bindings_12/cuda/bindings/runtime.pyx +++ b/cuda_bindings_12/cuda/bindings/runtime.pyx @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # This code was automatically generated with version 12.9.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=756f2405020fb6cc7847ccf6966b5246e1b1d6a247d0e34a64428f069dc3f603 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=be66dc3db6a8e66386b35398ce32c2a7f5edc02e1aa834f0f3c1c77c20d8d8e3 from typing import Any, Optional import cython import ctypes @@ -17803,7 +17803,7 @@ cdef class anon_union11: def pArray(self): return [cudaArray_t(init_value=_pArray) for _pArray in self._pvt_ptr[0].frame.pArray] @pArray.setter - def pArray(self, pArray : list[cudaArray_t]): + def pArray(self, pArray : list[cudaArray_t | int]): if len(pArray) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pArray)) pArray = [int(_pArray) for _pArray in pArray] diff --git a/cuda_bindings_13/cuda/bindings/_internal/_fast_enum.py b/cuda_bindings_13/cuda/bindings/_internal/_fast_enum.py index 18ad0239def..f5ced71c288 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/_fast_enum.py +++ b/cuda_bindings_13/cuda/bindings/_internal/_fast_enum.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=35d522fae601127f3ffc9d0de45d9adf2572934ee3308f5d99567aa8efd5ae77 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b35c6de7463e36646e40b3ab553e165d4e756a14303a8f1fcddcd71325dafd40 """ This is a replacement for the stdlib enum.IntEnum. @@ -13,7 +13,8 @@ `cuda_bindings/tests/test_basics.py` for details. """ -from typing import Any, Iterator +from collections.abc import Iterator +from typing import Any class FastEnumMetaclass(type): diff --git a/cuda_bindings_13/cuda/bindings/_v2/driver.pyx b/cuda_bindings_13/cuda/bindings/_v2/driver.pyx index e06821de748..a375a1879c1 100644 --- a/cuda_bindings_13/cuda/bindings/_v2/driver.pyx +++ b/cuda_bindings_13/cuda/bindings/_v2/driver.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4ba4315630cca2c1ae2b59ef0a31d0eeec18669c33ce7af80429e8b3ec4c0d29 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=458291ffe3c940aeb35a9f0715a0fc125913a680017fa109e99dba45829412db # <<<< PREAMBLE CONTENT >>>> @@ -1020,10 +1020,11 @@ class LaunchMemSyncDomain(_cyb_FastEnum): specific stream / graph node / kernel launch. See `CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN`, `cuStreamSetAttribute`, `cuLaunchKernelEx`, `cuGraphKernelNodeSetAttribute`. Memory operations - done in kernels launched in different domains are considered system- - scope distanced. In other words, a GPU scoped memory synchronization is - not sufficient for memory order to be observed by kernels in another - memory synchronization domain even if they are on the same GPU. + done in kernels launched in different domains are considered + system-scope distanced. In other words, a GPU scoped memory + synchronization is not sufficient for memory order to be observed by + kernels in another memory synchronization domain even if they are on + the same GPU. See `CUlaunchMemSyncDomain`. """ @@ -2781,15 +2782,20 @@ cdef int check_status_size(int status) except 1 nogil: ############################################################################### cdef _get_uuid_dtype_offsets(): - cdef CUuuid pod - return _numpy.dtype({ - 'names': ['bytes'], - 'formats': [(_numpy.int8, 16)], - 'offsets': [ - (&(pod.bytes)) - (&pod), - ], - 'itemsize': sizeof(CUuuid), - }) + cdef CUuuid *pod = _cyb_calloc(1, sizeof(CUuuid)) + if pod == NULL: + raise MemoryError("Error allocating CUuuid") + try: + return _numpy.dtype({ + 'names': ['bytes'], + 'formats': [(_numpy.int8, 16)], + 'offsets': [ + (&(pod.bytes)) - (pod), + ], + 'itemsize': sizeof(CUuuid), + }) + finally: + _cyb_free(pod) uuid_dtype = _get_uuid_dtype_offsets() @@ -2924,15 +2930,20 @@ cdef class Uuid: cdef _get_mem_fabric_handle_v1_dtype_offsets(): - cdef CUmemFabricHandle_v1 pod - return _numpy.dtype({ - 'names': ['data_'], - 'formats': [(_numpy.uint8, 64)], - 'offsets': [ - (&(pod.data)) - (&pod), - ], - 'itemsize': sizeof(CUmemFabricHandle_v1), - }) + cdef CUmemFabricHandle_v1 *pod = _cyb_calloc(1, sizeof(CUmemFabricHandle_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUmemFabricHandle_v1") + try: + return _numpy.dtype({ + 'names': ['data_'], + 'formats': [(_numpy.uint8, 64)], + 'offsets': [ + (&(pod.data)) - (pod), + ], + 'itemsize': sizeof(CUmemFabricHandle_v1), + }) + finally: + _cyb_free(pod) mem_fabric_handle_v1_dtype = _get_mem_fabric_handle_v1_dtype_offsets() @@ -3055,15 +3066,20 @@ cdef class MemFabricHandle_v1: cdef _get_ipc_event_handle_v1_dtype_offsets(): - cdef CUipcEventHandle_v1 pod - return _numpy.dtype({ - 'names': ['reserved'], - 'formats': [(_numpy.int8, 64)], - 'offsets': [ - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUipcEventHandle_v1), - }) + cdef CUipcEventHandle_v1 *pod = _cyb_calloc(1, sizeof(CUipcEventHandle_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUipcEventHandle_v1") + try: + return _numpy.dtype({ + 'names': ['reserved'], + 'formats': [(_numpy.int8, 64)], + 'offsets': [ + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUipcEventHandle_v1), + }) + finally: + _cyb_free(pod) ipc_event_handle_v1_dtype = _get_ipc_event_handle_v1_dtype_offsets() @@ -3169,15 +3185,20 @@ cdef class IpcEventHandle_v1: cdef _get_ipc_mem_handle_v1_dtype_offsets(): - cdef CUipcMemHandle_v1 pod - return _numpy.dtype({ - 'names': ['reserved'], - 'formats': [(_numpy.int8, 64)], - 'offsets': [ - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUipcMemHandle_v1), - }) + cdef CUipcMemHandle_v1 *pod = _cyb_calloc(1, sizeof(CUipcMemHandle_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUipcMemHandle_v1") + try: + return _numpy.dtype({ + 'names': ['reserved'], + 'formats': [(_numpy.int8, 64)], + 'offsets': [ + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUipcMemHandle_v1), + }) + finally: + _cyb_free(pod) ipc_mem_handle_v1_dtype = _get_ipc_mem_handle_v1_dtype_offsets() @@ -3283,16 +3304,21 @@ cdef class IpcMemHandle_v1: cdef _get_stream_mem_op_flush_remote_writes_params_dtype_offsets(): - cdef CUstreamMemOpFlushRemoteWritesParams_st pod - return _numpy.dtype({ - 'names': ['operation', 'flags_'], - 'formats': [_numpy.int32, _numpy.uint32], - 'offsets': [ - (&(pod.operation)) - (&pod), - (&(pod.flags)) - (&pod), - ], - 'itemsize': sizeof(CUstreamMemOpFlushRemoteWritesParams_st), - }) + cdef CUstreamMemOpFlushRemoteWritesParams_st *pod = _cyb_calloc(1, sizeof(CUstreamMemOpFlushRemoteWritesParams_st)) + if pod == NULL: + raise MemoryError("Error allocating CUstreamMemOpFlushRemoteWritesParams_st") + try: + return _numpy.dtype({ + 'names': ['operation', 'flags_'], + 'formats': [_numpy.int32, _numpy.uint32], + 'offsets': [ + (&(pod.operation)) - (pod), + (&(pod.flags)) - (pod), + ], + 'itemsize': sizeof(CUstreamMemOpFlushRemoteWritesParams_st), + }) + finally: + _cyb_free(pod) stream_mem_op_flush_remote_writes_params_dtype = _get_stream_mem_op_flush_remote_writes_params_dtype_offsets() @@ -3432,16 +3458,21 @@ cdef class StreamMemOpFlushRemoteWritesParams: cdef _get_stream_mem_op_memory_barrier_params_dtype_offsets(): - cdef CUstreamMemOpMemoryBarrierParams_st pod - return _numpy.dtype({ - 'names': ['operation', 'flags_'], - 'formats': [_numpy.int32, _numpy.uint32], - 'offsets': [ - (&(pod.operation)) - (&pod), - (&(pod.flags)) - (&pod), - ], - 'itemsize': sizeof(CUstreamMemOpMemoryBarrierParams_st), - }) + cdef CUstreamMemOpMemoryBarrierParams_st *pod = _cyb_calloc(1, sizeof(CUstreamMemOpMemoryBarrierParams_st)) + if pod == NULL: + raise MemoryError("Error allocating CUstreamMemOpMemoryBarrierParams_st") + try: + return _numpy.dtype({ + 'names': ['operation', 'flags_'], + 'formats': [_numpy.int32, _numpy.uint32], + 'offsets': [ + (&(pod.operation)) - (pod), + (&(pod.flags)) - (pod), + ], + 'itemsize': sizeof(CUstreamMemOpMemoryBarrierParams_st), + }) + finally: + _cyb_free(pod) stream_mem_op_memory_barrier_params_dtype = _get_stream_mem_op_memory_barrier_params_dtype_offsets() @@ -3581,21 +3612,26 @@ cdef class StreamMemOpMemoryBarrierParams: cdef _get_stream_mem_op_atomic_reduction_params_dtype_offsets(): - cdef CUstreamMemOpAtomicReductionParams_st pod - return _numpy.dtype({ - 'names': ['operation', 'flags_', 'reduction_op', 'data_type', 'address', 'value', 'alias'], - 'formats': [_numpy.int32, _numpy.uint32, _numpy.int32, _numpy.int32, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.operation)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.reductionOp)) - (&pod), - (&(pod.dataType)) - (&pod), - (&(pod.address)) - (&pod), - (&(pod.value)) - (&pod), - (&(pod.alias)) - (&pod), - ], - 'itemsize': sizeof(CUstreamMemOpAtomicReductionParams_st), - }) + cdef CUstreamMemOpAtomicReductionParams_st *pod = _cyb_calloc(1, sizeof(CUstreamMemOpAtomicReductionParams_st)) + if pod == NULL: + raise MemoryError("Error allocating CUstreamMemOpAtomicReductionParams_st") + try: + return _numpy.dtype({ + 'names': ['operation', 'flags_', 'reduction_op', 'data_type', 'address', 'value', 'alias'], + 'formats': [_numpy.int32, _numpy.uint32, _numpy.int32, _numpy.int32, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.operation)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.reductionOp)) - (pod), + (&(pod.dataType)) - (pod), + (&(pod.address)) - (pod), + (&(pod.value)) - (pod), + (&(pod.alias)) - (pod), + ], + 'itemsize': sizeof(CUstreamMemOpAtomicReductionParams_st), + }) + finally: + _cyb_free(pod) stream_mem_op_atomic_reduction_params_dtype = _get_stream_mem_op_atomic_reduction_params_dtype_offsets() @@ -3790,15 +3826,20 @@ cdef class StreamMemOpAtomicReductionParams: cdef _get__py_anon_pod3_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod3 pod - return _numpy.dtype({ - 'names': ['bytes_over_budget'], - 'formats': [_numpy.uint64], - 'offsets': [ - (&(pod.bytesOverBudget)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod3), - }) + cdef cuda_bindings_driver__anon_pod3 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod3)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod3") + try: + return _numpy.dtype({ + 'names': ['bytes_over_budget'], + 'formats': [_numpy.uint64], + 'offsets': [ + (&(pod.bytesOverBudget)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod3), + }) + finally: + _cyb_free(pod) _py_anon_pod3_dtype = _get__py_anon_pod3_dtype_offsets() @@ -3927,24 +3968,29 @@ cdef class _py_anon_pod3: cdef _get_dev_prop_v1_dtype_offsets(): - cdef CUdevprop_v1 pod - return _numpy.dtype({ - 'names': ['max_threads_per_block', 'max_threads_dim', 'max_grid_size', 'shared_mem_per_block', 'total_constant_memory', 'simd_width', 'mem_pitch', 'regs_per_block', 'clock_rate', 'texture_align'], - 'formats': [_numpy.int32, (_numpy.int32, 3), (_numpy.int32, 3), _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.maxThreadsPerBlock)) - (&pod), - (&(pod.maxThreadsDim)) - (&pod), - (&(pod.maxGridSize)) - (&pod), - (&(pod.sharedMemPerBlock)) - (&pod), - (&(pod.totalConstantMemory)) - (&pod), - (&(pod.SIMDWidth)) - (&pod), - (&(pod.memPitch)) - (&pod), - (&(pod.regsPerBlock)) - (&pod), - (&(pod.clockRate)) - (&pod), - (&(pod.textureAlign)) - (&pod), - ], - 'itemsize': sizeof(CUdevprop_v1), - }) + cdef CUdevprop_v1 *pod = _cyb_calloc(1, sizeof(CUdevprop_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUdevprop_v1") + try: + return _numpy.dtype({ + 'names': ['max_threads_per_block', 'max_threads_dim', 'max_grid_size', 'shared_mem_per_block', 'total_constant_memory', 'simd_width', 'mem_pitch', 'regs_per_block', 'clock_rate', 'texture_align'], + 'formats': [_numpy.int32, (_numpy.int32, 3), (_numpy.int32, 3), _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.maxThreadsPerBlock)) - (pod), + (&(pod.maxThreadsDim)) - (pod), + (&(pod.maxGridSize)) - (pod), + (&(pod.sharedMemPerBlock)) - (pod), + (&(pod.totalConstantMemory)) - (pod), + (&(pod.SIMDWidth)) - (pod), + (&(pod.memPitch)) - (pod), + (&(pod.regsPerBlock)) - (pod), + (&(pod.clockRate)) - (pod), + (&(pod.textureAlign)) - (pod), + ], + 'itemsize': sizeof(CUdevprop_v1), + }) + finally: + _cyb_free(pod) dev_prop_v1_dtype = _get_dev_prop_v1_dtype_offsets() @@ -4172,19 +4218,24 @@ cdef class DevProp_v1: cdef _get_access_policy_window_v1_dtype_offsets(): - cdef CUaccessPolicyWindow_v1 pod - return _numpy.dtype({ - 'names': ['base_ptr', 'num_bytes', 'hit_ratio', 'hit_prop', 'miss_prop'], - 'formats': [_numpy.intp, _numpy.uint64, _numpy.float32, _numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.base_ptr)) - (&pod), - (&(pod.num_bytes)) - (&pod), - (&(pod.hitRatio)) - (&pod), - (&(pod.hitProp)) - (&pod), - (&(pod.missProp)) - (&pod), - ], - 'itemsize': sizeof(CUaccessPolicyWindow_v1), - }) + cdef CUaccessPolicyWindow_v1 *pod = _cyb_calloc(1, sizeof(CUaccessPolicyWindow_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUaccessPolicyWindow_v1") + try: + return _numpy.dtype({ + 'names': ['base_ptr', 'num_bytes', 'hit_ratio', 'hit_prop', 'miss_prop'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.float32, _numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.base_ptr)) - (pod), + (&(pod.num_bytes)) - (pod), + (&(pod.hitRatio)) - (pod), + (&(pod.hitProp)) - (pod), + (&(pod.missProp)) - (pod), + ], + 'itemsize': sizeof(CUaccessPolicyWindow_v1), + }) + finally: + _cyb_free(pod) access_policy_window_v1_dtype = _get_access_policy_window_v1_dtype_offsets() @@ -4345,26 +4396,31 @@ cdef class AccessPolicyWindow_v1: cdef _get_kernel_node_params_v2_dtype_offsets(): - cdef CUDA_KERNEL_NODE_PARAMS_v2 pod - return _numpy.dtype({ - 'names': ['func', 'grid_dim_x', 'grid_dim_y', 'grid_dim_z', 'block_dim_x', 'block_dim_y', 'block_dim_z', 'shared_mem_bytes', 'kernel_params', 'extra', 'kern', 'ctx'], - 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.func)) - (&pod), - (&(pod.gridDimX)) - (&pod), - (&(pod.gridDimY)) - (&pod), - (&(pod.gridDimZ)) - (&pod), - (&(pod.blockDimX)) - (&pod), - (&(pod.blockDimY)) - (&pod), - (&(pod.blockDimZ)) - (&pod), - (&(pod.sharedMemBytes)) - (&pod), - (&(pod.kernelParams)) - (&pod), - (&(pod.extra)) - (&pod), - (&(pod.kern)) - (&pod), - (&(pod.ctx)) - (&pod), - ], - 'itemsize': sizeof(CUDA_KERNEL_NODE_PARAMS_v2), - }) + cdef CUDA_KERNEL_NODE_PARAMS_v2 *pod = _cyb_calloc(1, sizeof(CUDA_KERNEL_NODE_PARAMS_v2)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_KERNEL_NODE_PARAMS_v2") + try: + return _numpy.dtype({ + 'names': ['func', 'grid_dim_x', 'grid_dim_y', 'grid_dim_z', 'block_dim_x', 'block_dim_y', 'block_dim_z', 'shared_mem_bytes', 'kernel_params', 'extra', 'kern', 'ctx'], + 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.func)) - (pod), + (&(pod.gridDimX)) - (pod), + (&(pod.gridDimY)) - (pod), + (&(pod.gridDimZ)) - (pod), + (&(pod.blockDimX)) - (pod), + (&(pod.blockDimY)) - (pod), + (&(pod.blockDimZ)) - (pod), + (&(pod.sharedMemBytes)) - (pod), + (&(pod.kernelParams)) - (pod), + (&(pod.extra)) - (pod), + (&(pod.kern)) - (pod), + (&(pod.ctx)) - (pod), + ], + 'itemsize': sizeof(CUDA_KERNEL_NODE_PARAMS_v2), + }) + finally: + _cyb_free(pod) kernel_node_params_v2_dtype = _get_kernel_node_params_v2_dtype_offsets() @@ -4602,26 +4658,31 @@ cdef class KernelNodeParams_v2: cdef _get_kernel_node_params_v3_dtype_offsets(): - cdef CUDA_KERNEL_NODE_PARAMS_v3 pod - return _numpy.dtype({ - 'names': ['func', 'grid_dim_x', 'grid_dim_y', 'grid_dim_z', 'block_dim_x', 'block_dim_y', 'block_dim_z', 'shared_mem_bytes', 'kernel_params', 'extra', 'kern', 'ctx'], - 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.func)) - (&pod), - (&(pod.gridDimX)) - (&pod), - (&(pod.gridDimY)) - (&pod), - (&(pod.gridDimZ)) - (&pod), - (&(pod.blockDimX)) - (&pod), - (&(pod.blockDimY)) - (&pod), - (&(pod.blockDimZ)) - (&pod), - (&(pod.sharedMemBytes)) - (&pod), - (&(pod.kernelParams)) - (&pod), - (&(pod.extra)) - (&pod), - (&(pod.kern)) - (&pod), - (&(pod.ctx)) - (&pod), - ], - 'itemsize': sizeof(CUDA_KERNEL_NODE_PARAMS_v3), - }) + cdef CUDA_KERNEL_NODE_PARAMS_v3 *pod = _cyb_calloc(1, sizeof(CUDA_KERNEL_NODE_PARAMS_v3)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_KERNEL_NODE_PARAMS_v3") + try: + return _numpy.dtype({ + 'names': ['func', 'grid_dim_x', 'grid_dim_y', 'grid_dim_z', 'block_dim_x', 'block_dim_y', 'block_dim_z', 'shared_mem_bytes', 'kernel_params', 'extra', 'kern', 'ctx'], + 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.func)) - (pod), + (&(pod.gridDimX)) - (pod), + (&(pod.gridDimY)) - (pod), + (&(pod.gridDimZ)) - (pod), + (&(pod.blockDimX)) - (pod), + (&(pod.blockDimY)) - (pod), + (&(pod.blockDimZ)) - (pod), + (&(pod.sharedMemBytes)) - (pod), + (&(pod.kernelParams)) - (pod), + (&(pod.extra)) - (pod), + (&(pod.kern)) - (pod), + (&(pod.ctx)) - (pod), + ], + 'itemsize': sizeof(CUDA_KERNEL_NODE_PARAMS_v3), + }) + finally: + _cyb_free(pod) kernel_node_params_v3_dtype = _get_kernel_node_params_v3_dtype_offsets() @@ -4871,20 +4932,25 @@ cdef class KernelNodeParams_v3: cdef _get_mem_set_node_params_v1_dtype_offsets(): - cdef CUDA_MEMSET_NODE_PARAMS_v1 pod - return _numpy.dtype({ - 'names': ['dst', 'pitch', 'value', 'element_size', 'width', 'height'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.dst)) - (&pod), - (&(pod.pitch)) - (&pod), - (&(pod.value)) - (&pod), - (&(pod.elementSize)) - (&pod), - (&(pod.width)) - (&pod), - (&(pod.height)) - (&pod), - ], - 'itemsize': sizeof(CUDA_MEMSET_NODE_PARAMS_v1), - }) + cdef CUDA_MEMSET_NODE_PARAMS_v1 *pod = _cyb_calloc(1, sizeof(CUDA_MEMSET_NODE_PARAMS_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_MEMSET_NODE_PARAMS_v1") + try: + return _numpy.dtype({ + 'names': ['dst', 'pitch', 'value', 'element_size', 'width', 'height'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.dst)) - (pod), + (&(pod.pitch)) - (pod), + (&(pod.value)) - (pod), + (&(pod.elementSize)) - (pod), + (&(pod.width)) - (pod), + (&(pod.height)) - (pod), + ], + 'itemsize': sizeof(CUDA_MEMSET_NODE_PARAMS_v1), + }) + finally: + _cyb_free(pod) mem_set_node_params_v1_dtype = _get_mem_set_node_params_v1_dtype_offsets() @@ -5056,21 +5122,26 @@ cdef class MemSetNodeParams_v1: cdef _get_mem_set_node_params_v2_dtype_offsets(): - cdef CUDA_MEMSET_NODE_PARAMS_v2 pod - return _numpy.dtype({ - 'names': ['dst', 'pitch', 'value', 'element_size', 'width', 'height', 'ctx'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.intp], - 'offsets': [ - (&(pod.dst)) - (&pod), - (&(pod.pitch)) - (&pod), - (&(pod.value)) - (&pod), - (&(pod.elementSize)) - (&pod), - (&(pod.width)) - (&pod), - (&(pod.height)) - (&pod), - (&(pod.ctx)) - (&pod), - ], - 'itemsize': sizeof(CUDA_MEMSET_NODE_PARAMS_v2), - }) + cdef CUDA_MEMSET_NODE_PARAMS_v2 *pod = _cyb_calloc(1, sizeof(CUDA_MEMSET_NODE_PARAMS_v2)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_MEMSET_NODE_PARAMS_v2") + try: + return _numpy.dtype({ + 'names': ['dst', 'pitch', 'value', 'element_size', 'width', 'height', 'ctx'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.intp], + 'offsets': [ + (&(pod.dst)) - (pod), + (&(pod.pitch)) - (pod), + (&(pod.value)) - (pod), + (&(pod.elementSize)) - (pod), + (&(pod.width)) - (pod), + (&(pod.height)) - (pod), + (&(pod.ctx)) - (pod), + ], + 'itemsize': sizeof(CUDA_MEMSET_NODE_PARAMS_v2), + }) + finally: + _cyb_free(pod) mem_set_node_params_v2_dtype = _get_mem_set_node_params_v2_dtype_offsets() @@ -5265,16 +5336,21 @@ cdef class MemSetNodeParams_v2: cdef _get_host_node_params_v1_dtype_offsets(): - cdef CUDA_HOST_NODE_PARAMS_v1 pod - return _numpy.dtype({ - 'names': ['fn', 'user_data'], - 'formats': [_numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.fn)) - (&pod), - (&(pod.userData)) - (&pod), - ], - 'itemsize': sizeof(CUDA_HOST_NODE_PARAMS_v1), - }) + cdef CUDA_HOST_NODE_PARAMS_v1 *pod = _cyb_calloc(1, sizeof(CUDA_HOST_NODE_PARAMS_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_HOST_NODE_PARAMS_v1") + try: + return _numpy.dtype({ + 'names': ['fn', 'user_data'], + 'formats': [_numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.fn)) - (pod), + (&(pod.userData)) - (pod), + ], + 'itemsize': sizeof(CUDA_HOST_NODE_PARAMS_v1), + }) + finally: + _cyb_free(pod) host_node_params_v1_dtype = _get_host_node_params_v1_dtype_offsets() @@ -5402,19 +5478,24 @@ cdef class HostNodeParams_v1: cdef _get_conditional_node_params_dtype_offsets(): - cdef CUDA_CONDITIONAL_NODE_PARAMS pod - return _numpy.dtype({ - 'names': ['handle', 'type', 'size_', 'ph_graph_out', 'ctx'], - 'formats': [_numpy.uint64, _numpy.int32, _numpy.uint32, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.handle)) - (&pod), - (&(pod.type)) - (&pod), - (&(pod.size)) - (&pod), - (&(pod.phGraph_out)) - (&pod), - (&(pod.ctx)) - (&pod), - ], - 'itemsize': sizeof(CUDA_CONDITIONAL_NODE_PARAMS), - }) + cdef CUDA_CONDITIONAL_NODE_PARAMS *pod = _cyb_calloc(1, sizeof(CUDA_CONDITIONAL_NODE_PARAMS)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_CONDITIONAL_NODE_PARAMS") + try: + return _numpy.dtype({ + 'names': ['handle', 'type', 'size_', 'ph_graph_out', 'ctx'], + 'formats': [_numpy.uint64, _numpy.int32, _numpy.uint32, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.handle)) - (pod), + (&(pod.type)) - (pod), + (&(pod.size)) - (pod), + (&(pod.phGraph_out)) - (pod), + (&(pod.ctx)) - (pod), + ], + 'itemsize': sizeof(CUDA_CONDITIONAL_NODE_PARAMS), + }) + finally: + _cyb_free(pod) conditional_node_params_dtype = _get_conditional_node_params_dtype_offsets() @@ -5587,18 +5668,23 @@ cdef class ConditionalNodeParams: cdef _get_graph_edge_data_dtype_offsets(): - cdef CUgraphEdgeData pod - return _numpy.dtype({ - 'names': ['from_port', 'to_port', 'type', 'reserved'], - 'formats': [_numpy.uint8, _numpy.uint8, _numpy.uint8, (_numpy.uint8, 5)], - 'offsets': [ - (&(pod.from_port)) - (&pod), - (&(pod.to_port)) - (&pod), - (&(pod.type)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUgraphEdgeData), - }) + cdef CUgraphEdgeData *pod = _cyb_calloc(1, sizeof(CUgraphEdgeData)) + if pod == NULL: + raise MemoryError("Error allocating CUgraphEdgeData") + try: + return _numpy.dtype({ + 'names': ['from_port', 'to_port', 'type', 'reserved'], + 'formats': [_numpy.uint8, _numpy.uint8, _numpy.uint8, (_numpy.uint8, 5)], + 'offsets': [ + (&(pod.from_port)) - (pod), + (&(pod.to_port)) - (pod), + (&(pod.type)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUgraphEdgeData), + }) + finally: + _cyb_free(pod) graph_edge_data_dtype = _get_graph_edge_data_dtype_offsets() cdef object graph_edge_data_dtype_record = _numpy.dtype((_numpy.record, graph_edge_data_dtype)) @@ -5770,18 +5856,23 @@ cdef class GraphEdgeData: cdef _get_graph_instantiate_params_dtype_offsets(): - cdef CUDA_GRAPH_INSTANTIATE_PARAMS pod - return _numpy.dtype({ - 'names': ['flags_', 'h_upload_stream', 'h_err_node_out', 'result_out'], - 'formats': [_numpy.uint64, _numpy.intp, _numpy.intp, _numpy.int32], - 'offsets': [ - (&(pod.flags)) - (&pod), - (&(pod.hUploadStream)) - (&pod), - (&(pod.hErrNode_out)) - (&pod), - (&(pod.result_out)) - (&pod), - ], - 'itemsize': sizeof(CUDA_GRAPH_INSTANTIATE_PARAMS), - }) + cdef CUDA_GRAPH_INSTANTIATE_PARAMS *pod = _cyb_calloc(1, sizeof(CUDA_GRAPH_INSTANTIATE_PARAMS)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_GRAPH_INSTANTIATE_PARAMS") + try: + return _numpy.dtype({ + 'names': ['flags_', 'h_upload_stream', 'h_err_node_out', 'result_out'], + 'formats': [_numpy.uint64, _numpy.intp, _numpy.intp, _numpy.int32], + 'offsets': [ + (&(pod.flags)) - (pod), + (&(pod.hUploadStream)) - (pod), + (&(pod.hErrNode_out)) - (pod), + (&(pod.result_out)) - (pod), + ], + 'itemsize': sizeof(CUDA_GRAPH_INSTANTIATE_PARAMS), + }) + finally: + _cyb_free(pod) graph_instantiate_params_dtype = _get_graph_instantiate_params_dtype_offsets() @@ -5931,16 +6022,21 @@ cdef class GraphInstantiateParams: cdef _get_launch_mem_sync_domain_map_dtype_offsets(): - cdef CUlaunchMemSyncDomainMap pod - return _numpy.dtype({ - 'names': ['default_', 'remote'], - 'formats': [_numpy.uint8, _numpy.uint8], - 'offsets': [ - (&(pod.default_)) - (&pod), - (&(pod.remote)) - (&pod), - ], - 'itemsize': sizeof(CUlaunchMemSyncDomainMap), - }) + cdef CUlaunchMemSyncDomainMap *pod = _cyb_calloc(1, sizeof(CUlaunchMemSyncDomainMap)) + if pod == NULL: + raise MemoryError("Error allocating CUlaunchMemSyncDomainMap") + try: + return _numpy.dtype({ + 'names': ['default_', 'remote'], + 'formats': [_numpy.uint8, _numpy.uint8], + 'offsets': [ + (&(pod.default_)) - (pod), + (&(pod.remote)) - (pod), + ], + 'itemsize': sizeof(CUlaunchMemSyncDomainMap), + }) + finally: + _cyb_free(pod) launch_mem_sync_domain_map_dtype = _get_launch_mem_sync_domain_map_dtype_offsets() @@ -6080,17 +6176,22 @@ cdef class LaunchMemSyncDomainMap: cdef _get__py_anon_pod5_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod5 pod - return _numpy.dtype({ - 'names': ['x', 'y', 'z'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.x)) - (&pod), - (&(pod.y)) - (&pod), - (&(pod.z)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod5), - }) + cdef cuda_bindings_driver__anon_pod5 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod5)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod5") + try: + return _numpy.dtype({ + 'names': ['x', 'y', 'z'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.x)) - (pod), + (&(pod.y)) - (pod), + (&(pod.z)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod5), + }) + finally: + _cyb_free(pod) _py_anon_pod5_dtype = _get__py_anon_pod5_dtype_offsets() @@ -6241,17 +6342,22 @@ cdef class _py_anon_pod5: cdef _get__py_anon_pod6_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod6 pod - return _numpy.dtype({ - 'names': ['event', 'flags_', 'trigger_at_block_start'], - 'formats': [_numpy.intp, _numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.event)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.triggerAtBlockStart)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod6), - }) + cdef cuda_bindings_driver__anon_pod6 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod6)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod6") + try: + return _numpy.dtype({ + 'names': ['event', 'flags_', 'trigger_at_block_start'], + 'formats': [_numpy.intp, _numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.event)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.triggerAtBlockStart)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod6), + }) + finally: + _cyb_free(pod) _py_anon_pod6_dtype = _get__py_anon_pod6_dtype_offsets() @@ -6402,16 +6508,21 @@ cdef class _py_anon_pod6: cdef _get__py_anon_pod7_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod7 pod - return _numpy.dtype({ - 'names': ['event', 'flags_'], - 'formats': [_numpy.intp, _numpy.int32], - 'offsets': [ - (&(pod.event)) - (&pod), - (&(pod.flags)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod7), - }) + cdef cuda_bindings_driver__anon_pod7 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod7)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod7") + try: + return _numpy.dtype({ + 'names': ['event', 'flags_'], + 'formats': [_numpy.intp, _numpy.int32], + 'offsets': [ + (&(pod.event)) - (pod), + (&(pod.flags)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod7), + }) + finally: + _cyb_free(pod) _py_anon_pod7_dtype = _get__py_anon_pod7_dtype_offsets() @@ -6551,17 +6662,22 @@ cdef class _py_anon_pod7: cdef _get__py_anon_pod8_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod8 pod - return _numpy.dtype({ - 'names': ['x', 'y', 'z'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.x)) - (&pod), - (&(pod.y)) - (&pod), - (&(pod.z)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod8), - }) + cdef cuda_bindings_driver__anon_pod8 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod8)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod8") + try: + return _numpy.dtype({ + 'names': ['x', 'y', 'z'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.x)) - (pod), + (&(pod.y)) - (pod), + (&(pod.z)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod8), + }) + finally: + _cyb_free(pod) _py_anon_pod8_dtype = _get__py_anon_pod8_dtype_offsets() @@ -6712,16 +6828,21 @@ cdef class _py_anon_pod8: cdef _get__py_anon_pod9_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod9 pod - return _numpy.dtype({ - 'names': ['device_updatable', 'dev_node'], - 'formats': [_numpy.int32, _numpy.intp], - 'offsets': [ - (&(pod.deviceUpdatable)) - (&pod), - (&(pod.devNode)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod9), - }) + cdef cuda_bindings_driver__anon_pod9 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod9)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod9") + try: + return _numpy.dtype({ + 'names': ['device_updatable', 'dev_node'], + 'formats': [_numpy.int32, _numpy.intp], + 'offsets': [ + (&(pod.deviceUpdatable)) - (pod), + (&(pod.devNode)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod9), + }) + finally: + _cyb_free(pod) _py_anon_pod9_dtype = _get__py_anon_pod9_dtype_offsets() @@ -6861,15 +6982,20 @@ cdef class _py_anon_pod9: cdef _get_exec_affinity_sm_count_v1_dtype_offsets(): - cdef CUexecAffinitySmCount_v1 pod - return _numpy.dtype({ - 'names': ['val'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.val)) - (&pod), - ], - 'itemsize': sizeof(CUexecAffinitySmCount_v1), - }) + cdef CUexecAffinitySmCount_v1 *pod = _cyb_calloc(1, sizeof(CUexecAffinitySmCount_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUexecAffinitySmCount_v1") + try: + return _numpy.dtype({ + 'names': ['val'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.val)) - (pod), + ], + 'itemsize': sizeof(CUexecAffinitySmCount_v1), + }) + finally: + _cyb_free(pod) exec_affinity_sm_count_v1_dtype = _get_exec_affinity_sm_count_v1_dtype_offsets() @@ -6986,16 +7112,21 @@ cdef class ExecAffinitySmCount_v1: cdef _get_ctx_cig_param_dtype_offsets(): - cdef CUctxCigParam pod - return _numpy.dtype({ - 'names': ['shared_data_type', 'shared_data'], - 'formats': [_numpy.int32, _numpy.intp], - 'offsets': [ - (&(pod.sharedDataType)) - (&pod), - (&(pod.sharedData)) - (&pod), - ], - 'itemsize': sizeof(CUctxCigParam), - }) + cdef CUctxCigParam *pod = _cyb_calloc(1, sizeof(CUctxCigParam)) + if pod == NULL: + raise MemoryError("Error allocating CUctxCigParam") + try: + return _numpy.dtype({ + 'names': ['shared_data_type', 'shared_data'], + 'formats': [_numpy.int32, _numpy.intp], + 'offsets': [ + (&(pod.sharedDataType)) - (pod), + (&(pod.sharedData)) - (pod), + ], + 'itemsize': sizeof(CUctxCigParam), + }) + finally: + _cyb_free(pod) ctx_cig_param_dtype = _get_ctx_cig_param_dtype_offsets() @@ -7123,18 +7254,23 @@ cdef class CtxCigParam: cdef _get_library_host_universal_function_and_data_table_dtype_offsets(): - cdef CUlibraryHostUniversalFunctionAndDataTable pod - return _numpy.dtype({ - 'names': ['function_table', 'function_window_size', 'data_table', 'data_window_size'], - 'formats': [_numpy.intp, _numpy.uint64, _numpy.intp, _numpy.uint64], - 'offsets': [ - (&(pod.functionTable)) - (&pod), - (&(pod.functionWindowSize)) - (&pod), - (&(pod.dataTable)) - (&pod), - (&(pod.dataWindowSize)) - (&pod), - ], - 'itemsize': sizeof(CUlibraryHostUniversalFunctionAndDataTable), - }) + cdef CUlibraryHostUniversalFunctionAndDataTable *pod = _cyb_calloc(1, sizeof(CUlibraryHostUniversalFunctionAndDataTable)) + if pod == NULL: + raise MemoryError("Error allocating CUlibraryHostUniversalFunctionAndDataTable") + try: + return _numpy.dtype({ + 'names': ['function_table', 'function_window_size', 'data_table', 'data_window_size'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.intp, _numpy.uint64], + 'offsets': [ + (&(pod.functionTable)) - (pod), + (&(pod.functionWindowSize)) - (pod), + (&(pod.dataTable)) - (pod), + (&(pod.dataWindowSize)) - (pod), + ], + 'itemsize': sizeof(CUlibraryHostUniversalFunctionAndDataTable), + }) + finally: + _cyb_free(pod) library_host_universal_function_and_data_table_dtype = _get_library_host_universal_function_and_data_table_dtype_offsets() @@ -7284,30 +7420,35 @@ cdef class LibraryHostUniversalFunctionAndDataTable: cdef _get_mem_cpy2d_v2_dtype_offsets(): - cdef CUDA_MEMCPY2D_v2 pod - return _numpy.dtype({ - 'names': ['src_x_in_bytes', 'src_y', 'src_memory_type', 'src_host', 'src_device', 'src_array', 'src_pitch', 'dst_x_in_bytes', 'dst_y', 'dst_memory_type', 'dst_host', 'dst_device', 'dst_array', 'dst_pitch', 'width_in_bytes', 'height'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.srcXInBytes)) - (&pod), - (&(pod.srcY)) - (&pod), - (&(pod.srcMemoryType)) - (&pod), - (&(pod.srcHost)) - (&pod), - (&(pod.srcDevice)) - (&pod), - (&(pod.srcArray)) - (&pod), - (&(pod.srcPitch)) - (&pod), - (&(pod.dstXInBytes)) - (&pod), - (&(pod.dstY)) - (&pod), - (&(pod.dstMemoryType)) - (&pod), - (&(pod.dstHost)) - (&pod), - (&(pod.dstDevice)) - (&pod), - (&(pod.dstArray)) - (&pod), - (&(pod.dstPitch)) - (&pod), - (&(pod.WidthInBytes)) - (&pod), - (&(pod.Height)) - (&pod), - ], - 'itemsize': sizeof(CUDA_MEMCPY2D_v2), - }) + cdef CUDA_MEMCPY2D_v2 *pod = _cyb_calloc(1, sizeof(CUDA_MEMCPY2D_v2)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_MEMCPY2D_v2") + try: + return _numpy.dtype({ + 'names': ['src_x_in_bytes', 'src_y', 'src_memory_type', 'src_host', 'src_device', 'src_array', 'src_pitch', 'dst_x_in_bytes', 'dst_y', 'dst_memory_type', 'dst_host', 'dst_device', 'dst_array', 'dst_pitch', 'width_in_bytes', 'height'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.srcXInBytes)) - (pod), + (&(pod.srcY)) - (pod), + (&(pod.srcMemoryType)) - (pod), + (&(pod.srcHost)) - (pod), + (&(pod.srcDevice)) - (pod), + (&(pod.srcArray)) - (pod), + (&(pod.srcPitch)) - (pod), + (&(pod.dstXInBytes)) - (pod), + (&(pod.dstY)) - (pod), + (&(pod.dstMemoryType)) - (pod), + (&(pod.dstHost)) - (pod), + (&(pod.dstDevice)) - (pod), + (&(pod.dstArray)) - (pod), + (&(pod.dstPitch)) - (pod), + (&(pod.WidthInBytes)) - (pod), + (&(pod.Height)) - (pod), + ], + 'itemsize': sizeof(CUDA_MEMCPY2D_v2), + }) + finally: + _cyb_free(pod) mem_cpy2d_v2_dtype = _get_mem_cpy2d_v2_dtype_offsets() @@ -7589,39 +7730,44 @@ cdef class MemCpy2d_v2: cdef _get_mem_cpy3d_v2_dtype_offsets(): - cdef CUDA_MEMCPY3D_v2 pod - return _numpy.dtype({ - 'names': ['src_x_in_bytes', 'src_y', 'src_z', 'src_lod', 'src_memory_type', 'src_host', 'src_device', 'src_array', 'reserved0', 'src_pitch', 'src_height', 'dst_x_in_bytes', 'dst_y', 'dst_z', 'dst_lod', 'dst_memory_type', 'dst_host', 'dst_device', 'dst_array', 'reserved1', 'dst_pitch', 'dst_height', 'width_in_bytes', 'height', 'depth'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.srcXInBytes)) - (&pod), - (&(pod.srcY)) - (&pod), - (&(pod.srcZ)) - (&pod), - (&(pod.srcLOD)) - (&pod), - (&(pod.srcMemoryType)) - (&pod), - (&(pod.srcHost)) - (&pod), - (&(pod.srcDevice)) - (&pod), - (&(pod.srcArray)) - (&pod), - (&(pod.reserved0)) - (&pod), - (&(pod.srcPitch)) - (&pod), - (&(pod.srcHeight)) - (&pod), - (&(pod.dstXInBytes)) - (&pod), - (&(pod.dstY)) - (&pod), - (&(pod.dstZ)) - (&pod), - (&(pod.dstLOD)) - (&pod), - (&(pod.dstMemoryType)) - (&pod), - (&(pod.dstHost)) - (&pod), - (&(pod.dstDevice)) - (&pod), - (&(pod.dstArray)) - (&pod), - (&(pod.reserved1)) - (&pod), - (&(pod.dstPitch)) - (&pod), - (&(pod.dstHeight)) - (&pod), - (&(pod.WidthInBytes)) - (&pod), - (&(pod.Height)) - (&pod), - (&(pod.Depth)) - (&pod), - ], - 'itemsize': sizeof(CUDA_MEMCPY3D_v2), - }) + cdef CUDA_MEMCPY3D_v2 *pod = _cyb_calloc(1, sizeof(CUDA_MEMCPY3D_v2)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_MEMCPY3D_v2") + try: + return _numpy.dtype({ + 'names': ['src_x_in_bytes', 'src_y', 'src_z', 'src_lod', 'src_memory_type', 'src_host', 'src_device', 'src_array', 'reserved0', 'src_pitch', 'src_height', 'dst_x_in_bytes', 'dst_y', 'dst_z', 'dst_lod', 'dst_memory_type', 'dst_host', 'dst_device', 'dst_array', 'reserved1', 'dst_pitch', 'dst_height', 'width_in_bytes', 'height', 'depth'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.srcXInBytes)) - (pod), + (&(pod.srcY)) - (pod), + (&(pod.srcZ)) - (pod), + (&(pod.srcLOD)) - (pod), + (&(pod.srcMemoryType)) - (pod), + (&(pod.srcHost)) - (pod), + (&(pod.srcDevice)) - (pod), + (&(pod.srcArray)) - (pod), + (&(pod.reserved0)) - (pod), + (&(pod.srcPitch)) - (pod), + (&(pod.srcHeight)) - (pod), + (&(pod.dstXInBytes)) - (pod), + (&(pod.dstY)) - (pod), + (&(pod.dstZ)) - (pod), + (&(pod.dstLOD)) - (pod), + (&(pod.dstMemoryType)) - (pod), + (&(pod.dstHost)) - (pod), + (&(pod.dstDevice)) - (pod), + (&(pod.dstArray)) - (pod), + (&(pod.reserved1)) - (pod), + (&(pod.dstPitch)) - (pod), + (&(pod.dstHeight)) - (pod), + (&(pod.WidthInBytes)) - (pod), + (&(pod.Height)) - (pod), + (&(pod.Depth)) - (pod), + ], + 'itemsize': sizeof(CUDA_MEMCPY3D_v2), + }) + finally: + _cyb_free(pod) mem_cpy3d_v2_dtype = _get_mem_cpy3d_v2_dtype_offsets() @@ -7980,39 +8126,44 @@ cdef class MemCpy3d_v2: cdef _get_mem_cpy3d_peer_v1_dtype_offsets(): - cdef CUDA_MEMCPY3D_PEER_v1 pod - return _numpy.dtype({ - 'names': ['src_x_in_bytes', 'src_y', 'src_z', 'src_lod', 'src_memory_type', 'src_host', 'src_device', 'src_array', 'src_context', 'src_pitch', 'src_height', 'dst_x_in_bytes', 'dst_y', 'dst_z', 'dst_lod', 'dst_memory_type', 'dst_host', 'dst_device', 'dst_array', 'dst_context', 'dst_pitch', 'dst_height', 'width_in_bytes', 'height', 'depth'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.srcXInBytes)) - (&pod), - (&(pod.srcY)) - (&pod), - (&(pod.srcZ)) - (&pod), - (&(pod.srcLOD)) - (&pod), - (&(pod.srcMemoryType)) - (&pod), - (&(pod.srcHost)) - (&pod), - (&(pod.srcDevice)) - (&pod), - (&(pod.srcArray)) - (&pod), - (&(pod.srcContext)) - (&pod), - (&(pod.srcPitch)) - (&pod), - (&(pod.srcHeight)) - (&pod), - (&(pod.dstXInBytes)) - (&pod), - (&(pod.dstY)) - (&pod), - (&(pod.dstZ)) - (&pod), - (&(pod.dstLOD)) - (&pod), - (&(pod.dstMemoryType)) - (&pod), - (&(pod.dstHost)) - (&pod), - (&(pod.dstDevice)) - (&pod), - (&(pod.dstArray)) - (&pod), - (&(pod.dstContext)) - (&pod), - (&(pod.dstPitch)) - (&pod), - (&(pod.dstHeight)) - (&pod), - (&(pod.WidthInBytes)) - (&pod), - (&(pod.Height)) - (&pod), - (&(pod.Depth)) - (&pod), - ], - 'itemsize': sizeof(CUDA_MEMCPY3D_PEER_v1), - }) + cdef CUDA_MEMCPY3D_PEER_v1 *pod = _cyb_calloc(1, sizeof(CUDA_MEMCPY3D_PEER_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_MEMCPY3D_PEER_v1") + try: + return _numpy.dtype({ + 'names': ['src_x_in_bytes', 'src_y', 'src_z', 'src_lod', 'src_memory_type', 'src_host', 'src_device', 'src_array', 'src_context', 'src_pitch', 'src_height', 'dst_x_in_bytes', 'dst_y', 'dst_z', 'dst_lod', 'dst_memory_type', 'dst_host', 'dst_device', 'dst_array', 'dst_context', 'dst_pitch', 'dst_height', 'width_in_bytes', 'height', 'depth'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.srcXInBytes)) - (pod), + (&(pod.srcY)) - (pod), + (&(pod.srcZ)) - (pod), + (&(pod.srcLOD)) - (pod), + (&(pod.srcMemoryType)) - (pod), + (&(pod.srcHost)) - (pod), + (&(pod.srcDevice)) - (pod), + (&(pod.srcArray)) - (pod), + (&(pod.srcContext)) - (pod), + (&(pod.srcPitch)) - (pod), + (&(pod.srcHeight)) - (pod), + (&(pod.dstXInBytes)) - (pod), + (&(pod.dstY)) - (pod), + (&(pod.dstZ)) - (pod), + (&(pod.dstLOD)) - (pod), + (&(pod.dstMemoryType)) - (pod), + (&(pod.dstHost)) - (pod), + (&(pod.dstDevice)) - (pod), + (&(pod.dstArray)) - (pod), + (&(pod.dstContext)) - (pod), + (&(pod.dstPitch)) - (pod), + (&(pod.dstHeight)) - (pod), + (&(pod.WidthInBytes)) - (pod), + (&(pod.Height)) - (pod), + (&(pod.Depth)) - (pod), + ], + 'itemsize': sizeof(CUDA_MEMCPY3D_PEER_v1), + }) + finally: + _cyb_free(pod) mem_cpy3d_peer_v1_dtype = _get_mem_cpy3d_peer_v1_dtype_offsets() @@ -8393,18 +8544,23 @@ cdef class MemCpy3dPeer_v1: cdef _get_array_descriptor_v2_dtype_offsets(): - cdef CUDA_ARRAY_DESCRIPTOR_v2 pod - return _numpy.dtype({ - 'names': ['width', 'height', 'format', 'num_channels'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.uint32], - 'offsets': [ - (&(pod.Width)) - (&pod), - (&(pod.Height)) - (&pod), - (&(pod.Format)) - (&pod), - (&(pod.NumChannels)) - (&pod), - ], - 'itemsize': sizeof(CUDA_ARRAY_DESCRIPTOR_v2), - }) + cdef CUDA_ARRAY_DESCRIPTOR_v2 *pod = _cyb_calloc(1, sizeof(CUDA_ARRAY_DESCRIPTOR_v2)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_ARRAY_DESCRIPTOR_v2") + try: + return _numpy.dtype({ + 'names': ['width', 'height', 'format', 'num_channels'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.uint32], + 'offsets': [ + (&(pod.Width)) - (pod), + (&(pod.Height)) - (pod), + (&(pod.Format)) - (pod), + (&(pod.NumChannels)) - (pod), + ], + 'itemsize': sizeof(CUDA_ARRAY_DESCRIPTOR_v2), + }) + finally: + _cyb_free(pod) array_descriptor_v2_dtype = _get_array_descriptor_v2_dtype_offsets() @@ -8554,20 +8710,25 @@ cdef class ArrayDescriptor_v2: cdef _get_array3d_descriptor_v2_dtype_offsets(): - cdef CUDA_ARRAY3D_DESCRIPTOR_v2 pod - return _numpy.dtype({ - 'names': ['width', 'height', 'depth', 'format', 'num_channels', 'flags_'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.Width)) - (&pod), - (&(pod.Height)) - (&pod), - (&(pod.Depth)) - (&pod), - (&(pod.Format)) - (&pod), - (&(pod.NumChannels)) - (&pod), - (&(pod.Flags)) - (&pod), - ], - 'itemsize': sizeof(CUDA_ARRAY3D_DESCRIPTOR_v2), - }) + cdef CUDA_ARRAY3D_DESCRIPTOR_v2 *pod = _cyb_calloc(1, sizeof(CUDA_ARRAY3D_DESCRIPTOR_v2)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_ARRAY3D_DESCRIPTOR_v2") + try: + return _numpy.dtype({ + 'names': ['width', 'height', 'depth', 'format', 'num_channels', 'flags_'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.Width)) - (pod), + (&(pod.Height)) - (pod), + (&(pod.Depth)) - (pod), + (&(pod.Format)) - (pod), + (&(pod.NumChannels)) - (pod), + (&(pod.Flags)) - (pod), + ], + 'itemsize': sizeof(CUDA_ARRAY3D_DESCRIPTOR_v2), + }) + finally: + _cyb_free(pod) array3d_descriptor_v2_dtype = _get_array3d_descriptor_v2_dtype_offsets() @@ -8739,17 +8900,22 @@ cdef class Array3dDescriptor_v2: cdef _get__py_anon_pod11_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod11 pod - return _numpy.dtype({ - 'names': ['width', 'height', 'depth'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.width)) - (&pod), - (&(pod.height)) - (&pod), - (&(pod.depth)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod11), - }) + cdef cuda_bindings_driver__anon_pod11 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod11)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod11") + try: + return _numpy.dtype({ + 'names': ['width', 'height', 'depth'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.width)) - (pod), + (&(pod.height)) - (pod), + (&(pod.depth)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod11), + }) + finally: + _cyb_free(pod) _py_anon_pod11_dtype = _get__py_anon_pod11_dtype_offsets() @@ -8900,17 +9066,22 @@ cdef class _py_anon_pod11: cdef _get_array_memory_requirements_v1_dtype_offsets(): - cdef CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 pod - return _numpy.dtype({ - 'names': ['size_', 'alignment', 'reserved'], - 'formats': [_numpy.uint64, _numpy.uint64, (_numpy.uint32, 4)], - 'offsets': [ - (&(pod.size)) - (&pod), - (&(pod.alignment)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUDA_ARRAY_MEMORY_REQUIREMENTS_v1), - }) + cdef CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 *pod = _cyb_calloc(1, sizeof(CUDA_ARRAY_MEMORY_REQUIREMENTS_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_ARRAY_MEMORY_REQUIREMENTS_v1") + try: + return _numpy.dtype({ + 'names': ['size_', 'alignment', 'reserved'], + 'formats': [_numpy.uint64, _numpy.uint64, (_numpy.uint32, 4)], + 'offsets': [ + (&(pod.size)) - (pod), + (&(pod.alignment)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUDA_ARRAY_MEMORY_REQUIREMENTS_v1), + }) + finally: + _cyb_free(pod) array_memory_requirements_v1_dtype = _get_array_memory_requirements_v1_dtype_offsets() @@ -9038,15 +9209,20 @@ cdef class ArrayMemoryRequirements_v1: cdef _get__py_anon_pod13_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod13 pod - return _numpy.dtype({ - 'names': ['h_array'], - 'formats': [_numpy.intp], - 'offsets': [ - (&(pod.hArray)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod13), - }) + cdef cuda_bindings_driver__anon_pod13 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod13)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod13") + try: + return _numpy.dtype({ + 'names': ['h_array'], + 'formats': [_numpy.intp], + 'offsets': [ + (&(pod.hArray)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod13), + }) + finally: + _cyb_free(pod) _py_anon_pod13_dtype = _get__py_anon_pod13_dtype_offsets() @@ -9175,15 +9351,20 @@ cdef class _py_anon_pod13: cdef _get__py_anon_pod14_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod14 pod - return _numpy.dtype({ - 'names': ['h_mipmapped_array'], - 'formats': [_numpy.intp], - 'offsets': [ - (&(pod.hMipmappedArray)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod14), - }) + cdef cuda_bindings_driver__anon_pod14 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod14)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod14") + try: + return _numpy.dtype({ + 'names': ['h_mipmapped_array'], + 'formats': [_numpy.intp], + 'offsets': [ + (&(pod.hMipmappedArray)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod14), + }) + finally: + _cyb_free(pod) _py_anon_pod14_dtype = _get__py_anon_pod14_dtype_offsets() @@ -9312,18 +9493,23 @@ cdef class _py_anon_pod14: cdef _get__py_anon_pod15_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod15 pod - return _numpy.dtype({ - 'names': ['dev_ptr', 'format', 'num_channels', 'size_in_bytes'], - 'formats': [_numpy.uint64, _numpy.int32, _numpy.uint32, _numpy.uint64], - 'offsets': [ - (&(pod.devPtr)) - (&pod), - (&(pod.format)) - (&pod), - (&(pod.numChannels)) - (&pod), - (&(pod.sizeInBytes)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod15), - }) + cdef cuda_bindings_driver__anon_pod15 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod15)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod15") + try: + return _numpy.dtype({ + 'names': ['dev_ptr', 'format', 'num_channels', 'size_in_bytes'], + 'formats': [_numpy.uint64, _numpy.int32, _numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.devPtr)) - (pod), + (&(pod.format)) - (pod), + (&(pod.numChannels)) - (pod), + (&(pod.sizeInBytes)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod15), + }) + finally: + _cyb_free(pod) _py_anon_pod15_dtype = _get__py_anon_pod15_dtype_offsets() @@ -9485,20 +9671,25 @@ cdef class _py_anon_pod15: cdef _get__py_anon_pod16_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod16 pod - return _numpy.dtype({ - 'names': ['dev_ptr', 'format', 'num_channels', 'width', 'height', 'pitch_in_bytes'], - 'formats': [_numpy.uint64, _numpy.int32, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.devPtr)) - (&pod), - (&(pod.format)) - (&pod), - (&(pod.numChannels)) - (&pod), - (&(pod.width)) - (&pod), - (&(pod.height)) - (&pod), - (&(pod.pitchInBytes)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod16), - }) + cdef cuda_bindings_driver__anon_pod16 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod16)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod16") + try: + return _numpy.dtype({ + 'names': ['dev_ptr', 'format', 'num_channels', 'width', 'height', 'pitch_in_bytes'], + 'formats': [_numpy.uint64, _numpy.int32, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.devPtr)) - (pod), + (&(pod.format)) - (pod), + (&(pod.numChannels)) - (pod), + (&(pod.width)) - (pod), + (&(pod.height)) - (pod), + (&(pod.pitchInBytes)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod16), + }) + finally: + _cyb_free(pod) _py_anon_pod16_dtype = _get__py_anon_pod16_dtype_offsets() @@ -9682,15 +9873,20 @@ cdef class _py_anon_pod16: cdef _get__py_anon_pod17_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod17 pod - return _numpy.dtype({ - 'names': ['reserved'], - 'formats': [(_numpy.int32, 32)], - 'offsets': [ - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod17), - }) + cdef cuda_bindings_driver__anon_pod17 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod17)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod17") + try: + return _numpy.dtype({ + 'names': ['reserved'], + 'formats': [(_numpy.int32, 32)], + 'offsets': [ + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod17), + }) + finally: + _cyb_free(pod) _py_anon_pod17_dtype = _get__py_anon_pod17_dtype_offsets() @@ -9808,24 +10004,29 @@ cdef class _py_anon_pod17: cdef _get_texture_desc_v1_dtype_offsets(): - cdef CUDA_TEXTURE_DESC_v1 pod - return _numpy.dtype({ - 'names': ['address_mode', 'filter_mode', 'flags_', 'max_anisotropy', 'mipmap_filter_mode', 'mipmap_level_bias', 'min_mipmap_level_clamp', 'max_mipmap_level_clamp', 'border_color', 'reserved'], - 'formats': [(_numpy.int32, 3), _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.float32, _numpy.float32, _numpy.float32, (_numpy.float32, 4), (_numpy.int32, 12)], - 'offsets': [ - (&(pod.addressMode)) - (&pod), - (&(pod.filterMode)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.maxAnisotropy)) - (&pod), - (&(pod.mipmapFilterMode)) - (&pod), - (&(pod.mipmapLevelBias)) - (&pod), - (&(pod.minMipmapLevelClamp)) - (&pod), - (&(pod.maxMipmapLevelClamp)) - (&pod), - (&(pod.borderColor)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUDA_TEXTURE_DESC_v1), - }) + cdef CUDA_TEXTURE_DESC_v1 *pod = _cyb_calloc(1, sizeof(CUDA_TEXTURE_DESC_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_TEXTURE_DESC_v1") + try: + return _numpy.dtype({ + 'names': ['address_mode', 'filter_mode', 'flags_', 'max_anisotropy', 'mipmap_filter_mode', 'mipmap_level_bias', 'min_mipmap_level_clamp', 'max_mipmap_level_clamp', 'border_color', 'reserved'], + 'formats': [(_numpy.int32, 3), _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.float32, _numpy.float32, _numpy.float32, (_numpy.float32, 4), (_numpy.int32, 12)], + 'offsets': [ + (&(pod.addressMode)) - (pod), + (&(pod.filterMode)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.maxAnisotropy)) - (pod), + (&(pod.mipmapFilterMode)) - (pod), + (&(pod.mipmapLevelBias)) - (pod), + (&(pod.minMipmapLevelClamp)) - (pod), + (&(pod.maxMipmapLevelClamp)) - (pod), + (&(pod.borderColor)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUDA_TEXTURE_DESC_v1), + }) + finally: + _cyb_free(pod) texture_desc_v1_dtype = _get_texture_desc_v1_dtype_offsets() @@ -10042,23 +10243,28 @@ cdef class TextureDesc_v1: cdef _get_resource_view_desc_v1_dtype_offsets(): - cdef CUDA_RESOURCE_VIEW_DESC_v1 pod - return _numpy.dtype({ - 'names': ['format', 'width', 'height', 'depth', 'first_mipmap_level', 'last_mipmap_level', 'first_layer', 'last_layer', 'reserved'], - 'formats': [_numpy.int32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.uint32, 16)], - 'offsets': [ - (&(pod.format)) - (&pod), - (&(pod.width)) - (&pod), - (&(pod.height)) - (&pod), - (&(pod.depth)) - (&pod), - (&(pod.firstMipmapLevel)) - (&pod), - (&(pod.lastMipmapLevel)) - (&pod), - (&(pod.firstLayer)) - (&pod), - (&(pod.lastLayer)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUDA_RESOURCE_VIEW_DESC_v1), - }) + cdef CUDA_RESOURCE_VIEW_DESC_v1 *pod = _cyb_calloc(1, sizeof(CUDA_RESOURCE_VIEW_DESC_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_RESOURCE_VIEW_DESC_v1") + try: + return _numpy.dtype({ + 'names': ['format', 'width', 'height', 'depth', 'first_mipmap_level', 'last_mipmap_level', 'first_layer', 'last_layer', 'reserved'], + 'formats': [_numpy.int32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.uint32, 16)], + 'offsets': [ + (&(pod.format)) - (pod), + (&(pod.width)) - (pod), + (&(pod.height)) - (pod), + (&(pod.depth)) - (pod), + (&(pod.firstMipmapLevel)) - (pod), + (&(pod.lastMipmapLevel)) - (pod), + (&(pod.firstLayer)) - (pod), + (&(pod.lastLayer)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUDA_RESOURCE_VIEW_DESC_v1), + }) + finally: + _cyb_free(pod) resource_view_desc_v1_dtype = _get_resource_view_desc_v1_dtype_offsets() @@ -10252,15 +10458,20 @@ cdef class ResourceViewDesc_v1: cdef _get_tensor_map_dtype_offsets(): - cdef CUtensorMap pod - return _numpy.dtype({ - 'names': ['opaque'], - 'formats': [(_numpy.uint64, 16)], - 'offsets': [ - (&(pod.opaque)) - (&pod), - ], - 'itemsize': sizeof(CUtensorMap), - }) + cdef CUtensorMap *pod = _cyb_calloc(1, sizeof(CUtensorMap)) + if pod == NULL: + raise MemoryError("Error allocating CUtensorMap") + try: + return _numpy.dtype({ + 'names': ['opaque'], + 'formats': [(_numpy.uint64, 16)], + 'offsets': [ + (&(pod.opaque)) - (pod), + ], + 'itemsize': sizeof(CUtensorMap), + }) + finally: + _cyb_free(pod) tensor_map_dtype = _get_tensor_map_dtype_offsets() @@ -10383,16 +10594,21 @@ cdef class TensorMap: cdef _get_pointer_attribute_p2p_tokens_v1_dtype_offsets(): - cdef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 pod - return _numpy.dtype({ - 'names': ['p2p_token', 'va_space_token'], - 'formats': [_numpy.uint64, _numpy.uint32], - 'offsets': [ - (&(pod.p2pToken)) - (&pod), - (&(pod.vaSpaceToken)) - (&pod), - ], - 'itemsize': sizeof(CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1), - }) + cdef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 *pod = _cyb_calloc(1, sizeof(CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1") + try: + return _numpy.dtype({ + 'names': ['p2p_token', 'va_space_token'], + 'formats': [_numpy.uint64, _numpy.uint32], + 'offsets': [ + (&(pod.p2pToken)) - (pod), + (&(pod.vaSpaceToken)) - (pod), + ], + 'itemsize': sizeof(CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1), + }) + finally: + _cyb_free(pod) pointer_attribute_p2p_tokens_v1_dtype = _get_pointer_attribute_p2p_tokens_v1_dtype_offsets() @@ -10520,24 +10736,29 @@ cdef class PointerAttributeP2PTokens_v1: cdef _get_launch_params_v1_dtype_offsets(): - cdef CUDA_LAUNCH_PARAMS_v1 pod - return _numpy.dtype({ - 'names': ['function', 'grid_dim_x', 'grid_dim_y', 'grid_dim_z', 'block_dim_x', 'block_dim_y', 'block_dim_z', 'shared_mem_bytes', 'h_stream', 'kernel_params'], - 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.function)) - (&pod), - (&(pod.gridDimX)) - (&pod), - (&(pod.gridDimY)) - (&pod), - (&(pod.gridDimZ)) - (&pod), - (&(pod.blockDimX)) - (&pod), - (&(pod.blockDimY)) - (&pod), - (&(pod.blockDimZ)) - (&pod), - (&(pod.sharedMemBytes)) - (&pod), - (&(pod.hStream)) - (&pod), - (&(pod.kernelParams)) - (&pod), - ], - 'itemsize': sizeof(CUDA_LAUNCH_PARAMS_v1), - }) + cdef CUDA_LAUNCH_PARAMS_v1 *pod = _cyb_calloc(1, sizeof(CUDA_LAUNCH_PARAMS_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_LAUNCH_PARAMS_v1") + try: + return _numpy.dtype({ + 'names': ['function', 'grid_dim_x', 'grid_dim_y', 'grid_dim_z', 'block_dim_x', 'block_dim_y', 'block_dim_z', 'shared_mem_bytes', 'h_stream', 'kernel_params'], + 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.function)) - (pod), + (&(pod.gridDimX)) - (pod), + (&(pod.gridDimY)) - (pod), + (&(pod.gridDimZ)) - (pod), + (&(pod.blockDimX)) - (pod), + (&(pod.blockDimY)) - (pod), + (&(pod.blockDimZ)) - (pod), + (&(pod.sharedMemBytes)) - (pod), + (&(pod.hStream)) - (pod), + (&(pod.kernelParams)) - (pod), + ], + 'itemsize': sizeof(CUDA_LAUNCH_PARAMS_v1), + }) + finally: + _cyb_free(pod) launch_params_v1_dtype = _get_launch_params_v1_dtype_offsets() @@ -10753,16 +10974,21 @@ cdef class LaunchParams_v1: cdef _get__py_anon_pod19_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod19 pod - return _numpy.dtype({ - 'names': ['handle', 'name'], - 'formats': [_numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.handle)) - (&pod), - (&(pod.name)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod19), - }) + cdef cuda_bindings_driver__anon_pod19 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod19)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod19") + try: + return _numpy.dtype({ + 'names': ['handle', 'name'], + 'formats': [_numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.handle)) - (pod), + (&(pod.name)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod19), + }) + finally: + _cyb_free(pod) _py_anon_pod19_dtype = _get__py_anon_pod19_dtype_offsets() @@ -10902,18 +11128,23 @@ cdef class _py_anon_pod19: cdef _get_external_memory_buffer_desc_v1_dtype_offsets(): - cdef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 pod - return _numpy.dtype({ - 'names': ['offset', 'size_', 'flags_', 'reserved'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint32, (_numpy.uint32, 16)], - 'offsets': [ - (&(pod.offset)) - (&pod), - (&(pod.size)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1), - }) + cdef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 *pod = _cyb_calloc(1, sizeof(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1") + try: + return _numpy.dtype({ + 'names': ['offset', 'size_', 'flags_', 'reserved'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint32, (_numpy.uint32, 16)], + 'offsets': [ + (&(pod.offset)) - (pod), + (&(pod.size)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1), + }) + finally: + _cyb_free(pod) external_memory_buffer_desc_v1_dtype = _get_external_memory_buffer_desc_v1_dtype_offsets() @@ -11052,16 +11283,21 @@ cdef class ExternalMemoryBufferDesc_v1: cdef _get__py_anon_pod21_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod21 pod - return _numpy.dtype({ - 'names': ['handle', 'name'], - 'formats': [_numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.handle)) - (&pod), - (&(pod.name)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod21), - }) + cdef cuda_bindings_driver__anon_pod21 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod21)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod21") + try: + return _numpy.dtype({ + 'names': ['handle', 'name'], + 'formats': [_numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.handle)) - (pod), + (&(pod.name)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod21), + }) + finally: + _cyb_free(pod) _py_anon_pod21_dtype = _get__py_anon_pod21_dtype_offsets() @@ -11201,15 +11437,20 @@ cdef class _py_anon_pod21: cdef _get__py_anon_pod23_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod23 pod - return _numpy.dtype({ - 'names': ['value'], - 'formats': [_numpy.uint64], - 'offsets': [ - (&(pod.value)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod23), - }) + cdef cuda_bindings_driver__anon_pod23 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod23)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod23") + try: + return _numpy.dtype({ + 'names': ['value'], + 'formats': [_numpy.uint64], + 'offsets': [ + (&(pod.value)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod23), + }) + finally: + _cyb_free(pod) _py_anon_pod23_dtype = _get__py_anon_pod23_dtype_offsets() @@ -11338,16 +11579,21 @@ cdef class _py_anon_pod23: cdef _get__py_anon_pod24_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod24 pod - return _numpy.dtype({ - 'names': ['fence', 'reserved'], - 'formats': [_numpy.intp, _numpy.uint64], - 'offsets': [ - (&(pod.fence)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod24), - }) + cdef cuda_bindings_driver__anon_pod24 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod24)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod24") + try: + return _numpy.dtype({ + 'names': ['fence', 'reserved'], + 'formats': [_numpy.intp, _numpy.uint64], + 'offsets': [ + (&(pod.fence)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod24), + }) + finally: + _cyb_free(pod) _py_anon_pod24_dtype = _get__py_anon_pod24_dtype_offsets() @@ -11476,15 +11722,20 @@ cdef class _py_anon_pod24: cdef _get__py_anon_pod25_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod25 pod - return _numpy.dtype({ - 'names': ['key'], - 'formats': [_numpy.uint64], - 'offsets': [ - (&(pod.key)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod25), - }) + cdef cuda_bindings_driver__anon_pod25 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod25)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod25") + try: + return _numpy.dtype({ + 'names': ['key'], + 'formats': [_numpy.uint64], + 'offsets': [ + (&(pod.key)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod25), + }) + finally: + _cyb_free(pod) _py_anon_pod25_dtype = _get__py_anon_pod25_dtype_offsets() @@ -11613,15 +11864,20 @@ cdef class _py_anon_pod25: cdef _get__py_anon_pod27_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod27 pod - return _numpy.dtype({ - 'names': ['value'], - 'formats': [_numpy.uint64], - 'offsets': [ - (&(pod.value)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod27), - }) + cdef cuda_bindings_driver__anon_pod27 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod27)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod27") + try: + return _numpy.dtype({ + 'names': ['value'], + 'formats': [_numpy.uint64], + 'offsets': [ + (&(pod.value)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod27), + }) + finally: + _cyb_free(pod) _py_anon_pod27_dtype = _get__py_anon_pod27_dtype_offsets() @@ -11750,16 +12006,21 @@ cdef class _py_anon_pod27: cdef _get__py_anon_pod28_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod28 pod - return _numpy.dtype({ - 'names': ['fence', 'reserved'], - 'formats': [_numpy.intp, _numpy.uint64], - 'offsets': [ - (&(pod.fence)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod28), - }) + cdef cuda_bindings_driver__anon_pod28 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod28)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod28") + try: + return _numpy.dtype({ + 'names': ['fence', 'reserved'], + 'formats': [_numpy.intp, _numpy.uint64], + 'offsets': [ + (&(pod.fence)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod28), + }) + finally: + _cyb_free(pod) _py_anon_pod28_dtype = _get__py_anon_pod28_dtype_offsets() @@ -11888,16 +12149,21 @@ cdef class _py_anon_pod28: cdef _get__py_anon_pod29_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod29 pod - return _numpy.dtype({ - 'names': ['key', 'timeout_ms'], - 'formats': [_numpy.uint64, _numpy.uint32], - 'offsets': [ - (&(pod.key)) - (&pod), - (&(pod.timeoutMs)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod29), - }) + cdef cuda_bindings_driver__anon_pod29 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod29)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod29") + try: + return _numpy.dtype({ + 'names': ['key', 'timeout_ms'], + 'formats': [_numpy.uint64, _numpy.uint32], + 'offsets': [ + (&(pod.key)) - (pod), + (&(pod.timeoutMs)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod29), + }) + finally: + _cyb_free(pod) _py_anon_pod29_dtype = _get__py_anon_pod29_dtype_offsets() @@ -12037,16 +12303,21 @@ cdef class _py_anon_pod29: cdef _get__py_anon_pod32_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod32 pod - return _numpy.dtype({ - 'names': ['mipmap', 'array'], - 'formats': [_numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.mipmap)) - (&pod), - (&(pod.array)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod32), - }) + cdef cuda_bindings_driver__anon_pod32 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod32)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod32") + try: + return _numpy.dtype({ + 'names': ['mipmap', 'array'], + 'formats': [_numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.mipmap)) - (pod), + (&(pod.array)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod32), + }) + finally: + _cyb_free(pod) _py_anon_pod32_dtype = _get__py_anon_pod32_dtype_offsets() @@ -12186,22 +12457,27 @@ cdef class _py_anon_pod32: cdef _get__py_anon_pod34_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod34 pod - return _numpy.dtype({ - 'names': ['level', 'layer', 'offset_x', 'offset_y', 'offset_z', 'extent_width', 'extent_height', 'extent_depth'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.level)) - (&pod), - (&(pod.layer)) - (&pod), - (&(pod.offsetX)) - (&pod), - (&(pod.offsetY)) - (&pod), - (&(pod.offsetZ)) - (&pod), - (&(pod.extentWidth)) - (&pod), - (&(pod.extentHeight)) - (&pod), - (&(pod.extentDepth)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod34), - }) + cdef cuda_bindings_driver__anon_pod34 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod34)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod34") + try: + return _numpy.dtype({ + 'names': ['level', 'layer', 'offset_x', 'offset_y', 'offset_z', 'extent_width', 'extent_height', 'extent_depth'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.level)) - (pod), + (&(pod.layer)) - (pod), + (&(pod.offsetX)) - (pod), + (&(pod.offsetY)) - (pod), + (&(pod.offsetZ)) - (pod), + (&(pod.extentWidth)) - (pod), + (&(pod.extentHeight)) - (pod), + (&(pod.extentDepth)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod34), + }) + finally: + _cyb_free(pod) _py_anon_pod34_dtype = _get__py_anon_pod34_dtype_offsets() @@ -12407,17 +12683,22 @@ cdef class _py_anon_pod34: cdef _get__py_anon_pod35_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod35 pod - return _numpy.dtype({ - 'names': ['layer', 'offset', 'size_'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.layer)) - (&pod), - (&(pod.offset)) - (&pod), - (&(pod.size)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod35), - }) + cdef cuda_bindings_driver__anon_pod35 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod35)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod35") + try: + return _numpy.dtype({ + 'names': ['layer', 'offset', 'size_'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.layer)) - (pod), + (&(pod.offset)) - (pod), + (&(pod.size)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod35), + }) + finally: + _cyb_free(pod) _py_anon_pod35_dtype = _get__py_anon_pod35_dtype_offsets() @@ -12568,15 +12849,20 @@ cdef class _py_anon_pod35: cdef _get__py_anon_pod36_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod36 pod - return _numpy.dtype({ - 'names': ['mem_handle'], - 'formats': [_numpy.uint64], - 'offsets': [ - (&(pod.memHandle)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod36), - }) + cdef cuda_bindings_driver__anon_pod36 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod36)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod36") + try: + return _numpy.dtype({ + 'names': ['mem_handle'], + 'formats': [_numpy.uint64], + 'offsets': [ + (&(pod.memHandle)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod36), + }) + finally: + _cyb_free(pod) _py_anon_pod36_dtype = _get__py_anon_pod36_dtype_offsets() @@ -12705,16 +12991,21 @@ cdef class _py_anon_pod36: cdef _get__py_anon_pod38_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod38 pod - return _numpy.dtype({ - 'names': ['device_id', 'locality_domain_id'], - 'formats': [_numpy.uint8, _numpy.uint8], - 'offsets': [ - (&(pod.deviceId)) - (&pod), - (&(pod.localityDomainId)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod38), - }) + cdef cuda_bindings_driver__anon_pod38 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod38)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod38") + try: + return _numpy.dtype({ + 'names': ['device_id', 'locality_domain_id'], + 'formats': [_numpy.uint8, _numpy.uint8], + 'offsets': [ + (&(pod.deviceId)) - (pod), + (&(pod.localityDomainId)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod38), + }) + finally: + _cyb_free(pod) _py_anon_pod38_dtype = _get__py_anon_pod38_dtype_offsets() @@ -12854,18 +13145,23 @@ cdef class _py_anon_pod38: cdef _get__py_anon_pod39_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod39 pod - return _numpy.dtype({ - 'names': ['compression_type', 'gpu_direct_rdma_capable', 'usage', 'reserved'], - 'formats': [_numpy.uint8, _numpy.uint8, _numpy.uint16, (_numpy.uint8, 4)], - 'offsets': [ - (&(pod.compressionType)) - (&pod), - (&(pod.gpuDirectRDMACapable)) - (&pod), - (&(pod.usage)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod39), - }) + cdef cuda_bindings_driver__anon_pod39 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod39)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod39") + try: + return _numpy.dtype({ + 'names': ['compression_type', 'gpu_direct_rdma_capable', 'usage', 'reserved'], + 'formats': [_numpy.uint8, _numpy.uint8, _numpy.uint16, (_numpy.uint8, 4)], + 'offsets': [ + (&(pod.compressionType)) - (pod), + (&(pod.gpuDirectRDMACapable)) - (pod), + (&(pod.usage)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod39), + }) + finally: + _cyb_free(pod) _py_anon_pod39_dtype = _get__py_anon_pod39_dtype_offsets() @@ -13016,18 +13312,23 @@ cdef class _py_anon_pod39: cdef _get_multicast_object_prop_v1_dtype_offsets(): - cdef CUmulticastObjectProp_v1 pod - return _numpy.dtype({ - 'names': ['num_devices', 'size_', 'handle_types', 'flags_'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.numDevices)) - (&pod), - (&(pod.size)) - (&pod), - (&(pod.handleTypes)) - (&pod), - (&(pod.flags)) - (&pod), - ], - 'itemsize': sizeof(CUmulticastObjectProp_v1), - }) + cdef CUmulticastObjectProp_v1 *pod = _cyb_calloc(1, sizeof(CUmulticastObjectProp_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUmulticastObjectProp_v1") + try: + return _numpy.dtype({ + 'names': ['num_devices', 'size_', 'handle_types', 'flags_'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.numDevices)) - (pod), + (&(pod.size)) - (pod), + (&(pod.handleTypes)) - (pod), + (&(pod.flags)) - (pod), + ], + 'itemsize': sizeof(CUmulticastObjectProp_v1), + }) + finally: + _cyb_free(pod) multicast_object_prop_v1_dtype = _get_multicast_object_prop_v1_dtype_offsets() @@ -13177,17 +13478,22 @@ cdef class MulticastObjectProp_v1: cdef _get_graph_exec_update_result_info_v1_dtype_offsets(): - cdef CUgraphExecUpdateResultInfo_v1 pod - return _numpy.dtype({ - 'names': ['result', 'error_node', 'error_from_node'], - 'formats': [_numpy.int32, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.result)) - (&pod), - (&(pod.errorNode)) - (&pod), - (&(pod.errorFromNode)) - (&pod), - ], - 'itemsize': sizeof(CUgraphExecUpdateResultInfo_v1), - }) + cdef CUgraphExecUpdateResultInfo_v1 *pod = _cyb_calloc(1, sizeof(CUgraphExecUpdateResultInfo_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUgraphExecUpdateResultInfo_v1") + try: + return _numpy.dtype({ + 'names': ['result', 'error_node', 'error_from_node'], + 'formats': [_numpy.int32, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.result)) - (pod), + (&(pod.errorNode)) - (pod), + (&(pod.errorFromNode)) - (pod), + ], + 'itemsize': sizeof(CUgraphExecUpdateResultInfo_v1), + }) + finally: + _cyb_free(pod) graph_exec_update_result_info_v1_dtype = _get_graph_exec_update_result_info_v1_dtype_offsets() @@ -13326,15 +13632,20 @@ cdef class GraphExecUpdateResultInfo_v1: cdef _get_mem_pool_ptr_export_data_v1_dtype_offsets(): - cdef CUmemPoolPtrExportData_v1 pod - return _numpy.dtype({ - 'names': ['reserved'], - 'formats': [(_numpy.uint8, 64)], - 'offsets': [ - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUmemPoolPtrExportData_v1), - }) + cdef CUmemPoolPtrExportData_v1 *pod = _cyb_calloc(1, sizeof(CUmemPoolPtrExportData_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUmemPoolPtrExportData_v1") + try: + return _numpy.dtype({ + 'names': ['reserved'], + 'formats': [(_numpy.uint8, 64)], + 'offsets': [ + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUmemPoolPtrExportData_v1), + }) + finally: + _cyb_free(pod) mem_pool_ptr_export_data_v1_dtype = _get_mem_pool_ptr_export_data_v1_dtype_offsets() @@ -13440,17 +13751,22 @@ cdef class MemPoolPtrExportData_v1: cdef _get_offset3d_v1_dtype_offsets(): - cdef CUoffset3D_v1 pod - return _numpy.dtype({ - 'names': ['x', 'y', 'z'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.x)) - (&pod), - (&(pod.y)) - (&pod), - (&(pod.z)) - (&pod), - ], - 'itemsize': sizeof(CUoffset3D_v1), - }) + cdef CUoffset3D_v1 *pod = _cyb_calloc(1, sizeof(CUoffset3D_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUoffset3D_v1") + try: + return _numpy.dtype({ + 'names': ['x', 'y', 'z'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.x)) - (pod), + (&(pod.y)) - (pod), + (&(pod.z)) - (pod), + ], + 'itemsize': sizeof(CUoffset3D_v1), + }) + finally: + _cyb_free(pod) offset3d_v1_dtype = _get_offset3d_v1_dtype_offsets() @@ -13589,17 +13905,22 @@ cdef class Offset3D_v1: cdef _get_extent3d_v1_dtype_offsets(): - cdef CUextent3D_v1 pod - return _numpy.dtype({ - 'names': ['width', 'height', 'depth'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.width)) - (&pod), - (&(pod.height)) - (&pod), - (&(pod.depth)) - (&pod), - ], - 'itemsize': sizeof(CUextent3D_v1), - }) + cdef CUextent3D_v1 *pod = _cyb_calloc(1, sizeof(CUextent3D_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUextent3D_v1") + try: + return _numpy.dtype({ + 'names': ['width', 'height', 'depth'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.width)) - (pod), + (&(pod.height)) - (pod), + (&(pod.depth)) - (pod), + ], + 'itemsize': sizeof(CUextent3D_v1), + }) + finally: + _cyb_free(pod) extent3d_v1_dtype = _get_extent3d_v1_dtype_offsets() @@ -13738,15 +14059,20 @@ cdef class Extent3D_v1: cdef _get_mem_free_node_params_dtype_offsets(): - cdef CUDA_MEM_FREE_NODE_PARAMS pod - return _numpy.dtype({ - 'names': ['dptr'], - 'formats': [_numpy.uint64], - 'offsets': [ - (&(pod.dptr)) - (&pod), - ], - 'itemsize': sizeof(CUDA_MEM_FREE_NODE_PARAMS), - }) + cdef CUDA_MEM_FREE_NODE_PARAMS *pod = _cyb_calloc(1, sizeof(CUDA_MEM_FREE_NODE_PARAMS)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_MEM_FREE_NODE_PARAMS") + try: + return _numpy.dtype({ + 'names': ['dptr'], + 'formats': [_numpy.uint64], + 'offsets': [ + (&(pod.dptr)) - (pod), + ], + 'itemsize': sizeof(CUDA_MEM_FREE_NODE_PARAMS), + }) + finally: + _cyb_free(pod) mem_free_node_params_dtype = _get_mem_free_node_params_dtype_offsets() @@ -13875,16 +14201,21 @@ cdef class MemFreeNodeParams: cdef _get_child_graph_node_params_dtype_offsets(): - cdef CUDA_CHILD_GRAPH_NODE_PARAMS pod - return _numpy.dtype({ - 'names': ['graph', 'ownership'], - 'formats': [_numpy.intp, _numpy.int32], - 'offsets': [ - (&(pod.graph)) - (&pod), - (&(pod.ownership)) - (&pod), - ], - 'itemsize': sizeof(CUDA_CHILD_GRAPH_NODE_PARAMS), - }) + cdef CUDA_CHILD_GRAPH_NODE_PARAMS *pod = _cyb_calloc(1, sizeof(CUDA_CHILD_GRAPH_NODE_PARAMS)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_CHILD_GRAPH_NODE_PARAMS") + try: + return _numpy.dtype({ + 'names': ['graph', 'ownership'], + 'formats': [_numpy.intp, _numpy.int32], + 'offsets': [ + (&(pod.graph)) - (pod), + (&(pod.ownership)) - (pod), + ], + 'itemsize': sizeof(CUDA_CHILD_GRAPH_NODE_PARAMS), + }) + finally: + _cyb_free(pod) child_graph_node_params_dtype = _get_child_graph_node_params_dtype_offsets() @@ -14024,15 +14355,20 @@ cdef class ChildGraphNodeParams: cdef _get_event_wait_node_params_dtype_offsets(): - cdef CUDA_EVENT_WAIT_NODE_PARAMS pod - return _numpy.dtype({ - 'names': ['event'], - 'formats': [_numpy.intp], - 'offsets': [ - (&(pod.event)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EVENT_WAIT_NODE_PARAMS), - }) + cdef CUDA_EVENT_WAIT_NODE_PARAMS *pod = _cyb_calloc(1, sizeof(CUDA_EVENT_WAIT_NODE_PARAMS)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EVENT_WAIT_NODE_PARAMS") + try: + return _numpy.dtype({ + 'names': ['event'], + 'formats': [_numpy.intp], + 'offsets': [ + (&(pod.event)) - (pod), + ], + 'itemsize': sizeof(CUDA_EVENT_WAIT_NODE_PARAMS), + }) + finally: + _cyb_free(pod) event_wait_node_params_dtype = _get_event_wait_node_params_dtype_offsets() @@ -14161,17 +14497,22 @@ cdef class EventWaitNodeParams: cdef _get_checkpoint_lock_args_dtype_offsets(): - cdef CUcheckpointLockArgs pod - return _numpy.dtype({ - 'names': ['timeout_ms', 'reserved0', 'reserved1'], - 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.uint64, 7)], - 'offsets': [ - (&(pod.timeoutMs)) - (&pod), - (&(pod.reserved0)) - (&pod), - (&(pod.reserved1)) - (&pod), - ], - 'itemsize': sizeof(CUcheckpointLockArgs), - }) + cdef CUcheckpointLockArgs *pod = _cyb_calloc(1, sizeof(CUcheckpointLockArgs)) + if pod == NULL: + raise MemoryError("Error allocating CUcheckpointLockArgs") + try: + return _numpy.dtype({ + 'names': ['timeout_ms', 'reserved0', 'reserved1'], + 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.uint64, 7)], + 'offsets': [ + (&(pod.timeoutMs)) - (pod), + (&(pod.reserved0)) - (pod), + (&(pod.reserved1)) - (pod), + ], + 'itemsize': sizeof(CUcheckpointLockArgs), + }) + finally: + _cyb_free(pod) checkpoint_lock_args_dtype = _get_checkpoint_lock_args_dtype_offsets() @@ -14288,15 +14629,20 @@ cdef class CheckpointLockArgs: cdef _get_checkpoint_unlock_args_dtype_offsets(): - cdef CUcheckpointUnlockArgs pod - return _numpy.dtype({ - 'names': ['reserved'], - 'formats': [(_numpy.uint64, 8)], - 'offsets': [ - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUcheckpointUnlockArgs), - }) + cdef CUcheckpointUnlockArgs *pod = _cyb_calloc(1, sizeof(CUcheckpointUnlockArgs)) + if pod == NULL: + raise MemoryError("Error allocating CUcheckpointUnlockArgs") + try: + return _numpy.dtype({ + 'names': ['reserved'], + 'formats': [(_numpy.uint64, 8)], + 'offsets': [ + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUcheckpointUnlockArgs), + }) + finally: + _cyb_free(pod) checkpoint_unlock_args_dtype = _get_checkpoint_unlock_args_dtype_offsets() @@ -14402,21 +14748,26 @@ cdef class CheckpointUnlockArgs: cdef _get_mem_decompress_params_dtype_offsets(): - cdef CUmemDecompressParams pod - return _numpy.dtype({ - 'names': ['src_num_bytes', 'dst_num_bytes', 'dst_act_bytes', 'src', 'dst', 'algo', 'padding'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.int32, (_numpy.uint8, 20)], - 'offsets': [ - (&(pod.srcNumBytes)) - (&pod), - (&(pod.dstNumBytes)) - (&pod), - (&(pod.dstActBytes)) - (&pod), - (&(pod.src)) - (&pod), - (&(pod.dst)) - (&pod), - (&(pod.algo)) - (&pod), - (&(pod.padding)) - (&pod), - ], - 'itemsize': sizeof(CUmemDecompressParams), - }) + cdef CUmemDecompressParams *pod = _cyb_calloc(1, sizeof(CUmemDecompressParams)) + if pod == NULL: + raise MemoryError("Error allocating CUmemDecompressParams") + try: + return _numpy.dtype({ + 'names': ['src_num_bytes', 'dst_num_bytes', 'dst_act_bytes', 'src', 'dst', 'algo', 'padding'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.int32, (_numpy.uint8, 20)], + 'offsets': [ + (&(pod.srcNumBytes)) - (pod), + (&(pod.dstNumBytes)) - (pod), + (&(pod.dstActBytes)) - (pod), + (&(pod.src)) - (pod), + (&(pod.dst)) - (pod), + (&(pod.algo)) - (pod), + (&(pod.padding)) - (pod), + ], + 'itemsize': sizeof(CUmemDecompressParams), + }) + finally: + _cyb_free(pod) mem_decompress_params_dtype = _get_mem_decompress_params_dtype_offsets() @@ -14588,19 +14939,24 @@ cdef class MemDecompressParams: cdef _get_dev_sm_resource_dtype_offsets(): - cdef CUdevSmResource pod - return _numpy.dtype({ - 'names': ['sm_count', 'min_sm_partition_size', 'sm_coscheduled_alignment', 'flags_', 'locality_domain_id'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.smCount)) - (&pod), - (&(pod.minSmPartitionSize)) - (&pod), - (&(pod.smCoscheduledAlignment)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.localityDomainId)) - (&pod), - ], - 'itemsize': sizeof(CUdevSmResource), - }) + cdef CUdevSmResource *pod = _cyb_calloc(1, sizeof(CUdevSmResource)) + if pod == NULL: + raise MemoryError("Error allocating CUdevSmResource") + try: + return _numpy.dtype({ + 'names': ['sm_count', 'min_sm_partition_size', 'sm_coscheduled_alignment', 'flags_', 'locality_domain_id'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.smCount)) - (pod), + (&(pod.minSmPartitionSize)) - (pod), + (&(pod.smCoscheduledAlignment)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.localityDomainId)) - (pod), + ], + 'itemsize': sizeof(CUdevSmResource), + }) + finally: + _cyb_free(pod) dev_sm_resource_dtype = _get_dev_sm_resource_dtype_offsets() @@ -14773,17 +15129,22 @@ cdef class DevSmResource: cdef _get_dev_workqueue_config_resource_dtype_offsets(): - cdef CUdevWorkqueueConfigResource pod - return _numpy.dtype({ - 'names': ['device_', 'wq_concurrency_limit', 'sharing_scope'], - 'formats': [_numpy.int32, _numpy.uint32, _numpy.int32], - 'offsets': [ - (&(pod.device)) - (&pod), - (&(pod.wqConcurrencyLimit)) - (&pod), - (&(pod.sharingScope)) - (&pod), - ], - 'itemsize': sizeof(CUdevWorkqueueConfigResource), - }) + cdef CUdevWorkqueueConfigResource *pod = _cyb_calloc(1, sizeof(CUdevWorkqueueConfigResource)) + if pod == NULL: + raise MemoryError("Error allocating CUdevWorkqueueConfigResource") + try: + return _numpy.dtype({ + 'names': ['device_', 'wq_concurrency_limit', 'sharing_scope'], + 'formats': [_numpy.int32, _numpy.uint32, _numpy.int32], + 'offsets': [ + (&(pod.device)) - (pod), + (&(pod.wqConcurrencyLimit)) - (pod), + (&(pod.sharingScope)) - (pod), + ], + 'itemsize': sizeof(CUdevWorkqueueConfigResource), + }) + finally: + _cyb_free(pod) dev_workqueue_config_resource_dtype = _get_dev_workqueue_config_resource_dtype_offsets() @@ -14934,15 +15295,20 @@ cdef class DevWorkqueueConfigResource: cdef _get_dev_workqueue_resource_dtype_offsets(): - cdef CUdevWorkqueueResource pod - return _numpy.dtype({ - 'names': ['reserved'], - 'formats': [(_numpy.uint8, 40)], - 'offsets': [ - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUdevWorkqueueResource), - }) + cdef CUdevWorkqueueResource *pod = _cyb_calloc(1, sizeof(CUdevWorkqueueResource)) + if pod == NULL: + raise MemoryError("Error allocating CUdevWorkqueueResource") + try: + return _numpy.dtype({ + 'names': ['reserved'], + 'formats': [(_numpy.uint8, 40)], + 'offsets': [ + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUdevWorkqueueResource), + }) + finally: + _cyb_free(pod) dev_workqueue_resource_dtype = _get_dev_workqueue_resource_dtype_offsets() @@ -15060,20 +15426,25 @@ cdef class DevWorkqueueResource: cdef _get_dev_sm_resource_group_params_dtype_offsets(): - cdef CU_DEV_SM_RESOURCE_GROUP_PARAMS pod - return _numpy.dtype({ - 'names': ['sm_count', 'coscheduled_sm_count', 'preferred_coscheduled_sm_count', 'flags_', 'locality_domain_id', 'reserved'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.uint32, 11)], - 'offsets': [ - (&(pod.smCount)) - (&pod), - (&(pod.coscheduledSmCount)) - (&pod), - (&(pod.preferredCoscheduledSmCount)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.localityDomainId)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CU_DEV_SM_RESOURCE_GROUP_PARAMS), - }) + cdef CU_DEV_SM_RESOURCE_GROUP_PARAMS *pod = _cyb_calloc(1, sizeof(CU_DEV_SM_RESOURCE_GROUP_PARAMS)) + if pod == NULL: + raise MemoryError("Error allocating CU_DEV_SM_RESOURCE_GROUP_PARAMS") + try: + return _numpy.dtype({ + 'names': ['sm_count', 'coscheduled_sm_count', 'preferred_coscheduled_sm_count', 'flags_', 'locality_domain_id', 'reserved'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.uint32, 11)], + 'offsets': [ + (&(pod.smCount)) - (pod), + (&(pod.coscheduledSmCount)) - (pod), + (&(pod.preferredCoscheduledSmCount)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.localityDomainId)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CU_DEV_SM_RESOURCE_GROUP_PARAMS), + }) + finally: + _cyb_free(pod) dev_sm_resource_group_params_dtype = _get_dev_sm_resource_group_params_dtype_offsets() cdef object dev_sm_resource_group_params_dtype_record = _numpy.dtype((_numpy.record, dev_sm_resource_group_params_dtype)) @@ -15271,16 +15642,21 @@ cdef class DevSmResourceGroupParams: cdef _get_stream_cig_param_dtype_offsets(): - cdef CUstreamCigParam pod - return _numpy.dtype({ - 'names': ['stream_shared_data_type', 'stream_shared_data'], - 'formats': [_numpy.int32, _numpy.intp], - 'offsets': [ - (&(pod.streamSharedDataType)) - (&pod), - (&(pod.streamSharedData)) - (&pod), - ], - 'itemsize': sizeof(CUstreamCigParam), - }) + cdef CUstreamCigParam *pod = _cyb_calloc(1, sizeof(CUstreamCigParam)) + if pod == NULL: + raise MemoryError("Error allocating CUstreamCigParam") + try: + return _numpy.dtype({ + 'names': ['stream_shared_data_type', 'stream_shared_data'], + 'formats': [_numpy.int32, _numpy.intp], + 'offsets': [ + (&(pod.streamSharedDataType)) - (pod), + (&(pod.streamSharedData)) - (pod), + ], + 'itemsize': sizeof(CUstreamCigParam), + }) + finally: + _cyb_free(pod) stream_cig_param_dtype = _get_stream_cig_param_dtype_offsets() @@ -15408,15 +15784,20 @@ cdef class StreamCigParam: cdef _get_logical_endpoint_fabric_handle_dtype_offsets(): - cdef CUlogicalEndpointFabricHandle pod - return _numpy.dtype({ - 'names': ['data_'], - 'formats': [(_numpy.uint8, 64)], - 'offsets': [ - (&(pod.data)) - (&pod), - ], - 'itemsize': sizeof(CUlogicalEndpointFabricHandle), - }) + cdef CUlogicalEndpointFabricHandle *pod = _cyb_calloc(1, sizeof(CUlogicalEndpointFabricHandle)) + if pod == NULL: + raise MemoryError("Error allocating CUlogicalEndpointFabricHandle") + try: + return _numpy.dtype({ + 'names': ['data_'], + 'formats': [(_numpy.uint8, 64)], + 'offsets': [ + (&(pod.data)) - (pod), + ], + 'itemsize': sizeof(CUlogicalEndpointFabricHandle), + }) + finally: + _cyb_free(pod) logical_endpoint_fabric_handle_dtype = _get_logical_endpoint_fabric_handle_dtype_offsets() @@ -15539,15 +15920,20 @@ cdef class LogicalEndpointFabricHandle: cdef _get__py_anon_pod47_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod47 pod - return _numpy.dtype({ - 'names': ['device_'], - 'formats': [_numpy.int32], - 'offsets': [ - (&(pod.device)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod47), - }) + cdef cuda_bindings_driver__anon_pod47 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod47)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod47") + try: + return _numpy.dtype({ + 'names': ['device_'], + 'formats': [_numpy.int32], + 'offsets': [ + (&(pod.device)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod47), + }) + finally: + _cyb_free(pod) _py_anon_pod47_dtype = _get__py_anon_pod47_dtype_offsets() @@ -15676,15 +16062,20 @@ cdef class _py_anon_pod47: cdef _get__py_anon_pod48_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod48 pod - return _numpy.dtype({ - 'names': ['num_devices'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.numDevices)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod48), - }) + cdef cuda_bindings_driver__anon_pod48 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod48)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod48") + try: + return _numpy.dtype({ + 'names': ['num_devices'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.numDevices)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod48), + }) + finally: + _cyb_free(pod) _py_anon_pod48_dtype = _get__py_anon_pod48_dtype_offsets() @@ -15813,16 +16204,21 @@ cdef class _py_anon_pod48: cdef _get_clique_info_dtype_offsets(): - cdef CUcliqueInfo pod - return _numpy.dtype({ - 'names': ['type', 'id'], - 'formats': [_numpy.int32, _numpy.uint32], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.id)) - (&pod), - ], - 'itemsize': sizeof(CUcliqueInfo), - }) + cdef CUcliqueInfo *pod = _cyb_calloc(1, sizeof(CUcliqueInfo)) + if pod == NULL: + raise MemoryError("Error allocating CUcliqueInfo") + try: + return _numpy.dtype({ + 'names': ['type', 'id'], + 'formats': [_numpy.int32, _numpy.uint32], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.id)) - (pod), + ], + 'itemsize': sizeof(CUcliqueInfo), + }) + finally: + _cyb_free(pod) clique_info_dtype = _get_clique_info_dtype_offsets() cdef object clique_info_dtype_record = _numpy.dtype((_numpy.record, clique_info_dtype)) @@ -15981,16 +16377,21 @@ cdef class CliqueInfo: cdef _get_checkpoint_gpu_pair_dtype_offsets(): - cdef CUcheckpointGpuPair pod - return _numpy.dtype({ - 'names': ['old_uuid', 'new_uuid'], - 'formats': [uuid_dtype, uuid_dtype], - 'offsets': [ - (&(pod.oldUuid)) - (&pod), - (&(pod.newUuid)) - (&pod), - ], - 'itemsize': sizeof(CUcheckpointGpuPair), - }) + cdef CUcheckpointGpuPair *pod = _cyb_calloc(1, sizeof(CUcheckpointGpuPair)) + if pod == NULL: + raise MemoryError("Error allocating CUcheckpointGpuPair") + try: + return _numpy.dtype({ + 'names': ['old_uuid', 'new_uuid'], + 'formats': [uuid_dtype, uuid_dtype], + 'offsets': [ + (&(pod.oldUuid)) - (pod), + (&(pod.newUuid)) - (pod), + ], + 'itemsize': sizeof(CUcheckpointGpuPair), + }) + finally: + _cyb_free(pod) checkpoint_gpu_pair_dtype = _get_checkpoint_gpu_pair_dtype_offsets() @@ -16128,20 +16529,25 @@ cdef class CheckpointGpuPair: cdef _get_stream_mem_op_wait_value_params_dtype_offsets(): - cdef CUstreamMemOpWaitValueParams_st pod - return _numpy.dtype({ - 'names': ['operation', 'address', 'value', 'value64', 'flags_', 'alias'], - 'formats': [_numpy.int32, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint64], - 'offsets': [ - (&(pod.operation)) - (&pod), - (&(pod.address)) - (&pod), - (&(pod.value)) - (&pod), - (&(pod.value64)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.alias)) - (&pod), - ], - 'itemsize': sizeof(CUstreamMemOpWaitValueParams_st), - }) + cdef CUstreamMemOpWaitValueParams_st *pod = _cyb_calloc(1, sizeof(CUstreamMemOpWaitValueParams_st)) + if pod == NULL: + raise MemoryError("Error allocating CUstreamMemOpWaitValueParams_st") + try: + return _numpy.dtype({ + 'names': ['operation', 'address', 'value', 'value64', 'flags_', 'alias'], + 'formats': [_numpy.int32, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.operation)) - (pod), + (&(pod.address)) - (pod), + (&(pod.value)) - (pod), + (&(pod.value64)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.alias)) - (pod), + ], + 'itemsize': sizeof(CUstreamMemOpWaitValueParams_st), + }) + finally: + _cyb_free(pod) stream_mem_op_wait_value_params_dtype = _get_stream_mem_op_wait_value_params_dtype_offsets() @@ -16325,20 +16731,25 @@ cdef class StreamMemOpWaitValueParams: cdef _get_stream_mem_op_write_value_params_dtype_offsets(): - cdef CUstreamMemOpWriteValueParams_st pod - return _numpy.dtype({ - 'names': ['operation', 'address', 'value', 'value64', 'flags_', 'alias'], - 'formats': [_numpy.int32, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint64], - 'offsets': [ - (&(pod.operation)) - (&pod), - (&(pod.address)) - (&pod), - (&(pod.value)) - (&pod), - (&(pod.value64)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.alias)) - (&pod), - ], - 'itemsize': sizeof(CUstreamMemOpWriteValueParams_st), - }) + cdef CUstreamMemOpWriteValueParams_st *pod = _cyb_calloc(1, sizeof(CUstreamMemOpWriteValueParams_st)) + if pod == NULL: + raise MemoryError("Error allocating CUstreamMemOpWriteValueParams_st") + try: + return _numpy.dtype({ + 'names': ['operation', 'address', 'value', 'value64', 'flags_', 'alias'], + 'formats': [_numpy.int32, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.operation)) - (pod), + (&(pod.address)) - (pod), + (&(pod.value)) - (pod), + (&(pod.value64)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.alias)) - (pod), + ], + 'itemsize': sizeof(CUstreamMemOpWriteValueParams_st), + }) + finally: + _cyb_free(pod) stream_mem_op_write_value_params_dtype = _get_stream_mem_op_write_value_params_dtype_offsets() @@ -16522,15 +16933,20 @@ cdef class StreamMemOpWriteValueParams: cdef _get__py_anon_pod2_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod2 pod - return _numpy.dtype({ - 'names': ['over_budget'], - 'formats': [_py_anon_pod3_dtype], - 'offsets': [ - (&(pod.overBudget)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod2), - }) + cdef cuda_bindings_driver__anon_pod2 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod2)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod2") + try: + return _numpy.dtype({ + 'names': ['over_budget'], + 'formats': [_py_anon_pod3_dtype], + 'offsets': [ + (&(pod.overBudget)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod2), + }) + finally: + _cyb_free(pod) _py_anon_pod2_dtype = _get__py_anon_pod2_dtype_offsets() @@ -16664,19 +17080,24 @@ cdef class _py_anon_pod2: cdef _get_host_node_params_v2_dtype_offsets(): - cdef CUDA_HOST_NODE_PARAMS_v2 pod - return _numpy.dtype({ - 'names': ['fn', 'user_data', 'sync_mode', 'ctx', 'g_ctx'], - 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.fn)) - (&pod), - (&(pod.userData)) - (&pod), - (&(pod.syncMode)) - (&pod), - (&(pod.ctx)) - (&pod), - (&(pod.gCtx)) - (&pod), - ], - 'itemsize': sizeof(CUDA_HOST_NODE_PARAMS_v2), - }) + cdef CUDA_HOST_NODE_PARAMS_v2 *pod = _cyb_calloc(1, sizeof(CUDA_HOST_NODE_PARAMS_v2)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_HOST_NODE_PARAMS_v2") + try: + return _numpy.dtype({ + 'names': ['fn', 'user_data', 'sync_mode', 'ctx', 'g_ctx'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.fn)) - (pod), + (&(pod.userData)) - (pod), + (&(pod.syncMode)) - (pod), + (&(pod.ctx)) - (pod), + (&(pod.gCtx)) - (pod), + ], + 'itemsize': sizeof(CUDA_HOST_NODE_PARAMS_v2), + }) + finally: + _cyb_free(pod) host_node_params_v2_dtype = _get_host_node_params_v2_dtype_offsets() @@ -16849,32 +17270,37 @@ cdef class HostNodeParams_v2: cdef _get_launch_attribute_value_dtype_offsets(): - cdef CUlaunchAttributeValue pod - return _numpy.dtype({ - 'names': ['pad', 'access_policy_window', 'cooperative', 'sync_policy', 'cluster_dim', 'cluster_scheduling_policy_preference', 'programmatic_stream_serialization_allowed', 'programmatic_event', 'launch_completion_event', 'priority', 'mem_sync_domain_map', 'mem_sync_domain', 'preferred_cluster_dim', 'device_updatable_kernel_node', 'shared_mem_carveout', 'nvlink_util_centric_scheduling', 'portable_cluster_size_mode', 'shared_memory_mode'], - 'formats': [(_numpy.int8, 64), access_policy_window_v1_dtype, _numpy.int32, _numpy.int32, _py_anon_pod5_dtype, _numpy.int32, _numpy.int32, _py_anon_pod6_dtype, _py_anon_pod7_dtype, _numpy.int32, launch_mem_sync_domain_map_dtype, _numpy.int32, _py_anon_pod8_dtype, _py_anon_pod9_dtype, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.pad)) - (&pod), - (&(pod.accessPolicyWindow)) - (&pod), - (&(pod.cooperative)) - (&pod), - (&(pod.syncPolicy)) - (&pod), - (&(pod.clusterDim)) - (&pod), - (&(pod.clusterSchedulingPolicyPreference)) - (&pod), - (&(pod.programmaticStreamSerializationAllowed)) - (&pod), - (&(pod.programmaticEvent)) - (&pod), - (&(pod.launchCompletionEvent)) - (&pod), - (&(pod.priority)) - (&pod), - (&(pod.memSyncDomainMap)) - (&pod), - (&(pod.memSyncDomain)) - (&pod), - (&(pod.preferredClusterDim)) - (&pod), - (&(pod.deviceUpdatableKernelNode)) - (&pod), - (&(pod.sharedMemCarveout)) - (&pod), - (&(pod.nvlinkUtilCentricScheduling)) - (&pod), - (&(pod.portableClusterSizeMode)) - (&pod), - (&(pod.sharedMemoryMode)) - (&pod), - ], - 'itemsize': sizeof(CUlaunchAttributeValue), - }) + cdef CUlaunchAttributeValue *pod = _cyb_calloc(1, sizeof(CUlaunchAttributeValue)) + if pod == NULL: + raise MemoryError("Error allocating CUlaunchAttributeValue") + try: + return _numpy.dtype({ + 'names': ['pad', 'access_policy_window', 'cooperative', 'sync_policy', 'cluster_dim', 'cluster_scheduling_policy_preference', 'programmatic_stream_serialization_allowed', 'programmatic_event', 'launch_completion_event', 'priority', 'mem_sync_domain_map', 'mem_sync_domain', 'preferred_cluster_dim', 'device_updatable_kernel_node', 'shared_mem_carveout', 'nvlink_util_centric_scheduling', 'portable_cluster_size_mode', 'shared_memory_mode'], + 'formats': [(_numpy.int8, 64), access_policy_window_v1_dtype, _numpy.int32, _numpy.int32, _py_anon_pod5_dtype, _numpy.int32, _numpy.int32, _py_anon_pod6_dtype, _py_anon_pod7_dtype, _numpy.int32, launch_mem_sync_domain_map_dtype, _numpy.int32, _py_anon_pod8_dtype, _py_anon_pod9_dtype, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.pad)) - (pod), + (&(pod.accessPolicyWindow)) - (pod), + (&(pod.cooperative)) - (pod), + (&(pod.syncPolicy)) - (pod), + (&(pod.clusterDim)) - (pod), + (&(pod.clusterSchedulingPolicyPreference)) - (pod), + (&(pod.programmaticStreamSerializationAllowed)) - (pod), + (&(pod.programmaticEvent)) - (pod), + (&(pod.launchCompletionEvent)) - (pod), + (&(pod.priority)) - (pod), + (&(pod.memSyncDomainMap)) - (pod), + (&(pod.memSyncDomain)) - (pod), + (&(pod.preferredClusterDim)) - (pod), + (&(pod.deviceUpdatableKernelNode)) - (pod), + (&(pod.sharedMemCarveout)) - (pod), + (&(pod.nvlinkUtilCentricScheduling)) - (pod), + (&(pod.portableClusterSizeMode)) - (pod), + (&(pod.sharedMemoryMode)) - (pod), + ], + 'itemsize': sizeof(CUlaunchAttributeValue), + }) + finally: + _cyb_free(pod) launch_attribute_value_dtype = _get_launch_attribute_value_dtype_offsets() @@ -17214,15 +17640,20 @@ cdef class LaunchAttributeValue: cdef _get__py_anon_pod10_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod10 pod - return _numpy.dtype({ - 'names': ['sm_count'], - 'formats': [exec_affinity_sm_count_v1_dtype], - 'offsets': [ - (&(pod.smCount)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod10), - }) + cdef cuda_bindings_driver__anon_pod10 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod10)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod10") + try: + return _numpy.dtype({ + 'names': ['sm_count'], + 'formats': [exec_affinity_sm_count_v1_dtype], + 'offsets': [ + (&(pod.smCount)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod10), + }) + finally: + _cyb_free(pod) _py_anon_pod10_dtype = _get__py_anon_pod10_dtype_offsets() @@ -17356,18 +17787,23 @@ cdef class _py_anon_pod10: cdef _get_mem_cpy_node_params_dtype_offsets(): - cdef CUDA_MEMCPY_NODE_PARAMS pod - return _numpy.dtype({ - 'names': ['flags_', 'reserved', 'copy_ctx', 'copy_params'], - 'formats': [_numpy.int32, _numpy.int32, _numpy.intp, mem_cpy3d_v2_dtype], - 'offsets': [ - (&(pod.flags)) - (&pod), - (&(pod.reserved)) - (&pod), - (&(pod.copyCtx)) - (&pod), - (&(pod.copyParams)) - (&pod), - ], - 'itemsize': sizeof(CUDA_MEMCPY_NODE_PARAMS), - }) + cdef CUDA_MEMCPY_NODE_PARAMS *pod = _cyb_calloc(1, sizeof(CUDA_MEMCPY_NODE_PARAMS)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_MEMCPY_NODE_PARAMS") + try: + return _numpy.dtype({ + 'names': ['flags_', 'reserved', 'copy_ctx', 'copy_params'], + 'formats': [_numpy.int32, _numpy.int32, _numpy.intp, mem_cpy3d_v2_dtype], + 'offsets': [ + (&(pod.flags)) - (pod), + (&(pod.reserved)) - (pod), + (&(pod.copyCtx)) - (pod), + (&(pod.copyParams)) - (pod), + ], + 'itemsize': sizeof(CUDA_MEMCPY_NODE_PARAMS), + }) + finally: + _cyb_free(pod) mem_cpy_node_params_dtype = _get_mem_cpy_node_params_dtype_offsets() @@ -17523,18 +17959,23 @@ cdef class MemCpyNodeParams: cdef _get_external_memory_mipmapped_array_desc_v1_dtype_offsets(): - cdef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 pod - return _numpy.dtype({ - 'names': ['offset', 'array_desc', 'num_levels', 'reserved'], - 'formats': [_numpy.uint64, array3d_descriptor_v2_dtype, _numpy.uint32, (_numpy.uint32, 16)], - 'offsets': [ - (&(pod.offset)) - (&pod), - (&(pod.arrayDesc)) - (&pod), - (&(pod.numLevels)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1), - }) + cdef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 *pod = _cyb_calloc(1, sizeof(CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1") + try: + return _numpy.dtype({ + 'names': ['offset', 'array_desc', 'num_levels', 'reserved'], + 'formats': [_numpy.uint64, array3d_descriptor_v2_dtype, _numpy.uint32, (_numpy.uint32, 16)], + 'offsets': [ + (&(pod.offset)) - (pod), + (&(pod.arrayDesc)) - (pod), + (&(pod.numLevels)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1), + }) + finally: + _cyb_free(pod) external_memory_mipmapped_array_desc_v1_dtype = _get_external_memory_mipmapped_array_desc_v1_dtype_offsets() @@ -17678,19 +18119,24 @@ cdef class ExternalMemoryMipmappedArrayDesc_v1: cdef _get_array_sparse_properties_v1_dtype_offsets(): - cdef CUDA_ARRAY_SPARSE_PROPERTIES_v1 pod - return _numpy.dtype({ - 'names': ['tile_extent', 'miptail_first_level', 'miptail_size', 'flags_', 'reserved'], - 'formats': [_py_anon_pod11_dtype, _numpy.uint32, _numpy.uint64, _numpy.uint32, (_numpy.uint32, 4)], - 'offsets': [ - (&(pod.tileExtent)) - (&pod), - (&(pod.miptailFirstLevel)) - (&pod), - (&(pod.miptailSize)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUDA_ARRAY_SPARSE_PROPERTIES_v1), - }) + cdef CUDA_ARRAY_SPARSE_PROPERTIES_v1 *pod = _cyb_calloc(1, sizeof(CUDA_ARRAY_SPARSE_PROPERTIES_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_ARRAY_SPARSE_PROPERTIES_v1") + try: + return _numpy.dtype({ + 'names': ['tile_extent', 'miptail_first_level', 'miptail_size', 'flags_', 'reserved'], + 'formats': [_py_anon_pod11_dtype, _numpy.uint32, _numpy.uint64, _numpy.uint32, (_numpy.uint32, 4)], + 'offsets': [ + (&(pod.tileExtent)) - (pod), + (&(pod.miptailFirstLevel)) - (pod), + (&(pod.miptailSize)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUDA_ARRAY_SPARSE_PROPERTIES_v1), + }) + finally: + _cyb_free(pod) array_sparse_properties_v1_dtype = _get_array_sparse_properties_v1_dtype_offsets() @@ -17845,19 +18291,24 @@ cdef class ArraySparseProperties_v1: cdef _get__py_anon_pod12_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod12 pod - return _numpy.dtype({ - 'names': ['array', 'mipmap', 'linear', 'pitch2d', 'reserved'], - 'formats': [_py_anon_pod13_dtype, _py_anon_pod14_dtype, _py_anon_pod15_dtype, _py_anon_pod16_dtype, _py_anon_pod17_dtype], - 'offsets': [ - (&(pod.array)) - (&pod), - (&(pod.mipmap)) - (&pod), - (&(pod.linear)) - (&pod), - (&(pod.pitch2D)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod12), - }) + cdef cuda_bindings_driver__anon_pod12 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod12)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod12") + try: + return _numpy.dtype({ + 'names': ['array', 'mipmap', 'linear', 'pitch2d', 'reserved'], + 'formats': [_py_anon_pod13_dtype, _py_anon_pod14_dtype, _py_anon_pod15_dtype, _py_anon_pod16_dtype, _py_anon_pod17_dtype], + 'offsets': [ + (&(pod.array)) - (pod), + (&(pod.mipmap)) - (pod), + (&(pod.linear)) - (pod), + (&(pod.pitch2D)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod12), + }) + finally: + _cyb_free(pod) _py_anon_pod12_dtype = _get__py_anon_pod12_dtype_offsets() @@ -18039,17 +18490,22 @@ cdef class _py_anon_pod12: cdef _get__py_anon_pod18_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod18 pod - return _numpy.dtype({ - 'names': ['fd', 'win32', 'nv_sci_buf_object'], - 'formats': [_numpy.int32, _py_anon_pod19_dtype, _numpy.intp], - 'offsets': [ - (&(pod.fd)) - (&pod), - (&(pod.win32)) - (&pod), - (&(pod.nvSciBufObject)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod18), - }) + cdef cuda_bindings_driver__anon_pod18 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod18)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod18") + try: + return _numpy.dtype({ + 'names': ['fd', 'win32', 'nv_sci_buf_object'], + 'formats': [_numpy.int32, _py_anon_pod19_dtype, _numpy.intp], + 'offsets': [ + (&(pod.fd)) - (pod), + (&(pod.win32)) - (pod), + (&(pod.nvSciBufObject)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod18), + }) + finally: + _cyb_free(pod) _py_anon_pod18_dtype = _get__py_anon_pod18_dtype_offsets() @@ -18205,17 +18661,22 @@ cdef class _py_anon_pod18: cdef _get__py_anon_pod20_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod20 pod - return _numpy.dtype({ - 'names': ['fd', 'win32', 'nv_sci_sync_obj'], - 'formats': [_numpy.int32, _py_anon_pod21_dtype, _numpy.intp], - 'offsets': [ - (&(pod.fd)) - (&pod), - (&(pod.win32)) - (&pod), - (&(pod.nvSciSyncObj)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod20), - }) + cdef cuda_bindings_driver__anon_pod20 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod20)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod20") + try: + return _numpy.dtype({ + 'names': ['fd', 'win32', 'nv_sci_sync_obj'], + 'formats': [_numpy.int32, _py_anon_pod21_dtype, _numpy.intp], + 'offsets': [ + (&(pod.fd)) - (pod), + (&(pod.win32)) - (pod), + (&(pod.nvSciSyncObj)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod20), + }) + finally: + _cyb_free(pod) _py_anon_pod20_dtype = _get__py_anon_pod20_dtype_offsets() @@ -18371,18 +18832,23 @@ cdef class _py_anon_pod20: cdef _get__py_anon_pod22_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod22 pod - return _numpy.dtype({ - 'names': ['fence', 'nv_sci_sync', 'keyed_mutex', 'reserved'], - 'formats': [_py_anon_pod23_dtype, _py_anon_pod24_dtype, _py_anon_pod25_dtype, (_numpy.uint32, 12)], - 'offsets': [ - (&(pod.fence)) - (&pod), - (&(pod.nvSciSync)) - (&pod), - (&(pod.keyedMutex)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod22), - }) + cdef cuda_bindings_driver__anon_pod22 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod22)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod22") + try: + return _numpy.dtype({ + 'names': ['fence', 'nv_sci_sync', 'keyed_mutex', 'reserved'], + 'formats': [_py_anon_pod23_dtype, _py_anon_pod24_dtype, _py_anon_pod25_dtype, (_numpy.uint32, 12)], + 'offsets': [ + (&(pod.fence)) - (pod), + (&(pod.nvSciSync)) - (pod), + (&(pod.keyedMutex)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod22), + }) + finally: + _cyb_free(pod) _py_anon_pod22_dtype = _get__py_anon_pod22_dtype_offsets() @@ -18548,18 +19014,23 @@ cdef class _py_anon_pod22: cdef _get__py_anon_pod26_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod26 pod - return _numpy.dtype({ - 'names': ['fence', 'nv_sci_sync', 'keyed_mutex', 'reserved'], - 'formats': [_py_anon_pod27_dtype, _py_anon_pod28_dtype, _py_anon_pod29_dtype, (_numpy.uint32, 10)], - 'offsets': [ - (&(pod.fence)) - (&pod), - (&(pod.nvSciSync)) - (&pod), - (&(pod.keyedMutex)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod26), - }) + cdef cuda_bindings_driver__anon_pod26 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod26)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod26") + try: + return _numpy.dtype({ + 'names': ['fence', 'nv_sci_sync', 'keyed_mutex', 'reserved'], + 'formats': [_py_anon_pod27_dtype, _py_anon_pod28_dtype, _py_anon_pod29_dtype, (_numpy.uint32, 10)], + 'offsets': [ + (&(pod.fence)) - (pod), + (&(pod.nvSciSync)) - (pod), + (&(pod.keyedMutex)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod26), + }) + finally: + _cyb_free(pod) _py_anon_pod26_dtype = _get__py_anon_pod26_dtype_offsets() @@ -18725,16 +19196,21 @@ cdef class _py_anon_pod26: cdef _get__py_anon_pod33_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod33 pod - return _numpy.dtype({ - 'names': ['sparse_level', 'miptail'], - 'formats': [_py_anon_pod34_dtype, _py_anon_pod35_dtype], - 'offsets': [ - (&(pod.sparseLevel)) - (&pod), - (&(pod.miptail)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod33), - }) + cdef cuda_bindings_driver__anon_pod33 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod33)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod33") + try: + return _numpy.dtype({ + 'names': ['sparse_level', 'miptail'], + 'formats': [_py_anon_pod34_dtype, _py_anon_pod35_dtype], + 'offsets': [ + (&(pod.sparseLevel)) - (pod), + (&(pod.miptail)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod33), + }) + finally: + _cyb_free(pod) _py_anon_pod33_dtype = _get__py_anon_pod33_dtype_offsets() @@ -18884,16 +19360,21 @@ cdef class _py_anon_pod33: cdef _get__py_anon_pod42_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod42 pod - return _numpy.dtype({ - 'names': ['array', 'offset'], - 'formats': [_numpy.intp, offset3d_v1_dtype], - 'offsets': [ - (&(pod.array)) - (&pod), - (&(pod.offset)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod42), - }) + cdef cuda_bindings_driver__anon_pod42 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod42)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod42") + try: + return _numpy.dtype({ + 'names': ['array', 'offset'], + 'formats': [_numpy.intp, offset3d_v1_dtype], + 'offsets': [ + (&(pod.array)) - (pod), + (&(pod.offset)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod42), + }) + finally: + _cyb_free(pod) _py_anon_pod42_dtype = _get__py_anon_pod42_dtype_offsets() @@ -19038,17 +19519,22 @@ cdef class _py_anon_pod42: cdef _get_event_record_node_params_dtype_offsets(): - cdef CUDA_EVENT_RECORD_NODE_PARAMS pod - return _numpy.dtype({ - 'names': ['event', 'ctx', 'g_ctx'], - 'formats': [_numpy.intp, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.event)) - (&pod), - (&(pod.ctx)) - (&pod), - (&(pod.gCtx)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EVENT_RECORD_NODE_PARAMS), - }) + cdef CUDA_EVENT_RECORD_NODE_PARAMS *pod = _cyb_calloc(1, sizeof(CUDA_EVENT_RECORD_NODE_PARAMS)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EVENT_RECORD_NODE_PARAMS") + try: + return _numpy.dtype({ + 'names': ['event', 'ctx', 'g_ctx'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.event)) - (pod), + (&(pod.ctx)) - (pod), + (&(pod.gCtx)) - (pod), + ], + 'itemsize': sizeof(CUDA_EVENT_RECORD_NODE_PARAMS), + }) + finally: + _cyb_free(pod) event_record_node_params_dtype = _get_event_record_node_params_dtype_offsets() @@ -19199,19 +19685,24 @@ cdef class EventRecordNodeParams: cdef _get_fabric_cpy_batch_node_params_v1_dtype_offsets(): - cdef CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 pod - return _numpy.dtype({ - 'names': ['num_ops', 'op_list', 'flags_', 'ctx', 'g_ctx'], - 'formats': [_numpy.uint64, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.numOps)) - (&pod), - (&(pod.opList)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.ctx)) - (&pod), - (&(pod.gCtx)) - (&pod), - ], - 'itemsize': sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1), - }) + cdef CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 *pod = _cyb_calloc(1, sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1") + try: + return _numpy.dtype({ + 'names': ['num_ops', 'op_list', 'flags_', 'ctx', 'g_ctx'], + 'formats': [_numpy.uint64, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.numOps)) - (pod), + (&(pod.opList)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.ctx)) - (pod), + (&(pod.gCtx)) - (pod), + ], + 'itemsize': sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1), + }) + finally: + _cyb_free(pod) fabric_cpy_batch_node_params_v1_dtype = _get_fabric_cpy_batch_node_params_v1_dtype_offsets() @@ -19384,15 +19875,20 @@ cdef class FabricCpyBatchNodeParamsV1: cdef _get_stream_cig_capture_params_dtype_offsets(): - cdef CUstreamCigCaptureParams pod - return _numpy.dtype({ - 'names': ['stream_cig_params'], - 'formats': [_numpy.intp], - 'offsets': [ - (&(pod.streamCigParams)) - (&pod), - ], - 'itemsize': sizeof(CUstreamCigCaptureParams), - }) + cdef CUstreamCigCaptureParams *pod = _cyb_calloc(1, sizeof(CUstreamCigCaptureParams)) + if pod == NULL: + raise MemoryError("Error allocating CUstreamCigCaptureParams") + try: + return _numpy.dtype({ + 'names': ['stream_cig_params'], + 'formats': [_numpy.intp], + 'offsets': [ + (&(pod.streamCigParams)) - (pod), + ], + 'itemsize': sizeof(CUstreamCigCaptureParams), + }) + finally: + _cyb_free(pod) stream_cig_capture_params_dtype = _get_stream_cig_capture_params_dtype_offsets() @@ -19509,21 +20005,26 @@ cdef class StreamCigCaptureParams: cdef _get_stream_batch_mem_op_params_v1_dtype_offsets(): - cdef CUstreamBatchMemOpParams_v1 pod - return _numpy.dtype({ - 'names': ['operation', 'wait_value', 'write_value', 'flush_remote_writes', 'memory_barrier', 'atomic_reduction', 'pad'], - 'formats': [_numpy.int32, stream_mem_op_wait_value_params_dtype, stream_mem_op_write_value_params_dtype, stream_mem_op_flush_remote_writes_params_dtype, stream_mem_op_memory_barrier_params_dtype, stream_mem_op_atomic_reduction_params_dtype, (_numpy.uint64, 6)], - 'offsets': [ - (&(pod.operation)) - (&pod), - (&(pod.waitValue)) - (&pod), - (&(pod.writeValue)) - (&pod), - (&(pod.flushRemoteWrites)) - (&pod), - (&(pod.memoryBarrier)) - (&pod), - (&(pod.atomicReduction)) - (&pod), - (&(pod.pad)) - (&pod), - ], - 'itemsize': sizeof(CUstreamBatchMemOpParams_v1), - }) + cdef CUstreamBatchMemOpParams_v1 *pod = _cyb_calloc(1, sizeof(CUstreamBatchMemOpParams_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUstreamBatchMemOpParams_v1") + try: + return _numpy.dtype({ + 'names': ['operation', 'wait_value', 'write_value', 'flush_remote_writes', 'memory_barrier', 'atomic_reduction', 'pad'], + 'formats': [_numpy.int32, stream_mem_op_wait_value_params_dtype, stream_mem_op_write_value_params_dtype, stream_mem_op_flush_remote_writes_params_dtype, stream_mem_op_memory_barrier_params_dtype, stream_mem_op_atomic_reduction_params_dtype, (_numpy.uint64, 6)], + 'offsets': [ + (&(pod.operation)) - (pod), + (&(pod.waitValue)) - (pod), + (&(pod.writeValue)) - (pod), + (&(pod.flushRemoteWrites)) - (pod), + (&(pod.memoryBarrier)) - (pod), + (&(pod.atomicReduction)) - (pod), + (&(pod.pad)) - (pod), + ], + 'itemsize': sizeof(CUstreamBatchMemOpParams_v1), + }) + finally: + _cyb_free(pod) stream_batch_mem_op_params_v1_dtype = _get_stream_batch_mem_op_params_v1_dtype_offsets() cdef object stream_batch_mem_op_params_v1_dtype_record = _numpy.dtype((_numpy.record, stream_batch_mem_op_params_v1_dtype)) @@ -19814,16 +20315,21 @@ cdef class StreamBatchMemOpParams_v1: cdef _get_async_notification_info_dtype_offsets(): - cdef CUasyncNotificationInfo pod - return _numpy.dtype({ - 'names': ['type', 'info'], - 'formats': [_numpy.int32, _py_anon_pod2_dtype], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.info)) - (&pod), - ], - 'itemsize': sizeof(CUasyncNotificationInfo), - }) + cdef CUasyncNotificationInfo *pod = _cyb_calloc(1, sizeof(CUasyncNotificationInfo)) + if pod == NULL: + raise MemoryError("Error allocating CUasyncNotificationInfo") + try: + return _numpy.dtype({ + 'names': ['type', 'info'], + 'formats': [_numpy.int32, _py_anon_pod2_dtype], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.info)) - (pod), + ], + 'itemsize': sizeof(CUasyncNotificationInfo), + }) + finally: + _cyb_free(pod) async_notification_info_dtype = _get_async_notification_info_dtype_offsets() @@ -19956,16 +20462,21 @@ cdef class AsyncNotificationInfo: cdef _get_launch_attribute_dtype_offsets(): - cdef CUlaunchAttribute pod - return _numpy.dtype({ - 'names': ['id', 'value'], - 'formats': [_numpy.int32, launch_attribute_value_dtype], - 'offsets': [ - (&(pod.id)) - (&pod), - (&(pod.value)) - (&pod), - ], - 'itemsize': sizeof(CUlaunchAttribute), - }) + cdef CUlaunchAttribute *pod = _cyb_calloc(1, sizeof(CUlaunchAttribute)) + if pod == NULL: + raise MemoryError("Error allocating CUlaunchAttribute") + try: + return _numpy.dtype({ + 'names': ['id', 'value'], + 'formats': [_numpy.int32, launch_attribute_value_dtype], + 'offsets': [ + (&(pod.id)) - (pod), + (&(pod.value)) - (pod), + ], + 'itemsize': sizeof(CUlaunchAttribute), + }) + finally: + _cyb_free(pod) launch_attribute_dtype = _get_launch_attribute_dtype_offsets() @@ -20098,16 +20609,21 @@ cdef class LaunchAttribute: cdef _get_exec_affinity_param_v1_dtype_offsets(): - cdef CUexecAffinityParam_v1 pod - return _numpy.dtype({ - 'names': ['type', 'param'], - 'formats': [_numpy.int32, _py_anon_pod10_dtype], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.param)) - (&pod), - ], - 'itemsize': sizeof(CUexecAffinityParam_v1), - }) + cdef CUexecAffinityParam_v1 *pod = _cyb_calloc(1, sizeof(CUexecAffinityParam_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUexecAffinityParam_v1") + try: + return _numpy.dtype({ + 'names': ['type', 'param'], + 'formats': [_numpy.int32, _py_anon_pod10_dtype], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.param)) - (pod), + ], + 'itemsize': sizeof(CUexecAffinityParam_v1), + }) + finally: + _cyb_free(pod) exec_affinity_param_v1_dtype = _get_exec_affinity_param_v1_dtype_offsets() cdef object exec_affinity_param_v1_dtype_record = _numpy.dtype((_numpy.record, exec_affinity_param_v1_dtype)) @@ -20282,17 +20798,22 @@ cdef class ExecAffinityParam_v1: cdef _get_resource_desc_v1_dtype_offsets(): - cdef CUDA_RESOURCE_DESC_v1 pod - return _numpy.dtype({ - 'names': ['res_type', 'res', 'flags_'], - 'formats': [_numpy.int32, _py_anon_pod12_dtype, _numpy.uint32], - 'offsets': [ - (&(pod.resType)) - (&pod), - (&(pod.res)) - (&pod), - (&(pod.flags)) - (&pod), - ], - 'itemsize': sizeof(CUDA_RESOURCE_DESC_v1), - }) + cdef CUDA_RESOURCE_DESC_v1 *pod = _cyb_calloc(1, sizeof(CUDA_RESOURCE_DESC_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_RESOURCE_DESC_v1") + try: + return _numpy.dtype({ + 'names': ['res_type', 'res', 'flags_'], + 'formats': [_numpy.int32, _py_anon_pod12_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.resType)) - (pod), + (&(pod.res)) - (pod), + (&(pod.flags)) - (pod), + ], + 'itemsize': sizeof(CUDA_RESOURCE_DESC_v1), + }) + finally: + _cyb_free(pod) resource_desc_v1_dtype = _get_resource_desc_v1_dtype_offsets() @@ -20436,19 +20957,24 @@ cdef class ResourceDesc_v1: cdef _get_external_memory_handle_desc_v1_dtype_offsets(): - cdef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 pod - return _numpy.dtype({ - 'names': ['type', 'handle', 'size_', 'flags_', 'reserved'], - 'formats': [_numpy.int32, _py_anon_pod18_dtype, _numpy.uint64, _numpy.uint32, (_numpy.uint32, 16)], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.handle)) - (&pod), - (&(pod.size)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1), - }) + cdef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 *pod = _cyb_calloc(1, sizeof(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1") + try: + return _numpy.dtype({ + 'names': ['type', 'handle', 'size_', 'flags_', 'reserved'], + 'formats': [_numpy.int32, _py_anon_pod18_dtype, _numpy.uint64, _numpy.uint32, (_numpy.uint32, 16)], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.handle)) - (pod), + (&(pod.size)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1), + }) + finally: + _cyb_free(pod) external_memory_handle_desc_v1_dtype = _get_external_memory_handle_desc_v1_dtype_offsets() @@ -20603,18 +21129,23 @@ cdef class ExternalMemoryHandleDesc_v1: cdef _get_external_semaphore_handle_desc_v1_dtype_offsets(): - cdef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 pod - return _numpy.dtype({ - 'names': ['type', 'handle', 'flags_', 'reserved'], - 'formats': [_numpy.int32, _py_anon_pod20_dtype, _numpy.uint32, (_numpy.uint32, 16)], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.handle)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1), - }) + cdef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 *pod = _cyb_calloc(1, sizeof(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1") + try: + return _numpy.dtype({ + 'names': ['type', 'handle', 'flags_', 'reserved'], + 'formats': [_numpy.int32, _py_anon_pod20_dtype, _numpy.uint32, (_numpy.uint32, 16)], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.handle)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1), + }) + finally: + _cyb_free(pod) external_semaphore_handle_desc_v1_dtype = _get_external_semaphore_handle_desc_v1_dtype_offsets() @@ -20758,17 +21289,22 @@ cdef class ExternalSemaphoreHandleDesc_v1: cdef _get_external_semaphore_signal_params_v1_dtype_offsets(): - cdef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 pod - return _numpy.dtype({ - 'names': ['params', 'flags_', 'reserved'], - 'formats': [_py_anon_pod22_dtype, _numpy.uint32, (_numpy.uint32, 16)], - 'offsets': [ - (&(pod.params)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1), - }) + cdef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 *pod = _cyb_calloc(1, sizeof(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1") + try: + return _numpy.dtype({ + 'names': ['params', 'flags_', 'reserved'], + 'formats': [_py_anon_pod22_dtype, _numpy.uint32, (_numpy.uint32, 16)], + 'offsets': [ + (&(pod.params)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1), + }) + finally: + _cyb_free(pod) external_semaphore_signal_params_v1_dtype = _get_external_semaphore_signal_params_v1_dtype_offsets() @@ -20901,17 +21437,22 @@ cdef class ExternalSemaphoreSignalParams_v1: cdef _get_external_semaphore_wait_params_v1_dtype_offsets(): - cdef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 pod - return _numpy.dtype({ - 'names': ['params', 'flags_', 'reserved'], - 'formats': [_py_anon_pod26_dtype, _numpy.uint32, (_numpy.uint32, 16)], - 'offsets': [ - (&(pod.params)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1), - }) + cdef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 *pod = _cyb_calloc(1, sizeof(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1") + try: + return _numpy.dtype({ + 'names': ['params', 'flags_', 'reserved'], + 'formats': [_py_anon_pod26_dtype, _numpy.uint32, (_numpy.uint32, 16)], + 'offsets': [ + (&(pod.params)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1), + }) + finally: + _cyb_free(pod) external_semaphore_wait_params_v1_dtype = _get_external_semaphore_wait_params_v1_dtype_offsets() @@ -21044,25 +21585,30 @@ cdef class ExternalSemaphoreWaitParams_v1: cdef _get_array_map_info_v1_dtype_offsets(): - cdef CUarrayMapInfo_v1 pod - return _numpy.dtype({ - 'names': ['resource_type', 'resource', 'subresource_type', 'subresource', 'mem_operation_type', 'mem_handle_type', 'mem_handle', 'offset', 'device_bit_mask', 'flags_', 'reserved'], - 'formats': [_numpy.int32, _py_anon_pod32_dtype, _numpy.int32, _py_anon_pod33_dtype, _numpy.int32, _numpy.int32, _py_anon_pod36_dtype, _numpy.uint64, _numpy.uint32, _numpy.uint32, (_numpy.uint32, 2)], - 'offsets': [ - (&(pod.resourceType)) - (&pod), - (&(pod.resource)) - (&pod), - (&(pod.subresourceType)) - (&pod), - (&(pod.subresource)) - (&pod), - (&(pod.memOperationType)) - (&pod), - (&(pod.memHandleType)) - (&pod), - (&(pod.memHandle)) - (&pod), - (&(pod.offset)) - (&pod), - (&(pod.deviceBitMask)) - (&pod), - (&(pod.flags)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUarrayMapInfo_v1), - }) + cdef CUarrayMapInfo_v1 *pod = _cyb_calloc(1, sizeof(CUarrayMapInfo_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUarrayMapInfo_v1") + try: + return _numpy.dtype({ + 'names': ['resource_type', 'resource', 'subresource_type', 'subresource', 'mem_operation_type', 'mem_handle_type', 'mem_handle', 'offset', 'device_bit_mask', 'flags_', 'reserved'], + 'formats': [_numpy.int32, _py_anon_pod32_dtype, _numpy.int32, _py_anon_pod33_dtype, _numpy.int32, _numpy.int32, _py_anon_pod36_dtype, _numpy.uint64, _numpy.uint32, _numpy.uint32, (_numpy.uint32, 2)], + 'offsets': [ + (&(pod.resourceType)) - (pod), + (&(pod.resource)) - (pod), + (&(pod.subresourceType)) - (pod), + (&(pod.subresource)) - (pod), + (&(pod.memOperationType)) - (pod), + (&(pod.memHandleType)) - (pod), + (&(pod.memHandle)) - (pod), + (&(pod.offset)) - (pod), + (&(pod.deviceBitMask)) - (pod), + (&(pod.flags)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUarrayMapInfo_v1), + }) + finally: + _cyb_free(pod) array_map_info_v1_dtype = _get_array_map_info_v1_dtype_offsets() cdef object array_map_info_v1_dtype_record = _numpy.dtype((_numpy.record, array_map_info_v1_dtype)) @@ -21373,17 +21919,22 @@ cdef class ArrayMapInfo_v1: cdef _get_mem_location_v1_dtype_offsets(): - cdef CUmemLocation_v1 pod - return _numpy.dtype({ - 'names': ['type', 'id', 'localized'], - 'formats': [_numpy.int32, _numpy.int32, _py_anon_pod38_dtype], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.localized)) - (&pod), - ], - 'itemsize': sizeof(CUmemLocation_v1), - }) + cdef CUmemLocation_v1 *pod = _cyb_calloc(1, sizeof(CUmemLocation_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUmemLocation_v1") + try: + return _numpy.dtype({ + 'names': ['type', 'id', 'localized'], + 'formats': [_numpy.int32, _numpy.int32, _py_anon_pod38_dtype], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.id)) - (pod), + (&(pod.localized)) - (pod), + ], + 'itemsize': sizeof(CUmemLocation_v1), + }) + finally: + _cyb_free(pod) mem_location_v1_dtype = _get_mem_location_v1_dtype_offsets() @@ -21527,16 +22078,21 @@ cdef class MemLocation_v1: cdef _get_checkpoint_checkpoint_args_dtype_offsets(): - cdef CUcheckpointCheckpointArgs pod - return _numpy.dtype({ - 'names': ['custom_storage_info_out', 'reserved'], - 'formats': [_numpy.intp, (_numpy.int8, 56)], - 'offsets': [ - (&(pod.customStorageInfo_out)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUcheckpointCheckpointArgs), - }) + cdef CUcheckpointCheckpointArgs *pod = _cyb_calloc(1, sizeof(CUcheckpointCheckpointArgs)) + if pod == NULL: + raise MemoryError("Error allocating CUcheckpointCheckpointArgs") + try: + return _numpy.dtype({ + 'names': ['custom_storage_info_out', 'reserved'], + 'formats': [_numpy.intp, (_numpy.int8, 56)], + 'offsets': [ + (&(pod.customStorageInfo_out)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUcheckpointCheckpointArgs), + }) + finally: + _cyb_free(pod) checkpoint_checkpoint_args_dtype = _get_checkpoint_checkpoint_args_dtype_offsets() @@ -21653,19 +22209,24 @@ cdef class CheckpointCheckpointArgs: cdef _get_checkpoint_restore_args_dtype_offsets(): - cdef CUcheckpointRestoreArgs pod - return _numpy.dtype({ - 'names': ['gpu_pairs', 'gpu_pairs_count', 'padding0', 'custom_storage_info_out', 'reserved'], - 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, _numpy.intp, (_numpy.int8, 40)], - 'offsets': [ - (&(pod.gpuPairs)) - (&pod), - (&(pod.gpuPairsCount)) - (&pod), - (&(pod.padding0)) - (&pod), - (&(pod.customStorageInfo_out)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUcheckpointRestoreArgs), - }) + cdef CUcheckpointRestoreArgs *pod = _cyb_calloc(1, sizeof(CUcheckpointRestoreArgs)) + if pod == NULL: + raise MemoryError("Error allocating CUcheckpointRestoreArgs") + try: + return _numpy.dtype({ + 'names': ['gpu_pairs', 'gpu_pairs_count', 'padding0', 'custom_storage_info_out', 'reserved'], + 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, _numpy.intp, (_numpy.int8, 40)], + 'offsets': [ + (&(pod.gpuPairs)) - (pod), + (&(pod.gpuPairsCount)) - (pod), + (&(pod.padding0)) - (pod), + (&(pod.customStorageInfo_out)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUcheckpointRestoreArgs), + }) + finally: + _cyb_free(pod) checkpoint_restore_args_dtype = _get_checkpoint_restore_args_dtype_offsets() @@ -21804,21 +22365,26 @@ cdef class CheckpointRestoreArgs: cdef _get_dev_resource_v1_dtype_offsets(): - cdef CUdevResource_v1 pod - return _numpy.dtype({ - 'names': ['type', '_internal_padding', 'sm', 'wq_config', 'wq', '_oversize', 'next_resource'], - 'formats': [_numpy.int32, (_numpy.uint8, 92), dev_sm_resource_dtype, dev_workqueue_config_resource_dtype, dev_workqueue_resource_dtype, (_numpy.uint8, 40), _numpy.intp], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod._internal_padding)) - (&pod), - (&(pod.sm)) - (&pod), - (&(pod.wqConfig)) - (&pod), - (&(pod.wq)) - (&pod), - (&(pod._oversize)) - (&pod), - (&(pod.nextResource)) - (&pod), - ], - 'itemsize': sizeof(CUdevResource_v1), - }) + cdef CUdevResource_v1 *pod = _cyb_calloc(1, sizeof(CUdevResource_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUdevResource_v1") + try: + return _numpy.dtype({ + 'names': ['type', '_internal_padding', 'sm', 'wq_config', 'wq', '_oversize', 'next_resource'], + 'formats': [_numpy.int32, (_numpy.uint8, 92), dev_sm_resource_dtype, dev_workqueue_config_resource_dtype, dev_workqueue_resource_dtype, (_numpy.uint8, 40), _numpy.intp], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod._internal_padding)) - (pod), + (&(pod.sm)) - (pod), + (&(pod.wqConfig)) - (pod), + (&(pod.wq)) - (pod), + (&(pod._oversize)) - (pod), + (&(pod.nextResource)) - (pod), + ], + 'itemsize': sizeof(CUdevResource_v1), + }) + finally: + _cyb_free(pod) dev_resource_v1_dtype = _get_dev_resource_v1_dtype_offsets() cdef object dev_resource_v1_dtype_record = _numpy.dtype((_numpy.record, dev_resource_v1_dtype)) @@ -22086,20 +22652,25 @@ cdef class DevResource_v1: cdef _get_logical_endpoint_prop_dtype_offsets(): - cdef CUlogicalEndpointProp pod - return _numpy.dtype({ - 'names': ['type', 'unicast', 'multicast', 'size_', 'ipc_handle_types', 'flags_'], - 'formats': [_numpy.int32, _py_anon_pod47_dtype, _py_anon_pod48_dtype, _numpy.uint64, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.unicast)) - (&pod), - (&(pod.multicast)) - (&pod), - (&(pod.size)) - (&pod), - (&(pod.ipcHandleTypes)) - (&pod), - (&(pod.flags)) - (&pod), - ], - 'itemsize': sizeof(CUlogicalEndpointProp), - }) + cdef CUlogicalEndpointProp *pod = _cyb_calloc(1, sizeof(CUlogicalEndpointProp)) + if pod == NULL: + raise MemoryError("Error allocating CUlogicalEndpointProp") + try: + return _numpy.dtype({ + 'names': ['type', 'unicast', 'multicast', 'size_', 'ipc_handle_types', 'flags_'], + 'formats': [_numpy.int32, _py_anon_pod47_dtype, _py_anon_pod48_dtype, _numpy.uint64, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.unicast)) - (pod), + (&(pod.multicast)) - (pod), + (&(pod.size)) - (pod), + (&(pod.ipcHandleTypes)) - (pod), + (&(pod.flags)) - (pod), + ], + 'itemsize': sizeof(CUlogicalEndpointProp), + }) + finally: + _cyb_free(pod) logical_endpoint_prop_dtype = _get_logical_endpoint_prop_dtype_offsets() @@ -22281,18 +22852,23 @@ cdef class LogicalEndpointProp: cdef _get_batch_mem_op_node_params_v1_dtype_offsets(): - cdef CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 pod - return _numpy.dtype({ - 'names': ['ctx', 'count', 'param_array', 'flags_'], - 'formats': [_numpy.intp, _numpy.uint32, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.ctx)) - (&pod), - (&(pod.count)) - (&pod), - (&(pod.paramArray)) - (&pod), - (&(pod.flags)) - (&pod), - ], - 'itemsize': sizeof(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1), - }) + cdef CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 *pod = _cyb_calloc(1, sizeof(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_BATCH_MEM_OP_NODE_PARAMS_v1") + try: + return _numpy.dtype({ + 'names': ['ctx', 'count', 'param_array', 'flags_'], + 'formats': [_numpy.intp, _numpy.uint32, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.ctx)) - (pod), + (&(pod.count)) - (pod), + (&(pod.paramArray)) - (pod), + (&(pod.flags)) - (pod), + ], + 'itemsize': sizeof(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1), + }) + finally: + _cyb_free(pod) batch_mem_op_node_params_v1_dtype = _get_batch_mem_op_node_params_v1_dtype_offsets() @@ -22442,18 +23018,23 @@ cdef class BatchMemOpNodeParams_v1: cdef _get_batch_mem_op_node_params_v2_dtype_offsets(): - cdef CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 pod - return _numpy.dtype({ - 'names': ['ctx', 'count', 'param_array', 'flags_'], - 'formats': [_numpy.intp, _numpy.uint32, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.ctx)) - (&pod), - (&(pod.count)) - (&pod), - (&(pod.paramArray)) - (&pod), - (&(pod.flags)) - (&pod), - ], - 'itemsize': sizeof(CUDA_BATCH_MEM_OP_NODE_PARAMS_v2), - }) + cdef CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 *pod = _cyb_calloc(1, sizeof(CUDA_BATCH_MEM_OP_NODE_PARAMS_v2)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_BATCH_MEM_OP_NODE_PARAMS_v2") + try: + return _numpy.dtype({ + 'names': ['ctx', 'count', 'param_array', 'flags_'], + 'formats': [_numpy.intp, _numpy.uint32, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.ctx)) - (pod), + (&(pod.count)) - (pod), + (&(pod.paramArray)) - (pod), + (&(pod.flags)) - (pod), + ], + 'itemsize': sizeof(CUDA_BATCH_MEM_OP_NODE_PARAMS_v2), + }) + finally: + _cyb_free(pod) batch_mem_op_node_params_v2_dtype = _get_batch_mem_op_node_params_v2_dtype_offsets() @@ -22615,24 +23196,29 @@ cdef class BatchMemOpNodeParams_v2: cdef _get_launch_config_dtype_offsets(): - cdef CUlaunchConfig pod - return _numpy.dtype({ - 'names': ['grid_dim_x', 'grid_dim_y', 'grid_dim_z', 'block_dim_x', 'block_dim_y', 'block_dim_z', 'shared_mem_bytes', 'h_stream', 'attrs', 'num_attrs'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.gridDimX)) - (&pod), - (&(pod.gridDimY)) - (&pod), - (&(pod.gridDimZ)) - (&pod), - (&(pod.blockDimX)) - (&pod), - (&(pod.blockDimY)) - (&pod), - (&(pod.blockDimZ)) - (&pod), - (&(pod.sharedMemBytes)) - (&pod), - (&(pod.hStream)) - (&pod), - (&(pod.attrs)) - (&pod), - (&(pod.numAttrs)) - (&pod), - ], - 'itemsize': sizeof(CUlaunchConfig), - }) + cdef CUlaunchConfig *pod = _cyb_calloc(1, sizeof(CUlaunchConfig)) + if pod == NULL: + raise MemoryError("Error allocating CUlaunchConfig") + try: + return _numpy.dtype({ + 'names': ['grid_dim_x', 'grid_dim_y', 'grid_dim_z', 'block_dim_x', 'block_dim_y', 'block_dim_z', 'shared_mem_bytes', 'h_stream', 'attrs', 'num_attrs'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.gridDimX)) - (pod), + (&(pod.gridDimY)) - (pod), + (&(pod.gridDimZ)) - (pod), + (&(pod.blockDimX)) - (pod), + (&(pod.blockDimY)) - (pod), + (&(pod.blockDimZ)) - (pod), + (&(pod.sharedMemBytes)) - (pod), + (&(pod.hStream)) - (pod), + (&(pod.attrs)) - (pod), + (&(pod.numAttrs)) - (pod), + ], + 'itemsize': sizeof(CUlaunchConfig), + }) + finally: + _cyb_free(pod) launch_config_dtype = _get_launch_config_dtype_offsets() @@ -22848,17 +23434,22 @@ cdef class LaunchConfig: cdef _get_ctx_create_params_dtype_offsets(): - cdef CUctxCreateParams pod - return _numpy.dtype({ - 'names': ['exec_affinity_params', 'num_exec_affinity_params', 'cig_params'], - 'formats': [_numpy.intp, _numpy.int32, _numpy.intp], - 'offsets': [ - (&(pod.execAffinityParams)) - (&pod), - (&(pod.numExecAffinityParams)) - (&pod), - (&(pod.cigParams)) - (&pod), - ], - 'itemsize': sizeof(CUctxCreateParams), - }) + cdef CUctxCreateParams *pod = _cyb_calloc(1, sizeof(CUctxCreateParams)) + if pod == NULL: + raise MemoryError("Error allocating CUctxCreateParams") + try: + return _numpy.dtype({ + 'names': ['exec_affinity_params', 'num_exec_affinity_params', 'cig_params'], + 'formats': [_numpy.intp, _numpy.int32, _numpy.intp], + 'offsets': [ + (&(pod.execAffinityParams)) - (pod), + (&(pod.numExecAffinityParams)) - (pod), + (&(pod.cigParams)) - (pod), + ], + 'itemsize': sizeof(CUctxCreateParams), + }) + finally: + _cyb_free(pod) ctx_create_params_dtype = _get_ctx_create_params_dtype_offsets() @@ -22997,17 +23588,22 @@ cdef class CtxCreateParams: cdef _get_ext_sem_signal_node_params_v1_dtype_offsets(): - cdef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 pod - return _numpy.dtype({ - 'names': ['ext_sem_array', 'params_array', 'num_ext_sems'], - 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.extSemArray)) - (&pod), - (&(pod.paramsArray)) - (&pod), - (&(pod.numExtSems)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1), - }) + cdef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 *pod = _cyb_calloc(1, sizeof(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1") + try: + return _numpy.dtype({ + 'names': ['ext_sem_array', 'params_array', 'num_ext_sems'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.extSemArray)) - (pod), + (&(pod.paramsArray)) - (pod), + (&(pod.numExtSems)) - (pod), + ], + 'itemsize': sizeof(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1), + }) + finally: + _cyb_free(pod) ext_sem_signal_node_params_v1_dtype = _get_ext_sem_signal_node_params_v1_dtype_offsets() @@ -23146,19 +23742,24 @@ cdef class ExtSemSignalNodeParams_v1: cdef _get_ext_sem_signal_node_params_v2_dtype_offsets(): - cdef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 pod - return _numpy.dtype({ - 'names': ['ext_sem_array', 'params_array', 'num_ext_sems', 'ctx', 'g_ctx'], - 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.extSemArray)) - (&pod), - (&(pod.paramsArray)) - (&pod), - (&(pod.numExtSems)) - (&pod), - (&(pod.ctx)) - (&pod), - (&(pod.gCtx)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2), - }) + cdef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 *pod = _cyb_calloc(1, sizeof(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2") + try: + return _numpy.dtype({ + 'names': ['ext_sem_array', 'params_array', 'num_ext_sems', 'ctx', 'g_ctx'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.extSemArray)) - (pod), + (&(pod.paramsArray)) - (pod), + (&(pod.numExtSems)) - (pod), + (&(pod.ctx)) - (pod), + (&(pod.gCtx)) - (pod), + ], + 'itemsize': sizeof(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2), + }) + finally: + _cyb_free(pod) ext_sem_signal_node_params_v2_dtype = _get_ext_sem_signal_node_params_v2_dtype_offsets() @@ -23331,17 +23932,22 @@ cdef class ExtSemSignalNodeParams_v2: cdef _get_ext_sem_wait_node_params_v1_dtype_offsets(): - cdef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 pod - return _numpy.dtype({ - 'names': ['ext_sem_array', 'params_array', 'num_ext_sems'], - 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.extSemArray)) - (&pod), - (&(pod.paramsArray)) - (&pod), - (&(pod.numExtSems)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1), - }) + cdef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 *pod = _cyb_calloc(1, sizeof(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1") + try: + return _numpy.dtype({ + 'names': ['ext_sem_array', 'params_array', 'num_ext_sems'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.extSemArray)) - (pod), + (&(pod.paramsArray)) - (pod), + (&(pod.numExtSems)) - (pod), + ], + 'itemsize': sizeof(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1), + }) + finally: + _cyb_free(pod) ext_sem_wait_node_params_v1_dtype = _get_ext_sem_wait_node_params_v1_dtype_offsets() @@ -23480,19 +24086,24 @@ cdef class ExtSemWaitNodeParams_v1: cdef _get_ext_sem_wait_node_params_v2_dtype_offsets(): - cdef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 pod - return _numpy.dtype({ - 'names': ['ext_sem_array', 'params_array', 'num_ext_sems', 'ctx', 'g_ctx'], - 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.extSemArray)) - (&pod), - (&(pod.paramsArray)) - (&pod), - (&(pod.numExtSems)) - (&pod), - (&(pod.ctx)) - (&pod), - (&(pod.gCtx)) - (&pod), - ], - 'itemsize': sizeof(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2), - }) + cdef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 *pod = _cyb_calloc(1, sizeof(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2") + try: + return _numpy.dtype({ + 'names': ['ext_sem_array', 'params_array', 'num_ext_sems', 'ctx', 'g_ctx'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.extSemArray)) - (pod), + (&(pod.paramsArray)) - (pod), + (&(pod.numExtSems)) - (pod), + (&(pod.ctx)) - (pod), + (&(pod.gCtx)) - (pod), + ], + 'itemsize': sizeof(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2), + }) + finally: + _cyb_free(pod) ext_sem_wait_node_params_v2_dtype = _get_ext_sem_wait_node_params_v2_dtype_offsets() @@ -23665,19 +24276,24 @@ cdef class ExtSemWaitNodeParams_v2: cdef _get_mem_allocation_prop_v1_dtype_offsets(): - cdef CUmemAllocationProp_v1 pod - return _numpy.dtype({ - 'names': ['type', 'requested_handle_types', 'location', 'win32handle_meta_data', 'alloc_flags'], - 'formats': [_numpy.int32, _numpy.int32, mem_location_v1_dtype, _numpy.intp, _py_anon_pod39_dtype], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.requestedHandleTypes)) - (&pod), - (&(pod.location)) - (&pod), - (&(pod.win32HandleMetaData)) - (&pod), - (&(pod.allocFlags)) - (&pod), - ], - 'itemsize': sizeof(CUmemAllocationProp_v1), - }) + cdef CUmemAllocationProp_v1 *pod = _cyb_calloc(1, sizeof(CUmemAllocationProp_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUmemAllocationProp_v1") + try: + return _numpy.dtype({ + 'names': ['type', 'requested_handle_types', 'location', 'win32handle_meta_data', 'alloc_flags'], + 'formats': [_numpy.int32, _numpy.int32, mem_location_v1_dtype, _numpy.intp, _py_anon_pod39_dtype], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.requestedHandleTypes)) - (pod), + (&(pod.location)) - (pod), + (&(pod.win32HandleMetaData)) - (pod), + (&(pod.allocFlags)) - (pod), + ], + 'itemsize': sizeof(CUmemAllocationProp_v1), + }) + finally: + _cyb_free(pod) mem_allocation_prop_v1_dtype = _get_mem_allocation_prop_v1_dtype_offsets() @@ -23848,16 +24464,21 @@ cdef class MemAllocationProp_v1: cdef _get_mem_access_desc_v1_dtype_offsets(): - cdef CUmemAccessDesc_v1 pod - return _numpy.dtype({ - 'names': ['location', 'flags_'], - 'formats': [mem_location_v1_dtype, _numpy.int32], - 'offsets': [ - (&(pod.location)) - (&pod), - (&(pod.flags)) - (&pod), - ], - 'itemsize': sizeof(CUmemAccessDesc_v1), - }) + cdef CUmemAccessDesc_v1 *pod = _cyb_calloc(1, sizeof(CUmemAccessDesc_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUmemAccessDesc_v1") + try: + return _numpy.dtype({ + 'names': ['location', 'flags_'], + 'formats': [mem_location_v1_dtype, _numpy.int32], + 'offsets': [ + (&(pod.location)) - (pod), + (&(pod.flags)) - (pod), + ], + 'itemsize': sizeof(CUmemAccessDesc_v1), + }) + finally: + _cyb_free(pod) mem_access_desc_v1_dtype = _get_mem_access_desc_v1_dtype_offsets() cdef object mem_access_desc_v1_dtype_record = _numpy.dtype((_numpy.record, mem_access_desc_v1_dtype)) @@ -24032,22 +24653,27 @@ cdef class MemAccessDesc_v1: cdef _get_mem_pool_props_v1_dtype_offsets(): - cdef CUmemPoolProps_v1 pod - return _numpy.dtype({ - 'names': ['alloc_type', 'handle_types', 'location', 'win32security_attributes', 'max_size', 'usage', 'gpu_direct_rdma_capable', 'reserved'], - 'formats': [_numpy.int32, _numpy.int32, mem_location_v1_dtype, _numpy.intp, _numpy.uint64, _numpy.uint16, _numpy.uint8, (_numpy.uint8, 53)], - 'offsets': [ - (&(pod.allocType)) - (&pod), - (&(pod.handleTypes)) - (&pod), - (&(pod.location)) - (&pod), - (&(pod.win32SecurityAttributes)) - (&pod), - (&(pod.maxSize)) - (&pod), - (&(pod.usage)) - (&pod), - (&(pod.gpuDirectRDMACapable)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(CUmemPoolProps_v1), - }) + cdef CUmemPoolProps_v1 *pod = _cyb_calloc(1, sizeof(CUmemPoolProps_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUmemPoolProps_v1") + try: + return _numpy.dtype({ + 'names': ['alloc_type', 'handle_types', 'location', 'win32security_attributes', 'max_size', 'usage', 'gpu_direct_rdma_capable', 'reserved'], + 'formats': [_numpy.int32, _numpy.int32, mem_location_v1_dtype, _numpy.intp, _numpy.uint64, _numpy.uint16, _numpy.uint8, (_numpy.uint8, 53)], + 'offsets': [ + (&(pod.allocType)) - (pod), + (&(pod.handleTypes)) - (pod), + (&(pod.location)) - (pod), + (&(pod.win32SecurityAttributes)) - (pod), + (&(pod.maxSize)) - (pod), + (&(pod.usage)) - (pod), + (&(pod.gpuDirectRDMACapable)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(CUmemPoolProps_v1), + }) + finally: + _cyb_free(pod) mem_pool_props_v1_dtype = _get_mem_pool_props_v1_dtype_offsets() @@ -24235,18 +24861,23 @@ cdef class MemPoolProps_v1: cdef _get_mem_cpy_attributes_v1_dtype_offsets(): - cdef CUmemcpyAttributes_v1 pod - return _numpy.dtype({ - 'names': ['src_access_order', 'src_loc_hint', 'dst_loc_hint', 'flags_'], - 'formats': [_numpy.int32, mem_location_v1_dtype, mem_location_v1_dtype, _numpy.uint32], - 'offsets': [ - (&(pod.srcAccessOrder)) - (&pod), - (&(pod.srcLocHint)) - (&pod), - (&(pod.dstLocHint)) - (&pod), - (&(pod.flags)) - (&pod), - ], - 'itemsize': sizeof(CUmemcpyAttributes_v1), - }) + cdef CUmemcpyAttributes_v1 *pod = _cyb_calloc(1, sizeof(CUmemcpyAttributes_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUmemcpyAttributes_v1") + try: + return _numpy.dtype({ + 'names': ['src_access_order', 'src_loc_hint', 'dst_loc_hint', 'flags_'], + 'formats': [_numpy.int32, mem_location_v1_dtype, mem_location_v1_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.srcAccessOrder)) - (pod), + (&(pod.srcLocHint)) - (pod), + (&(pod.dstLocHint)) - (pod), + (&(pod.flags)) - (pod), + ], + 'itemsize': sizeof(CUmemcpyAttributes_v1), + }) + finally: + _cyb_free(pod) mem_cpy_attributes_v1_dtype = _get_mem_cpy_attributes_v1_dtype_offsets() @@ -24406,18 +25037,23 @@ cdef class MemCpyAttributes_v1: cdef _get__py_anon_pod41_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod41 pod - return _numpy.dtype({ - 'names': ['ptr_', 'row_length', 'layer_height', 'loc_hint'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, mem_location_v1_dtype], - 'offsets': [ - (&(pod.ptr)) - (&pod), - (&(pod.rowLength)) - (&pod), - (&(pod.layerHeight)) - (&pod), - (&(pod.locHint)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod41), - }) + cdef cuda_bindings_driver__anon_pod41 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod41)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod41") + try: + return _numpy.dtype({ + 'names': ['ptr_', 'row_length', 'layer_height', 'loc_hint'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, mem_location_v1_dtype], + 'offsets': [ + (&(pod.ptr)) - (pod), + (&(pod.rowLength)) - (pod), + (&(pod.layerHeight)) - (pod), + (&(pod.locHint)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod41), + }) + finally: + _cyb_free(pod) _py_anon_pod41_dtype = _get__py_anon_pod41_dtype_offsets() @@ -24584,19 +25220,24 @@ cdef class _py_anon_pod41: cdef _get_mem_alloc_node_params_v1_dtype_offsets(): - cdef CUDA_MEM_ALLOC_NODE_PARAMS_v1 pod - return _numpy.dtype({ - 'names': ['pool_props', 'access_descs', 'access_desc_count', 'bytesize', 'dptr'], - 'formats': [mem_pool_props_v1_dtype, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.poolProps)) - (&pod), - (&(pod.accessDescs)) - (&pod), - (&(pod.accessDescCount)) - (&pod), - (&(pod.bytesize)) - (&pod), - (&(pod.dptr)) - (&pod), - ], - 'itemsize': sizeof(CUDA_MEM_ALLOC_NODE_PARAMS_v1), - }) + cdef CUDA_MEM_ALLOC_NODE_PARAMS_v1 *pod = _cyb_calloc(1, sizeof(CUDA_MEM_ALLOC_NODE_PARAMS_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_MEM_ALLOC_NODE_PARAMS_v1") + try: + return _numpy.dtype({ + 'names': ['pool_props', 'access_descs', 'access_desc_count', 'bytesize', 'dptr'], + 'formats': [mem_pool_props_v1_dtype, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.poolProps)) - (pod), + (&(pod.accessDescs)) - (pod), + (&(pod.accessDescCount)) - (pod), + (&(pod.bytesize)) - (pod), + (&(pod.dptr)) - (pod), + ], + 'itemsize': sizeof(CUDA_MEM_ALLOC_NODE_PARAMS_v1), + }) + finally: + _cyb_free(pod) mem_alloc_node_params_v1_dtype = _get_mem_alloc_node_params_v1_dtype_offsets() @@ -24762,19 +25403,24 @@ cdef class MemAllocNodeParams_v1: cdef _get_mem_alloc_node_params_v2_dtype_offsets(): - cdef CUDA_MEM_ALLOC_NODE_PARAMS_v2 pod - return _numpy.dtype({ - 'names': ['pool_props', 'access_descs', 'access_desc_count', 'bytesize', 'dptr'], - 'formats': [mem_pool_props_v1_dtype, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.poolProps)) - (&pod), - (&(pod.accessDescs)) - (&pod), - (&(pod.accessDescCount)) - (&pod), - (&(pod.bytesize)) - (&pod), - (&(pod.dptr)) - (&pod), - ], - 'itemsize': sizeof(CUDA_MEM_ALLOC_NODE_PARAMS_v2), - }) + cdef CUDA_MEM_ALLOC_NODE_PARAMS_v2 *pod = _cyb_calloc(1, sizeof(CUDA_MEM_ALLOC_NODE_PARAMS_v2)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_MEM_ALLOC_NODE_PARAMS_v2") + try: + return _numpy.dtype({ + 'names': ['pool_props', 'access_descs', 'access_desc_count', 'bytesize', 'dptr'], + 'formats': [mem_pool_props_v1_dtype, _numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.poolProps)) - (pod), + (&(pod.accessDescs)) - (pod), + (&(pod.accessDescCount)) - (pod), + (&(pod.bytesize)) - (pod), + (&(pod.dptr)) - (pod), + ], + 'itemsize': sizeof(CUDA_MEM_ALLOC_NODE_PARAMS_v2), + }) + finally: + _cyb_free(pod) mem_alloc_node_params_v2_dtype = _get_mem_alloc_node_params_v2_dtype_offsets() @@ -24952,23 +25598,28 @@ cdef class MemAllocNodeParams_v2: cdef _get_memcpy_batch_node_params_v1_dtype_offsets(): - cdef CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 pod - return _numpy.dtype({ - 'names': ['count', 'dsts', 'srcs', 'sizes', 'attrs', 'attrs_idxs', 'num_attrs', 'ctx', 'g_ctx'], - 'formats': [_numpy.uint64, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.count)) - (&pod), - (&(pod.dsts)) - (&pod), - (&(pod.srcs)) - (&pod), - (&(pod.sizes)) - (&pod), - (&(pod.attrs)) - (&pod), - (&(pod.attrsIdxs)) - (&pod), - (&(pod.numAttrs)) - (&pod), - (&(pod.ctx)) - (&pod), - (&(pod.gCtx)) - (&pod), - ], - 'itemsize': sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1), - }) + cdef CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 *pod = _cyb_calloc(1, sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_MEMCPY_BATCH_NODE_PARAMS_V1") + try: + return _numpy.dtype({ + 'names': ['count', 'dsts', 'srcs', 'sizes', 'attrs', 'attrs_idxs', 'num_attrs', 'ctx', 'g_ctx'], + 'formats': [_numpy.uint64, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.count)) - (pod), + (&(pod.dsts)) - (pod), + (&(pod.srcs)) - (pod), + (&(pod.sizes)) - (pod), + (&(pod.attrs)) - (pod), + (&(pod.attrsIdxs)) - (pod), + (&(pod.numAttrs)) - (pod), + (&(pod.ctx)) - (pod), + (&(pod.gCtx)) - (pod), + ], + 'itemsize': sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1), + }) + finally: + _cyb_free(pod) memcpy_batch_node_params_v1_dtype = _get_memcpy_batch_node_params_v1_dtype_offsets() @@ -25185,16 +25836,21 @@ cdef class MemcpyBatchNodeParamsV1: cdef _get__py_anon_pod40_dtype_offsets(): - cdef cuda_bindings_driver__anon_pod40 pod - return _numpy.dtype({ - 'names': ['ptr_', 'array'], - 'formats': [_py_anon_pod41_dtype, _py_anon_pod42_dtype], - 'offsets': [ - (&(pod.ptr)) - (&pod), - (&(pod.array)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_driver__anon_pod40), - }) + cdef cuda_bindings_driver__anon_pod40 *pod = _cyb_calloc(1, sizeof(cuda_bindings_driver__anon_pod40)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_driver__anon_pod40") + try: + return _numpy.dtype({ + 'names': ['ptr_', 'array'], + 'formats': [_py_anon_pod41_dtype, _py_anon_pod42_dtype], + 'offsets': [ + (&(pod.ptr)) - (pod), + (&(pod.array)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_driver__anon_pod40), + }) + finally: + _cyb_free(pod) _py_anon_pod40_dtype = _get__py_anon_pod40_dtype_offsets() @@ -25344,16 +26000,21 @@ cdef class _py_anon_pod40: cdef _get_mem_cpy3d_operand_v1_dtype_offsets(): - cdef CUmemcpy3DOperand_v1 pod - return _numpy.dtype({ - 'names': ['type', 'op'], - 'formats': [_numpy.int32, _py_anon_pod40_dtype], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.op)) - (&pod), - ], - 'itemsize': sizeof(CUmemcpy3DOperand_v1), - }) + cdef CUmemcpy3DOperand_v1 *pod = _cyb_calloc(1, sizeof(CUmemcpy3DOperand_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUmemcpy3DOperand_v1") + try: + return _numpy.dtype({ + 'names': ['type', 'op'], + 'formats': [_numpy.int32, _py_anon_pod40_dtype], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.op)) - (pod), + ], + 'itemsize': sizeof(CUmemcpy3DOperand_v1), + }) + finally: + _cyb_free(pod) mem_cpy3d_operand_v1_dtype = _get_mem_cpy3d_operand_v1_dtype_offsets() @@ -25486,34 +26147,39 @@ cdef class MemCpy3dOperand_v1: cdef _get_graph_node_params_dtype_offsets(): - cdef CUgraphNodeParams pod - return _numpy.dtype({ - 'names': ['type', 'reserved0', 'reserved1', 'kernel', 'memcpy', 'memset', 'host', 'graph', 'event_wait', 'event_record', 'ext_sem_signal', 'ext_sem_wait', 'alloc', 'free', 'mem_op', 'conditional', 'memcpy_batch', 'fabric_cpy_batch', 'as_bytes', 'reserved2'], - 'formats': [_numpy.int32, (_numpy.int32, 3), (_numpy.int64, 29), kernel_node_params_v3_dtype, mem_cpy_node_params_dtype, mem_set_node_params_v2_dtype, host_node_params_v2_dtype, child_graph_node_params_dtype, event_wait_node_params_dtype, event_record_node_params_dtype, ext_sem_signal_node_params_v2_dtype, ext_sem_wait_node_params_v2_dtype, mem_alloc_node_params_v2_dtype, mem_free_node_params_dtype, batch_mem_op_node_params_v2_dtype, conditional_node_params_dtype, memcpy_batch_node_params_v1_dtype, fabric_cpy_batch_node_params_v1_dtype, (_numpy.int8, 232), _numpy.int64], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.reserved0)) - (&pod), - (&(pod.reserved1)) - (&pod), - (&(pod.kernel)) - (&pod), - (&(pod.memcpy)) - (&pod), - (&(pod.memset)) - (&pod), - (&(pod.host)) - (&pod), - (&(pod.graph)) - (&pod), - (&(pod.eventWait)) - (&pod), - (&(pod.eventRecord)) - (&pod), - (&(pod.extSemSignal)) - (&pod), - (&(pod.extSemWait)) - (&pod), - (&(pod.alloc)) - (&pod), - (&(pod.free)) - (&pod), - (&(pod.memOp)) - (&pod), - (&(pod.conditional)) - (&pod), - (&(pod.memcpyBatch)) - (&pod), - (&(pod.fabricCpyBatch)) - (&pod), - (&(pod.asBytes)) - (&pod), - (&(pod.reserved2)) - (&pod), - ], - 'itemsize': sizeof(CUgraphNodeParams), - }) + cdef CUgraphNodeParams *pod = _cyb_calloc(1, sizeof(CUgraphNodeParams)) + if pod == NULL: + raise MemoryError("Error allocating CUgraphNodeParams") + try: + return _numpy.dtype({ + 'names': ['type', 'reserved0', 'reserved1', 'kernel', 'memcpy', 'memset', 'host', 'graph', 'event_wait', 'event_record', 'ext_sem_signal', 'ext_sem_wait', 'alloc', 'free', 'mem_op', 'conditional', 'memcpy_batch', 'fabric_cpy_batch', 'as_bytes', 'reserved2'], + 'formats': [_numpy.int32, (_numpy.int32, 3), (_numpy.int64, 29), kernel_node_params_v3_dtype, mem_cpy_node_params_dtype, mem_set_node_params_v2_dtype, host_node_params_v2_dtype, child_graph_node_params_dtype, event_wait_node_params_dtype, event_record_node_params_dtype, ext_sem_signal_node_params_v2_dtype, ext_sem_wait_node_params_v2_dtype, mem_alloc_node_params_v2_dtype, mem_free_node_params_dtype, batch_mem_op_node_params_v2_dtype, conditional_node_params_dtype, memcpy_batch_node_params_v1_dtype, fabric_cpy_batch_node_params_v1_dtype, (_numpy.int8, 232), _numpy.int64], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.reserved0)) - (pod), + (&(pod.reserved1)) - (pod), + (&(pod.kernel)) - (pod), + (&(pod.memcpy)) - (pod), + (&(pod.memset)) - (pod), + (&(pod.host)) - (pod), + (&(pod.graph)) - (pod), + (&(pod.eventWait)) - (pod), + (&(pod.eventRecord)) - (pod), + (&(pod.extSemSignal)) - (pod), + (&(pod.extSemWait)) - (pod), + (&(pod.alloc)) - (pod), + (&(pod.free)) - (pod), + (&(pod.memOp)) - (pod), + (&(pod.conditional)) - (pod), + (&(pod.memcpyBatch)) - (pod), + (&(pod.fabricCpyBatch)) - (pod), + (&(pod.asBytes)) - (pod), + (&(pod.reserved2)) - (pod), + ], + 'itemsize': sizeof(CUgraphNodeParams), + }) + finally: + _cyb_free(pod) graph_node_params_dtype = _get_graph_node_params_dtype_offsets() @@ -25887,19 +26553,24 @@ cdef class GraphNodeParams: cdef _get_mem_cpy3d_batch_op_v1_dtype_offsets(): - cdef CUDA_MEMCPY3D_BATCH_OP_v1 pod - return _numpy.dtype({ - 'names': ['src', 'dst', 'extent', 'src_access_order', 'flags_'], - 'formats': [mem_cpy3d_operand_v1_dtype, mem_cpy3d_operand_v1_dtype, extent3d_v1_dtype, _numpy.int32, _numpy.uint32], - 'offsets': [ - (&(pod.src)) - (&pod), - (&(pod.dst)) - (&pod), - (&(pod.extent)) - (&pod), - (&(pod.srcAccessOrder)) - (&pod), - (&(pod.flags)) - (&pod), - ], - 'itemsize': sizeof(CUDA_MEMCPY3D_BATCH_OP_v1), - }) + cdef CUDA_MEMCPY3D_BATCH_OP_v1 *pod = _cyb_calloc(1, sizeof(CUDA_MEMCPY3D_BATCH_OP_v1)) + if pod == NULL: + raise MemoryError("Error allocating CUDA_MEMCPY3D_BATCH_OP_v1") + try: + return _numpy.dtype({ + 'names': ['src', 'dst', 'extent', 'src_access_order', 'flags_'], + 'formats': [mem_cpy3d_operand_v1_dtype, mem_cpy3d_operand_v1_dtype, extent3d_v1_dtype, _numpy.int32, _numpy.uint32], + 'offsets': [ + (&(pod.src)) - (pod), + (&(pod.dst)) - (pod), + (&(pod.extent)) - (pod), + (&(pod.srcAccessOrder)) - (pod), + (&(pod.flags)) - (pod), + ], + 'itemsize': sizeof(CUDA_MEMCPY3D_BATCH_OP_v1), + }) + finally: + _cyb_free(pod) mem_cpy3d_batch_op_v1_dtype = _get_mem_cpy3d_batch_op_v1_dtype_offsets() @@ -27643,8 +28314,8 @@ cpdef flush_gpu_direct_rdma_writes(int target, int scope): https://docs.nvidia.com/cuda/gpudirect-rdma for more information), are visible to the specified scope. If the scope equals or lies within the scope indicated by - ``CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING``, the call will be a no- - op and can be safely omitted for performance. This can be determined by + ``CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING``, the call will be a + no-op and can be safely omitted for performance. This can be determined by comparing the numerical values between the two enums, with smaller scopes having smaller values. On platforms that support GPUDirect RDMA writes via more than one path in @@ -28750,8 +29421,8 @@ cpdef intptr_t module_load_data(image) except? 0: Takes a pointer ``image`` and loads the corresponding module ``module`` into the current context. The ``image`` may be a ``cubin`` or ``fatbin`` as output - by nvcc, or a NULL-terminated ``PTX``, either as output by nvcc or hand- - written, or ``Tile`` IR data. + by nvcc, or a NULL-terminated ``PTX``, either as output by nvcc or + hand-written, or ``Tile`` IR data. Args: image (bytes): Module data to load. @@ -28774,8 +29445,8 @@ cpdef intptr_t module_load_data_ex(image, unsigned int num_options, intptr_t opt Takes a pointer ``image`` and loads the corresponding module ``module`` into the current context. The ``image`` may be a ``cubin`` or ``fatbin`` as output - by nvcc, or a NULL-terminated ``PTX``, either as output by nvcc or hand- - written, or ``Tile`` IR data. + by nvcc, or a NULL-terminated ``PTX``, either as output by nvcc or + hand-written, or ``Tile`` IR data. Args: image (bytes): Module data to load. @@ -29177,9 +29848,9 @@ cpdef intptr_t library_load_data(code, intptr_t jit_options, intptr_t jit_option These environment variables are described in the CUDA programming guide under the "CUDA environment variables" section. - The ``code`` may be a ``cubin`` or ``fatbin`` as output by nvcc, or a NULL- - terminated ``PTX``, either as output by nvcc or hand-written, or ``Tile`` IR - data. A fatbin should also contain relocatable code when doing separate + The ``code`` may be a ``cubin`` or ``fatbin`` as output by nvcc, or a + NULL-terminated ``PTX``, either as output by nvcc or hand-written, or ``Tile`` + IR data. A fatbin should also contain relocatable code when doing separate compilation. Options are passed as an array via ``jit_options`` and any corresponding parameters are passed in ``jit_optionsValues``. The number of total JIT options @@ -29518,9 +30189,10 @@ cpdef int kernel_get_attribute(int attrib, intptr_t kernel, int dev) except? -1: - ``CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK``: The maximum number of threads per block, beyond which a launch of the kernel would fail. This number depends on both the kernel and the requested device. - - ``CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES``: The size in bytes of statically- - allocated shared memory per block required by this kernel. This does not - include dynamically-allocated shared memory requested by the user at runtime. + - ``CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES``: The size in bytes of + statically-allocated shared memory per block required by this kernel. This + does not include dynamically-allocated shared memory requested by the user at + runtime. - ``CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES``: The size in bytes of user-allocated constant memory required by this kernel. - ``CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES``: The size in bytes of local memory @@ -29598,8 +30270,8 @@ cpdef kernel_set_attribute(int attrib, int val, intptr_t kernel, int dev): ``kernel`` for the requested device ``dev`` to an integer value specified by ``val``. This function returns CUDA_SUCCESS if the new value of the attribute could be successfully set. If the set fails, this call will return an error. - Not all attributes can have values set. Attempting to set a value on a read- - only attribute will result in an error (CUDA_ERROR_INVALID_VALUE). + Not all attributes can have values set. Attempting to set a value on a + read-only attribute will result in an error (CUDA_ERROR_INVALID_VALUE). Note that attributes set using :func:`func_set_attribute` will override the attribute set by this API irrespective of whether the call to :func:`func_set_attribute` is made before or after this API call. However, @@ -30554,8 +31226,8 @@ cpdef mem_host_register_v2(p, size_t bytesize, unsigned int flags): Args: p (bytes): Host pointer to memory to page-lock. - bytesize (size_t): Size in bytes of the address range to page- - lock. + bytesize (size_t): Size in bytes of the address range to + page-lock. flags (unsigned int): flags for allocation request. .. seealso:: `cuMemHostRegister_v2` @@ -31954,10 +32626,10 @@ cpdef intptr_t array_3d_create_v2(p_allocate_array) except? 0: layered CUDA array, where the six layers represent the six faces of a cube. The order of the six layers in memory is the same as that listed in ``CUarray_cubemap_face``. - - A cubemap layered CUDA array is allocated if all three extents are non- - zero, and both, ``CUDA_ARRAY3D_CUBEMAP`` and ``CUDA_ARRAY3D_LAYERED`` flags - are set. ``Width`` must be equal to ``Height``, and ``Depth`` must be a - multiple of six. A cubemap layered CUDA array is a special type of 2D + - A cubemap layered CUDA array is allocated if all three extents are + non-zero, and both, ``CUDA_ARRAY3D_CUBEMAP`` and ``CUDA_ARRAY3D_LAYERED`` + flags are set. ``Width`` must be equal to ``Height``, and ``Depth`` must be + a multiple of six. A cubemap layered CUDA array is a special type of 2D layered CUDA array that consists of a collection of cubemaps. The first six layers represent the first cubemap, the next six layers form the second cubemap, and so on. @@ -32068,11 +32740,11 @@ cpdef intptr_t mipmapped_array_create(p_mipmapped_array_desc, unsigned int num_m - A 2D layered CUDA mipmapped array is allocated if all three extents are non-zero and the ``CUDA_ARRAY3D_LAYERED`` flag is set. Each layer is a 2D array. The number of layers is determined by the depth extent. - - A cubemap CUDA mipmapped array is allocated if all three extents are non- - zero and the ``CUDA_ARRAY3D_CUBEMAP`` flag is set. ``Width`` must be equal - to ``Height``, and ``Depth`` must be six. A cubemap is a special type of 2D - layered CUDA array, where the six layers represent the six faces of a cube. - The order of the six layers in memory is the same as that listed in + - A cubemap CUDA mipmapped array is allocated if all three extents are + non-zero and the ``CUDA_ARRAY3D_CUBEMAP`` flag is set. ``Width`` must be + equal to ``Height``, and ``Depth`` must be six. A cubemap is a special type + of 2D layered CUDA array, where the six layers represent the six faces of a + cube. The order of the six layers in memory is the same as that listed in ``CUarray_cubemap_face``. - A cubemap layered CUDA mipmapped array is allocated if all three extents are non-zero, and both, ``CUDA_ARRAY3D_CUBEMAP`` and @@ -32825,8 +33497,8 @@ cpdef mem_pool_set_attribute(intptr_t pool, int attr, intptr_t value): ``cuMemFreeAsync`` (default enabled). - ``CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH``: (value type = ``cuuint64_t``) Reset the high watermark that tracks the amount of backing memory that was - allocated for the memory pool. It is illegal to set this attribute to a non- - zero value. + allocated for the memory pool. It is illegal to set this attribute to a + non-zero value. - ``CU_MEMPOOL_ATTR_USED_MEM_HIGH``: (value type = ``cuuint64_t``) Reset the high watermark that tracks the amount of used memory that was allocated for the memory pool. @@ -32940,8 +33612,8 @@ cpdef intptr_t mem_pool_create(pool_props) except? 0: CU_MEM_LOCATION_TYPE_NONE to indicate no preferred location. ``CUmemPoolProps.maxSize`` must be set to zero for managed memory pools. ``CUmemPoolProps.usage`` should be zero as decompress for managed memory is not - supported. For managed memory pools, all devices on the system must have non- - zero ``concurrentManagedAccess``. If not, this call returns + supported. For managed memory pools, all devices on the system must have + non-zero ``concurrentManagedAccess``. If not, this call returns CUDA_ERROR_NOT_SUPPORTED. Args: @@ -33450,11 +34122,11 @@ cpdef mem_advise_v2(uint64_t dev_ptr, size_t count, int advice, location): and end address of the memory range will be rounded down and rounded up respectively to be aligned to CPU page size before the advice is applied. The memory range must refer to managed memory allocated via ``cuMemAllocManaged`` - or declared via managed variables. The memory range could also refer to system- - allocated pageable memory provided it represents a valid, host-accessible - region of memory and all additional constraints imposed by ``advice`` as - outlined below are also satisfied. Specifying an invalid system-allocated - pageable memory range results in an error being returned. + or declared via managed variables. The memory range could also refer to + system-allocated pageable memory provided it represents a valid, + host-accessible region of memory and all additional constraints imposed by + ``advice`` as outlined below are also satisfied. Specifying an invalid + system-allocated pageable memory range results in an error being returned. The ``advice`` parameter can take the following values:. - ``CU_MEM_ADVISE_SET_READ_MOSTLY``: This implies that the data is mostly going @@ -33486,8 +34158,8 @@ cpdef mem_advise_v2(uint64_t dev_ptr, size_t count, int advice, location): accesses this memory region. - ``CU_MEM_ADVISE_UNSET_READ_MOSTLY``: Undoes the effect of ``CU_MEM_ADVISE_SET_READ_MOSTLY`` and also prevents the Unified Memory driver - from attempting heuristic read-duplication on the memory range. Any read- - duplicated copies of the data will be collapsed into a single copy. The + from attempting heuristic read-duplication on the memory range. Any + read-duplicated copies of the data will be collapsed into a single copy. The location for the collapsed copy will be the preferred location if the page has a preferred location and one of the read-duplicated copies was resident at that location. Otherwise, the location chosen is arbitrary. Note: The @@ -33561,8 +34233,8 @@ cpdef mem_advise_v2(uint64_t dev_ptr, size_t count, int advice, location): policies of this advice. Additionally, if the preferred location of this memory region or any subset of it is also ``location``, then the policies associated with ``CU_MEM_ADVISE_SET_PREFERRED_LOCATION`` will override the - policies of this advice. If the memory region refers to valid system- - allocated pageable memory, and ``CUmemLocation.type`` is + policies of this advice. If the memory region refers to valid + system-allocated pageable memory, and ``CUmemLocation.type`` is ``CU_MEM_LOCATION_TYPE_DEVICE`` then device in ``CUmemLocation.id`` must have a non-zero value for the device attribute ``CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS``. Additionally, if @@ -34143,9 +34815,9 @@ cpdef tuple stream_get_capture_info_v2(intptr_t h_stream): which modify this set. The array pointer is valid until the next API call which operates on the stream or until the capture is terminated. The node handles may be copied out and - are valid until they or the graph is destroyed. The driver- - owned array may also be passed directly to APIs that operate - on the graph (not the stream) without copying. + are valid until they or the graph is destroyed. The + driver-owned array may also be passed directly to APIs that + operate on the graph (not the stream) without copying. .. seealso:: `cuStreamGetCaptureInfo_v2` """ @@ -34203,9 +34875,9 @@ cpdef tuple stream_get_capture_info_v3(intptr_t h_stream): which modify this set. The array pointer is valid until the next API call which operates on the stream or until the capture is terminated. The node handles may be copied out and - are valid until they or the graph is destroyed. The driver- - owned array may also be passed directly to APIs that operate - on the graph (not the stream) without copying. + are valid until they or the graph is destroyed. The + driver-owned array may also be passed directly to APIs that + operate on the graph (not the stream) without copying. - CUgraphEdgeData: Optional location to store a pointer to an array of graph edge data. This array parallels ``dependencies_out``; the next node to be added has an edge to @@ -34268,9 +34940,9 @@ cpdef stream_attach_mem_async(intptr_t h_stream, uint64_t dptr, size_t length, u """Attach memory to a stream asynchronously. Enqueues an operation in ``h_stream`` to specify stream association of - ``length`` bytes of memory starting from ``dptr``. This function is a stream- - ordered operation, meaning that it is dependent on, and will only take effect - when, previous work in stream has completed. Any previous association is + ``length`` bytes of memory starting from ``dptr``. This function is a + stream-ordered operation, meaning that it is dependent on, and will only take + effect when, previous work in stream has completed. Any previous association is automatically replaced. ``dptr`` must point to one of the following types of memories:. @@ -34324,8 +34996,8 @@ cpdef stream_attach_mem_async(intptr_t h_stream, uint64_t dptr, size_t length, u h_stream (intptr_t): Stream in which to enqueue the attach operation. dptr (uint64_t): Pointer to memory (must be a pointer to managed - memory or to a valid host-accessible region of system- - allocated pageable memory). + memory or to a valid host-accessible region of + system-allocated pageable memory). length (size_t): Length of memory. flags (unsigned int): Must be one of ``CUmemAttach_flags``. @@ -35317,9 +35989,10 @@ cpdef int func_get_attribute(int attrib, intptr_t hfunc) except? -1: per block, beyond which a launch of the function would fail. This number depends on both the function and the device on which the function is currently loaded. - - ``CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES``: The size in bytes of statically- - allocated shared memory per block required by this function. This does not - include dynamically-allocated shared memory requested by the user at runtime. + - ``CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES``: The size in bytes of + statically-allocated shared memory per block required by this function. This + does not include dynamically-allocated shared memory requested by the user at + runtime. - ``CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES``: The size in bytes of user-allocated constant memory required by this function. - ``CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES``: The size in bytes of local memory @@ -37726,8 +38399,8 @@ cpdef tuple graph_node_get_dependencies_v2(intptr_t h_node): the remaining entries in ``dependencies`` will be set to NULL, and the number of nodes actually obtained will be returned in ``num_dependencies``. Note that if an edge has non-zero (non-default) edge data and ``edge_data`` is - NULL, this API will return ``CUDA_ERROR_LOSSY_QUERY``. If ``edge_data`` is non- - NULL, then ``dependencies`` must be as well. + NULL, this API will return ``CUDA_ERROR_LOSSY_QUERY``. If ``edge_data`` is + non-NULL, then ``dependencies`` must be as well. Args: h_node (intptr_t): Node to query. @@ -37767,8 +38440,8 @@ cpdef tuple graph_node_get_dependent_nodes_v2(intptr_t h_node): NULL, and the number of nodes actually obtained will be returned in ``num_dependent_nodes``. Note that if an edge has non-zero (non-default) edge data and ``edge_data`` is - NULL, this API will return ``CUDA_ERROR_LOSSY_QUERY``. If ``edge_data`` is non- - NULL, then ``dependent_nodes`` must be as well. + NULL, this API will return ``CUDA_ERROR_LOSSY_QUERY``. If ``edge_data`` is + non-NULL, then ``dependent_nodes`` must be as well. Args: h_node (intptr_t): Node to query. @@ -38079,8 +38752,8 @@ cpdef graph_exec_kernel_node_set_params_v2(intptr_t h_graph_exec, intptr_t h_nod """Sets the parameters for a kernel node in the given graphExec. Sets the parameters of a kernel node in an executable graph ``h_graph_exec``. - The node is identified by the corresponding node ``h_node`` in the non- - executable graph, from which the executable graph was instantiated. + The node is identified by the corresponding node ``h_node`` in the + non-executable graph, from which the executable graph was instantiated. ``h_node`` must not have been removed from the original graph. All ``node_params`` fields may change, but the following restrictions apply to ``func`` updates:. @@ -38267,8 +38940,8 @@ cpdef graph_exec_event_record_node_set_event(intptr_t h_graph_exec, intptr_t h_n """Sets the event for an event record node in the given graphExec. Sets the event of an event record node in an executable graph ``h_graph_exec``. - The node is identified by the corresponding node ``h_node`` in the non- - executable graph, from which the executable graph was instantiated. + The node is identified by the corresponding node ``h_node`` in the + non-executable graph, from which the executable graph was instantiated. The modifications only affect future launches of ``h_graph_exec``. Already enqueued or running launches of ``h_graph_exec`` are not affected by this call. ``h_node`` is also not modified by this call. @@ -38294,8 +38967,8 @@ cpdef graph_exec_event_wait_node_set_event(intptr_t h_graph_exec, intptr_t h_nod """Sets the event for an event wait node in the given graphExec. Sets the event of an event wait node in an executable graph ``h_graph_exec``. - The node is identified by the corresponding node ``h_node`` in the non- - executable graph, from which the executable graph was instantiated. + The node is identified by the corresponding node ``h_node`` in the + non-executable graph, from which the executable graph was instantiated. The modifications only affect future launches of ``h_graph_exec``. Already enqueued or running launches of ``h_graph_exec`` are not affected by this call. ``h_node`` is also not modified by this call. @@ -38383,8 +39056,8 @@ cpdef graph_node_set_enabled(intptr_t h_graph_exec, intptr_t h_node, unsigned in Sets ``h_node`` to be either enabled or disabled. Disabled nodes are functionally equivalent to empty nodes until they are reenabled. Existing node parameters are not affected by disabling/enabling the node. - The node is identified by the corresponding node ``h_node`` in the non- - executable graph, from which the executable graph was instantiated. + The node is identified by the corresponding node ``h_node`` in the + non-executable graph, from which the executable graph was instantiated. ``h_node`` must not have been removed from the original graph. The modifications only affect future launches of ``h_graph_exec``. Already enqueued or running launches of ``h_graph_exec`` are not affected by this call. @@ -38413,8 +39086,8 @@ cpdef unsigned int graph_node_get_enabled(intptr_t h_graph_exec, intptr_t h_node """Query whether a node in the given graphExec is enabled. Sets is_enabled to 1 if ``h_node`` is enabled, or 0 if ``h_node`` is disabled. - The node is identified by the corresponding node ``h_node`` in the non- - executable graph, from which the executable graph was instantiated. + The node is identified by the corresponding node ``h_node`` in the + non-executable graph, from which the executable graph was instantiated. ``h_node`` must not have been removed from the original graph. Args: @@ -38528,8 +39201,8 @@ cpdef object graph_exec_update_v2(intptr_t h_graph_exec, intptr_t h_graph): cannot be updated to a function which uses CDP. - A node whose function originally did not make device-side update calls cannot be updated to a function which makes device-side update calls. - - A cooperative node cannot be updated to a non-cooperative node, and vice- - versa. + - A cooperative node cannot be updated to a non-cooperative node, and + vice-versa. - If the graph was instantiated with CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY, the priority attribute cannot change. Equality is checked on the originally requested priority @@ -39180,8 +39853,8 @@ cpdef int occupancy_max_potential_cluster_size(intptr_t func, config) except? -1 ``cuFuncGetAttribute``),``*cluster_size`` will reflect the required cluster size. By default this function will always return a value that's portable on future - hardware. A higher value may be returned if the kernel function allows non- - portable cluster sizes. + hardware. A higher value may be returned if the kernel function allows + non-portable cluster sizes. This function will respect the compile time launch bounds. Note that the API can also be used with context-less kernel ``CUkernel`` by querying the handle using :func:`library_get_kernel` and then passing it to the @@ -40828,8 +41501,8 @@ cpdef ctx_enable_peer_access(intptr_t peer_context, unsigned int flags): access memory from the current context in ``peer_context``, a separate symmetric call to :func:`ctx_enable_peer_access` is required. Note that there are both device-wide and system-wide limitations per system - configuration, as noted in the CUDA Programming Guide under the section "Peer- - to-Peer Memory Access". + configuration, as noted in the CUDA Programming Guide under the section + "Peer-to-Peer Memory Access". Returns ``CUDA_ERROR_PEER_ACCESS_UNSUPPORTED`` if :func:`device_can_access_peer` indicates that the ``CUdevice`` of the current context cannot directly access memory from the ``CUdevice`` of @@ -41815,10 +42488,10 @@ cpdef checkpoint_process_checkpoint(int pid, args): """Checkpoint a CUDA process's GPU memory contents. Checkpoints a CUDA process specified by ``pid``. The GPU memory contents will - be brought into host memory or mapped onto the calling process's GPUs for user- - defined behavior. Underlying GPU references are released when checkpointing - completes. The process must be in the ``CU_PROCESS_STATE_LOCKED`` state to - checkpoint. + be brought into host memory or mapped onto the calling process's GPUs for + user-defined behavior. Underlying GPU references are released when + checkpointing completes. The process must be in the ``CU_PROCESS_STATE_LOCKED`` + state to checkpoint. When ``CUcheckpointCheckpointArgs.customStorageInfo_out`` is not NULL, all the GPU memory allocated by the process with ``pid`` will be mapped onto the calling process's GPUs so the application can copy the memory to custom @@ -42608,8 +43281,8 @@ cpdef memcpy_3d_batch_async_v2(size_t num_ops, op_list, unsigned long long flags copy specified in ``CUDA_MEMCPY3D_BATCH_OP``::extent::height. When either of these values is zero, that aspect of the operand is considered to be tightly packed according to the copy extent. For managed memory pointers on devices - where ``CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`` is true or system- - allocated pageable memory on devices where + where ``CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`` is true or + system-allocated pageable memory on devices where ``CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`` is true, the ``CUmemcpy3DOperand.op.ptr.locHint`` field can be used to hint the location of the operand. @@ -42878,8 +43551,8 @@ cpdef mem_discard_and_prefetch_batch_async(intptr_t dptrs, intptr_t sizes, size_ Performs a batch of memory discards followed by prefetches. The batch as a whole executes in stream order but operations within a batch are not guaranteed - to execute in any specific order. All devices in the system must have a non- - zero value for the device attribute + to execute in any specific order. All devices in the system must have a + non-zero value for the device attribute ``CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`` otherwise the API will return an error. Calling ``cuMemDiscardAndPrefetchBatchAsync`` is semantically equivalent to @@ -43515,8 +44188,8 @@ cpdef stream_begin_capture_to_cig(intptr_t h_stream, stream_cig_capture_params): accesses them on the stream. Resubmission of the same recorded command list/buffer is not allowed. Further more, care must be taken for the order of execution of the recorded CUDA work - with regards to other CUDA work submitted under the same CIG context. Out-of- - order execution can lead to device hangs or exceptions. + with regards to other CUDA work submitted under the same CIG context. + Out-of-order execution can lead to device hangs or exceptions. CIG capture mode operates similarly to ``cuStreamBeginCapture`` with the ``CU_STREAM_CAPTURE_MODE_RELAXED`` option. There are additional limitations to streams in CIG capture mode. The following functions are not allowed for CIG @@ -44119,8 +44792,8 @@ cpdef int logical_endpoint_query(uint32_t le_id, uint32_t count) except? -1: Returns: int: Status of the logical endpoints. Returns 0 if any logical - endpoint in the given range is not fully constructed, and non- - zero if all logical endpoints in the given range are fully + endpoint in the given range is not fully constructed, and + non-zero if all logical endpoints in the given range are fully constructed. .. seealso:: `cuLogicalEndpointQuery` @@ -44314,9 +44987,9 @@ cpdef intptr_t graph_add_node_v3(intptr_t h_graph, dependencies, dependency_data initialization or memset to ensure all bytes are initialized. Note that for some node types, ``node_params`` may contain "out parameters" which are modified during the call, such as ``node_params->alloc.dptr``. - For kernel nodes, if both the kernel node's ``CUfunction`` and ctx are non- - NULL, the underlying device context of ctx must match the device context that - the ``CUfunction`` was loaded into; otherwise the call returns + For kernel nodes, if both the kernel node's ``CUfunction`` and ctx are + non-NULL, the underlying device context of ctx must match the device context + that the ``CUfunction`` was loaded into; otherwise the call returns ``CUDA_ERROR_INVALID_CONTEXT``. A handle to the new node will be returned in ``ph_graph_node``. @@ -44357,9 +45030,9 @@ cpdef graph_node_set_params_v2(intptr_t h_node, node_params): padding) zeroed. Modifying parameters is not supported for node types CU_GRAPH_NODE_TYPE_MEM_ALLOC and CU_GRAPH_NODE_TYPE_MEM_FREE. - For kernel nodes, if both the kernel node's ``CUfunction`` and ctx are non- - NULL, the underlying device context of ctx must match the device context that - the ``CUfunction`` was loaded into; otherwise the call returns + For kernel nodes, if both the kernel node's ``CUfunction`` and ctx are + non-NULL, the underlying device context of ctx must match the device context + that the ``CUfunction`` was loaded into; otherwise the call returns ``CUDA_ERROR_INVALID_CONTEXT``. Args: @@ -44421,8 +45094,8 @@ cpdef fabric_cpy_batch_async(size_t num_ops, intptr_t op_list, unsigned long lon is specified in ``num_ops``. Each entry describes a copy operation including source and destination operands (``CUDA_FABRIC_COPY_BATCH_OP.src`` and ``CUDA_FABRIC_COPY_BATCH_OP.dst``) and the size in bytes - (``CUDA_FABRIC_COPY_BATCH_OP.size``). A size of zero makes that operation a no- - op while preserving its position in the batch. Its operands are still + (``CUDA_FABRIC_COPY_BATCH_OP.size``). A size of zero makes that operation a + no-op while preserving its position in the batch. Its operands are still validated. The following operand type combinations are supported:. diff --git a/cuda_bindings_13/cuda/bindings/_v2/nvrtc.pyx b/cuda_bindings_13/cuda/bindings/_v2/nvrtc.pyx index 14e74208fd5..a0fd8faa8b7 100644 --- a/cuda_bindings_13/cuda/bindings/_v2/nvrtc.pyx +++ b/cuda_bindings_13/cuda/bindings/_v2/nvrtc.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ba26837dbd547d2e915dc2f5073385fd2f6b2d4f32fdeb60a93e4338e5a3a03c +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fff85c453c84fc538b768c24c857213e2dbe1ffb80a2a2e2838019d7e7d1630d # <<<< PREAMBLE CONTENT >>>> @@ -18,6 +18,10 @@ from cpython.buffer cimport ( ) from cython cimport view as _cyb_view from libc.stdint cimport intptr_t +from libc.stdlib cimport ( + calloc as _cyb_calloc, + free as _cyb_free, +) from libc.string cimport ( memcmp as _cyb_memcmp, memcpy as _cyb_memcpy, @@ -232,20 +236,25 @@ cdef int check_status(int status) except 1 nogil: ############################################################################### cdef _get_bundled_headers_info_dtype_offsets(): - cdef nvrtcBundledHeadersInfo pod - return _numpy.dtype({ - 'names': ['available', 'compressed_size', 'uncompressed_size', 'cuda_version_major', 'cuda_version_minor', 'num_files'], - 'formats': [_numpy.int32, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.int32, _numpy.uint32], - 'offsets': [ - (&(pod.available)) - (&pod), - (&(pod.compressedSize)) - (&pod), - (&(pod.uncompressedSize)) - (&pod), - (&(pod.cudaVersionMajor)) - (&pod), - (&(pod.cudaVersionMinor)) - (&pod), - (&(pod.numFiles)) - (&pod), - ], - 'itemsize': sizeof(nvrtcBundledHeadersInfo), - }) + cdef nvrtcBundledHeadersInfo *pod = _cyb_calloc(1, sizeof(nvrtcBundledHeadersInfo)) + if pod == NULL: + raise MemoryError("Error allocating nvrtcBundledHeadersInfo") + try: + return _numpy.dtype({ + 'names': ['available', 'compressed_size', 'uncompressed_size', 'cuda_version_major', 'cuda_version_minor', 'num_files'], + 'formats': [_numpy.int32, _numpy.uint64, _numpy.uint64, _numpy.int32, _numpy.int32, _numpy.uint32], + 'offsets': [ + (&(pod.available)) - (pod), + (&(pod.compressedSize)) - (pod), + (&(pod.uncompressedSize)) - (pod), + (&(pod.cudaVersionMajor)) - (pod), + (&(pod.cudaVersionMinor)) - (pod), + (&(pod.numFiles)) - (pod), + ], + 'itemsize': sizeof(nvrtcBundledHeadersInfo), + }) + finally: + _cyb_free(pod) bundled_headers_info_dtype = _get_bundled_headers_info_dtype_offsets() diff --git a/cuda_bindings_13/cuda/bindings/cudla.pyx b/cuda_bindings_13/cuda/bindings/cudla.pyx index 9501e6b20e2..43553382ec4 100644 --- a/cuda_bindings_13/cuda/bindings/cudla.pyx +++ b/cuda_bindings_13/cuda/bindings/cudla.pyx @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # This code was automatically generated across versions from 1.5.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4fb80303cf58308e310478def045302e182c8c4a8b169efd0b22cd322629190e +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2ddc08b7839e06f87dbb946eab7b3db85897fa051767efd3b966d681dbde4550 # <<<< PREAMBLE CONTENT >>>> @@ -23,6 +23,10 @@ from libc.stdint cimport ( uint64_t, uint8_t, ) +from libc.stdlib cimport ( + calloc as _cyb_calloc, + free as _cyb_free, +) from libc.string cimport ( memcmp as _cyb_memcmp, memcpy as _cyb_memcpy, @@ -117,16 +121,21 @@ from libc.stdlib cimport malloc, free ############################################################################### cdef _get_external_memory_handle_desc_dtype_offsets(): - cdef cudlaExternalMemoryHandleDesc_t pod - return _numpy.dtype({ - 'names': ['ext_buf_object', 'size_'], - 'formats': [_numpy.intp, _numpy.uint64], - 'offsets': [ - (&(pod.extBufObject)) - (&pod), - (&(pod.size)) - (&pod), - ], - 'itemsize': sizeof(cudlaExternalMemoryHandleDesc_t), - }) + cdef cudlaExternalMemoryHandleDesc_t *pod = _cyb_calloc(1, sizeof(cudlaExternalMemoryHandleDesc_t)) + if pod == NULL: + raise MemoryError("Error allocating cudlaExternalMemoryHandleDesc_t") + try: + return _numpy.dtype({ + 'names': ['ext_buf_object', 'size_'], + 'formats': [_numpy.intp, _numpy.uint64], + 'offsets': [ + (&(pod.extBufObject)) - (pod), + (&(pod.size)) - (pod), + ], + 'itemsize': sizeof(cudlaExternalMemoryHandleDesc_t), + }) + finally: + _cyb_free(pod) external_memory_handle_desc_dtype = _get_external_memory_handle_desc_dtype_offsets() @@ -254,15 +263,20 @@ cdef class ExternalMemoryHandleDesc: cdef _get_external_semaphore_handle_desc_dtype_offsets(): - cdef cudlaExternalSemaphoreHandleDesc_t pod - return _numpy.dtype({ - 'names': ['ext_sync_object'], - 'formats': [_numpy.intp], - 'offsets': [ - (&(pod.extSyncObject)) - (&pod), - ], - 'itemsize': sizeof(cudlaExternalSemaphoreHandleDesc_t), - }) + cdef cudlaExternalSemaphoreHandleDesc_t *pod = _cyb_calloc(1, sizeof(cudlaExternalSemaphoreHandleDesc_t)) + if pod == NULL: + raise MemoryError("Error allocating cudlaExternalSemaphoreHandleDesc_t") + try: + return _numpy.dtype({ + 'names': ['ext_sync_object'], + 'formats': [_numpy.intp], + 'offsets': [ + (&(pod.extSyncObject)) - (pod), + ], + 'itemsize': sizeof(cudlaExternalSemaphoreHandleDesc_t), + }) + finally: + _cyb_free(pod) external_semaphore_handle_desc_dtype = _get_external_semaphore_handle_desc_dtype_offsets() @@ -379,26 +393,31 @@ cdef class ExternalSemaphoreHandleDesc: cdef _get_module_tensor_descriptor_dtype_offsets(): - cdef cudlaModuleTensorDescriptor pod - return _numpy.dtype({ - 'names': ['name', 'size_', 'n', 'c', 'h', 'w', 'data_format', 'data_type', 'data_category', 'pixel_format', 'pixel_mapping', 'stride'], - 'formats': [(_numpy.int8, 81), _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, (_numpy.uint32, 8)], - 'offsets': [ - (&(pod.name)) - (&pod), - (&(pod.size)) - (&pod), - (&(pod.n)) - (&pod), - (&(pod.c)) - (&pod), - (&(pod.h)) - (&pod), - (&(pod.w)) - (&pod), - (&(pod.dataFormat)) - (&pod), - (&(pod.dataType)) - (&pod), - (&(pod.dataCategory)) - (&pod), - (&(pod.pixelFormat)) - (&pod), - (&(pod.pixelMapping)) - (&pod), - (&(pod.stride)) - (&pod), - ], - 'itemsize': sizeof(cudlaModuleTensorDescriptor), - }) + cdef cudlaModuleTensorDescriptor *pod = _cyb_calloc(1, sizeof(cudlaModuleTensorDescriptor)) + if pod == NULL: + raise MemoryError("Error allocating cudlaModuleTensorDescriptor") + try: + return _numpy.dtype({ + 'names': ['name', 'size_', 'n', 'c', 'h', 'w', 'data_format', 'data_type', 'data_category', 'pixel_format', 'pixel_mapping', 'stride'], + 'formats': [(_numpy.int8, 81), _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, (_numpy.uint32, 8)], + 'offsets': [ + (&(pod.name)) - (pod), + (&(pod.size)) - (pod), + (&(pod.n)) - (pod), + (&(pod.c)) - (pod), + (&(pod.h)) - (pod), + (&(pod.w)) - (pod), + (&(pod.dataFormat)) - (pod), + (&(pod.dataType)) - (pod), + (&(pod.dataCategory)) - (pod), + (&(pod.pixelFormat)) - (pod), + (&(pod.pixelMapping)) - (pod), + (&(pod.stride)) - (pod), + ], + 'itemsize': sizeof(cudlaModuleTensorDescriptor), + }) + finally: + _cyb_free(pod) module_tensor_descriptor_dtype = _get_module_tensor_descriptor_dtype_offsets() @@ -646,16 +665,21 @@ cdef class ModuleTensorDescriptor: cdef _get_fence_dtype_offsets(): - cdef CudlaFence pod - return _numpy.dtype({ - 'names': ['fence', 'type'], - 'formats': [_numpy.intp, _numpy.int32], - 'offsets': [ - (&(pod.fence)) - (&pod), - (&(pod.type)) - (&pod), - ], - 'itemsize': sizeof(CudlaFence), - }) + cdef CudlaFence *pod = _cyb_calloc(1, sizeof(CudlaFence)) + if pod == NULL: + raise MemoryError("Error allocating CudlaFence") + try: + return _numpy.dtype({ + 'names': ['fence', 'type'], + 'formats': [_numpy.intp, _numpy.int32], + 'offsets': [ + (&(pod.fence)) - (pod), + (&(pod.type)) - (pod), + ], + 'itemsize': sizeof(CudlaFence), + }) + finally: + _cyb_free(pod) fence_dtype = _get_fence_dtype_offsets() @@ -783,16 +807,21 @@ cdef class Fence: cdef _get_dev_attribute_dtype_offsets(): - cdef cudlaDevAttribute pod - return _numpy.dtype({ - 'names': ['unified_addressing_supported', 'device_version'], - 'formats': [_numpy.uint8, _numpy.uint32], - 'offsets': [ - (&(pod.unifiedAddressingSupported)) - (&pod), - (&(pod.deviceVersion)) - (&pod), - ], - 'itemsize': sizeof(cudlaDevAttribute), - }) + cdef cudlaDevAttribute *pod = _cyb_calloc(1, sizeof(cudlaDevAttribute)) + if pod == NULL: + raise MemoryError("Error allocating cudlaDevAttribute") + try: + return _numpy.dtype({ + 'names': ['unified_addressing_supported', 'device_version'], + 'formats': [_numpy.uint8, _numpy.uint32], + 'offsets': [ + (&(pod.unifiedAddressingSupported)) - (pod), + (&(pod.deviceVersion)) - (pod), + ], + 'itemsize': sizeof(cudlaDevAttribute), + }) + finally: + _cyb_free(pod) dev_attribute_dtype = _get_dev_attribute_dtype_offsets() @@ -920,18 +949,23 @@ cdef class DevAttribute: cdef _get_module_attribute_dtype_offsets(): - cdef cudlaModuleAttribute pod - return _numpy.dtype({ - 'names': ['num_input_tensors', 'num_output_tensors', 'input_tensor_desc', 'output_tensor_desc'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.numInputTensors)) - (&pod), - (&(pod.numOutputTensors)) - (&pod), - (&(pod.inputTensorDesc)) - (&pod), - (&(pod.outputTensorDesc)) - (&pod), - ], - 'itemsize': sizeof(cudlaModuleAttribute), - }) + cdef cudlaModuleAttribute *pod = _cyb_calloc(1, sizeof(cudlaModuleAttribute)) + if pod == NULL: + raise MemoryError("Error allocating cudlaModuleAttribute") + try: + return _numpy.dtype({ + 'names': ['num_input_tensors', 'num_output_tensors', 'input_tensor_desc', 'output_tensor_desc'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.numInputTensors)) - (pod), + (&(pod.numOutputTensors)) - (pod), + (&(pod.inputTensorDesc)) - (pod), + (&(pod.outputTensorDesc)) - (pod), + ], + 'itemsize': sizeof(cudlaModuleAttribute), + }) + finally: + _cyb_free(pod) module_attribute_dtype = _get_module_attribute_dtype_offsets() @@ -1081,16 +1115,21 @@ cdef class ModuleAttribute: cdef _get_wait_events_dtype_offsets(): - cdef cudlaWaitEvents pod - return _numpy.dtype({ - 'names': ['pre_fences', 'num_events'], - 'formats': [_numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.preFences)) - (&pod), - (&(pod.numEvents)) - (&pod), - ], - 'itemsize': sizeof(cudlaWaitEvents), - }) + cdef cudlaWaitEvents *pod = _cyb_calloc(1, sizeof(cudlaWaitEvents)) + if pod == NULL: + raise MemoryError("Error allocating cudlaWaitEvents") + try: + return _numpy.dtype({ + 'names': ['pre_fences', 'num_events'], + 'formats': [_numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.preFences)) - (pod), + (&(pod.numEvents)) - (pod), + ], + 'itemsize': sizeof(cudlaWaitEvents), + }) + finally: + _cyb_free(pod) wait_events_dtype = _get_wait_events_dtype_offsets() @@ -1220,17 +1259,22 @@ cdef class WaitEvents: cdef _get_signal_events_dtype_offsets(): - cdef cudlaSignalEvents pod - return _numpy.dtype({ - 'names': ['dev_ptrs', 'eof_fences', 'num_events'], - 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.devPtrs)) - (&pod), - (&(pod.eofFences)) - (&pod), - (&(pod.numEvents)) - (&pod), - ], - 'itemsize': sizeof(cudlaSignalEvents), - }) + cdef cudlaSignalEvents *pod = _cyb_calloc(1, sizeof(cudlaSignalEvents)) + if pod == NULL: + raise MemoryError("Error allocating cudlaSignalEvents") + try: + return _numpy.dtype({ + 'names': ['dev_ptrs', 'eof_fences', 'num_events'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.devPtrs)) - (pod), + (&(pod.eofFences)) - (pod), + (&(pod.numEvents)) - (pod), + ], + 'itemsize': sizeof(cudlaSignalEvents), + }) + finally: + _cyb_free(pod) signal_events_dtype = _get_signal_events_dtype_offsets() @@ -1386,21 +1430,26 @@ cdef class SignalEvents: cdef _get_task_dtype_offsets(): - cdef cudlaTask pod - return _numpy.dtype({ - 'names': ['module_handle', 'output_tensor', 'num_output_tensors', 'num_input_tensors', 'input_tensor', 'wait_events', 'signal_events'], - 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp, _numpy.intp], - 'offsets': [ - (&(pod.moduleHandle)) - (&pod), - (&(pod.outputTensor)) - (&pod), - (&(pod.numOutputTensors)) - (&pod), - (&(pod.numInputTensors)) - (&pod), - (&(pod.inputTensor)) - (&pod), - (&(pod.waitEvents)) - (&pod), - (&(pod.signalEvents)) - (&pod), - ], - 'itemsize': sizeof(cudlaTask), - }) + cdef cudlaTask *pod = _cyb_calloc(1, sizeof(cudlaTask)) + if pod == NULL: + raise MemoryError("Error allocating cudlaTask") + try: + return _numpy.dtype({ + 'names': ['module_handle', 'output_tensor', 'num_output_tensors', 'num_input_tensors', 'input_tensor', 'wait_events', 'signal_events'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.moduleHandle)) - (pod), + (&(pod.outputTensor)) - (pod), + (&(pod.numOutputTensors)) - (pod), + (&(pod.numInputTensors)) - (pod), + (&(pod.inputTensor)) - (pod), + (&(pod.waitEvents)) - (pod), + (&(pod.signalEvents)) - (pod), + ], + 'itemsize': sizeof(cudlaTask), + }) + finally: + _cyb_free(pod) task_dtype = _get_task_dtype_offsets() diff --git a/cuda_bindings_13/cuda/bindings/cufile.pyx b/cuda_bindings_13/cuda/bindings/cufile.pyx index 641d4c7d953..7012d925b78 100644 --- a/cuda_bindings_13/cuda/bindings/cufile.pyx +++ b/cuda_bindings_13/cuda/bindings/cufile.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=88e58a7cce47d08fe8ea4f26ad9f159d35f8bddbf7fbd00d74c0c971c8f53d8d +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c3b2b4bee74608c9147b08755b19a90a61411b964f48c4067832acf1eeaa1096 # <<<< PREAMBLE CONTENT >>>> @@ -101,16 +101,21 @@ from cuda.bindings.driver import CUresult as pyCUresult ############################################################################### cdef _get__py_anon_pod1_dtype_offsets(): - cdef cuda_bindings_cufile__anon_pod1 pod - return _numpy.dtype({ - 'names': ['fd', 'handle'], - 'formats': [_numpy.int32, _numpy.intp], - 'offsets': [ - (&(pod.fd)) - (&pod), - (&(pod.handle)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_cufile__anon_pod1), - }) + cdef cuda_bindings_cufile__anon_pod1 *pod = _cyb_calloc(1, sizeof(cuda_bindings_cufile__anon_pod1)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_cufile__anon_pod1") + try: + return _numpy.dtype({ + 'names': ['fd', 'handle'], + 'formats': [_numpy.int32, _numpy.intp], + 'offsets': [ + (&(pod.fd)) - (pod), + (&(pod.handle)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_cufile__anon_pod1), + }) + finally: + _cyb_free(pod) _py_anon_pod1_dtype = _get__py_anon_pod1_dtype_offsets() @@ -250,18 +255,23 @@ cdef class _py_anon_pod1: cdef _get__py_anon_pod3_dtype_offsets(): - cdef cuda_bindings_cufile__anon_pod3 pod - return _numpy.dtype({ - 'names': ['dev_ptr_base', 'file_offset', 'dev_ptr_offset', 'size_'], - 'formats': [_numpy.intp, _numpy.int64, _numpy.int64, _numpy.uint64], - 'offsets': [ - (&(pod.devPtr_base)) - (&pod), - (&(pod.file_offset)) - (&pod), - (&(pod.devPtr_offset)) - (&pod), - (&(pod.size)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_cufile__anon_pod3), - }) + cdef cuda_bindings_cufile__anon_pod3 *pod = _cyb_calloc(1, sizeof(cuda_bindings_cufile__anon_pod3)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_cufile__anon_pod3") + try: + return _numpy.dtype({ + 'names': ['dev_ptr_base', 'file_offset', 'dev_ptr_offset', 'size_'], + 'formats': [_numpy.intp, _numpy.int64, _numpy.int64, _numpy.uint64], + 'offsets': [ + (&(pod.devPtr_base)) - (pod), + (&(pod.file_offset)) - (pod), + (&(pod.devPtr_offset)) - (pod), + (&(pod.size)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_cufile__anon_pod3), + }) + finally: + _cyb_free(pod) _py_anon_pod3_dtype = _get__py_anon_pod3_dtype_offsets() @@ -423,17 +433,22 @@ cdef class _py_anon_pod3: cdef _get_io_events_dtype_offsets(): - cdef CUfileIOEvents_t pod - return _numpy.dtype({ - 'names': ['cookie', 'status', 'ret'], - 'formats': [_numpy.intp, _numpy.int32, _numpy.uint64], - 'offsets': [ - (&(pod.cookie)) - (&pod), - (&(pod.status)) - (&pod), - (&(pod.ret)) - (&pod), - ], - 'itemsize': sizeof(CUfileIOEvents_t), - }) + cdef CUfileIOEvents_t *pod = _cyb_calloc(1, sizeof(CUfileIOEvents_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfileIOEvents_t") + try: + return _numpy.dtype({ + 'names': ['cookie', 'status', 'ret'], + 'formats': [_numpy.intp, _numpy.int32, _numpy.uint64], + 'offsets': [ + (&(pod.cookie)) - (pod), + (&(pod.status)) - (pod), + (&(pod.ret)) - (pod), + ], + 'itemsize': sizeof(CUfileIOEvents_t), + }) + finally: + _cyb_free(pod) io_events_dtype = _get_io_events_dtype_offsets() cdef object io_events_dtype_record = _numpy.dtype((_numpy.record, io_events_dtype)) @@ -605,16 +620,21 @@ cdef class IOEvents: cdef _get_op_counter_dtype_offsets(): - cdef CUfileOpCounter_t pod - return _numpy.dtype({ - 'names': ['ok', 'err'], - 'formats': [_numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.ok)) - (&pod), - (&(pod.err)) - (&pod), - ], - 'itemsize': sizeof(CUfileOpCounter_t), - }) + cdef CUfileOpCounter_t *pod = _cyb_calloc(1, sizeof(CUfileOpCounter_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfileOpCounter_t") + try: + return _numpy.dtype({ + 'names': ['ok', 'err'], + 'formats': [_numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.ok)) - (pod), + (&(pod.err)) - (pod), + ], + 'itemsize': sizeof(CUfileOpCounter_t), + }) + finally: + _cyb_free(pod) op_counter_dtype = _get_op_counter_dtype_offsets() @@ -754,44 +774,49 @@ cdef class OpCounter: cdef _get_per_gpu_stats_dtype_offsets(): - cdef CUfilePerGpuStats_t pod - return _numpy.dtype({ - 'names': ['uuid', 'read_bytes', 'read_bw_bytes_per_sec', 'read_utilization', 'read_duration_us', 'n_total_reads', 'n_p2p_reads', 'n_nvfs_reads', 'n_posix_reads', 'n_unaligned_reads', 'n_dr_reads', 'n_sparse_regions', 'n_inline_regions', 'n_reads_err', 'writes_bytes', 'write_bw_bytes_per_sec', 'write_utilization', 'write_duration_us', 'n_total_writes', 'n_p2p_writes', 'n_nvfs_writes', 'n_posix_writes', 'n_unaligned_writes', 'n_dr_writes', 'n_writes_err', 'n_mmap', 'n_mmap_ok', 'n_mmap_err', 'n_mmap_free', 'reg_bytes'], - 'formats': [(_numpy.int8, 16), _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.uuid)) - (&pod), - (&(pod.read_bytes)) - (&pod), - (&(pod.read_bw_bytes_per_sec)) - (&pod), - (&(pod.read_utilization)) - (&pod), - (&(pod.read_duration_us)) - (&pod), - (&(pod.n_total_reads)) - (&pod), - (&(pod.n_p2p_reads)) - (&pod), - (&(pod.n_nvfs_reads)) - (&pod), - (&(pod.n_posix_reads)) - (&pod), - (&(pod.n_unaligned_reads)) - (&pod), - (&(pod.n_dr_reads)) - (&pod), - (&(pod.n_sparse_regions)) - (&pod), - (&(pod.n_inline_regions)) - (&pod), - (&(pod.n_reads_err)) - (&pod), - (&(pod.writes_bytes)) - (&pod), - (&(pod.write_bw_bytes_per_sec)) - (&pod), - (&(pod.write_utilization)) - (&pod), - (&(pod.write_duration_us)) - (&pod), - (&(pod.n_total_writes)) - (&pod), - (&(pod.n_p2p_writes)) - (&pod), - (&(pod.n_nvfs_writes)) - (&pod), - (&(pod.n_posix_writes)) - (&pod), - (&(pod.n_unaligned_writes)) - (&pod), - (&(pod.n_dr_writes)) - (&pod), - (&(pod.n_writes_err)) - (&pod), - (&(pod.n_mmap)) - (&pod), - (&(pod.n_mmap_ok)) - (&pod), - (&(pod.n_mmap_err)) - (&pod), - (&(pod.n_mmap_free)) - (&pod), - (&(pod.reg_bytes)) - (&pod), - ], - 'itemsize': sizeof(CUfilePerGpuStats_t), - }) + cdef CUfilePerGpuStats_t *pod = _cyb_calloc(1, sizeof(CUfilePerGpuStats_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfilePerGpuStats_t") + try: + return _numpy.dtype({ + 'names': ['uuid', 'read_bytes', 'read_bw_bytes_per_sec', 'read_utilization', 'read_duration_us', 'n_total_reads', 'n_p2p_reads', 'n_nvfs_reads', 'n_posix_reads', 'n_unaligned_reads', 'n_dr_reads', 'n_sparse_regions', 'n_inline_regions', 'n_reads_err', 'writes_bytes', 'write_bw_bytes_per_sec', 'write_utilization', 'write_duration_us', 'n_total_writes', 'n_p2p_writes', 'n_nvfs_writes', 'n_posix_writes', 'n_unaligned_writes', 'n_dr_writes', 'n_writes_err', 'n_mmap', 'n_mmap_ok', 'n_mmap_err', 'n_mmap_free', 'reg_bytes'], + 'formats': [(_numpy.int8, 16), _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.uuid)) - (pod), + (&(pod.read_bytes)) - (pod), + (&(pod.read_bw_bytes_per_sec)) - (pod), + (&(pod.read_utilization)) - (pod), + (&(pod.read_duration_us)) - (pod), + (&(pod.n_total_reads)) - (pod), + (&(pod.n_p2p_reads)) - (pod), + (&(pod.n_nvfs_reads)) - (pod), + (&(pod.n_posix_reads)) - (pod), + (&(pod.n_unaligned_reads)) - (pod), + (&(pod.n_dr_reads)) - (pod), + (&(pod.n_sparse_regions)) - (pod), + (&(pod.n_inline_regions)) - (pod), + (&(pod.n_reads_err)) - (pod), + (&(pod.writes_bytes)) - (pod), + (&(pod.write_bw_bytes_per_sec)) - (pod), + (&(pod.write_utilization)) - (pod), + (&(pod.write_duration_us)) - (pod), + (&(pod.n_total_writes)) - (pod), + (&(pod.n_p2p_writes)) - (pod), + (&(pod.n_nvfs_writes)) - (pod), + (&(pod.n_posix_writes)) - (pod), + (&(pod.n_unaligned_writes)) - (pod), + (&(pod.n_dr_writes)) - (pod), + (&(pod.n_writes_err)) - (pod), + (&(pod.n_mmap)) - (pod), + (&(pod.n_mmap_ok)) - (pod), + (&(pod.n_mmap_err)) - (pod), + (&(pod.n_mmap_free)) - (pod), + (&(pod.reg_bytes)) - (pod), + ], + 'itemsize': sizeof(CUfilePerGpuStats_t), + }) + finally: + _cyb_free(pod) per_gpu_stats_dtype = _get_per_gpu_stats_dtype_offsets() cdef object per_gpu_stats_dtype_record = _numpy.dtype((_numpy.record, per_gpu_stats_dtype)) @@ -1312,16 +1337,21 @@ cdef class PerGpuStats: cdef _get_io_vec_dtype_offsets(): - cdef CUfileIOVec_t pod - return _numpy.dtype({ - 'names': ['base_', 'len'], - 'formats': [_numpy.intp, _numpy.uint64], - 'offsets': [ - (&(pod.base)) - (&pod), - (&(pod.len)) - (&pod), - ], - 'itemsize': sizeof(CUfileIOVec_t), - }) + cdef CUfileIOVec_t *pod = _cyb_calloc(1, sizeof(CUfileIOVec_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfileIOVec_t") + try: + return _numpy.dtype({ + 'names': ['base_', 'len'], + 'formats': [_numpy.intp, _numpy.uint64], + 'offsets': [ + (&(pod.base)) - (pod), + (&(pod.len)) - (pod), + ], + 'itemsize': sizeof(CUfileIOVec_t), + }) + finally: + _cyb_free(pod) io_vec_dtype = _get_io_vec_dtype_offsets() cdef object io_vec_dtype_record = _numpy.dtype((_numpy.record, io_vec_dtype)) @@ -1480,17 +1510,22 @@ cdef class IOVec: cdef _get_descr_dtype_offsets(): - cdef CUfileDescr_t pod - return _numpy.dtype({ - 'names': ['type', 'handle', 'fs_ops'], - 'formats': [_numpy.int32, _py_anon_pod1_dtype, _numpy.intp], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.handle)) - (&pod), - (&(pod.fs_ops)) - (&pod), - ], - 'itemsize': sizeof(CUfileDescr_t), - }) + cdef CUfileDescr_t *pod = _cyb_calloc(1, sizeof(CUfileDescr_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfileDescr_t") + try: + return _numpy.dtype({ + 'names': ['type', 'handle', 'fs_ops'], + 'formats': [_numpy.int32, _py_anon_pod1_dtype, _numpy.intp], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.handle)) - (pod), + (&(pod.fs_ops)) - (pod), + ], + 'itemsize': sizeof(CUfileDescr_t), + }) + finally: + _cyb_free(pod) descr_dtype = _get_descr_dtype_offsets() cdef object descr_dtype_record = _numpy.dtype((_numpy.record, descr_dtype)) @@ -1660,15 +1695,20 @@ cdef class Descr: cdef _get__py_anon_pod2_dtype_offsets(): - cdef cuda_bindings_cufile__anon_pod2 pod - return _numpy.dtype({ - 'names': ['batch'], - 'formats': [_py_anon_pod3_dtype], - 'offsets': [ - (&(pod.batch)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_cufile__anon_pod2), - }) + cdef cuda_bindings_cufile__anon_pod2 *pod = _cyb_calloc(1, sizeof(cuda_bindings_cufile__anon_pod2)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_cufile__anon_pod2") + try: + return _numpy.dtype({ + 'names': ['batch'], + 'formats': [_py_anon_pod3_dtype], + 'offsets': [ + (&(pod.batch)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_cufile__anon_pod2), + }) + finally: + _cyb_free(pod) _py_anon_pod2_dtype = _get__py_anon_pod2_dtype_offsets() @@ -1802,69 +1842,74 @@ cdef class _py_anon_pod2: cdef _get_stats_level1_dtype_offsets(): - cdef CUfileStatsLevel1_t pod - return _numpy.dtype({ - 'names': ['read_ops', 'write_ops', 'hdl_register_ops', 'hdl_deregister_ops', 'buf_register_ops', 'buf_deregister_ops', 'read_bytes', 'write_bytes', 'read_bw_bytes_per_sec', 'write_bw_bytes_per_sec', 'read_lat_avg_us', 'write_lat_avg_us', 'read_ops_per_sec', 'write_ops_per_sec', 'read_lat_sum_us', 'write_lat_sum_us', 'batch_submit_ops', 'batch_complete_ops', 'batch_setup_ops', 'batch_cancel_ops', 'batch_destroy_ops', 'batch_enqueued_ops', 'batch_posix_enqueued_ops', 'batch_processed_ops', 'batch_posix_processed_ops', 'batch_nvfs_submit_ops', 'batch_p2p_submit_ops', 'batch_aio_submit_ops', 'batch_iouring_submit_ops', 'batch_mixed_io_submit_ops', 'batch_total_submit_ops', 'batch_read_bytes', 'batch_write_bytes', 'batch_read_bw_bytes', 'batch_write_bw_bytes', 'batch_submit_lat_avg_us', 'batch_completion_lat_avg_us', 'batch_submit_ops_per_sec', 'batch_complete_ops_per_sec', 'batch_submit_lat_sum_us', 'batch_completion_lat_sum_us', 'last_batch_read_bytes', 'last_batch_write_bytes', 'readv_ops', 'writev_ops', 'readv_bytes', 'writev_bytes', 'readv_bw_bytes_per_sec', 'writev_bw_bytes_per_sec', 'readv_lat_avg_us', 'writev_lat_avg_us', 'readv_ops_per_sec', 'writev_ops_per_sec', 'readv_lat_sum_us', 'writev_lat_sum_us'], - 'formats': [op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.read_ops)) - (&pod), - (&(pod.write_ops)) - (&pod), - (&(pod.hdl_register_ops)) - (&pod), - (&(pod.hdl_deregister_ops)) - (&pod), - (&(pod.buf_register_ops)) - (&pod), - (&(pod.buf_deregister_ops)) - (&pod), - (&(pod.read_bytes)) - (&pod), - (&(pod.write_bytes)) - (&pod), - (&(pod.read_bw_bytes_per_sec)) - (&pod), - (&(pod.write_bw_bytes_per_sec)) - (&pod), - (&(pod.read_lat_avg_us)) - (&pod), - (&(pod.write_lat_avg_us)) - (&pod), - (&(pod.read_ops_per_sec)) - (&pod), - (&(pod.write_ops_per_sec)) - (&pod), - (&(pod.read_lat_sum_us)) - (&pod), - (&(pod.write_lat_sum_us)) - (&pod), - (&(pod.batch_submit_ops)) - (&pod), - (&(pod.batch_complete_ops)) - (&pod), - (&(pod.batch_setup_ops)) - (&pod), - (&(pod.batch_cancel_ops)) - (&pod), - (&(pod.batch_destroy_ops)) - (&pod), - (&(pod.batch_enqueued_ops)) - (&pod), - (&(pod.batch_posix_enqueued_ops)) - (&pod), - (&(pod.batch_processed_ops)) - (&pod), - (&(pod.batch_posix_processed_ops)) - (&pod), - (&(pod.batch_nvfs_submit_ops)) - (&pod), - (&(pod.batch_p2p_submit_ops)) - (&pod), - (&(pod.batch_aio_submit_ops)) - (&pod), - (&(pod.batch_iouring_submit_ops)) - (&pod), - (&(pod.batch_mixed_io_submit_ops)) - (&pod), - (&(pod.batch_total_submit_ops)) - (&pod), - (&(pod.batch_read_bytes)) - (&pod), - (&(pod.batch_write_bytes)) - (&pod), - (&(pod.batch_read_bw_bytes)) - (&pod), - (&(pod.batch_write_bw_bytes)) - (&pod), - (&(pod.batch_submit_lat_avg_us)) - (&pod), - (&(pod.batch_completion_lat_avg_us)) - (&pod), - (&(pod.batch_submit_ops_per_sec)) - (&pod), - (&(pod.batch_complete_ops_per_sec)) - (&pod), - (&(pod.batch_submit_lat_sum_us)) - (&pod), - (&(pod.batch_completion_lat_sum_us)) - (&pod), - (&(pod.last_batch_read_bytes)) - (&pod), - (&(pod.last_batch_write_bytes)) - (&pod), - (&(pod.readv_ops)) - (&pod), - (&(pod.writev_ops)) - (&pod), - (&(pod.readv_bytes)) - (&pod), - (&(pod.writev_bytes)) - (&pod), - (&(pod.readv_bw_bytes_per_sec)) - (&pod), - (&(pod.writev_bw_bytes_per_sec)) - (&pod), - (&(pod.readv_lat_avg_us)) - (&pod), - (&(pod.writev_lat_avg_us)) - (&pod), - (&(pod.readv_ops_per_sec)) - (&pod), - (&(pod.writev_ops_per_sec)) - (&pod), - (&(pod.readv_lat_sum_us)) - (&pod), - (&(pod.writev_lat_sum_us)) - (&pod), - ], - 'itemsize': sizeof(CUfileStatsLevel1_t), - }) + cdef CUfileStatsLevel1_t *pod = _cyb_calloc(1, sizeof(CUfileStatsLevel1_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfileStatsLevel1_t") + try: + return _numpy.dtype({ + 'names': ['read_ops', 'write_ops', 'hdl_register_ops', 'hdl_deregister_ops', 'buf_register_ops', 'buf_deregister_ops', 'read_bytes', 'write_bytes', 'read_bw_bytes_per_sec', 'write_bw_bytes_per_sec', 'read_lat_avg_us', 'write_lat_avg_us', 'read_ops_per_sec', 'write_ops_per_sec', 'read_lat_sum_us', 'write_lat_sum_us', 'batch_submit_ops', 'batch_complete_ops', 'batch_setup_ops', 'batch_cancel_ops', 'batch_destroy_ops', 'batch_enqueued_ops', 'batch_posix_enqueued_ops', 'batch_processed_ops', 'batch_posix_processed_ops', 'batch_nvfs_submit_ops', 'batch_p2p_submit_ops', 'batch_aio_submit_ops', 'batch_iouring_submit_ops', 'batch_mixed_io_submit_ops', 'batch_total_submit_ops', 'batch_read_bytes', 'batch_write_bytes', 'batch_read_bw_bytes', 'batch_write_bw_bytes', 'batch_submit_lat_avg_us', 'batch_completion_lat_avg_us', 'batch_submit_ops_per_sec', 'batch_complete_ops_per_sec', 'batch_submit_lat_sum_us', 'batch_completion_lat_sum_us', 'last_batch_read_bytes', 'last_batch_write_bytes', 'readv_ops', 'writev_ops', 'readv_bytes', 'writev_bytes', 'readv_bw_bytes_per_sec', 'writev_bw_bytes_per_sec', 'readv_lat_avg_us', 'writev_lat_avg_us', 'readv_ops_per_sec', 'writev_ops_per_sec', 'readv_lat_sum_us', 'writev_lat_sum_us'], + 'formats': [op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.read_ops)) - (pod), + (&(pod.write_ops)) - (pod), + (&(pod.hdl_register_ops)) - (pod), + (&(pod.hdl_deregister_ops)) - (pod), + (&(pod.buf_register_ops)) - (pod), + (&(pod.buf_deregister_ops)) - (pod), + (&(pod.read_bytes)) - (pod), + (&(pod.write_bytes)) - (pod), + (&(pod.read_bw_bytes_per_sec)) - (pod), + (&(pod.write_bw_bytes_per_sec)) - (pod), + (&(pod.read_lat_avg_us)) - (pod), + (&(pod.write_lat_avg_us)) - (pod), + (&(pod.read_ops_per_sec)) - (pod), + (&(pod.write_ops_per_sec)) - (pod), + (&(pod.read_lat_sum_us)) - (pod), + (&(pod.write_lat_sum_us)) - (pod), + (&(pod.batch_submit_ops)) - (pod), + (&(pod.batch_complete_ops)) - (pod), + (&(pod.batch_setup_ops)) - (pod), + (&(pod.batch_cancel_ops)) - (pod), + (&(pod.batch_destroy_ops)) - (pod), + (&(pod.batch_enqueued_ops)) - (pod), + (&(pod.batch_posix_enqueued_ops)) - (pod), + (&(pod.batch_processed_ops)) - (pod), + (&(pod.batch_posix_processed_ops)) - (pod), + (&(pod.batch_nvfs_submit_ops)) - (pod), + (&(pod.batch_p2p_submit_ops)) - (pod), + (&(pod.batch_aio_submit_ops)) - (pod), + (&(pod.batch_iouring_submit_ops)) - (pod), + (&(pod.batch_mixed_io_submit_ops)) - (pod), + (&(pod.batch_total_submit_ops)) - (pod), + (&(pod.batch_read_bytes)) - (pod), + (&(pod.batch_write_bytes)) - (pod), + (&(pod.batch_read_bw_bytes)) - (pod), + (&(pod.batch_write_bw_bytes)) - (pod), + (&(pod.batch_submit_lat_avg_us)) - (pod), + (&(pod.batch_completion_lat_avg_us)) - (pod), + (&(pod.batch_submit_ops_per_sec)) - (pod), + (&(pod.batch_complete_ops_per_sec)) - (pod), + (&(pod.batch_submit_lat_sum_us)) - (pod), + (&(pod.batch_completion_lat_sum_us)) - (pod), + (&(pod.last_batch_read_bytes)) - (pod), + (&(pod.last_batch_write_bytes)) - (pod), + (&(pod.readv_ops)) - (pod), + (&(pod.writev_ops)) - (pod), + (&(pod.readv_bytes)) - (pod), + (&(pod.writev_bytes)) - (pod), + (&(pod.readv_bw_bytes_per_sec)) - (pod), + (&(pod.writev_bw_bytes_per_sec)) - (pod), + (&(pod.readv_lat_avg_us)) - (pod), + (&(pod.writev_lat_avg_us)) - (pod), + (&(pod.readv_ops_per_sec)) - (pod), + (&(pod.writev_ops_per_sec)) - (pod), + (&(pod.readv_lat_sum_us)) - (pod), + (&(pod.writev_lat_sum_us)) - (pod), + ], + 'itemsize': sizeof(CUfileStatsLevel1_t), + }) + finally: + _cyb_free(pod) stats_level1_dtype = _get_stats_level1_dtype_offsets() @@ -2702,19 +2747,24 @@ cdef class StatsLevel1: cdef _get_io_params_dtype_offsets(): - cdef CUfileIOParams_t pod - return _numpy.dtype({ - 'names': ['mode', 'u', 'fh', 'opcode', 'cookie'], - 'formats': [_numpy.int32, _py_anon_pod2_dtype, _numpy.intp, _numpy.int32, _numpy.intp], - 'offsets': [ - (&(pod.mode)) - (&pod), - (&(pod.u)) - (&pod), - (&(pod.fh)) - (&pod), - (&(pod.opcode)) - (&pod), - (&(pod.cookie)) - (&pod), - ], - 'itemsize': sizeof(CUfileIOParams_t), - }) + cdef CUfileIOParams_t *pod = _cyb_calloc(1, sizeof(CUfileIOParams_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfileIOParams_t") + try: + return _numpy.dtype({ + 'names': ['mode', 'u', 'fh', 'opcode', 'cookie'], + 'formats': [_numpy.int32, _py_anon_pod2_dtype, _numpy.intp, _numpy.int32, _numpy.intp], + 'offsets': [ + (&(pod.mode)) - (pod), + (&(pod.u)) - (pod), + (&(pod.fh)) - (pod), + (&(pod.opcode)) - (pod), + (&(pod.cookie)) - (pod), + ], + 'itemsize': sizeof(CUfileIOParams_t), + }) + finally: + _cyb_free(pod) io_params_dtype = _get_io_params_dtype_offsets() cdef object io_params_dtype_record = _numpy.dtype((_numpy.record, io_params_dtype)) @@ -2910,17 +2960,22 @@ cdef class IOParams: cdef _get_stats_level2_dtype_offsets(): - cdef CUfileStatsLevel2_t pod - return _numpy.dtype({ - 'names': ['basic', 'read_size_kb_hist', 'write_size_kb_hist'], - 'formats': [stats_level1_dtype, (_numpy.uint64, 32), (_numpy.uint64, 32)], - 'offsets': [ - (&(pod.basic)) - (&pod), - (&(pod.read_size_kb_hist)) - (&pod), - (&(pod.write_size_kb_hist)) - (&pod), - ], - 'itemsize': sizeof(CUfileStatsLevel2_t), - }) + cdef CUfileStatsLevel2_t *pod = _cyb_calloc(1, sizeof(CUfileStatsLevel2_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfileStatsLevel2_t") + try: + return _numpy.dtype({ + 'names': ['basic', 'read_size_kb_hist', 'write_size_kb_hist'], + 'formats': [stats_level1_dtype, (_numpy.uint64, 32), (_numpy.uint64, 32)], + 'offsets': [ + (&(pod.basic)) - (pod), + (&(pod.read_size_kb_hist)) - (pod), + (&(pod.write_size_kb_hist)) - (pod), + ], + 'itemsize': sizeof(CUfileStatsLevel2_t), + }) + finally: + _cyb_free(pod) stats_level2_dtype = _get_stats_level2_dtype_offsets() @@ -3088,17 +3143,22 @@ cdef class StatsLevel2: cdef _get_stats_level3_dtype_offsets(): - cdef CUfileStatsLevel3_t pod - return _numpy.dtype({ - 'names': ['detailed', 'num_gpus', 'per_gpu_stats'], - 'formats': [stats_level2_dtype, _numpy.uint32, (per_gpu_stats_dtype, 16)], - 'offsets': [ - (&(pod.detailed)) - (&pod), - (&(pod.num_gpus)) - (&pod), - (&(pod.per_gpu_stats)) - (&pod), - ], - 'itemsize': sizeof(CUfileStatsLevel3_t), - }) + cdef CUfileStatsLevel3_t *pod = _cyb_calloc(1, sizeof(CUfileStatsLevel3_t)) + if pod == NULL: + raise MemoryError("Error allocating CUfileStatsLevel3_t") + try: + return _numpy.dtype({ + 'names': ['detailed', 'num_gpus', 'per_gpu_stats'], + 'formats': [stats_level2_dtype, _numpy.uint32, (per_gpu_stats_dtype, 16)], + 'offsets': [ + (&(pod.detailed)) - (pod), + (&(pod.num_gpus)) - (pod), + (&(pod.per_gpu_stats)) - (pod), + ], + 'itemsize': sizeof(CUfileStatsLevel3_t), + }) + finally: + _cyb_free(pod) stats_level3_dtype = _get_stats_level3_dtype_offsets() diff --git a/cuda_bindings_13/cuda/bindings/driver.pyx b/cuda_bindings_13/cuda/bindings/driver.pyx index c734204eb09..4483ea49961 100644 --- a/cuda_bindings_13/cuda/bindings/driver.pyx +++ b/cuda_bindings_13/cuda/bindings/driver.pyx @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # This code was automatically generated with version 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=31ee6b840352a46ffa3e1fe1c52799ecf357ffc86e8ecfe2a6b73590006e86ea +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a9861cd2390709aa722c402deb710e0b922d2ac7cf483a2208a997a00027a479 from typing import Any, Optional import cython import ctypes @@ -26277,7 +26277,7 @@ cdef class anon_union24: def pArray(self): return [CUarray(init_value=_pArray) for _pArray in self._pvt_ptr[0].frame.pArray] @pArray.setter - def pArray(self, pArray : list[CUarray]): + def pArray(self, pArray : list[CUarray | int]): if len(pArray) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pArray)) pArray = [int(_pArray) for _pArray in pArray] diff --git a/cuda_bindings_13/cuda/bindings/nvml.pyx b/cuda_bindings_13/cuda/bindings/nvml.pyx index 402428b5e6f..54a3dddfbd0 100644 --- a/cuda_bindings_13/cuda/bindings/nvml.pyx +++ b/cuda_bindings_13/cuda/bindings/nvml.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=41c2a2147ee34ceed11d38eb00faa851b5c1d5f10c215a0df65f85b22a41757c +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=82df971c247cf6ab3e4aed0e3fa58bcfc88508a419b3dcd9f099182445ca41cd # <<<< PREAMBLE CONTENT >>>> @@ -3102,23 +3102,28 @@ cpdef int check_status_size(int status) except 1 nogil: cdef _get_pci_info_ext_v1_dtype_offsets(): - cdef nvmlPciInfoExt_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'domain', 'bus', 'device_', 'pci_device_id', 'pci_sub_system_id', 'base_class', 'sub_class', 'bus_id'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 32)], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.domain)) - (&pod), - (&(pod.bus)) - (&pod), - (&(pod.device)) - (&pod), - (&(pod.pciDeviceId)) - (&pod), - (&(pod.pciSubSystemId)) - (&pod), - (&(pod.baseClass)) - (&pod), - (&(pod.subClass)) - (&pod), - (&(pod.busId)) - (&pod), - ], - 'itemsize': sizeof(nvmlPciInfoExt_v1_t), - }) + cdef nvmlPciInfoExt_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPciInfoExt_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPciInfoExt_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'domain', 'bus', 'device_', 'pci_device_id', 'pci_sub_system_id', 'base_class', 'sub_class', 'bus_id'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 32)], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.domain)) - (pod), + (&(pod.bus)) - (pod), + (&(pod.device)) - (pod), + (&(pod.pciDeviceId)) - (pod), + (&(pod.pciSubSystemId)) - (pod), + (&(pod.baseClass)) - (pod), + (&(pod.subClass)) - (pod), + (&(pod.busId)) - (pod), + ], + 'itemsize': sizeof(nvmlPciInfoExt_v1_t), + }) + finally: + _cyb_free(pod) pci_info_ext_v1_dtype = _get_pci_info_ext_v1_dtype_offsets() @@ -3327,21 +3332,26 @@ cdef class PciInfoExt_v1: cdef _get_pci_info_dtype_offsets(): - cdef nvmlPciInfo_t pod - return _numpy.dtype({ - 'names': ['bus_id_legacy', 'domain', 'bus', 'device_', 'pci_device_id', 'pci_sub_system_id', 'bus_id'], - 'formats': [(_numpy.int8, 16), _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 32)], - 'offsets': [ - (&(pod.busIdLegacy)) - (&pod), - (&(pod.domain)) - (&pod), - (&(pod.bus)) - (&pod), - (&(pod.device)) - (&pod), - (&(pod.pciDeviceId)) - (&pod), - (&(pod.pciSubSystemId)) - (&pod), - (&(pod.busId)) - (&pod), - ], - 'itemsize': sizeof(nvmlPciInfo_t), - }) + cdef nvmlPciInfo_t *pod = _cyb_calloc(1, sizeof(nvmlPciInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPciInfo_t") + try: + return _numpy.dtype({ + 'names': ['bus_id_legacy', 'domain', 'bus', 'device_', 'pci_device_id', 'pci_sub_system_id', 'bus_id'], + 'formats': [(_numpy.int8, 16), _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 32)], + 'offsets': [ + (&(pod.busIdLegacy)) - (pod), + (&(pod.domain)) - (pod), + (&(pod.bus)) - (pod), + (&(pod.device)) - (pod), + (&(pod.pciDeviceId)) - (pod), + (&(pod.pciSubSystemId)) - (pod), + (&(pod.busId)) - (pod), + ], + 'itemsize': sizeof(nvmlPciInfo_t), + }) + finally: + _cyb_free(pod) pci_info_dtype = _get_pci_info_dtype_offsets() @@ -3544,16 +3554,21 @@ cdef class PciInfo: cdef _get_utilization_dtype_offsets(): - cdef nvmlUtilization_t pod - return _numpy.dtype({ - 'names': ['gpu', 'memory'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.gpu)) - (&pod), - (&(pod.memory)) - (&pod), - ], - 'itemsize': sizeof(nvmlUtilization_t), - }) + cdef nvmlUtilization_t *pod = _cyb_calloc(1, sizeof(nvmlUtilization_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlUtilization_t") + try: + return _numpy.dtype({ + 'names': ['gpu', 'memory'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.gpu)) - (pod), + (&(pod.memory)) - (pod), + ], + 'itemsize': sizeof(nvmlUtilization_t), + }) + finally: + _cyb_free(pod) utilization_dtype = _get_utilization_dtype_offsets() @@ -3681,17 +3696,22 @@ cdef class Utilization: cdef _get_memory_dtype_offsets(): - cdef nvmlMemory_t pod - return _numpy.dtype({ - 'names': ['total', 'free', 'used'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.total)) - (&pod), - (&(pod.free)) - (&pod), - (&(pod.used)) - (&pod), - ], - 'itemsize': sizeof(nvmlMemory_t), - }) + cdef nvmlMemory_t *pod = _cyb_calloc(1, sizeof(nvmlMemory_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlMemory_t") + try: + return _numpy.dtype({ + 'names': ['total', 'free', 'used'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.total)) - (pod), + (&(pod.free)) - (pod), + (&(pod.used)) - (pod), + ], + 'itemsize': sizeof(nvmlMemory_t), + }) + finally: + _cyb_free(pod) memory_dtype = _get_memory_dtype_offsets() @@ -3830,19 +3850,24 @@ cdef class Memory: cdef _get_memory_v2_dtype_offsets(): - cdef nvmlMemory_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'total', 'reserved', 'free', 'used'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.total)) - (&pod), - (&(pod.reserved)) - (&pod), - (&(pod.free)) - (&pod), - (&(pod.used)) - (&pod), - ], - 'itemsize': sizeof(nvmlMemory_v2_t), - }) + cdef nvmlMemory_v2_t *pod = _cyb_calloc(1, sizeof(nvmlMemory_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlMemory_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'total', 'reserved', 'free', 'used'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.total)) - (pod), + (&(pod.reserved)) - (pod), + (&(pod.free)) - (pod), + (&(pod.used)) - (pod), + ], + 'itemsize': sizeof(nvmlMemory_v2_t), + }) + finally: + _cyb_free(pod) memory_v2_dtype = _get_memory_v2_dtype_offsets() @@ -4003,17 +4028,22 @@ cdef class Memory_v2: cdef _get_ba_r1memory_dtype_offsets(): - cdef nvmlBAR1Memory_t pod - return _numpy.dtype({ - 'names': ['bar1_total', 'bar1_free', 'bar1_used'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.bar1Total)) - (&pod), - (&(pod.bar1Free)) - (&pod), - (&(pod.bar1Used)) - (&pod), - ], - 'itemsize': sizeof(nvmlBAR1Memory_t), - }) + cdef nvmlBAR1Memory_t *pod = _cyb_calloc(1, sizeof(nvmlBAR1Memory_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlBAR1Memory_t") + try: + return _numpy.dtype({ + 'names': ['bar1_total', 'bar1_free', 'bar1_used'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.bar1Total)) - (pod), + (&(pod.bar1Free)) - (pod), + (&(pod.bar1Used)) - (pod), + ], + 'itemsize': sizeof(nvmlBAR1Memory_t), + }) + finally: + _cyb_free(pod) ba_r1memory_dtype = _get_ba_r1memory_dtype_offsets() @@ -4152,18 +4182,23 @@ cdef class BAR1Memory: cdef _get_process_info_dtype_offsets(): - cdef nvmlProcessInfo_t pod - return _numpy.dtype({ - 'names': ['pid', 'used_gpu_memory', 'gpu_instance_id', 'compute_instance_id'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.pid)) - (&pod), - (&(pod.usedGpuMemory)) - (&pod), - (&(pod.gpuInstanceId)) - (&pod), - (&(pod.computeInstanceId)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessInfo_t), - }) + cdef nvmlProcessInfo_t *pod = _cyb_calloc(1, sizeof(nvmlProcessInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessInfo_t") + try: + return _numpy.dtype({ + 'names': ['pid', 'used_gpu_memory', 'gpu_instance_id', 'compute_instance_id'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.pid)) - (pod), + (&(pod.usedGpuMemory)) - (pod), + (&(pod.gpuInstanceId)) - (pod), + (&(pod.computeInstanceId)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessInfo_t), + }) + finally: + _cyb_free(pod) process_info_dtype = _get_process_info_dtype_offsets() cdef object process_info_dtype_record = _numpy.dtype((_numpy.record, process_info_dtype)) @@ -4348,19 +4383,24 @@ cdef class ProcessInfo: cdef _get_process_detail_v1_dtype_offsets(): - cdef nvmlProcessDetail_v1_t pod - return _numpy.dtype({ - 'names': ['pid', 'used_gpu_memory', 'gpu_instance_id', 'compute_instance_id', 'used_gpu_cc_protected_memory'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint64], - 'offsets': [ - (&(pod.pid)) - (&pod), - (&(pod.usedGpuMemory)) - (&pod), - (&(pod.gpuInstanceId)) - (&pod), - (&(pod.computeInstanceId)) - (&pod), - (&(pod.usedGpuCcProtectedMemory)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessDetail_v1_t), - }) + cdef nvmlProcessDetail_v1_t *pod = _cyb_calloc(1, sizeof(nvmlProcessDetail_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessDetail_v1_t") + try: + return _numpy.dtype({ + 'names': ['pid', 'used_gpu_memory', 'gpu_instance_id', 'compute_instance_id', 'used_gpu_cc_protected_memory'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.pid)) - (pod), + (&(pod.usedGpuMemory)) - (pod), + (&(pod.gpuInstanceId)) - (pod), + (&(pod.computeInstanceId)) - (pod), + (&(pod.usedGpuCcProtectedMemory)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessDetail_v1_t), + }) + finally: + _cyb_free(pod) process_detail_v1_dtype = _get_process_detail_v1_dtype_offsets() cdef object process_detail_v1_dtype_record = _numpy.dtype((_numpy.record, process_detail_v1_dtype)) @@ -4558,23 +4598,28 @@ cdef class ProcessDetail_v1: cdef _get_device_attributes_dtype_offsets(): - cdef nvmlDeviceAttributes_t pod - return _numpy.dtype({ - 'names': ['multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'gpu_instance_slice_count', 'compute_instance_slice_count', 'memory_size_mb'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64], - 'offsets': [ - (&(pod.multiprocessorCount)) - (&pod), - (&(pod.sharedCopyEngineCount)) - (&pod), - (&(pod.sharedDecoderCount)) - (&pod), - (&(pod.sharedEncoderCount)) - (&pod), - (&(pod.sharedJpegCount)) - (&pod), - (&(pod.sharedOfaCount)) - (&pod), - (&(pod.gpuInstanceSliceCount)) - (&pod), - (&(pod.computeInstanceSliceCount)) - (&pod), - (&(pod.memorySizeMB)) - (&pod), - ], - 'itemsize': sizeof(nvmlDeviceAttributes_t), - }) + cdef nvmlDeviceAttributes_t *pod = _cyb_calloc(1, sizeof(nvmlDeviceAttributes_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlDeviceAttributes_t") + try: + return _numpy.dtype({ + 'names': ['multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'gpu_instance_slice_count', 'compute_instance_slice_count', 'memory_size_mb'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.multiprocessorCount)) - (pod), + (&(pod.sharedCopyEngineCount)) - (pod), + (&(pod.sharedDecoderCount)) - (pod), + (&(pod.sharedEncoderCount)) - (pod), + (&(pod.sharedJpegCount)) - (pod), + (&(pod.sharedOfaCount)) - (pod), + (&(pod.gpuInstanceSliceCount)) - (pod), + (&(pod.computeInstanceSliceCount)) - (pod), + (&(pod.memorySizeMB)) - (pod), + ], + 'itemsize': sizeof(nvmlDeviceAttributes_t), + }) + finally: + _cyb_free(pod) device_attributes_dtype = _get_device_attributes_dtype_offsets() @@ -4779,15 +4824,20 @@ cdef class DeviceAttributes: cdef _get_c2c_mode_info_v1_dtype_offsets(): - cdef nvmlC2cModeInfo_v1_t pod - return _numpy.dtype({ - 'names': ['is_c2c_enabled'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.isC2cEnabled)) - (&pod), - ], - 'itemsize': sizeof(nvmlC2cModeInfo_v1_t), - }) + cdef nvmlC2cModeInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlC2cModeInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlC2cModeInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['is_c2c_enabled'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.isC2cEnabled)) - (pod), + ], + 'itemsize': sizeof(nvmlC2cModeInfo_v1_t), + }) + finally: + _cyb_free(pod) c2c_mode_info_v1_dtype = _get_c2c_mode_info_v1_dtype_offsets() @@ -4904,19 +4954,24 @@ cdef class C2cModeInfo_v1: cdef _get_row_remapper_histogram_values_dtype_offsets(): - cdef nvmlRowRemapperHistogramValues_t pod - return _numpy.dtype({ - 'names': ['max_', 'high', 'partial', 'low', 'none'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.max)) - (&pod), - (&(pod.high)) - (&pod), - (&(pod.partial)) - (&pod), - (&(pod.low)) - (&pod), - (&(pod.none)) - (&pod), - ], - 'itemsize': sizeof(nvmlRowRemapperHistogramValues_t), - }) + cdef nvmlRowRemapperHistogramValues_t *pod = _cyb_calloc(1, sizeof(nvmlRowRemapperHistogramValues_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlRowRemapperHistogramValues_t") + try: + return _numpy.dtype({ + 'names': ['max_', 'high', 'partial', 'low', 'none'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.max)) - (pod), + (&(pod.high)) - (pod), + (&(pod.partial)) - (pod), + (&(pod.low)) - (pod), + (&(pod.none)) - (pod), + ], + 'itemsize': sizeof(nvmlRowRemapperHistogramValues_t), + }) + finally: + _cyb_free(pod) row_remapper_histogram_values_dtype = _get_row_remapper_histogram_values_dtype_offsets() @@ -5077,16 +5132,21 @@ cdef class RowRemapperHistogramValues: cdef _get_bridge_chip_info_dtype_offsets(): - cdef nvmlBridgeChipInfo_t pod - return _numpy.dtype({ - 'names': ['type', 'fw_version'], - 'formats': [_numpy.int32, _numpy.uint32], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.fwVersion)) - (&pod), - ], - 'itemsize': sizeof(nvmlBridgeChipInfo_t), - }) + cdef nvmlBridgeChipInfo_t *pod = _cyb_calloc(1, sizeof(nvmlBridgeChipInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlBridgeChipInfo_t") + try: + return _numpy.dtype({ + 'names': ['type', 'fw_version'], + 'formats': [_numpy.int32, _numpy.uint32], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.fwVersion)) - (pod), + ], + 'itemsize': sizeof(nvmlBridgeChipInfo_t), + }) + finally: + _cyb_free(pod) bridge_chip_info_dtype = _get_bridge_chip_info_dtype_offsets() cdef object bridge_chip_info_dtype_record = _numpy.dtype((_numpy.record, bridge_chip_info_dtype)) @@ -5245,21 +5305,26 @@ cdef class BridgeChipInfo: cdef _get_value_dtype_offsets(): - cdef nvmlValue_t pod - return _numpy.dtype({ - 'names': ['d_val', 'si_val', 'ui_val', 'ul_val', 'ull_val', 'sll_val', 'us_val'], - 'formats': [_numpy.float64, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.int64, _numpy.uint16], - 'offsets': [ - (&(pod.dVal)) - (&pod), - (&(pod.siVal)) - (&pod), - (&(pod.uiVal)) - (&pod), - (&(pod.ulVal)) - (&pod), - (&(pod.ullVal)) - (&pod), - (&(pod.sllVal)) - (&pod), - (&(pod.usVal)) - (&pod), - ], - 'itemsize': sizeof(nvmlValue_t), - }) + cdef nvmlValue_t *pod = _cyb_calloc(1, sizeof(nvmlValue_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlValue_t") + try: + return _numpy.dtype({ + 'names': ['d_val', 'si_val', 'ui_val', 'ul_val', 'ull_val', 'sll_val', 'us_val'], + 'formats': [_numpy.float64, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.int64, _numpy.uint16], + 'offsets': [ + (&(pod.dVal)) - (pod), + (&(pod.siVal)) - (pod), + (&(pod.uiVal)) - (pod), + (&(pod.ulVal)) - (pod), + (&(pod.ullVal)) - (pod), + (&(pod.sllVal)) - (pod), + (&(pod.usVal)) - (pod), + ], + 'itemsize': sizeof(nvmlValue_t), + }) + finally: + _cyb_free(pod) value_dtype = _get_value_dtype_offsets() @@ -5454,19 +5519,24 @@ cdef class Value: cdef _get__py_anon_pod0_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod0 pod - return _numpy.dtype({ - 'names': ['controller', 'default_min_temp', 'default_max_temp', 'current_temp', 'target'], - 'formats': [_numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.controller)) - (&pod), - (&(pod.defaultMinTemp)) - (&pod), - (&(pod.defaultMaxTemp)) - (&pod), - (&(pod.currentTemp)) - (&pod), - (&(pod.target)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod0), - }) + cdef cuda_bindings_nvml__anon_pod0 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod0)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod0") + try: + return _numpy.dtype({ + 'names': ['controller', 'default_min_temp', 'default_max_temp', 'current_temp', 'target'], + 'formats': [_numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.controller)) - (pod), + (&(pod.defaultMinTemp)) - (pod), + (&(pod.defaultMaxTemp)) - (pod), + (&(pod.currentTemp)) - (pod), + (&(pod.target)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod0), + }) + finally: + _cyb_free(pod) _py_anon_pod0_dtype = _get__py_anon_pod0_dtype_offsets() cdef object _py_anon_pod0_dtype_record = _numpy.dtype((_numpy.record, _py_anon_pod0_dtype)) @@ -5664,18 +5734,23 @@ cdef class _py_anon_pod0: cdef _get_cooler_info_v1_dtype_offsets(): - cdef nvmlCoolerInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'index', 'signal_type', 'target'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.index)) - (&pod), - (&(pod.signalType)) - (&pod), - (&(pod.target)) - (&pod), - ], - 'itemsize': sizeof(nvmlCoolerInfo_v1_t), - }) + cdef nvmlCoolerInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlCoolerInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlCoolerInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'index', 'signal_type', 'target'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.index)) - (pod), + (&(pod.signalType)) - (pod), + (&(pod.target)) - (pod), + ], + 'itemsize': sizeof(nvmlCoolerInfo_v1_t), + }) + finally: + _cyb_free(pod) cooler_info_v1_dtype = _get_cooler_info_v1_dtype_offsets() @@ -5825,16 +5900,21 @@ cdef class CoolerInfo_v1: cdef _get_clk_mon_fault_info_dtype_offsets(): - cdef nvmlClkMonFaultInfo_t pod - return _numpy.dtype({ - 'names': ['clk_api_domain', 'clk_domain_fault_mask'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.clkApiDomain)) - (&pod), - (&(pod.clkDomainFaultMask)) - (&pod), - ], - 'itemsize': sizeof(nvmlClkMonFaultInfo_t), - }) + cdef nvmlClkMonFaultInfo_t *pod = _cyb_calloc(1, sizeof(nvmlClkMonFaultInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlClkMonFaultInfo_t") + try: + return _numpy.dtype({ + 'names': ['clk_api_domain', 'clk_domain_fault_mask'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.clkApiDomain)) - (pod), + (&(pod.clkDomainFaultMask)) - (pod), + ], + 'itemsize': sizeof(nvmlClkMonFaultInfo_t), + }) + finally: + _cyb_free(pod) clk_mon_fault_info_dtype = _get_clk_mon_fault_info_dtype_offsets() cdef object clk_mon_fault_info_dtype_record = _numpy.dtype((_numpy.record, clk_mon_fault_info_dtype)) @@ -5993,20 +6073,25 @@ cdef class ClkMonFaultInfo: cdef _get_clock_offset_v1_dtype_offsets(): - cdef nvmlClockOffset_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'type', 'pstate', 'clock_offset_m_hz', 'min_clock_offset_m_hz', 'max_clock_offset_m_hz'], - 'formats': [_numpy.uint32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.type)) - (&pod), - (&(pod.pstate)) - (&pod), - (&(pod.clockOffsetMHz)) - (&pod), - (&(pod.minClockOffsetMHz)) - (&pod), - (&(pod.maxClockOffsetMHz)) - (&pod), - ], - 'itemsize': sizeof(nvmlClockOffset_v1_t), - }) + cdef nvmlClockOffset_v1_t *pod = _cyb_calloc(1, sizeof(nvmlClockOffset_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlClockOffset_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'type', 'pstate', 'clock_offset_m_hz', 'min_clock_offset_m_hz', 'max_clock_offset_m_hz'], + 'formats': [_numpy.uint32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.type)) - (pod), + (&(pod.pstate)) - (pod), + (&(pod.clockOffsetMHz)) - (pod), + (&(pod.minClockOffsetMHz)) - (pod), + (&(pod.maxClockOffsetMHz)) - (pod), + ], + 'itemsize': sizeof(nvmlClockOffset_v1_t), + }) + finally: + _cyb_free(pod) clock_offset_v1_dtype = _get_clock_offset_v1_dtype_offsets() @@ -6178,20 +6263,25 @@ cdef class ClockOffset_v1: cdef _get_process_utilization_sample_dtype_offsets(): - cdef nvmlProcessUtilizationSample_t pod - return _numpy.dtype({ - 'names': ['pid', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.pid)) - (&pod), - (&(pod.timeStamp)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessUtilizationSample_t), - }) + cdef nvmlProcessUtilizationSample_t *pod = _cyb_calloc(1, sizeof(nvmlProcessUtilizationSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessUtilizationSample_t") + try: + return _numpy.dtype({ + 'names': ['pid', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.pid)) - (pod), + (&(pod.timeStamp)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessUtilizationSample_t), + }) + finally: + _cyb_free(pod) process_utilization_sample_dtype = _get_process_utilization_sample_dtype_offsets() cdef object process_utilization_sample_dtype_record = _numpy.dtype((_numpy.record, process_utilization_sample_dtype)) @@ -6402,22 +6492,27 @@ cdef class ProcessUtilizationSample: cdef _get_process_utilization_info_v1_dtype_offsets(): - cdef nvmlProcessUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['time_stamp', 'pid', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], - 'formats': [_numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.timeStamp)) - (&pod), - (&(pod.pid)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - (&(pod.jpgUtil)) - (&pod), - (&(pod.ofaUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessUtilizationInfo_v1_t), - }) + cdef nvmlProcessUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlProcessUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['time_stamp', 'pid', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], + 'formats': [_numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.timeStamp)) - (pod), + (&(pod.pid)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + (&(pod.jpgUtil)) - (pod), + (&(pod.ofaUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) process_utilization_info_v1_dtype = _get_process_utilization_info_v1_dtype_offsets() cdef object process_utilization_info_v1_dtype_record = _numpy.dtype((_numpy.record, process_utilization_info_v1_dtype)) @@ -6654,27 +6749,32 @@ cdef class ProcessUtilizationInfo_v1: cdef _get_ecc_sram_error_status_v1_dtype_offsets(): - cdef nvmlEccSramErrorStatus_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'aggregate_unc_parity', 'aggregate_unc_sec_ded', 'aggregate_cor', 'volatile_unc_parity', 'volatile_unc_sec_ded', 'volatile_cor', 'aggregate_unc_bucket_l2', 'aggregate_unc_bucket_sm', 'aggregate_unc_bucket_pcie', 'aggregate_unc_bucket_mcu', 'aggregate_unc_bucket_other', 'b_threshold_exceeded'], - 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.aggregateUncParity)) - (&pod), - (&(pod.aggregateUncSecDed)) - (&pod), - (&(pod.aggregateCor)) - (&pod), - (&(pod.volatileUncParity)) - (&pod), - (&(pod.volatileUncSecDed)) - (&pod), - (&(pod.volatileCor)) - (&pod), - (&(pod.aggregateUncBucketL2)) - (&pod), - (&(pod.aggregateUncBucketSm)) - (&pod), - (&(pod.aggregateUncBucketPcie)) - (&pod), - (&(pod.aggregateUncBucketMcu)) - (&pod), - (&(pod.aggregateUncBucketOther)) - (&pod), - (&(pod.bThresholdExceeded)) - (&pod), - ], - 'itemsize': sizeof(nvmlEccSramErrorStatus_v1_t), - }) + cdef nvmlEccSramErrorStatus_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEccSramErrorStatus_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEccSramErrorStatus_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'aggregate_unc_parity', 'aggregate_unc_sec_ded', 'aggregate_cor', 'volatile_unc_parity', 'volatile_unc_sec_ded', 'volatile_cor', 'aggregate_unc_bucket_l2', 'aggregate_unc_bucket_sm', 'aggregate_unc_bucket_pcie', 'aggregate_unc_bucket_mcu', 'aggregate_unc_bucket_other', 'b_threshold_exceeded'], + 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.aggregateUncParity)) - (pod), + (&(pod.aggregateUncSecDed)) - (pod), + (&(pod.aggregateCor)) - (pod), + (&(pod.volatileUncParity)) - (pod), + (&(pod.volatileUncSecDed)) - (pod), + (&(pod.volatileCor)) - (pod), + (&(pod.aggregateUncBucketL2)) - (pod), + (&(pod.aggregateUncBucketSm)) - (pod), + (&(pod.aggregateUncBucketPcie)) - (pod), + (&(pod.aggregateUncBucketMcu)) - (pod), + (&(pod.aggregateUncBucketOther)) - (pod), + (&(pod.bThresholdExceeded)) - (pod), + ], + 'itemsize': sizeof(nvmlEccSramErrorStatus_v1_t), + }) + finally: + _cyb_free(pod) ecc_sram_error_status_v1_dtype = _get_ecc_sram_error_status_v1_dtype_offsets() @@ -6923,22 +7023,27 @@ cdef class EccSramErrorStatus_v1: cdef _get_platform_info_v1_dtype_offsets(): - cdef nvmlPlatformInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'ib_guid', 'rack_guid', 'chassis_physical_slot_number', 'compute_slot_index', 'node_index', 'peer_type', 'module_id'], - 'formats': [_numpy.uint32, (_numpy.uint8, 16), (_numpy.uint8, 16), _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.ibGuid)) - (&pod), - (&(pod.rackGuid)) - (&pod), - (&(pod.chassisPhysicalSlotNumber)) - (&pod), - (&(pod.computeSlotIndex)) - (&pod), - (&(pod.nodeIndex)) - (&pod), - (&(pod.peerType)) - (&pod), - (&(pod.moduleId)) - (&pod), - ], - 'itemsize': sizeof(nvmlPlatformInfo_v1_t), - }) + cdef nvmlPlatformInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPlatformInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPlatformInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'ib_guid', 'rack_guid', 'chassis_physical_slot_number', 'compute_slot_index', 'node_index', 'peer_type', 'module_id'], + 'formats': [_numpy.uint32, (_numpy.uint8, 16), (_numpy.uint8, 16), _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.ibGuid)) - (pod), + (&(pod.rackGuid)) - (pod), + (&(pod.chassisPhysicalSlotNumber)) - (pod), + (&(pod.computeSlotIndex)) - (pod), + (&(pod.nodeIndex)) - (pod), + (&(pod.peerType)) - (pod), + (&(pod.moduleId)) - (pod), + ], + 'itemsize': sizeof(nvmlPlatformInfo_v1_t), + }) + finally: + _cyb_free(pod) platform_info_v1_dtype = _get_platform_info_v1_dtype_offsets() @@ -7144,22 +7249,27 @@ cdef class PlatformInfo_v1: cdef _get_platform_info_v2_dtype_offsets(): - cdef nvmlPlatformInfo_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'ib_guid', 'chassis_serial_number', 'slot_number', 'tray_index', 'host_id', 'peer_type', 'module_id'], - 'formats': [_numpy.uint32, (_numpy.uint8, 16), (_numpy.uint8, 16), _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.ibGuid)) - (&pod), - (&(pod.chassisSerialNumber)) - (&pod), - (&(pod.slotNumber)) - (&pod), - (&(pod.trayIndex)) - (&pod), - (&(pod.hostId)) - (&pod), - (&(pod.peerType)) - (&pod), - (&(pod.moduleId)) - (&pod), - ], - 'itemsize': sizeof(nvmlPlatformInfo_v2_t), - }) + cdef nvmlPlatformInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlPlatformInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPlatformInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'ib_guid', 'chassis_serial_number', 'slot_number', 'tray_index', 'host_id', 'peer_type', 'module_id'], + 'formats': [_numpy.uint32, (_numpy.uint8, 16), (_numpy.uint8, 16), _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.ibGuid)) - (pod), + (&(pod.chassisSerialNumber)) - (pod), + (&(pod.slotNumber)) - (pod), + (&(pod.trayIndex)) - (pod), + (&(pod.hostId)) - (pod), + (&(pod.peerType)) - (pod), + (&(pod.moduleId)) - (pod), + ], + 'itemsize': sizeof(nvmlPlatformInfo_v2_t), + }) + finally: + _cyb_free(pod) platform_info_v2_dtype = _get_platform_info_v2_dtype_offsets() @@ -7365,18 +7475,23 @@ cdef class PlatformInfo_v2: cdef _get__py_anon_pod1_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod1 pod - return _numpy.dtype({ - 'names': ['b_is_present', 'percentage', 'inc_threshold', 'dec_threshold'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.bIsPresent)) - (&pod), - (&(pod.percentage)) - (&pod), - (&(pod.incThreshold)) - (&pod), - (&(pod.decThreshold)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod1), - }) + cdef cuda_bindings_nvml__anon_pod1 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod1)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod1") + try: + return _numpy.dtype({ + 'names': ['b_is_present', 'percentage', 'inc_threshold', 'dec_threshold'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.bIsPresent)) - (pod), + (&(pod.percentage)) - (pod), + (&(pod.incThreshold)) - (pod), + (&(pod.decThreshold)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod1), + }) + finally: + _cyb_free(pod) _py_anon_pod1_dtype = _get__py_anon_pod1_dtype_offsets() cdef object _py_anon_pod1_dtype_record = _numpy.dtype((_numpy.record, _py_anon_pod1_dtype)) @@ -7561,19 +7676,24 @@ cdef class _py_anon_pod1: cdef _get_vgpu_placement_list_v2_dtype_offsets(): - cdef nvmlVgpuPlacementList_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'placement_size', 'count', 'placement_ids', 'mode'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.placementSize)) - (&pod), - (&(pod.count)) - (&pod), - (&(pod.placementIds)) - (&pod), - (&(pod.mode)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuPlacementList_v2_t), - }) + cdef nvmlVgpuPlacementList_v2_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuPlacementList_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuPlacementList_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'placement_size', 'count', 'placement_ids', 'mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.placementSize)) - (pod), + (&(pod.count)) - (pod), + (&(pod.placementIds)) - (pod), + (&(pod.mode)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuPlacementList_v2_t), + }) + finally: + _cyb_free(pod) vgpu_placement_list_v2_dtype = _get_vgpu_placement_list_v2_dtype_offsets() @@ -7734,16 +7854,21 @@ cdef class VgpuPlacementList_v2: cdef _get_vgpu_type_bar1info_v1_dtype_offsets(): - cdef nvmlVgpuTypeBar1Info_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'bar1size'], - 'formats': [_numpy.uint32, _numpy.uint64], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.bar1Size)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuTypeBar1Info_v1_t), - }) + cdef nvmlVgpuTypeBar1Info_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuTypeBar1Info_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuTypeBar1Info_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'bar1size'], + 'formats': [_numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.bar1Size)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuTypeBar1Info_v1_t), + }) + finally: + _cyb_free(pod) vgpu_type_bar1info_v1_dtype = _get_vgpu_type_bar1info_v1_dtype_offsets() @@ -7871,22 +7996,27 @@ cdef class VgpuTypeBar1Info_v1: cdef _get_vgpu_process_utilization_sample_dtype_offsets(): - cdef nvmlVgpuProcessUtilizationSample_t pod - return _numpy.dtype({ - 'names': ['vgpu_instance', 'pid', 'process_name', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], - 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 64), _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.vgpuInstance)) - (&pod), - (&(pod.pid)) - (&pod), - (&(pod.processName)) - (&pod), - (&(pod.timeStamp)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuProcessUtilizationSample_t), - }) + cdef nvmlVgpuProcessUtilizationSample_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuProcessUtilizationSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuProcessUtilizationSample_t") + try: + return _numpy.dtype({ + 'names': ['vgpu_instance', 'pid', 'process_name', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], + 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 64), _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.vgpuInstance)) - (pod), + (&(pod.pid)) - (pod), + (&(pod.processName)) - (pod), + (&(pod.timeStamp)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuProcessUtilizationSample_t), + }) + finally: + _cyb_free(pod) vgpu_process_utilization_sample_dtype = _get_vgpu_process_utilization_sample_dtype_offsets() cdef object vgpu_process_utilization_sample_dtype_record = _numpy.dtype((_numpy.record, vgpu_process_utilization_sample_dtype)) @@ -8121,24 +8251,29 @@ cdef class VgpuProcessUtilizationSample: cdef _get_vgpu_process_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuProcessUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['process_name', 'time_stamp', 'vgpu_instance', 'pid', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], - 'formats': [(_numpy.int8, 64), _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.processName)) - (&pod), - (&(pod.timeStamp)) - (&pod), - (&(pod.vgpuInstance)) - (&pod), - (&(pod.pid)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - (&(pod.jpgUtil)) - (&pod), - (&(pod.ofaUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuProcessUtilizationInfo_v1_t), - }) + cdef nvmlVgpuProcessUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuProcessUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuProcessUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['process_name', 'time_stamp', 'vgpu_instance', 'pid', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], + 'formats': [(_numpy.int8, 64), _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.processName)) - (pod), + (&(pod.timeStamp)) - (pod), + (&(pod.vgpuInstance)) - (pod), + (&(pod.pid)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + (&(pod.jpgUtil)) - (pod), + (&(pod.ofaUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuProcessUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_process_utilization_info_v1_dtype = _get_vgpu_process_utilization_info_v1_dtype_offsets() cdef object vgpu_process_utilization_info_v1_dtype_record = _numpy.dtype((_numpy.record, vgpu_process_utilization_info_v1_dtype)) @@ -8399,16 +8534,21 @@ cdef class VgpuProcessUtilizationInfo_v1: cdef _get__py_anon_pod2_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod2 pod - return _numpy.dtype({ - 'names': ['avg_factor', 'timeslice'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.avgFactor)) - (&pod), - (&(pod.timeslice)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod2), - }) + cdef cuda_bindings_nvml__anon_pod2 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod2)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod2") + try: + return _numpy.dtype({ + 'names': ['avg_factor', 'timeslice'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.avgFactor)) - (pod), + (&(pod.timeslice)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod2), + }) + finally: + _cyb_free(pod) _py_anon_pod2_dtype = _get__py_anon_pod2_dtype_offsets() @@ -8548,15 +8688,20 @@ cdef class _py_anon_pod2: cdef _get__py_anon_pod3_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod3 pod - return _numpy.dtype({ - 'names': ['timeslice'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.timeslice)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod3), - }) + cdef cuda_bindings_nvml__anon_pod3 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod3)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod3") + try: + return _numpy.dtype({ + 'names': ['timeslice'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.timeslice)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod3), + }) + finally: + _cyb_free(pod) _py_anon_pod3_dtype = _get__py_anon_pod3_dtype_offsets() @@ -8685,20 +8830,25 @@ cdef class _py_anon_pod3: cdef _get_vgpu_scheduler_log_entry_dtype_offsets(): - cdef nvmlVgpuSchedulerLogEntry_t pod - return _numpy.dtype({ - 'names': ['timestamp', 'time_run_total', 'time_run', 'sw_runlist_id', 'target_time_slice', 'cumulative_preemption_time'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.timestamp)) - (&pod), - (&(pod.timeRunTotal)) - (&pod), - (&(pod.timeRun)) - (&pod), - (&(pod.swRunlistId)) - (&pod), - (&(pod.targetTimeSlice)) - (&pod), - (&(pod.cumulativePreemptionTime)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogEntry_t), - }) + cdef nvmlVgpuSchedulerLogEntry_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogEntry_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerLogEntry_t") + try: + return _numpy.dtype({ + 'names': ['timestamp', 'time_run_total', 'time_run', 'sw_runlist_id', 'target_time_slice', 'cumulative_preemption_time'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.timestamp)) - (pod), + (&(pod.timeRunTotal)) - (pod), + (&(pod.timeRun)) - (pod), + (&(pod.swRunlistId)) - (pod), + (&(pod.targetTimeSlice)) - (pod), + (&(pod.cumulativePreemptionTime)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogEntry_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_log_entry_dtype = _get_vgpu_scheduler_log_entry_dtype_offsets() cdef object vgpu_scheduler_log_entry_dtype_record = _numpy.dtype((_numpy.record, vgpu_scheduler_log_entry_dtype)) @@ -8909,16 +9059,21 @@ cdef class VgpuSchedulerLogEntry: cdef _get__py_anon_pod4_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod4 pod - return _numpy.dtype({ - 'names': ['avg_factor', 'frequency'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.avgFactor)) - (&pod), - (&(pod.frequency)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod4), - }) + cdef cuda_bindings_nvml__anon_pod4 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod4)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod4") + try: + return _numpy.dtype({ + 'names': ['avg_factor', 'frequency'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.avgFactor)) - (pod), + (&(pod.frequency)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod4), + }) + finally: + _cyb_free(pod) _py_anon_pod4_dtype = _get__py_anon_pod4_dtype_offsets() @@ -9058,15 +9213,20 @@ cdef class _py_anon_pod4: cdef _get__py_anon_pod5_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod5 pod - return _numpy.dtype({ - 'names': ['timeslice'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.timeslice)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod5), - }) + cdef cuda_bindings_nvml__anon_pod5 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod5)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod5") + try: + return _numpy.dtype({ + 'names': ['timeslice'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.timeslice)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod5), + }) + finally: + _cyb_free(pod) _py_anon_pod5_dtype = _get__py_anon_pod5_dtype_offsets() @@ -9195,22 +9355,27 @@ cdef class _py_anon_pod5: cdef _get_vgpu_scheduler_capabilities_dtype_offsets(): - cdef nvmlVgpuSchedulerCapabilities_t pod - return _numpy.dtype({ - 'names': ['supported_schedulers', 'max_timeslice', 'min_timeslice', 'is_arr_mode_supported', 'max_frequency_for_arr', 'min_frequency_for_arr', 'max_avg_factor_for_arr', 'min_avg_factor_for_arr'], - 'formats': [(_numpy.uint32, 3), _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.supportedSchedulers)) - (&pod), - (&(pod.maxTimeslice)) - (&pod), - (&(pod.minTimeslice)) - (&pod), - (&(pod.isArrModeSupported)) - (&pod), - (&(pod.maxFrequencyForARR)) - (&pod), - (&(pod.minFrequencyForARR)) - (&pod), - (&(pod.maxAvgFactorForARR)) - (&pod), - (&(pod.minAvgFactorForARR)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerCapabilities_t), - }) + cdef nvmlVgpuSchedulerCapabilities_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerCapabilities_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerCapabilities_t") + try: + return _numpy.dtype({ + 'names': ['supported_schedulers', 'max_timeslice', 'min_timeslice', 'is_arr_mode_supported', 'max_frequency_for_arr', 'min_frequency_for_arr', 'max_avg_factor_for_arr', 'min_avg_factor_for_arr'], + 'formats': [(_numpy.uint32, 3), _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.supportedSchedulers)) - (pod), + (&(pod.maxTimeslice)) - (pod), + (&(pod.minTimeslice)) - (pod), + (&(pod.isArrModeSupported)) - (pod), + (&(pod.maxFrequencyForARR)) - (pod), + (&(pod.minFrequencyForARR)) - (pod), + (&(pod.maxAvgFactorForARR)) - (pod), + (&(pod.minAvgFactorForARR)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerCapabilities_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_capabilities_dtype = _get_vgpu_scheduler_capabilities_dtype_offsets() @@ -9410,21 +9575,26 @@ cdef class VgpuSchedulerCapabilities: cdef _get_vgpu_license_expiry_dtype_offsets(): - cdef nvmlVgpuLicenseExpiry_t pod - return _numpy.dtype({ - 'names': ['year', 'month', 'day', 'hour', 'min_', 'sec', 'status'], - 'formats': [_numpy.uint32, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint8], - 'offsets': [ - (&(pod.year)) - (&pod), - (&(pod.month)) - (&pod), - (&(pod.day)) - (&pod), - (&(pod.hour)) - (&pod), - (&(pod.min)) - (&pod), - (&(pod.sec)) - (&pod), - (&(pod.status)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuLicenseExpiry_t), - }) + cdef nvmlVgpuLicenseExpiry_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuLicenseExpiry_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuLicenseExpiry_t") + try: + return _numpy.dtype({ + 'names': ['year', 'month', 'day', 'hour', 'min_', 'sec', 'status'], + 'formats': [_numpy.uint32, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint8], + 'offsets': [ + (&(pod.year)) - (pod), + (&(pod.month)) - (pod), + (&(pod.day)) - (pod), + (&(pod.hour)) - (pod), + (&(pod.min)) - (pod), + (&(pod.sec)) - (pod), + (&(pod.status)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuLicenseExpiry_t), + }) + finally: + _cyb_free(pod) vgpu_license_expiry_dtype = _get_vgpu_license_expiry_dtype_offsets() @@ -9619,21 +9789,26 @@ cdef class VgpuLicenseExpiry: cdef _get_grid_license_expiry_dtype_offsets(): - cdef nvmlGridLicenseExpiry_t pod - return _numpy.dtype({ - 'names': ['year', 'month', 'day', 'hour', 'min_', 'sec', 'status'], - 'formats': [_numpy.uint32, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint8], - 'offsets': [ - (&(pod.year)) - (&pod), - (&(pod.month)) - (&pod), - (&(pod.day)) - (&pod), - (&(pod.hour)) - (&pod), - (&(pod.min)) - (&pod), - (&(pod.sec)) - (&pod), - (&(pod.status)) - (&pod), - ], - 'itemsize': sizeof(nvmlGridLicenseExpiry_t), - }) + cdef nvmlGridLicenseExpiry_t *pod = _cyb_calloc(1, sizeof(nvmlGridLicenseExpiry_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGridLicenseExpiry_t") + try: + return _numpy.dtype({ + 'names': ['year', 'month', 'day', 'hour', 'min_', 'sec', 'status'], + 'formats': [_numpy.uint32, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint8], + 'offsets': [ + (&(pod.year)) - (pod), + (&(pod.month)) - (pod), + (&(pod.day)) - (pod), + (&(pod.hour)) - (pod), + (&(pod.min)) - (pod), + (&(pod.sec)) - (pod), + (&(pod.status)) - (pod), + ], + 'itemsize': sizeof(nvmlGridLicenseExpiry_t), + }) + finally: + _cyb_free(pod) grid_license_expiry_dtype = _get_grid_license_expiry_dtype_offsets() @@ -9828,17 +10003,22 @@ cdef class GridLicenseExpiry: cdef _get_vgpu_type_id_info_v1_dtype_offsets(): - cdef nvmlVgpuTypeIdInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'vgpu_count', 'vgpu_type_ids'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.vgpuCount)) - (&pod), - (&(pod.vgpuTypeIds)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuTypeIdInfo_v1_t), - }) + cdef nvmlVgpuTypeIdInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuTypeIdInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuTypeIdInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'vgpu_count', 'vgpu_type_ids'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.vgpuCount)) - (pod), + (&(pod.vgpuTypeIds)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuTypeIdInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_type_id_info_v1_dtype = _get_vgpu_type_id_info_v1_dtype_offsets() @@ -9977,17 +10157,22 @@ cdef class VgpuTypeIdInfo_v1: cdef _get_active_vgpu_instance_info_v1_dtype_offsets(): - cdef nvmlActiveVgpuInstanceInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'vgpu_count', 'vgpu_instances'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.vgpuCount)) - (&pod), - (&(pod.vgpuInstances)) - (&pod), - ], - 'itemsize': sizeof(nvmlActiveVgpuInstanceInfo_v1_t), - }) + cdef nvmlActiveVgpuInstanceInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlActiveVgpuInstanceInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'vgpu_count', 'vgpu_instances'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.vgpuCount)) - (pod), + (&(pod.vgpuInstances)) - (pod), + ], + 'itemsize': sizeof(nvmlActiveVgpuInstanceInfo_v1_t), + }) + finally: + _cyb_free(pod) active_vgpu_instance_info_v1_dtype = _get_active_vgpu_instance_info_v1_dtype_offsets() @@ -10126,19 +10311,24 @@ cdef class ActiveVgpuInstanceInfo_v1: cdef _get_vgpu_creatable_placement_info_v1_dtype_offsets(): - cdef nvmlVgpuCreatablePlacementInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'vgpu_type_id', 'count', 'placement_ids', 'placement_size'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.vgpuTypeId)) - (&pod), - (&(pod.count)) - (&pod), - (&(pod.placementIds)) - (&pod), - (&(pod.placementSize)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuCreatablePlacementInfo_v1_t), - }) + cdef nvmlVgpuCreatablePlacementInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuCreatablePlacementInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'vgpu_type_id', 'count', 'placement_ids', 'placement_size'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.vgpuTypeId)) - (pod), + (&(pod.count)) - (pod), + (&(pod.placementIds)) - (pod), + (&(pod.placementSize)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuCreatablePlacementInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_creatable_placement_info_v1_dtype = _get_vgpu_creatable_placement_info_v1_dtype_offsets() @@ -10299,16 +10489,21 @@ cdef class VgpuCreatablePlacementInfo_v1: cdef _get_hwbc_entry_dtype_offsets(): - cdef nvmlHwbcEntry_t pod - return _numpy.dtype({ - 'names': ['hwbc_id', 'firmware_version'], - 'formats': [_numpy.uint32, (_numpy.int8, 32)], - 'offsets': [ - (&(pod.hwbcId)) - (&pod), - (&(pod.firmwareVersion)) - (&pod), - ], - 'itemsize': sizeof(nvmlHwbcEntry_t), - }) + cdef nvmlHwbcEntry_t *pod = _cyb_calloc(1, sizeof(nvmlHwbcEntry_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlHwbcEntry_t") + try: + return _numpy.dtype({ + 'names': ['hwbc_id', 'firmware_version'], + 'formats': [_numpy.uint32, (_numpy.int8, 32)], + 'offsets': [ + (&(pod.hwbcId)) - (pod), + (&(pod.firmwareVersion)) - (pod), + ], + 'itemsize': sizeof(nvmlHwbcEntry_t), + }) + finally: + _cyb_free(pod) hwbc_entry_dtype = _get_hwbc_entry_dtype_offsets() cdef object hwbc_entry_dtype_record = _numpy.dtype((_numpy.record, hwbc_entry_dtype)) @@ -10465,16 +10660,21 @@ cdef class HwbcEntry: cdef _get_led_state_dtype_offsets(): - cdef nvmlLedState_t pod - return _numpy.dtype({ - 'names': ['cause', 'color'], - 'formats': [(_numpy.int8, 256), _numpy.int32], - 'offsets': [ - (&(pod.cause)) - (&pod), - (&(pod.color)) - (&pod), - ], - 'itemsize': sizeof(nvmlLedState_t), - }) + cdef nvmlLedState_t *pod = _cyb_calloc(1, sizeof(nvmlLedState_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlLedState_t") + try: + return _numpy.dtype({ + 'names': ['cause', 'color'], + 'formats': [(_numpy.int8, 256), _numpy.int32], + 'offsets': [ + (&(pod.cause)) - (pod), + (&(pod.color)) - (pod), + ], + 'itemsize': sizeof(nvmlLedState_t), + }) + finally: + _cyb_free(pod) led_state_dtype = _get_led_state_dtype_offsets() @@ -10606,18 +10806,23 @@ cdef class LedState: cdef _get_unit_info_dtype_offsets(): - cdef nvmlUnitInfo_t pod - return _numpy.dtype({ - 'names': ['name', 'id', 'serial', 'firmware_version'], - 'formats': [(_numpy.int8, 96), (_numpy.int8, 96), (_numpy.int8, 96), (_numpy.int8, 96)], - 'offsets': [ - (&(pod.name)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.serial)) - (&pod), - (&(pod.firmwareVersion)) - (&pod), - ], - 'itemsize': sizeof(nvmlUnitInfo_t), - }) + cdef nvmlUnitInfo_t *pod = _cyb_calloc(1, sizeof(nvmlUnitInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlUnitInfo_t") + try: + return _numpy.dtype({ + 'names': ['name', 'id', 'serial', 'firmware_version'], + 'formats': [(_numpy.int8, 96), (_numpy.int8, 96), (_numpy.int8, 96), (_numpy.int8, 96)], + 'offsets': [ + (&(pod.name)) - (pod), + (&(pod.id)) - (pod), + (&(pod.serial)) - (pod), + (&(pod.firmwareVersion)) - (pod), + ], + 'itemsize': sizeof(nvmlUnitInfo_t), + }) + finally: + _cyb_free(pod) unit_info_dtype = _get_unit_info_dtype_offsets() @@ -10783,18 +10988,23 @@ cdef class UnitInfo: cdef _get_psu_info_dtype_offsets(): - cdef nvmlPSUInfo_t pod - return _numpy.dtype({ - 'names': ['state', 'current', 'voltage', 'power'], - 'formats': [(_numpy.int8, 256), _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.state)) - (&pod), - (&(pod.current)) - (&pod), - (&(pod.voltage)) - (&pod), - (&(pod.power)) - (&pod), - ], - 'itemsize': sizeof(nvmlPSUInfo_t), - }) + cdef nvmlPSUInfo_t *pod = _cyb_calloc(1, sizeof(nvmlPSUInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPSUInfo_t") + try: + return _numpy.dtype({ + 'names': ['state', 'current', 'voltage', 'power'], + 'formats': [(_numpy.int8, 256), _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.state)) - (pod), + (&(pod.current)) - (pod), + (&(pod.voltage)) - (pod), + (&(pod.power)) - (pod), + ], + 'itemsize': sizeof(nvmlPSUInfo_t), + }) + finally: + _cyb_free(pod) psu_info_dtype = _get_psu_info_dtype_offsets() @@ -10948,16 +11158,21 @@ cdef class PSUInfo: cdef _get_unit_fan_info_dtype_offsets(): - cdef nvmlUnitFanInfo_t pod - return _numpy.dtype({ - 'names': ['speed', 'state'], - 'formats': [_numpy.uint32, _numpy.int32], - 'offsets': [ - (&(pod.speed)) - (&pod), - (&(pod.state)) - (&pod), - ], - 'itemsize': sizeof(nvmlUnitFanInfo_t), - }) + cdef nvmlUnitFanInfo_t *pod = _cyb_calloc(1, sizeof(nvmlUnitFanInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlUnitFanInfo_t") + try: + return _numpy.dtype({ + 'names': ['speed', 'state'], + 'formats': [_numpy.uint32, _numpy.int32], + 'offsets': [ + (&(pod.speed)) - (pod), + (&(pod.state)) - (pod), + ], + 'itemsize': sizeof(nvmlUnitFanInfo_t), + }) + finally: + _cyb_free(pod) unit_fan_info_dtype = _get_unit_fan_info_dtype_offsets() cdef object unit_fan_info_dtype_record = _numpy.dtype((_numpy.record, unit_fan_info_dtype)) @@ -11116,19 +11331,24 @@ cdef class UnitFanInfo: cdef _get_event_data_dtype_offsets(): - cdef nvmlEventData_t pod - return _numpy.dtype({ - 'names': ['device_', 'event_type', 'event_data', 'gpu_instance_id', 'compute_instance_id'], - 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.device)) - (&pod), - (&(pod.eventType)) - (&pod), - (&(pod.eventData)) - (&pod), - (&(pod.gpuInstanceId)) - (&pod), - (&(pod.computeInstanceId)) - (&pod), - ], - 'itemsize': sizeof(nvmlEventData_t), - }) + cdef nvmlEventData_t *pod = _cyb_calloc(1, sizeof(nvmlEventData_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEventData_t") + try: + return _numpy.dtype({ + 'names': ['device_', 'event_type', 'event_data', 'gpu_instance_id', 'compute_instance_id'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.device)) - (pod), + (&(pod.eventType)) - (pod), + (&(pod.eventData)) - (pod), + (&(pod.gpuInstanceId)) - (pod), + (&(pod.computeInstanceId)) - (pod), + ], + 'itemsize': sizeof(nvmlEventData_t), + }) + finally: + _cyb_free(pod) event_data_dtype = _get_event_data_dtype_offsets() @@ -11289,16 +11509,21 @@ cdef class EventData: cdef _get_system_event_data_v1_dtype_offsets(): - cdef nvmlSystemEventData_v1_t pod - return _numpy.dtype({ - 'names': ['event_type', 'gpu_id'], - 'formats': [_numpy.uint64, _numpy.uint32], - 'offsets': [ - (&(pod.eventType)) - (&pod), - (&(pod.gpuId)) - (&pod), - ], - 'itemsize': sizeof(nvmlSystemEventData_v1_t), - }) + cdef nvmlSystemEventData_v1_t *pod = _cyb_calloc(1, sizeof(nvmlSystemEventData_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlSystemEventData_v1_t") + try: + return _numpy.dtype({ + 'names': ['event_type', 'gpu_id'], + 'formats': [_numpy.uint64, _numpy.uint32], + 'offsets': [ + (&(pod.eventType)) - (pod), + (&(pod.gpuId)) - (pod), + ], + 'itemsize': sizeof(nvmlSystemEventData_v1_t), + }) + finally: + _cyb_free(pod) system_event_data_v1_dtype = _get_system_event_data_v1_dtype_offsets() cdef object system_event_data_v1_dtype_record = _numpy.dtype((_numpy.record, system_event_data_v1_dtype)) @@ -11457,21 +11682,26 @@ cdef class SystemEventData_v1: cdef _get_accounting_stats_dtype_offsets(): - cdef nvmlAccountingStats_t pod - return _numpy.dtype({ - 'names': ['gpu_utilization', 'memory_utilization', 'max_memory_usage', 'time', 'start_time', 'is_running', 'reserved'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, (_numpy.uint32, 5)], - 'offsets': [ - (&(pod.gpuUtilization)) - (&pod), - (&(pod.memoryUtilization)) - (&pod), - (&(pod.maxMemoryUsage)) - (&pod), - (&(pod.time)) - (&pod), - (&(pod.startTime)) - (&pod), - (&(pod.isRunning)) - (&pod), - (&(pod.reserved)) - (&pod), - ], - 'itemsize': sizeof(nvmlAccountingStats_t), - }) + cdef nvmlAccountingStats_t *pod = _cyb_calloc(1, sizeof(nvmlAccountingStats_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlAccountingStats_t") + try: + return _numpy.dtype({ + 'names': ['gpu_utilization', 'memory_utilization', 'max_memory_usage', 'time', 'start_time', 'is_running', 'reserved'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, (_numpy.uint32, 5)], + 'offsets': [ + (&(pod.gpuUtilization)) - (pod), + (&(pod.memoryUtilization)) - (pod), + (&(pod.maxMemoryUsage)) - (pod), + (&(pod.time)) - (pod), + (&(pod.startTime)) - (pod), + (&(pod.isRunning)) - (pod), + (&(pod.reserved)) - (pod), + ], + 'itemsize': sizeof(nvmlAccountingStats_t), + }) + finally: + _cyb_free(pod) accounting_stats_dtype = _get_accounting_stats_dtype_offsets() @@ -11643,22 +11873,27 @@ cdef class AccountingStats: cdef _get_encoder_session_info_dtype_offsets(): - cdef nvmlEncoderSessionInfo_t pod - return _numpy.dtype({ - 'names': ['session_id', 'pid', 'vgpu_instance', 'codec_type', 'h_resolution', 'v_resolution', 'average_fps', 'average_latency'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.sessionId)) - (&pod), - (&(pod.pid)) - (&pod), - (&(pod.vgpuInstance)) - (&pod), - (&(pod.codecType)) - (&pod), - (&(pod.hResolution)) - (&pod), - (&(pod.vResolution)) - (&pod), - (&(pod.averageFps)) - (&pod), - (&(pod.averageLatency)) - (&pod), - ], - 'itemsize': sizeof(nvmlEncoderSessionInfo_t), - }) + cdef nvmlEncoderSessionInfo_t *pod = _cyb_calloc(1, sizeof(nvmlEncoderSessionInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEncoderSessionInfo_t") + try: + return _numpy.dtype({ + 'names': ['session_id', 'pid', 'vgpu_instance', 'codec_type', 'h_resolution', 'v_resolution', 'average_fps', 'average_latency'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.sessionId)) - (pod), + (&(pod.pid)) - (pod), + (&(pod.vgpuInstance)) - (pod), + (&(pod.codecType)) - (pod), + (&(pod.hResolution)) - (pod), + (&(pod.vResolution)) - (pod), + (&(pod.averageFps)) - (pod), + (&(pod.averageLatency)) - (pod), + ], + 'itemsize': sizeof(nvmlEncoderSessionInfo_t), + }) + finally: + _cyb_free(pod) encoder_session_info_dtype = _get_encoder_session_info_dtype_offsets() cdef object encoder_session_info_dtype_record = _numpy.dtype((_numpy.record, encoder_session_info_dtype)) @@ -11895,17 +12130,22 @@ cdef class EncoderSessionInfo: cdef _get_fbc_stats_dtype_offsets(): - cdef nvmlFBCStats_t pod - return _numpy.dtype({ - 'names': ['sessions_count', 'average_fps', 'average_latency'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.sessionsCount)) - (&pod), - (&(pod.averageFPS)) - (&pod), - (&(pod.averageLatency)) - (&pod), - ], - 'itemsize': sizeof(nvmlFBCStats_t), - }) + cdef nvmlFBCStats_t *pod = _cyb_calloc(1, sizeof(nvmlFBCStats_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlFBCStats_t") + try: + return _numpy.dtype({ + 'names': ['sessions_count', 'average_fps', 'average_latency'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.sessionsCount)) - (pod), + (&(pod.averageFPS)) - (pod), + (&(pod.averageLatency)) - (pod), + ], + 'itemsize': sizeof(nvmlFBCStats_t), + }) + finally: + _cyb_free(pod) fbc_stats_dtype = _get_fbc_stats_dtype_offsets() @@ -12044,26 +12284,31 @@ cdef class FBCStats: cdef _get_fbc_session_info_dtype_offsets(): - cdef nvmlFBCSessionInfo_t pod - return _numpy.dtype({ - 'names': ['session_id', 'pid', 'vgpu_instance', 'display_ordinal', 'session_type', 'session_flags', 'h_max_resolution', 'v_max_resolution', 'h_resolution', 'v_resolution', 'average_fps', 'average_latency'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.sessionId)) - (&pod), - (&(pod.pid)) - (&pod), - (&(pod.vgpuInstance)) - (&pod), - (&(pod.displayOrdinal)) - (&pod), - (&(pod.sessionType)) - (&pod), - (&(pod.sessionFlags)) - (&pod), - (&(pod.hMaxResolution)) - (&pod), - (&(pod.vMaxResolution)) - (&pod), - (&(pod.hResolution)) - (&pod), - (&(pod.vResolution)) - (&pod), - (&(pod.averageFPS)) - (&pod), - (&(pod.averageLatency)) - (&pod), - ], - 'itemsize': sizeof(nvmlFBCSessionInfo_t), - }) + cdef nvmlFBCSessionInfo_t *pod = _cyb_calloc(1, sizeof(nvmlFBCSessionInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlFBCSessionInfo_t") + try: + return _numpy.dtype({ + 'names': ['session_id', 'pid', 'vgpu_instance', 'display_ordinal', 'session_type', 'session_flags', 'h_max_resolution', 'v_max_resolution', 'h_resolution', 'v_resolution', 'average_fps', 'average_latency'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.sessionId)) - (pod), + (&(pod.pid)) - (pod), + (&(pod.vgpuInstance)) - (pod), + (&(pod.displayOrdinal)) - (pod), + (&(pod.sessionType)) - (pod), + (&(pod.sessionFlags)) - (pod), + (&(pod.hMaxResolution)) - (pod), + (&(pod.vMaxResolution)) - (pod), + (&(pod.hResolution)) - (pod), + (&(pod.vResolution)) - (pod), + (&(pod.averageFPS)) - (pod), + (&(pod.averageLatency)) - (pod), + ], + 'itemsize': sizeof(nvmlFBCSessionInfo_t), + }) + finally: + _cyb_free(pod) fbc_session_info_dtype = _get_fbc_session_info_dtype_offsets() cdef object fbc_session_info_dtype_record = _numpy.dtype((_numpy.record, fbc_session_info_dtype)) @@ -12352,16 +12597,21 @@ cdef class FBCSessionInfo: cdef _get_conf_compute_system_caps_dtype_offsets(): - cdef nvmlConfComputeSystemCaps_t pod - return _numpy.dtype({ - 'names': ['cpu_caps', 'gpus_caps'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.cpuCaps)) - (&pod), - (&(pod.gpusCaps)) - (&pod), - ], - 'itemsize': sizeof(nvmlConfComputeSystemCaps_t), - }) + cdef nvmlConfComputeSystemCaps_t *pod = _cyb_calloc(1, sizeof(nvmlConfComputeSystemCaps_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlConfComputeSystemCaps_t") + try: + return _numpy.dtype({ + 'names': ['cpu_caps', 'gpus_caps'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.cpuCaps)) - (pod), + (&(pod.gpusCaps)) - (pod), + ], + 'itemsize': sizeof(nvmlConfComputeSystemCaps_t), + }) + finally: + _cyb_free(pod) conf_compute_system_caps_dtype = _get_conf_compute_system_caps_dtype_offsets() @@ -12489,17 +12739,22 @@ cdef class ConfComputeSystemCaps: cdef _get_conf_compute_system_state_dtype_offsets(): - cdef nvmlConfComputeSystemState_t pod - return _numpy.dtype({ - 'names': ['environment', 'cc_feature', 'dev_tools_mode'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.environment)) - (&pod), - (&(pod.ccFeature)) - (&pod), - (&(pod.devToolsMode)) - (&pod), - ], - 'itemsize': sizeof(nvmlConfComputeSystemState_t), - }) + cdef nvmlConfComputeSystemState_t *pod = _cyb_calloc(1, sizeof(nvmlConfComputeSystemState_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlConfComputeSystemState_t") + try: + return _numpy.dtype({ + 'names': ['environment', 'cc_feature', 'dev_tools_mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.environment)) - (pod), + (&(pod.ccFeature)) - (pod), + (&(pod.devToolsMode)) - (pod), + ], + 'itemsize': sizeof(nvmlConfComputeSystemState_t), + }) + finally: + _cyb_free(pod) conf_compute_system_state_dtype = _get_conf_compute_system_state_dtype_offsets() @@ -12638,19 +12893,24 @@ cdef class ConfComputeSystemState: cdef _get_system_conf_compute_settings_v1_dtype_offsets(): - cdef nvmlSystemConfComputeSettings_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'environment', 'cc_feature', 'dev_tools_mode', 'multi_gpu_mode'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.environment)) - (&pod), - (&(pod.ccFeature)) - (&pod), - (&(pod.devToolsMode)) - (&pod), - (&(pod.multiGpuMode)) - (&pod), - ], - 'itemsize': sizeof(nvmlSystemConfComputeSettings_v1_t), - }) + cdef nvmlSystemConfComputeSettings_v1_t *pod = _cyb_calloc(1, sizeof(nvmlSystemConfComputeSettings_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlSystemConfComputeSettings_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'environment', 'cc_feature', 'dev_tools_mode', 'multi_gpu_mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.environment)) - (pod), + (&(pod.ccFeature)) - (pod), + (&(pod.devToolsMode)) - (pod), + (&(pod.multiGpuMode)) - (pod), + ], + 'itemsize': sizeof(nvmlSystemConfComputeSettings_v1_t), + }) + finally: + _cyb_free(pod) system_conf_compute_settings_v1_dtype = _get_system_conf_compute_settings_v1_dtype_offsets() @@ -12811,16 +13071,21 @@ cdef class SystemConfComputeSettings_v1: cdef _get_conf_compute_mem_size_info_dtype_offsets(): - cdef nvmlConfComputeMemSizeInfo_t pod - return _numpy.dtype({ - 'names': ['protected_mem_size_kib', 'unprotected_mem_size_kib'], - 'formats': [_numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.protectedMemSizeKib)) - (&pod), - (&(pod.unprotectedMemSizeKib)) - (&pod), - ], - 'itemsize': sizeof(nvmlConfComputeMemSizeInfo_t), - }) + cdef nvmlConfComputeMemSizeInfo_t *pod = _cyb_calloc(1, sizeof(nvmlConfComputeMemSizeInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlConfComputeMemSizeInfo_t") + try: + return _numpy.dtype({ + 'names': ['protected_mem_size_kib', 'unprotected_mem_size_kib'], + 'formats': [_numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.protectedMemSizeKib)) - (pod), + (&(pod.unprotectedMemSizeKib)) - (pod), + ], + 'itemsize': sizeof(nvmlConfComputeMemSizeInfo_t), + }) + finally: + _cyb_free(pod) conf_compute_mem_size_info_dtype = _get_conf_compute_mem_size_info_dtype_offsets() @@ -12948,18 +13213,23 @@ cdef class ConfComputeMemSizeInfo: cdef _get_conf_compute_gpu_certificate_dtype_offsets(): - cdef nvmlConfComputeGpuCertificate_t pod - return _numpy.dtype({ - 'names': ['cert_chain_size', 'attestation_cert_chain_size', 'cert_chain', 'attestation_cert_chain'], - 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.uint8, 4096), (_numpy.uint8, 5120)], - 'offsets': [ - (&(pod.certChainSize)) - (&pod), - (&(pod.attestationCertChainSize)) - (&pod), - (&(pod.certChain)) - (&pod), - (&(pod.attestationCertChain)) - (&pod), - ], - 'itemsize': sizeof(nvmlConfComputeGpuCertificate_t), - }) + cdef nvmlConfComputeGpuCertificate_t *pod = _cyb_calloc(1, sizeof(nvmlConfComputeGpuCertificate_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlConfComputeGpuCertificate_t") + try: + return _numpy.dtype({ + 'names': ['cert_chain_size', 'attestation_cert_chain_size', 'cert_chain', 'attestation_cert_chain'], + 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.uint8, 4096), (_numpy.uint8, 5120)], + 'offsets': [ + (&(pod.certChainSize)) - (pod), + (&(pod.attestationCertChainSize)) - (pod), + (&(pod.certChain)) - (pod), + (&(pod.attestationCertChain)) - (pod), + ], + 'itemsize': sizeof(nvmlConfComputeGpuCertificate_t), + }) + finally: + _cyb_free(pod) conf_compute_gpu_certificate_dtype = _get_conf_compute_gpu_certificate_dtype_offsets() @@ -13109,20 +13379,25 @@ cdef class ConfComputeGpuCertificate: cdef _get_conf_compute_gpu_attestation_report_dtype_offsets(): - cdef nvmlConfComputeGpuAttestationReport_t pod - return _numpy.dtype({ - 'names': ['is_cec_attestation_report_present', 'attestation_report_size', 'cec_attestation_report_size', 'nonce', 'attestation_report', 'cec_attestation_report'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.uint8, 32), (_numpy.uint8, 8192), (_numpy.uint8, 4096)], - 'offsets': [ - (&(pod.isCecAttestationReportPresent)) - (&pod), - (&(pod.attestationReportSize)) - (&pod), - (&(pod.cecAttestationReportSize)) - (&pod), - (&(pod.nonce)) - (&pod), - (&(pod.attestationReport)) - (&pod), - (&(pod.cecAttestationReport)) - (&pod), - ], - 'itemsize': sizeof(nvmlConfComputeGpuAttestationReport_t), - }) + cdef nvmlConfComputeGpuAttestationReport_t *pod = _cyb_calloc(1, sizeof(nvmlConfComputeGpuAttestationReport_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlConfComputeGpuAttestationReport_t") + try: + return _numpy.dtype({ + 'names': ['is_cec_attestation_report_present', 'attestation_report_size', 'cec_attestation_report_size', 'nonce', 'attestation_report', 'cec_attestation_report'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.uint8, 32), (_numpy.uint8, 8192), (_numpy.uint8, 4096)], + 'offsets': [ + (&(pod.isCecAttestationReportPresent)) - (pod), + (&(pod.attestationReportSize)) - (pod), + (&(pod.cecAttestationReportSize)) - (pod), + (&(pod.nonce)) - (pod), + (&(pod.attestationReport)) - (pod), + (&(pod.cecAttestationReport)) - (pod), + ], + 'itemsize': sizeof(nvmlConfComputeGpuAttestationReport_t), + }) + finally: + _cyb_free(pod) conf_compute_gpu_attestation_report_dtype = _get_conf_compute_gpu_attestation_report_dtype_offsets() @@ -13300,20 +13575,25 @@ cdef class ConfComputeGpuAttestationReport: cdef _get_gpu_fabric_info_v2_dtype_offsets(): - cdef nvmlGpuFabricInfo_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'cluster_uuid', 'status', 'clique_id', 'state', 'health_mask'], - 'formats': [_numpy.uint32, (_numpy.uint8, 16), _numpy.int32, _numpy.uint32, _numpy.uint8, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.clusterUuid)) - (&pod), - (&(pod.status)) - (&pod), - (&(pod.cliqueId)) - (&pod), - (&(pod.state)) - (&pod), - (&(pod.healthMask)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuFabricInfo_v2_t), - }) + cdef nvmlGpuFabricInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlGpuFabricInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuFabricInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'cluster_uuid', 'status', 'clique_id', 'state', 'health_mask'], + 'formats': [_numpy.uint32, (_numpy.uint8, 16), _numpy.int32, _numpy.uint32, _numpy.uint8, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.clusterUuid)) - (pod), + (&(pod.status)) - (pod), + (&(pod.cliqueId)) - (pod), + (&(pod.state)) - (pod), + (&(pod.healthMask)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuFabricInfo_v2_t), + }) + finally: + _cyb_free(pod) gpu_fabric_info_v2_dtype = _get_gpu_fabric_info_v2_dtype_offsets() @@ -13491,17 +13771,22 @@ cdef class GpuFabricInfo_v2: cdef _get_nvlink_supported_bw_modes_v1_dtype_offsets(): - cdef nvmlNvlinkSupportedBwModes_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'bw_modes', 'total_bw_modes'], - 'formats': [_numpy.uint32, (_numpy.uint8, 23), _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.bwModes)) - (&pod), - (&(pod.totalBwModes)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkSupportedBwModes_v1_t), - }) + cdef nvmlNvlinkSupportedBwModes_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkSupportedBwModes_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'bw_modes', 'total_bw_modes'], + 'formats': [_numpy.uint32, (_numpy.uint8, 23), _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.bwModes)) - (pod), + (&(pod.totalBwModes)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkSupportedBwModes_v1_t), + }) + finally: + _cyb_free(pod) nvlink_supported_bw_modes_v1_dtype = _get_nvlink_supported_bw_modes_v1_dtype_offsets() @@ -13640,17 +13925,22 @@ cdef class NvlinkSupportedBwModes_v1: cdef _get_nvlink_get_bw_mode_v1_dtype_offsets(): - cdef nvmlNvlinkGetBwMode_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'b_is_best', 'bw_mode'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.bIsBest)) - (&pod), - (&(pod.bwMode)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkGetBwMode_v1_t), - }) + cdef nvmlNvlinkGetBwMode_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkGetBwMode_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkGetBwMode_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'b_is_best', 'bw_mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.bIsBest)) - (pod), + (&(pod.bwMode)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkGetBwMode_v1_t), + }) + finally: + _cyb_free(pod) nvlink_get_bw_mode_v1_dtype = _get_nvlink_get_bw_mode_v1_dtype_offsets() @@ -13789,17 +14079,22 @@ cdef class NvlinkGetBwMode_v1: cdef _get_nvlink_set_bw_mode_v1_dtype_offsets(): - cdef nvmlNvlinkSetBwMode_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'b_set_best', 'bw_mode'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.bSetBest)) - (&pod), - (&(pod.bwMode)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkSetBwMode_v1_t), - }) + cdef nvmlNvlinkSetBwMode_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkSetBwMode_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkSetBwMode_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'b_set_best', 'bw_mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.bSetBest)) - (pod), + (&(pod.bwMode)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkSetBwMode_v1_t), + }) + finally: + _cyb_free(pod) nvlink_set_bw_mode_v1_dtype = _get_nvlink_set_bw_mode_v1_dtype_offsets() @@ -13938,16 +14233,21 @@ cdef class NvlinkSetBwMode_v1: cdef _get_vgpu_version_dtype_offsets(): - cdef nvmlVgpuVersion_t pod - return _numpy.dtype({ - 'names': ['min_version', 'max_version'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.minVersion)) - (&pod), - (&(pod.maxVersion)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuVersion_t), - }) + cdef nvmlVgpuVersion_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuVersion_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuVersion_t") + try: + return _numpy.dtype({ + 'names': ['min_version', 'max_version'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.minVersion)) - (pod), + (&(pod.maxVersion)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuVersion_t), + }) + finally: + _cyb_free(pod) vgpu_version_dtype = _get_vgpu_version_dtype_offsets() @@ -14087,24 +14387,29 @@ cdef class VgpuVersion: cdef _get_vgpu_metadata_dtype_offsets(): - cdef nvmlVgpuMetadata_t pod - return _numpy.dtype({ - 'names': ['version', 'revision', 'guest_info_state', 'guest_driver_version', 'host_driver_version', 'reserved', 'vgpu_virtualization_caps', 'guest_vgpu_version', 'opaque_data_size', 'opaque_data'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int32, (_numpy.int8, 80), (_numpy.int8, 80), (_numpy.uint32, 6), _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 4)], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.revision)) - (&pod), - (&(pod.guestInfoState)) - (&pod), - (&(pod.guestDriverVersion)) - (&pod), - (&(pod.hostDriverVersion)) - (&pod), - (&(pod.reserved)) - (&pod), - (&(pod.vgpuVirtualizationCaps)) - (&pod), - (&(pod.guestVgpuVersion)) - (&pod), - (&(pod.opaqueDataSize)) - (&pod), - (&(pod.opaqueData)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuMetadata_t), - }) + cdef nvmlVgpuMetadata_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuMetadata_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuMetadata_t") + try: + return _numpy.dtype({ + 'names': ['version', 'revision', 'guest_info_state', 'guest_driver_version', 'host_driver_version', 'reserved', 'vgpu_virtualization_caps', 'guest_vgpu_version', 'opaque_data_size', 'opaque_data'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int32, (_numpy.int8, 80), (_numpy.int8, 80), (_numpy.uint32, 6), _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 4)], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.revision)) - (pod), + (&(pod.guestInfoState)) - (pod), + (&(pod.guestDriverVersion)) - (pod), + (&(pod.hostDriverVersion)) - (pod), + (&(pod.reserved)) - (pod), + (&(pod.vgpuVirtualizationCaps)) - (pod), + (&(pod.guestVgpuVersion)) - (pod), + (&(pod.opaqueDataSize)) - (pod), + (&(pod.opaqueData)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuMetadata_t), + }) + finally: + _cyb_free(pod) vgpu_metadata_dtype = _get_vgpu_metadata_dtype_offsets() @@ -14321,16 +14626,21 @@ cdef class VgpuMetadata: cdef _get_vgpu_pgpu_compatibility_dtype_offsets(): - cdef nvmlVgpuPgpuCompatibility_t pod - return _numpy.dtype({ - 'names': ['vgpu_vm_compatibility', 'compatibility_limit_code'], - 'formats': [_numpy.int32, _numpy.int32], - 'offsets': [ - (&(pod.vgpuVmCompatibility)) - (&pod), - (&(pod.compatibilityLimitCode)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuPgpuCompatibility_t), - }) + cdef nvmlVgpuPgpuCompatibility_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuPgpuCompatibility_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuPgpuCompatibility_t") + try: + return _numpy.dtype({ + 'names': ['vgpu_vm_compatibility', 'compatibility_limit_code'], + 'formats': [_numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.vgpuVmCompatibility)) - (pod), + (&(pod.compatibilityLimitCode)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuPgpuCompatibility_t), + }) + finally: + _cyb_free(pod) vgpu_pgpu_compatibility_dtype = _get_vgpu_pgpu_compatibility_dtype_offsets() @@ -14458,16 +14768,21 @@ cdef class VgpuPgpuCompatibility: cdef _get_gpu_instance_placement_dtype_offsets(): - cdef nvmlGpuInstancePlacement_t pod - return _numpy.dtype({ - 'names': ['start', 'size_'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.start)) - (&pod), - (&(pod.size)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuInstancePlacement_t), - }) + cdef nvmlGpuInstancePlacement_t *pod = _cyb_calloc(1, sizeof(nvmlGpuInstancePlacement_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuInstancePlacement_t") + try: + return _numpy.dtype({ + 'names': ['start', 'size_'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.start)) - (pod), + (&(pod.size)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuInstancePlacement_t), + }) + finally: + _cyb_free(pod) gpu_instance_placement_dtype = _get_gpu_instance_placement_dtype_offsets() cdef object gpu_instance_placement_dtype_record = _numpy.dtype((_numpy.record, gpu_instance_placement_dtype)) @@ -14626,27 +14941,32 @@ cdef class GpuInstancePlacement: cdef _get_gpu_instance_profile_info_v3_dtype_offsets(): - cdef nvmlGpuInstanceProfileInfo_v3_t pod - return _numpy.dtype({ - 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'copy_engine_count', 'decoder_count', 'encoder_count', 'jpeg_count', 'ofa_count', 'memory_size_mb', 'name', 'capabilities'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64, (_numpy.int8, 96), _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.sliceCount)) - (&pod), - (&(pod.instanceCount)) - (&pod), - (&(pod.multiprocessorCount)) - (&pod), - (&(pod.copyEngineCount)) - (&pod), - (&(pod.decoderCount)) - (&pod), - (&(pod.encoderCount)) - (&pod), - (&(pod.jpegCount)) - (&pod), - (&(pod.ofaCount)) - (&pod), - (&(pod.memorySizeMB)) - (&pod), - (&(pod.name)) - (&pod), - (&(pod.capabilities)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuInstanceProfileInfo_v3_t), - }) + cdef nvmlGpuInstanceProfileInfo_v3_t *pod = _cyb_calloc(1, sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuInstanceProfileInfo_v3_t") + try: + return _numpy.dtype({ + 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'copy_engine_count', 'decoder_count', 'encoder_count', 'jpeg_count', 'ofa_count', 'memory_size_mb', 'name', 'capabilities'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64, (_numpy.int8, 96), _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.id)) - (pod), + (&(pod.sliceCount)) - (pod), + (&(pod.instanceCount)) - (pod), + (&(pod.multiprocessorCount)) - (pod), + (&(pod.copyEngineCount)) - (pod), + (&(pod.decoderCount)) - (pod), + (&(pod.encoderCount)) - (pod), + (&(pod.jpegCount)) - (pod), + (&(pod.ofaCount)) - (pod), + (&(pod.memorySizeMB)) - (pod), + (&(pod.name)) - (pod), + (&(pod.capabilities)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuInstanceProfileInfo_v3_t), + }) + finally: + _cyb_free(pod) gpu_instance_profile_info_v3_dtype = _get_gpu_instance_profile_info_v3_dtype_offsets() @@ -14899,16 +15219,21 @@ cdef class GpuInstanceProfileInfo_v3: cdef _get_compute_instance_placement_dtype_offsets(): - cdef nvmlComputeInstancePlacement_t pod - return _numpy.dtype({ - 'names': ['start', 'size_'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.start)) - (&pod), - (&(pod.size)) - (&pod), - ], - 'itemsize': sizeof(nvmlComputeInstancePlacement_t), - }) + cdef nvmlComputeInstancePlacement_t *pod = _cyb_calloc(1, sizeof(nvmlComputeInstancePlacement_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlComputeInstancePlacement_t") + try: + return _numpy.dtype({ + 'names': ['start', 'size_'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.start)) - (pod), + (&(pod.size)) - (pod), + ], + 'itemsize': sizeof(nvmlComputeInstancePlacement_t), + }) + finally: + _cyb_free(pod) compute_instance_placement_dtype = _get_compute_instance_placement_dtype_offsets() cdef object compute_instance_placement_dtype_record = _numpy.dtype((_numpy.record, compute_instance_placement_dtype)) @@ -15067,25 +15392,30 @@ cdef class ComputeInstancePlacement: cdef _get_compute_instance_profile_info_v2_dtype_offsets(): - cdef nvmlComputeInstanceProfileInfo_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'name'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 96)], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.sliceCount)) - (&pod), - (&(pod.instanceCount)) - (&pod), - (&(pod.multiprocessorCount)) - (&pod), - (&(pod.sharedCopyEngineCount)) - (&pod), - (&(pod.sharedDecoderCount)) - (&pod), - (&(pod.sharedEncoderCount)) - (&pod), - (&(pod.sharedJpegCount)) - (&pod), - (&(pod.sharedOfaCount)) - (&pod), - (&(pod.name)) - (&pod), - ], - 'itemsize': sizeof(nvmlComputeInstanceProfileInfo_v2_t), - }) + cdef nvmlComputeInstanceProfileInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlComputeInstanceProfileInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlComputeInstanceProfileInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'name'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 96)], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.id)) - (pod), + (&(pod.sliceCount)) - (pod), + (&(pod.instanceCount)) - (pod), + (&(pod.multiprocessorCount)) - (pod), + (&(pod.sharedCopyEngineCount)) - (pod), + (&(pod.sharedDecoderCount)) - (pod), + (&(pod.sharedEncoderCount)) - (pod), + (&(pod.sharedJpegCount)) - (pod), + (&(pod.sharedOfaCount)) - (pod), + (&(pod.name)) - (pod), + ], + 'itemsize': sizeof(nvmlComputeInstanceProfileInfo_v2_t), + }) + finally: + _cyb_free(pod) compute_instance_profile_info_v2_dtype = _get_compute_instance_profile_info_v2_dtype_offsets() @@ -15316,26 +15646,31 @@ cdef class ComputeInstanceProfileInfo_v2: cdef _get_compute_instance_profile_info_v3_dtype_offsets(): - cdef nvmlComputeInstanceProfileInfo_v3_t pod - return _numpy.dtype({ - 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'name', 'capabilities'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 96), _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.sliceCount)) - (&pod), - (&(pod.instanceCount)) - (&pod), - (&(pod.multiprocessorCount)) - (&pod), - (&(pod.sharedCopyEngineCount)) - (&pod), - (&(pod.sharedDecoderCount)) - (&pod), - (&(pod.sharedEncoderCount)) - (&pod), - (&(pod.sharedJpegCount)) - (&pod), - (&(pod.sharedOfaCount)) - (&pod), - (&(pod.name)) - (&pod), - (&(pod.capabilities)) - (&pod), - ], - 'itemsize': sizeof(nvmlComputeInstanceProfileInfo_v3_t), - }) + cdef nvmlComputeInstanceProfileInfo_v3_t *pod = _cyb_calloc(1, sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlComputeInstanceProfileInfo_v3_t") + try: + return _numpy.dtype({ + 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'name', 'capabilities'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 96), _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.id)) - (pod), + (&(pod.sliceCount)) - (pod), + (&(pod.instanceCount)) - (pod), + (&(pod.multiprocessorCount)) - (pod), + (&(pod.sharedCopyEngineCount)) - (pod), + (&(pod.sharedDecoderCount)) - (pod), + (&(pod.sharedEncoderCount)) - (pod), + (&(pod.sharedJpegCount)) - (pod), + (&(pod.sharedOfaCount)) - (pod), + (&(pod.name)) - (pod), + (&(pod.capabilities)) - (pod), + ], + 'itemsize': sizeof(nvmlComputeInstanceProfileInfo_v3_t), + }) + finally: + _cyb_free(pod) compute_instance_profile_info_v3_dtype = _get_compute_instance_profile_info_v3_dtype_offsets() @@ -15577,16 +15912,21 @@ cdef class ComputeInstanceProfileInfo_v3: cdef _get_device_addressing_mode_v1_dtype_offsets(): - cdef nvmlDeviceAddressingMode_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'value'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.value)) - (&pod), - ], - 'itemsize': sizeof(nvmlDeviceAddressingMode_v1_t), - }) + cdef nvmlDeviceAddressingMode_v1_t *pod = _cyb_calloc(1, sizeof(nvmlDeviceAddressingMode_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlDeviceAddressingMode_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'value'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.value)) - (pod), + ], + 'itemsize': sizeof(nvmlDeviceAddressingMode_v1_t), + }) + finally: + _cyb_free(pod) device_addressing_mode_v1_dtype = _get_device_addressing_mode_v1_dtype_offsets() @@ -15714,17 +16054,22 @@ cdef class DeviceAddressingMode_v1: cdef _get_repair_status_v1_dtype_offsets(): - cdef nvmlRepairStatus_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'b_channel_repair_pending', 'b_tpc_repair_pending'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.bChannelRepairPending)) - (&pod), - (&(pod.bTpcRepairPending)) - (&pod), - ], - 'itemsize': sizeof(nvmlRepairStatus_v1_t), - }) + cdef nvmlRepairStatus_v1_t *pod = _cyb_calloc(1, sizeof(nvmlRepairStatus_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlRepairStatus_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'b_channel_repair_pending', 'b_tpc_repair_pending'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.bChannelRepairPending)) - (pod), + (&(pod.bTpcRepairPending)) - (pod), + ], + 'itemsize': sizeof(nvmlRepairStatus_v1_t), + }) + finally: + _cyb_free(pod) repair_status_v1_dtype = _get_repair_status_v1_dtype_offsets() @@ -15863,17 +16208,22 @@ cdef class RepairStatus_v1: cdef _get_device_power_mizer_modes_v1_dtype_offsets(): - cdef nvmlDevicePowerMizerModes_v1_t pod - return _numpy.dtype({ - 'names': ['current_mode', 'mode', 'supported_power_mizer_modes'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.currentMode)) - (&pod), - (&(pod.mode)) - (&pod), - (&(pod.supportedPowerMizerModes)) - (&pod), - ], - 'itemsize': sizeof(nvmlDevicePowerMizerModes_v1_t), - }) + cdef nvmlDevicePowerMizerModes_v1_t *pod = _cyb_calloc(1, sizeof(nvmlDevicePowerMizerModes_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlDevicePowerMizerModes_v1_t") + try: + return _numpy.dtype({ + 'names': ['current_mode', 'mode', 'supported_power_mizer_modes'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.currentMode)) - (pod), + (&(pod.mode)) - (pod), + (&(pod.supportedPowerMizerModes)) - (pod), + ], + 'itemsize': sizeof(nvmlDevicePowerMizerModes_v1_t), + }) + finally: + _cyb_free(pod) device_power_mizer_modes_v1_dtype = _get_device_power_mizer_modes_v1_dtype_offsets() @@ -16012,21 +16362,26 @@ cdef class DevicePowerMizerModes_v1: cdef _get_ecc_sram_unique_uncorrected_error_entry_v1_dtype_offsets(): - cdef nvmlEccSramUniqueUncorrectedErrorEntry_v1_t pod - return _numpy.dtype({ - 'names': ['unit', 'location', 'sublocation', 'extlocation', 'address', 'is_parity', 'count'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.unit)) - (&pod), - (&(pod.location)) - (&pod), - (&(pod.sublocation)) - (&pod), - (&(pod.extlocation)) - (&pod), - (&(pod.address)) - (&pod), - (&(pod.isParity)) - (&pod), - (&(pod.count)) - (&pod), - ], - 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorEntry_v1_t), - }) + cdef nvmlEccSramUniqueUncorrectedErrorEntry_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEccSramUniqueUncorrectedErrorEntry_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEccSramUniqueUncorrectedErrorEntry_v1_t") + try: + return _numpy.dtype({ + 'names': ['unit', 'location', 'sublocation', 'extlocation', 'address', 'is_parity', 'count'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.unit)) - (pod), + (&(pod.location)) - (pod), + (&(pod.sublocation)) - (pod), + (&(pod.extlocation)) - (pod), + (&(pod.address)) - (pod), + (&(pod.isParity)) - (pod), + (&(pod.count)) - (pod), + ], + 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorEntry_v1_t), + }) + finally: + _cyb_free(pod) ecc_sram_unique_uncorrected_error_entry_v1_dtype = _get_ecc_sram_unique_uncorrected_error_entry_v1_dtype_offsets() cdef object ecc_sram_unique_uncorrected_error_entry_v1_dtype_record = _numpy.dtype((_numpy.record, ecc_sram_unique_uncorrected_error_entry_v1_dtype)) @@ -16250,21 +16605,26 @@ cdef class EccSramUniqueUncorrectedErrorEntry_v1: cdef _get_gpu_fabric_info_v3_dtype_offsets(): - cdef nvmlGpuFabricInfo_v3_t pod - return _numpy.dtype({ - 'names': ['version', 'cluster_uuid', 'status', 'clique_id', 'state', 'health_mask', 'health_summary'], - 'formats': [_numpy.uint32, (_numpy.uint8, 16), _numpy.int32, _numpy.uint32, _numpy.uint8, _numpy.uint32, _numpy.uint8], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.clusterUuid)) - (&pod), - (&(pod.status)) - (&pod), - (&(pod.cliqueId)) - (&pod), - (&(pod.state)) - (&pod), - (&(pod.healthMask)) - (&pod), - (&(pod.healthSummary)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuFabricInfo_v3_t), - }) + cdef nvmlGpuFabricInfo_v3_t *pod = _cyb_calloc(1, sizeof(nvmlGpuFabricInfo_v3_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuFabricInfo_v3_t") + try: + return _numpy.dtype({ + 'names': ['version', 'cluster_uuid', 'status', 'clique_id', 'state', 'health_mask', 'health_summary'], + 'formats': [_numpy.uint32, (_numpy.uint8, 16), _numpy.int32, _numpy.uint32, _numpy.uint8, _numpy.uint32, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.clusterUuid)) - (pod), + (&(pod.status)) - (pod), + (&(pod.cliqueId)) - (pod), + (&(pod.state)) - (pod), + (&(pod.healthMask)) - (pod), + (&(pod.healthSummary)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuFabricInfo_v3_t), + }) + finally: + _cyb_free(pod) gpu_fabric_info_v3_dtype = _get_gpu_fabric_info_v3_dtype_offsets() @@ -16453,16 +16813,21 @@ cdef class GpuFabricInfo_v3: cdef _get_nv_link_info_v1_dtype_offsets(): - cdef nvmlNvLinkInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'is_nvle_enabled'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.isNvleEnabled)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvLinkInfo_v1_t), - }) + cdef nvmlNvLinkInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvLinkInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'is_nvle_enabled'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.isNvleEnabled)) - (pod), + ], + 'itemsize': sizeof(nvmlNvLinkInfo_v1_t), + }) + finally: + _cyb_free(pod) nv_link_info_v1_dtype = _get_nv_link_info_v1_dtype_offsets() @@ -16590,18 +16955,23 @@ cdef class NvLinkInfo_v1: cdef _get_nvlink_firmware_version_dtype_offsets(): - cdef nvmlNvlinkFirmwareVersion_t pod - return _numpy.dtype({ - 'names': ['ucode_type', 'major', 'minor', 'sub_minor'], - 'formats': [_numpy.uint8, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.ucodeType)) - (&pod), - (&(pod.major)) - (&pod), - (&(pod.minor)) - (&pod), - (&(pod.subMinor)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkFirmwareVersion_t), - }) + cdef nvmlNvlinkFirmwareVersion_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkFirmwareVersion_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkFirmwareVersion_t") + try: + return _numpy.dtype({ + 'names': ['ucode_type', 'major', 'minor', 'sub_minor'], + 'formats': [_numpy.uint8, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.ucodeType)) - (pod), + (&(pod.major)) - (pod), + (&(pod.minor)) - (pod), + (&(pod.subMinor)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkFirmwareVersion_t), + }) + finally: + _cyb_free(pod) nvlink_firmware_version_dtype = _get_nvlink_firmware_version_dtype_offsets() cdef object nvlink_firmware_version_dtype_record = _numpy.dtype((_numpy.record, nvlink_firmware_version_dtype)) @@ -16786,15 +17156,20 @@ cdef class NvlinkFirmwareVersion: cdef _get_prm_counter_input_v1_dtype_offsets(): - cdef nvmlPRMCounterInput_v1_t pod - return _numpy.dtype({ - 'names': ['local_port'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.localPort)) - (&pod), - ], - 'itemsize': sizeof(nvmlPRMCounterInput_v1_t), - }) + cdef nvmlPRMCounterInput_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPRMCounterInput_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPRMCounterInput_v1_t") + try: + return _numpy.dtype({ + 'names': ['local_port'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.localPort)) - (pod), + ], + 'itemsize': sizeof(nvmlPRMCounterInput_v1_t), + }) + finally: + _cyb_free(pod) prm_counter_input_v1_dtype = _get_prm_counter_input_v1_dtype_offsets() @@ -16923,18 +17298,23 @@ cdef class PRMCounterInput_v1: cdef _get_vgpu_scheduler_state_info_v2_dtype_offsets(): - cdef nvmlVgpuSchedulerStateInfo_v2_t pod - return _numpy.dtype({ - 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.avgFactor)) - (&pod), - (&(pod.timeslice)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v2_t), - }) + cdef nvmlVgpuSchedulerStateInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerStateInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.avgFactor)) - (pod), + (&(pod.timeslice)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v2_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_state_info_v2_dtype = _get_vgpu_scheduler_state_info_v2_dtype_offsets() @@ -17084,21 +17464,26 @@ cdef class VgpuSchedulerStateInfo_v2: cdef _get_vgpu_scheduler_log_entry_v2_dtype_offsets(): - cdef nvmlVgpuSchedulerLogEntry_v2_t pod - return _numpy.dtype({ - 'names': ['timestamp', 'time_run_total', 'time_run', 'sw_runlist_id', 'target_time_slice', 'cumulative_preemption_time', 'weight'], - 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint32], - 'offsets': [ - (&(pod.timestamp)) - (&pod), - (&(pod.timeRunTotal)) - (&pod), - (&(pod.timeRun)) - (&pod), - (&(pod.swRunlistId)) - (&pod), - (&(pod.targetTimeSlice)) - (&pod), - (&(pod.cumulativePreemptionTime)) - (&pod), - (&(pod.weight)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogEntry_v2_t), - }) + cdef nvmlVgpuSchedulerLogEntry_v2_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogEntry_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerLogEntry_v2_t") + try: + return _numpy.dtype({ + 'names': ['timestamp', 'time_run_total', 'time_run', 'sw_runlist_id', 'target_time_slice', 'cumulative_preemption_time', 'weight'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint32], + 'offsets': [ + (&(pod.timestamp)) - (pod), + (&(pod.timeRunTotal)) - (pod), + (&(pod.timeRun)) - (pod), + (&(pod.swRunlistId)) - (pod), + (&(pod.targetTimeSlice)) - (pod), + (&(pod.cumulativePreemptionTime)) - (pod), + (&(pod.weight)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogEntry_v2_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_log_entry_v2_dtype = _get_vgpu_scheduler_log_entry_v2_dtype_offsets() cdef object vgpu_scheduler_log_entry_v2_dtype_record = _numpy.dtype((_numpy.record, vgpu_scheduler_log_entry_v2_dtype)) @@ -17322,18 +17707,23 @@ cdef class VgpuSchedulerLogEntry_v2: cdef _get_vgpu_scheduler_state_v2_dtype_offsets(): - cdef nvmlVgpuSchedulerState_v2_t pod - return _numpy.dtype({ - 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'frequency'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.avgFactor)) - (&pod), - (&(pod.frequency)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerState_v2_t), - }) + cdef nvmlVgpuSchedulerState_v2_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerState_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerState_v2_t") + try: + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'frequency'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.avgFactor)) - (pod), + (&(pod.frequency)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerState_v2_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_state_v2_dtype = _get_vgpu_scheduler_state_v2_dtype_offsets() @@ -17483,15 +17873,20 @@ cdef class VgpuSchedulerState_v2: cdef _get_bbx_time_data_v1_dtype_offsets(): - cdef nvmlBBXTimeData_v1_t pod - return _numpy.dtype({ - 'names': ['time_run'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.timeRun)) - (&pod), - ], - 'itemsize': sizeof(nvmlBBXTimeData_v1_t), - }) + cdef nvmlBBXTimeData_v1_t *pod = _cyb_calloc(1, sizeof(nvmlBBXTimeData_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlBBXTimeData_v1_t") + try: + return _numpy.dtype({ + 'names': ['time_run'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.timeRun)) - (pod), + ], + 'itemsize': sizeof(nvmlBBXTimeData_v1_t), + }) + finally: + _cyb_free(pod) bbx_time_data_v1_dtype = _get_bbx_time_data_v1_dtype_offsets() @@ -17608,20 +18003,25 @@ cdef class BBXTimeData_v1: cdef _get_remapped_rows_info_v2_dtype_offsets(): - cdef nvmlRemappedRowsInfo_v2_t pod - return _numpy.dtype({ - 'names': ['corr_active_remaps', 'corr_inactive_remaps', 'unc_active_remaps', 'unc_inactive_remaps', 'b_pending', 'b_failure_occurred'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.corrActiveRemaps)) - (&pod), - (&(pod.corrInactiveRemaps)) - (&pod), - (&(pod.uncActiveRemaps)) - (&pod), - (&(pod.uncInactiveRemaps)) - (&pod), - (&(pod.bPending)) - (&pod), - (&(pod.bFailureOccurred)) - (&pod), - ], - 'itemsize': sizeof(nvmlRemappedRowsInfo_v2_t), - }) + cdef nvmlRemappedRowsInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlRemappedRowsInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlRemappedRowsInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['corr_active_remaps', 'corr_inactive_remaps', 'unc_active_remaps', 'unc_inactive_remaps', 'b_pending', 'b_failure_occurred'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.corrActiveRemaps)) - (pod), + (&(pod.corrInactiveRemaps)) - (pod), + (&(pod.uncActiveRemaps)) - (pod), + (&(pod.uncInactiveRemaps)) - (pod), + (&(pod.bPending)) - (pod), + (&(pod.bFailureOccurred)) - (pod), + ], + 'itemsize': sizeof(nvmlRemappedRowsInfo_v2_t), + }) + finally: + _cyb_free(pod) remapped_rows_info_v2_dtype = _get_remapped_rows_info_v2_dtype_offsets() @@ -17793,24 +18193,29 @@ cdef class RemappedRowsInfo_v2: cdef _get_accounting_stats_v2_dtype_offsets(): - cdef nvmlAccountingStats_v2_t pod - return _numpy.dtype({ - 'names': ['pid', 'is_running', 'gpu_utilization', 'memory_utilization', 'max_memory_usage', 'sample_count', 'sum_gpu_util', 'sum_fb_util', 'time', 'start_time'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.pid)) - (&pod), - (&(pod.isRunning)) - (&pod), - (&(pod.gpuUtilization)) - (&pod), - (&(pod.memoryUtilization)) - (&pod), - (&(pod.maxMemoryUsage)) - (&pod), - (&(pod.sampleCount)) - (&pod), - (&(pod.sumGpuUtil)) - (&pod), - (&(pod.sumFbUtil)) - (&pod), - (&(pod.time)) - (&pod), - (&(pod.startTime)) - (&pod), - ], - 'itemsize': sizeof(nvmlAccountingStats_v2_t), - }) + cdef nvmlAccountingStats_v2_t *pod = _cyb_calloc(1, sizeof(nvmlAccountingStats_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlAccountingStats_v2_t") + try: + return _numpy.dtype({ + 'names': ['pid', 'is_running', 'gpu_utilization', 'memory_utilization', 'max_memory_usage', 'sample_count', 'sum_gpu_util', 'sum_fb_util', 'time', 'start_time'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.pid)) - (pod), + (&(pod.isRunning)) - (pod), + (&(pod.gpuUtilization)) - (pod), + (&(pod.memoryUtilization)) - (pod), + (&(pod.maxMemoryUsage)) - (pod), + (&(pod.sampleCount)) - (pod), + (&(pod.sumGpuUtil)) - (pod), + (&(pod.sumFbUtil)) - (pod), + (&(pod.time)) - (pod), + (&(pod.startTime)) - (pod), + ], + 'itemsize': sizeof(nvmlAccountingStats_v2_t), + }) + finally: + _cyb_free(pod) accounting_stats_v2_dtype = _get_accounting_stats_v2_dtype_offsets() @@ -18026,17 +18431,22 @@ cdef class AccountingStats_v2: cdef _get_cper_cursor_v1_dtype_offsets(): - cdef nvmlCPERCursor_v1_t pod - return _numpy.dtype({ - 'names': ['cper_type_mask', 'uuid', 'handle'], - 'formats': [_numpy.uint32, (_numpy.int8, 80), _numpy.uint64], - 'offsets': [ - (&(pod.cperTypeMask)) - (&pod), - (&(pod.uuid)) - (&pod), - (&(pod.handle)) - (&pod), - ], - 'itemsize': sizeof(nvmlCPERCursor_v1_t), - }) + cdef nvmlCPERCursor_v1_t *pod = _cyb_calloc(1, sizeof(nvmlCPERCursor_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlCPERCursor_v1_t") + try: + return _numpy.dtype({ + 'names': ['cper_type_mask', 'uuid', 'handle'], + 'formats': [_numpy.uint32, (_numpy.int8, 80), _numpy.uint64], + 'offsets': [ + (&(pod.cperTypeMask)) - (pod), + (&(pod.uuid)) - (pod), + (&(pod.handle)) - (pod), + ], + 'itemsize': sizeof(nvmlCPERCursor_v1_t), + }) + finally: + _cyb_free(pod) cper_cursor_v1_dtype = _get_cper_cursor_v1_dtype_offsets() @@ -18191,17 +18601,22 @@ cdef class CPERCursor_v1: cdef _get_set_memory_limits_v1_dtype_offsets(): - cdef nvmlSetMemoryLimits_v1_t pod - return _numpy.dtype({ - 'names': ['name_space', 'soft_limit', 'hard_limit'], - 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.nameSpace)) - (&pod), - (&(pod.softLimit)) - (&pod), - (&(pod.hardLimit)) - (&pod), - ], - 'itemsize': sizeof(nvmlSetMemoryLimits_v1_t), - }) + cdef nvmlSetMemoryLimits_v1_t *pod = _cyb_calloc(1, sizeof(nvmlSetMemoryLimits_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlSetMemoryLimits_v1_t") + try: + return _numpy.dtype({ + 'names': ['name_space', 'soft_limit', 'hard_limit'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.nameSpace)) - (pod), + (&(pod.softLimit)) - (pod), + (&(pod.hardLimit)) - (pod), + ], + 'itemsize': sizeof(nvmlSetMemoryLimits_v1_t), + }) + finally: + _cyb_free(pod) set_memory_limits_v1_dtype = _get_set_memory_limits_v1_dtype_offsets() @@ -18349,18 +18764,23 @@ cdef class SetMemoryLimits_v1: cdef _get_get_memory_limits_v1_dtype_offsets(): - cdef nvmlGetMemoryLimits_v1_t pod - return _numpy.dtype({ - 'names': ['name_space', 'soft_limit', 'hard_limit', 'current_used'], - 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], - 'offsets': [ - (&(pod.nameSpace)) - (&pod), - (&(pod.softLimit)) - (&pod), - (&(pod.hardLimit)) - (&pod), - (&(pod.currentUsed)) - (&pod), - ], - 'itemsize': sizeof(nvmlGetMemoryLimits_v1_t), - }) + cdef nvmlGetMemoryLimits_v1_t *pod = _cyb_calloc(1, sizeof(nvmlGetMemoryLimits_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGetMemoryLimits_v1_t") + try: + return _numpy.dtype({ + 'names': ['name_space', 'soft_limit', 'hard_limit', 'current_used'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.nameSpace)) - (pod), + (&(pod.softLimit)) - (pod), + (&(pod.hardLimit)) - (pod), + (&(pod.currentUsed)) - (pod), + ], + 'itemsize': sizeof(nvmlGetMemoryLimits_v1_t), + }) + finally: + _cyb_free(pod) get_memory_limits_v1_dtype = _get_get_memory_limits_v1_dtype_offsets() @@ -18519,15 +18939,20 @@ cdef class GetMemoryLimits_v1: cdef _get_pmgr_pwr_tuple_dtype_offsets(): - cdef nvmlPmgrPwrTuple_t pod - return _numpy.dtype({ - 'names': ['pwrm_w'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.pwrmW)) - (&pod), - ], - 'itemsize': sizeof(nvmlPmgrPwrTuple_t), - }) + cdef nvmlPmgrPwrTuple_t *pod = _cyb_calloc(1, sizeof(nvmlPmgrPwrTuple_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPmgrPwrTuple_t") + try: + return _numpy.dtype({ + 'names': ['pwrm_w'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.pwrmW)) - (pod), + ], + 'itemsize': sizeof(nvmlPmgrPwrTuple_t), + }) + finally: + _cyb_free(pod) pmgr_pwr_tuple_dtype = _get_pmgr_pwr_tuple_dtype_offsets() cdef object pmgr_pwr_tuple_dtype_record = _numpy.dtype((_numpy.record, pmgr_pwr_tuple_dtype)) @@ -18673,16 +19098,21 @@ cdef class PmgrPwrTuple: cdef _get_rail_metrics_dtype_offsets(): - cdef nvmlRailMetrics_t pod - return _numpy.dtype({ - 'names': ['freqk_hz', 'util_pct'], - 'formats': [_numpy.uint32, _numpy.uint64], - 'offsets': [ - (&(pod.freqkHz)) - (&pod), - (&(pod.utilPct)) - (&pod), - ], - 'itemsize': sizeof(nvmlRailMetrics_t), - }) + cdef nvmlRailMetrics_t *pod = _cyb_calloc(1, sizeof(nvmlRailMetrics_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlRailMetrics_t") + try: + return _numpy.dtype({ + 'names': ['freqk_hz', 'util_pct'], + 'formats': [_numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.freqkHz)) - (pod), + (&(pod.utilPct)) - (pod), + ], + 'itemsize': sizeof(nvmlRailMetrics_t), + }) + finally: + _cyb_free(pod) rail_metrics_dtype = _get_rail_metrics_dtype_offsets() cdef object rail_metrics_dtype_record = _numpy.dtype((_numpy.record, rail_metrics_dtype)) @@ -18841,15 +19271,20 @@ cdef class RailMetrics: cdef _get_pwr_model_metrics_dlppm1x_perf_dtype_offsets(): - cdef nvmlPwrModelMetricsDlppm1xPerf_t pod - return _numpy.dtype({ - 'names': ['perfms'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.perfms)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xPerf_t), - }) + cdef nvmlPwrModelMetricsDlppm1xPerf_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelMetricsDlppm1xPerf_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelMetricsDlppm1xPerf_t") + try: + return _numpy.dtype({ + 'names': ['perfms'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.perfms)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xPerf_t), + }) + finally: + _cyb_free(pod) pwr_model_metrics_dlppm1x_perf_dtype = _get_pwr_model_metrics_dlppm1x_perf_dtype_offsets() cdef object pwr_model_metrics_dlppm1x_perf_dtype_record = _numpy.dtype((_numpy.record, pwr_model_metrics_dlppm1x_perf_dtype)) @@ -18995,16 +19430,21 @@ cdef class PwrModelMetricsDlppm1xPerf: cdef _get_pwr_model_metrics_sample_pfpp1x_dtype_offsets(): - cdef nvmlPwrModelMetricsSamplePfpp1x_t pod - return _numpy.dtype({ - 'names': ['freqk_hz', 'est_tgp_pwrm_w'], - 'formats': [(_numpy.uint32, 16), _numpy.uint32], - 'offsets': [ - (&(pod.freqkHz)) - (&pod), - (&(pod.estTgpPwrmW)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelMetricsSamplePfpp1x_t), - }) + cdef nvmlPwrModelMetricsSamplePfpp1x_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelMetricsSamplePfpp1x_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelMetricsSamplePfpp1x_t") + try: + return _numpy.dtype({ + 'names': ['freqk_hz', 'est_tgp_pwrm_w'], + 'formats': [(_numpy.uint32, 16), _numpy.uint32], + 'offsets': [ + (&(pod.freqkHz)) - (pod), + (&(pod.estTgpPwrmW)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelMetricsSamplePfpp1x_t), + }) + finally: + _cyb_free(pod) pwr_model_metrics_sample_pfpp1x_dtype = _get_pwr_model_metrics_sample_pfpp1x_dtype_offsets() cdef object pwr_model_metrics_sample_pfpp1x_dtype_record = _numpy.dtype((_numpy.record, pwr_model_metrics_sample_pfpp1x_dtype)) @@ -19161,16 +19601,21 @@ cdef class PwrModelMetricsSamplePfpp1x: cdef _get_pwr_model_operating_point_pfpp1x_dtype_offsets(): - cdef nvmlPwrModelOperatingPointPfpp1x_t pod - return _numpy.dtype({ - 'names': ['freqk_hz', 'pwrm_w'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.freqkHz)) - (&pod), - (&(pod.pwrmW)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelOperatingPointPfpp1x_t), - }) + cdef nvmlPwrModelOperatingPointPfpp1x_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelOperatingPointPfpp1x_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelOperatingPointPfpp1x_t") + try: + return _numpy.dtype({ + 'names': ['freqk_hz', 'pwrm_w'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.freqkHz)) - (pod), + (&(pod.pwrmW)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelOperatingPointPfpp1x_t), + }) + finally: + _cyb_free(pod) pwr_model_operating_point_pfpp1x_dtype = _get_pwr_model_operating_point_pfpp1x_dtype_offsets() cdef object pwr_model_operating_point_pfpp1x_dtype_record = _numpy.dtype((_numpy.record, pwr_model_operating_point_pfpp1x_dtype)) @@ -19329,19 +19774,24 @@ cdef class PwrModelOperatingPointPfpp1x: cdef _get_adaptive_tgp_mode_info_v1_dtype_offsets(): - cdef nvmlAdaptiveTgpModeInfo_v1_t pod - return _numpy.dtype({ - 'names': ['in_band_enable_request', 'feature_allowed_by_admin', 'admin_override_enabled', 'enablement_status', 'adjusted_limit_mw'], - 'formats': [_numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.uint32], - 'offsets': [ - (&(pod.inBandEnableRequest)) - (&pod), - (&(pod.featureAllowedByAdmin)) - (&pod), - (&(pod.adminOverrideEnabled)) - (&pod), - (&(pod.enablementStatus)) - (&pod), - (&(pod.adjustedLimitMw)) - (&pod), - ], - 'itemsize': sizeof(nvmlAdaptiveTgpModeInfo_v1_t), - }) + cdef nvmlAdaptiveTgpModeInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlAdaptiveTgpModeInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlAdaptiveTgpModeInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['in_band_enable_request', 'feature_allowed_by_admin', 'admin_override_enabled', 'enablement_status', 'adjusted_limit_mw'], + 'formats': [_numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.uint32], + 'offsets': [ + (&(pod.inBandEnableRequest)) - (pod), + (&(pod.featureAllowedByAdmin)) - (pod), + (&(pod.adminOverrideEnabled)) - (pod), + (&(pod.enablementStatus)) - (pod), + (&(pod.adjustedLimitMw)) - (pod), + ], + 'itemsize': sizeof(nvmlAdaptiveTgpModeInfo_v1_t), + }) + finally: + _cyb_free(pod) adaptive_tgp_mode_info_v1_dtype = _get_adaptive_tgp_mode_info_v1_dtype_offsets() @@ -19502,15 +19952,20 @@ cdef class AdaptiveTgpModeInfo_v1: cdef _get_event_set_get_context_count_v1_dtype_offsets(): - cdef nvmlEventSetGetContextCount_v1_t pod - return _numpy.dtype({ - 'names': ['count'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.count)) - (&pod), - ], - 'itemsize': sizeof(nvmlEventSetGetContextCount_v1_t), - }) + cdef nvmlEventSetGetContextCount_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEventSetGetContextCount_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEventSetGetContextCount_v1_t") + try: + return _numpy.dtype({ + 'names': ['count'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.count)) - (pod), + ], + 'itemsize': sizeof(nvmlEventSetGetContextCount_v1_t), + }) + finally: + _cyb_free(pod) event_set_get_context_count_v1_dtype = _get_event_set_get_context_count_v1_dtype_offsets() @@ -19627,19 +20082,24 @@ cdef class EventSetGetContextCount_v1: cdef _get_event_set_get_context_info_v1_dtype_offsets(): - cdef nvmlEventSetGetContextInfo_v1_t pod - return _numpy.dtype({ - 'names': ['index', 'nvml_gpu_operational_event_context_type', 'source_event_context_type', 'data_size', 'data_format_version'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint16], - 'offsets': [ - (&(pod.index)) - (&pod), - (&(pod.nvmlGpuOperationalEventContextType)) - (&pod), - (&(pod.sourceEventContextType)) - (&pod), - (&(pod.dataSize)) - (&pod), - (&(pod.dataFormatVersion)) - (&pod), - ], - 'itemsize': sizeof(nvmlEventSetGetContextInfo_v1_t), - }) + cdef nvmlEventSetGetContextInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEventSetGetContextInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEventSetGetContextInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['index', 'nvml_gpu_operational_event_context_type', 'source_event_context_type', 'data_size', 'data_format_version'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint16], + 'offsets': [ + (&(pod.index)) - (pod), + (&(pod.nvmlGpuOperationalEventContextType)) - (pod), + (&(pod.sourceEventContextType)) - (pod), + (&(pod.dataSize)) - (pod), + (&(pod.dataFormatVersion)) - (pod), + ], + 'itemsize': sizeof(nvmlEventSetGetContextInfo_v1_t), + }) + finally: + _cyb_free(pod) event_set_get_context_info_v1_dtype = _get_event_set_get_context_info_v1_dtype_offsets() @@ -19800,16 +20260,21 @@ cdef class EventSetGetContextInfo_v1: cdef _get_event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype_offsets(): - cdef nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t pod - return _numpy.dtype({ - 'names': ['index', 'xid_code'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.index)) - (&pod), - (&(pod.xidCode)) - (&pod), - ], - 'itemsize': sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t), - }) + cdef nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t") + try: + return _numpy.dtype({ + 'names': ['index', 'xid_code'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.index)) - (pod), + (&(pod.xidCode)) - (pod), + ], + 'itemsize': sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t), + }) + finally: + _cyb_free(pod) event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype = _get_event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype_offsets() @@ -19937,16 +20402,21 @@ cdef class EventSetGetGpuOperationalEventContextLegacyXid_v1: cdef _get_gpu_fabric_clique_v1_dtype_offsets(): - cdef nvmlGpuFabricClique_v1_t pod - return _numpy.dtype({ - 'names': ['type', 'id'], - 'formats': [_numpy.uint8, _numpy.uint32], - 'offsets': [ - (&(pod.type)) - (&pod), - (&(pod.id)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuFabricClique_v1_t), - }) + cdef nvmlGpuFabricClique_v1_t *pod = _cyb_calloc(1, sizeof(nvmlGpuFabricClique_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuFabricClique_v1_t") + try: + return _numpy.dtype({ + 'names': ['type', 'id'], + 'formats': [_numpy.uint8, _numpy.uint32], + 'offsets': [ + (&(pod.type)) - (pod), + (&(pod.id)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuFabricClique_v1_t), + }) + finally: + _cyb_free(pod) gpu_fabric_clique_v1_dtype = _get_gpu_fabric_clique_v1_dtype_offsets() @@ -20086,17 +20556,22 @@ cdef class GpuFabricClique_v1: cdef _get_gpu_operational_event_config_v1_dtype_offsets(): - cdef nvmlGpuOperationalEventConfig_v1_t pod - return _numpy.dtype({ - 'names': ['uuid', 'min_log_level', 'min_severity'], - 'formats': [(_numpy.int8, 96), _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.uuid)) - (&pod), - (&(pod.minLogLevel)) - (&pod), - (&(pod.minSeverity)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuOperationalEventConfig_v1_t), - }) + cdef nvmlGpuOperationalEventConfig_v1_t *pod = _cyb_calloc(1, sizeof(nvmlGpuOperationalEventConfig_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuOperationalEventConfig_v1_t") + try: + return _numpy.dtype({ + 'names': ['uuid', 'min_log_level', 'min_severity'], + 'formats': [(_numpy.int8, 96), _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.uuid)) - (pod), + (&(pod.minLogLevel)) - (pod), + (&(pod.minSeverity)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuOperationalEventConfig_v1_t), + }) + finally: + _cyb_free(pod) gpu_operational_event_config_v1_dtype = _get_gpu_operational_event_config_v1_dtype_offsets() @@ -20239,39 +20714,44 @@ cdef class GpuOperationalEventConfig_v1: cdef _get_event_set_wait_v3_dtype_offsets(): - cdef nvmlEventSetWait_v3_t pod - return _numpy.dtype({ - 'names': ['timeout_ms', 'data_type', 'uuid', 'source_module', 'event_type', 'event_data', 'group_cursor', 'instance_id', 'timestamp_usec', 'trace_id', 'gpu_instance_id', 'compute_instance_id', 'severity', 'category_id', 'module_event_code', 'scope', 'originator', 'module_instance', 'chiplet_id', 'log_level', 'attributes', 'group_cper_size', 'group_attributes', 'group_size', 'group_index'], - 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 96), (_numpy.int8, 16), _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint8, _numpy.uint8], - 'offsets': [ - (&(pod.timeoutMs)) - (&pod), - (&(pod.dataType)) - (&pod), - (&(pod.uuid)) - (&pod), - (&(pod.sourceModule)) - (&pod), - (&(pod.eventType)) - (&pod), - (&(pod.eventData)) - (&pod), - (&(pod.groupCursor)) - (&pod), - (&(pod.instanceId)) - (&pod), - (&(pod.timestampUsec)) - (&pod), - (&(pod.traceId)) - (&pod), - (&(pod.gpuInstanceId)) - (&pod), - (&(pod.computeInstanceId)) - (&pod), - (&(pod.severity)) - (&pod), - (&(pod.categoryId)) - (&pod), - (&(pod.moduleEventCode)) - (&pod), - (&(pod.scope)) - (&pod), - (&(pod.originator)) - (&pod), - (&(pod.moduleInstance)) - (&pod), - (&(pod.chipletId)) - (&pod), - (&(pod.logLevel)) - (&pod), - (&(pod.attributes)) - (&pod), - (&(pod.groupCperSize)) - (&pod), - (&(pod.groupAttributes)) - (&pod), - (&(pod.groupSize)) - (&pod), - (&(pod.groupIndex)) - (&pod), - ], - 'itemsize': sizeof(nvmlEventSetWait_v3_t), - }) + cdef nvmlEventSetWait_v3_t *pod = _cyb_calloc(1, sizeof(nvmlEventSetWait_v3_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEventSetWait_v3_t") + try: + return _numpy.dtype({ + 'names': ['timeout_ms', 'data_type', 'uuid', 'source_module', 'event_type', 'event_data', 'group_cursor', 'instance_id', 'timestamp_usec', 'trace_id', 'gpu_instance_id', 'compute_instance_id', 'severity', 'category_id', 'module_event_code', 'scope', 'originator', 'module_instance', 'chiplet_id', 'log_level', 'attributes', 'group_cper_size', 'group_attributes', 'group_size', 'group_index'], + 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 96), (_numpy.int8, 16), _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint8, _numpy.uint8], + 'offsets': [ + (&(pod.timeoutMs)) - (pod), + (&(pod.dataType)) - (pod), + (&(pod.uuid)) - (pod), + (&(pod.sourceModule)) - (pod), + (&(pod.eventType)) - (pod), + (&(pod.eventData)) - (pod), + (&(pod.groupCursor)) - (pod), + (&(pod.instanceId)) - (pod), + (&(pod.timestampUsec)) - (pod), + (&(pod.traceId)) - (pod), + (&(pod.gpuInstanceId)) - (pod), + (&(pod.computeInstanceId)) - (pod), + (&(pod.severity)) - (pod), + (&(pod.categoryId)) - (pod), + (&(pod.moduleEventCode)) - (pod), + (&(pod.scope)) - (pod), + (&(pod.originator)) - (pod), + (&(pod.moduleInstance)) - (pod), + (&(pod.chipletId)) - (pod), + (&(pod.logLevel)) - (pod), + (&(pod.attributes)) - (pod), + (&(pod.groupCperSize)) - (pod), + (&(pod.groupAttributes)) - (pod), + (&(pod.groupSize)) - (pod), + (&(pod.groupIndex)) - (pod), + ], + 'itemsize': sizeof(nvmlEventSetWait_v3_t), + }) + finally: + _cyb_free(pod) event_set_wait_v3_dtype = _get_event_set_wait_v3_dtype_offsets() @@ -20660,17 +21140,22 @@ cdef class EventSetWait_v3: cdef _get_nvlink_set_bw_mode_async_v1_dtype_offsets(): - cdef nvmlNvlinkSetBwModeAsync_v1_t pod - return _numpy.dtype({ - 'names': ['b_set_best', 'bw_mode', 'async_poll_timeout_ms'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.bSetBest)) - (&pod), - (&(pod.bwMode)) - (&pod), - (&(pod.asyncPollTimeoutMs)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkSetBwModeAsync_v1_t), - }) + cdef nvmlNvlinkSetBwModeAsync_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkSetBwModeAsync_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkSetBwModeAsync_v1_t") + try: + return _numpy.dtype({ + 'names': ['b_set_best', 'bw_mode', 'async_poll_timeout_ms'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.bSetBest)) - (pod), + (&(pod.bwMode)) - (pod), + (&(pod.asyncPollTimeoutMs)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkSetBwModeAsync_v1_t), + }) + finally: + _cyb_free(pod) nvlink_set_bw_mode_async_v1_dtype = _get_nvlink_set_bw_mode_async_v1_dtype_offsets() @@ -20809,19 +21294,24 @@ cdef class NvlinkSetBwModeAsync_v1: cdef _get_nvlink_telemetry_sample_v1_dtype_offsets(): - cdef nvmlNvlinkTelemetrySample_v1_t pod - return _numpy.dtype({ - 'names': ['link_id', 'sample_type', 'sample_count', 'samples', 'nvml_return'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.int32], - 'offsets': [ - (&(pod.linkId)) - (&pod), - (&(pod.sampleType)) - (&pod), - (&(pod.sampleCount)) - (&pod), - (&(pod.samples)) - (&pod), - (&(pod.nvmlReturn)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkTelemetrySample_v1_t), - }) + cdef nvmlNvlinkTelemetrySample_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkTelemetrySample_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkTelemetrySample_v1_t") + try: + return _numpy.dtype({ + 'names': ['link_id', 'sample_type', 'sample_count', 'samples', 'nvml_return'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.int32], + 'offsets': [ + (&(pod.linkId)) - (pod), + (&(pod.sampleType)) - (pod), + (&(pod.sampleCount)) - (pod), + (&(pod.samples)) - (pod), + (&(pod.nvmlReturn)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkTelemetrySample_v1_t), + }) + finally: + _cyb_free(pod) nvlink_telemetry_sample_v1_dtype = _get_nvlink_telemetry_sample_v1_dtype_offsets() cdef object nvlink_telemetry_sample_v1_dtype_record = _numpy.dtype((_numpy.record, nvlink_telemetry_sample_v1_dtype)) @@ -21019,16 +21509,21 @@ cdef class NvlinkTelemetrySample_v1: cdef _get_ecc_bank_remapper_histogram_v1_dtype_offsets(): - cdef nvmlEccBankRemapperHistogram_v1_t pod - return _numpy.dtype({ - 'names': ['max_spare_group_count', 'no_spare_group_count'], - 'formats': [_numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.maxSpareGroupCount)) - (&pod), - (&(pod.noSpareGroupCount)) - (&pod), - ], - 'itemsize': sizeof(nvmlEccBankRemapperHistogram_v1_t), - }) + cdef nvmlEccBankRemapperHistogram_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEccBankRemapperHistogram_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEccBankRemapperHistogram_v1_t") + try: + return _numpy.dtype({ + 'names': ['max_spare_group_count', 'no_spare_group_count'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.maxSpareGroupCount)) - (pod), + (&(pod.noSpareGroupCount)) - (pod), + ], + 'itemsize': sizeof(nvmlEccBankRemapperHistogram_v1_t), + }) + finally: + _cyb_free(pod) ecc_bank_remapper_histogram_v1_dtype = _get_ecc_bank_remapper_histogram_v1_dtype_offsets() @@ -21168,15 +21663,20 @@ cdef class EccBankRemapperHistogram_v1: cdef _get_gpu_uptime_v1_dtype_offsets(): - cdef nvmlGpuUptime_v1_t pod - return _numpy.dtype({ - 'names': ['uptime'], - 'formats': [_numpy.uint32], - 'offsets': [ - (&(pod.uptime)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuUptime_v1_t), - }) + cdef nvmlGpuUptime_v1_t *pod = _cyb_calloc(1, sizeof(nvmlGpuUptime_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuUptime_v1_t") + try: + return _numpy.dtype({ + 'names': ['uptime'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.uptime)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuUptime_v1_t), + }) + finally: + _cyb_free(pod) gpu_uptime_v1_dtype = _get_gpu_uptime_v1_dtype_offsets() @@ -21293,20 +21793,25 @@ cdef class GpuUptime_v1: cdef _get_system_conf_compute_settings_v2_dtype_offsets(): - cdef nvmlSystemConfComputeSettings_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'environment', 'cc_feature', 'dev_tools_mode', 'multi_gpu_mode', 'tdisp_state'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.environment)) - (&pod), - (&(pod.ccFeature)) - (&pod), - (&(pod.devToolsMode)) - (&pod), - (&(pod.multiGpuMode)) - (&pod), - (&(pod.tdispState)) - (&pod), - ], - 'itemsize': sizeof(nvmlSystemConfComputeSettings_v2_t), - }) + cdef nvmlSystemConfComputeSettings_v2_t *pod = _cyb_calloc(1, sizeof(nvmlSystemConfComputeSettings_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlSystemConfComputeSettings_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'environment', 'cc_feature', 'dev_tools_mode', 'multi_gpu_mode', 'tdisp_state'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.environment)) - (pod), + (&(pod.ccFeature)) - (pod), + (&(pod.devToolsMode)) - (pod), + (&(pod.multiGpuMode)) - (pod), + (&(pod.tdispState)) - (pod), + ], + 'itemsize': sizeof(nvmlSystemConfComputeSettings_v2_t), + }) + finally: + _cyb_free(pod) system_conf_compute_settings_v2_dtype = _get_system_conf_compute_settings_v2_dtype_offsets() @@ -21478,18 +21983,23 @@ cdef class SystemConfComputeSettings_v2: cdef _get_nvlink_get_remap_table_info_v1_dtype_offsets(): - cdef nvmlNvlinkGetRemapTableInfo_v1_t pod - return _numpy.dtype({ - 'names': ['alid', 'fla_remap_tab_addr', 'gpa_remap_tab_addr', 'remap_tab_size'], - 'formats': [_numpy.uint32, (_numpy.uint32, 4096), (_numpy.uint32, 4096), _numpy.uint32], - 'offsets': [ - (&(pod.alid)) - (&pod), - (&(pod.flaRemapTabAddr)) - (&pod), - (&(pod.gpaRemapTabAddr)) - (&pod), - (&(pod.remapTabSize)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkGetRemapTableInfo_v1_t), - }) + cdef nvmlNvlinkGetRemapTableInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkGetRemapTableInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkGetRemapTableInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['alid', 'fla_remap_tab_addr', 'gpa_remap_tab_addr', 'remap_tab_size'], + 'formats': [_numpy.uint32, (_numpy.uint32, 4096), (_numpy.uint32, 4096), _numpy.uint32], + 'offsets': [ + (&(pod.alid)) - (pod), + (&(pod.flaRemapTabAddr)) - (pod), + (&(pod.gpaRemapTabAddr)) - (pod), + (&(pod.remapTabSize)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkGetRemapTableInfo_v1_t), + }) + finally: + _cyb_free(pod) nvlink_get_remap_table_info_v1_dtype = _get_nvlink_get_remap_table_info_v1_dtype_offsets() @@ -21650,15 +22160,20 @@ cdef class NvlinkGetRemapTableInfo_v1: cdef _get_nvlink_set_nvle_ready_v1_dtype_offsets(): - cdef nvmlNvlinkSetNvleReady_v1_t pod - return _numpy.dtype({ - 'names': ['b_nvle_ready'], - 'formats': [_numpy.uint8], - 'offsets': [ - (&(pod.bNvleReady)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkSetNvleReady_v1_t), - }) + cdef nvmlNvlinkSetNvleReady_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkSetNvleReady_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkSetNvleReady_v1_t") + try: + return _numpy.dtype({ + 'names': ['b_nvle_ready'], + 'formats': [_numpy.uint8], + 'offsets': [ + (&(pod.bNvleReady)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkSetNvleReady_v1_t), + }) + finally: + _cyb_free(pod) nvlink_set_nvle_ready_v1_dtype = _get_nvlink_set_nvle_ready_v1_dtype_offsets() @@ -21775,16 +22290,21 @@ cdef class NvlinkSetNvleReady_v1: cdef _get_nvlink_lock_remap_table_v1_dtype_offsets(): - cdef nvmlNvlinkLockRemapTable_v1_t pod - return _numpy.dtype({ - 'names': ['b_remap_table_locked', 'b_remap_table_lock_disabled'], - 'formats': [_numpy.uint8, _numpy.uint8], - 'offsets': [ - (&(pod.bRemapTableLocked)) - (&pod), - (&(pod.bRemapTableLockDisabled)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkLockRemapTable_v1_t), - }) + cdef nvmlNvlinkLockRemapTable_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkLockRemapTable_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkLockRemapTable_v1_t") + try: + return _numpy.dtype({ + 'names': ['b_remap_table_locked', 'b_remap_table_lock_disabled'], + 'formats': [_numpy.uint8, _numpy.uint8], + 'offsets': [ + (&(pod.bRemapTableLocked)) - (pod), + (&(pod.bRemapTableLockDisabled)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkLockRemapTable_v1_t), + }) + finally: + _cyb_free(pod) nvlink_lock_remap_table_v1_dtype = _get_nvlink_lock_remap_table_v1_dtype_offsets() @@ -21912,16 +22432,21 @@ cdef class NvlinkLockRemapTable_v1: cdef _get_nvlink_nvle_private_info_v1_dtype_offsets(): - cdef nvmlNvlinkNvlePrivateInfo_v1_t pod - return _numpy.dtype({ - 'names': ['data_', 'size_'], - 'formats': [(_numpy.uint8, 256), _numpy.uint32], - 'offsets': [ - (&(pod.data)) - (&pod), - (&(pod.size)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkNvlePrivateInfo_v1_t), - }) + cdef nvmlNvlinkNvlePrivateInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkNvlePrivateInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkNvlePrivateInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['data_', 'size_'], + 'formats': [(_numpy.uint8, 256), _numpy.uint32], + 'offsets': [ + (&(pod.data)) - (pod), + (&(pod.size)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkNvlePrivateInfo_v1_t), + }) + finally: + _cyb_free(pod) nvlink_nvle_private_info_v1_dtype = _get_nvlink_nvle_private_info_v1_dtype_offsets() @@ -22061,16 +22586,21 @@ cdef class NvlinkNvlePrivateInfo_v1: cdef _get_excluded_device_info_dtype_offsets(): - cdef nvmlExcludedDeviceInfo_t pod - return _numpy.dtype({ - 'names': ['pci_info', 'uuid'], - 'formats': [pci_info_dtype, (_numpy.int8, 80)], - 'offsets': [ - (&(pod.pciInfo)) - (&pod), - (&(pod.uuid)) - (&pod), - ], - 'itemsize': sizeof(nvmlExcludedDeviceInfo_t), - }) + cdef nvmlExcludedDeviceInfo_t *pod = _cyb_calloc(1, sizeof(nvmlExcludedDeviceInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlExcludedDeviceInfo_t") + try: + return _numpy.dtype({ + 'names': ['pci_info', 'uuid'], + 'formats': [pci_info_dtype, (_numpy.int8, 80)], + 'offsets': [ + (&(pod.pciInfo)) - (pod), + (&(pod.uuid)) - (pod), + ], + 'itemsize': sizeof(nvmlExcludedDeviceInfo_t), + }) + finally: + _cyb_free(pod) excluded_device_info_dtype = _get_excluded_device_info_dtype_offsets() @@ -22207,18 +22737,23 @@ cdef class ExcludedDeviceInfo: cdef _get_process_detail_list_v1_dtype_offsets(): - cdef nvmlProcessDetailList_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'mode', 'num_proc_array_entries', 'proc_array'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.mode)) - (&pod), - (&(pod.numProcArrayEntries)) - (&pod), - (&(pod.procArray)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessDetailList_v1_t), - }) + cdef nvmlProcessDetailList_v1_t *pod = _cyb_calloc(1, sizeof(nvmlProcessDetailList_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessDetailList_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'mode', 'num_proc_array_entries', 'proc_array'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.mode)) - (pod), + (&(pod.numProcArrayEntries)) - (pod), + (&(pod.procArray)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessDetailList_v1_t), + }) + finally: + _cyb_free(pod) process_detail_list_v1_dtype = _get_process_detail_list_v1_dtype_offsets() @@ -22370,16 +22905,21 @@ cdef class ProcessDetailList_v1: cdef _get_bridge_chip_hierarchy_dtype_offsets(): - cdef nvmlBridgeChipHierarchy_t pod - return _numpy.dtype({ - 'names': ['bridge_count', 'bridge_chip_info'], - 'formats': [_numpy.uint8, (bridge_chip_info_dtype, 128)], - 'offsets': [ - (&(pod.bridgeCount)) - (&pod), - (&(pod.bridgeChipInfo)) - (&pod), - ], - 'itemsize': sizeof(nvmlBridgeChipHierarchy_t), - }) + cdef nvmlBridgeChipHierarchy_t *pod = _cyb_calloc(1, sizeof(nvmlBridgeChipHierarchy_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlBridgeChipHierarchy_t") + try: + return _numpy.dtype({ + 'names': ['bridge_count', 'bridge_chip_info'], + 'formats': [_numpy.uint8, (bridge_chip_info_dtype, 128)], + 'offsets': [ + (&(pod.bridgeCount)) - (pod), + (&(pod.bridgeChipInfo)) - (pod), + ], + 'itemsize': sizeof(nvmlBridgeChipHierarchy_t), + }) + finally: + _cyb_free(pod) bridge_chip_hierarchy_dtype = _get_bridge_chip_hierarchy_dtype_offsets() @@ -22507,16 +23047,21 @@ cdef class BridgeChipHierarchy: cdef _get_sample_dtype_offsets(): - cdef nvmlSample_t pod - return _numpy.dtype({ - 'names': ['time_stamp', 'sample_value'], - 'formats': [_numpy.uint64, value_dtype], - 'offsets': [ - (&(pod.timeStamp)) - (&pod), - (&(pod.sampleValue)) - (&pod), - ], - 'itemsize': sizeof(nvmlSample_t), - }) + cdef nvmlSample_t *pod = _cyb_calloc(1, sizeof(nvmlSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlSample_t") + try: + return _numpy.dtype({ + 'names': ['time_stamp', 'sample_value'], + 'formats': [_numpy.uint64, value_dtype], + 'offsets': [ + (&(pod.timeStamp)) - (pod), + (&(pod.sampleValue)) - (pod), + ], + 'itemsize': sizeof(nvmlSample_t), + }) + finally: + _cyb_free(pod) sample_dtype = _get_sample_dtype_offsets() cdef object sample_dtype_record = _numpy.dtype((_numpy.record, sample_dtype)) @@ -22673,20 +23218,25 @@ cdef class Sample: cdef _get_vgpu_instance_utilization_sample_dtype_offsets(): - cdef nvmlVgpuInstanceUtilizationSample_t pod - return _numpy.dtype({ - 'names': ['vgpu_instance', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], - 'formats': [_numpy.uint32, _numpy.uint64, value_dtype, value_dtype, value_dtype, value_dtype], - 'offsets': [ - (&(pod.vgpuInstance)) - (&pod), - (&(pod.timeStamp)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuInstanceUtilizationSample_t), - }) + cdef nvmlVgpuInstanceUtilizationSample_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuInstanceUtilizationSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuInstanceUtilizationSample_t") + try: + return _numpy.dtype({ + 'names': ['vgpu_instance', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], + 'formats': [_numpy.uint32, _numpy.uint64, value_dtype, value_dtype, value_dtype, value_dtype], + 'offsets': [ + (&(pod.vgpuInstance)) - (pod), + (&(pod.timeStamp)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuInstanceUtilizationSample_t), + }) + finally: + _cyb_free(pod) vgpu_instance_utilization_sample_dtype = _get_vgpu_instance_utilization_sample_dtype_offsets() cdef object vgpu_instance_utilization_sample_dtype_record = _numpy.dtype((_numpy.record, vgpu_instance_utilization_sample_dtype)) @@ -22889,22 +23439,27 @@ cdef class VgpuInstanceUtilizationSample: cdef _get_vgpu_instance_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuInstanceUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['time_stamp', 'vgpu_instance', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], - 'formats': [_numpy.uint64, _numpy.uint32, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype], - 'offsets': [ - (&(pod.timeStamp)) - (&pod), - (&(pod.vgpuInstance)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - (&(pod.jpgUtil)) - (&pod), - (&(pod.ofaUtil)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t), - }) + cdef nvmlVgpuInstanceUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuInstanceUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['time_stamp', 'vgpu_instance', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], + 'formats': [_numpy.uint64, _numpy.uint32, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype], + 'offsets': [ + (&(pod.timeStamp)) - (pod), + (&(pod.vgpuInstance)) - (pod), + (&(pod.smUtil)) - (pod), + (&(pod.memUtil)) - (pod), + (&(pod.encUtil)) - (pod), + (&(pod.decUtil)) - (pod), + (&(pod.jpgUtil)) - (pod), + (&(pod.ofaUtil)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_instance_utilization_info_v1_dtype = _get_vgpu_instance_utilization_info_v1_dtype_offsets() cdef object vgpu_instance_utilization_info_v1_dtype_record = _numpy.dtype((_numpy.record, vgpu_instance_utilization_info_v1_dtype)) @@ -23129,21 +23684,26 @@ cdef class VgpuInstanceUtilizationInfo_v1: cdef _get_field_value_dtype_offsets(): - cdef nvmlFieldValue_t pod - return _numpy.dtype({ - 'names': ['field_id', 'scope_id', 'timestamp', 'latency_usec', 'value_type', 'nvml_return', 'value'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int64, _numpy.int64, _numpy.int32, _numpy.int32, value_dtype], - 'offsets': [ - (&(pod.fieldId)) - (&pod), - (&(pod.scopeId)) - (&pod), - (&(pod.timestamp)) - (&pod), - (&(pod.latencyUsec)) - (&pod), - (&(pod.valueType)) - (&pod), - (&(pod.nvmlReturn)) - (&pod), - (&(pod.value)) - (&pod), - ], - 'itemsize': sizeof(nvmlFieldValue_t), - }) + cdef nvmlFieldValue_t *pod = _cyb_calloc(1, sizeof(nvmlFieldValue_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlFieldValue_t") + try: + return _numpy.dtype({ + 'names': ['field_id', 'scope_id', 'timestamp', 'latency_usec', 'value_type', 'nvml_return', 'value'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int64, _numpy.int64, _numpy.int32, _numpy.int32, value_dtype], + 'offsets': [ + (&(pod.fieldId)) - (pod), + (&(pod.scopeId)) - (pod), + (&(pod.timestamp)) - (pod), + (&(pod.latencyUsec)) - (pod), + (&(pod.valueType)) - (pod), + (&(pod.nvmlReturn)) - (pod), + (&(pod.value)) - (pod), + ], + 'itemsize': sizeof(nvmlFieldValue_t), + }) + finally: + _cyb_free(pod) field_value_dtype = _get_field_value_dtype_offsets() cdef object field_value_dtype_record = _numpy.dtype((_numpy.record, field_value_dtype)) @@ -23365,17 +23925,22 @@ cdef class FieldValue: cdef _get_prm_counter_value_v1_dtype_offsets(): - cdef nvmlPRMCounterValue_v1_t pod - return _numpy.dtype({ - 'names': ['status', 'output_type', 'output_value'], - 'formats': [_numpy.int32, _numpy.int32, value_dtype], - 'offsets': [ - (&(pod.status)) - (&pod), - (&(pod.outputType)) - (&pod), - (&(pod.outputValue)) - (&pod), - ], - 'itemsize': sizeof(nvmlPRMCounterValue_v1_t), - }) + cdef nvmlPRMCounterValue_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPRMCounterValue_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPRMCounterValue_v1_t") + try: + return _numpy.dtype({ + 'names': ['status', 'output_type', 'output_value'], + 'formats': [_numpy.int32, _numpy.int32, value_dtype], + 'offsets': [ + (&(pod.status)) - (pod), + (&(pod.outputType)) - (pod), + (&(pod.outputValue)) - (pod), + ], + 'itemsize': sizeof(nvmlPRMCounterValue_v1_t), + }) + finally: + _cyb_free(pod) prm_counter_value_v1_dtype = _get_prm_counter_value_v1_dtype_offsets() @@ -23531,16 +24096,21 @@ cdef class PRMCounterValue_v1: cdef _get_gpu_thermal_settings_dtype_offsets(): - cdef nvmlGpuThermalSettings_t pod - return _numpy.dtype({ - 'names': ['count', 'sensor'], - 'formats': [_numpy.uint32, (_py_anon_pod0_dtype, 3)], - 'offsets': [ - (&(pod.count)) - (&pod), - (&(pod.sensor)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuThermalSettings_t), - }) + cdef nvmlGpuThermalSettings_t *pod = _cyb_calloc(1, sizeof(nvmlGpuThermalSettings_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuThermalSettings_t") + try: + return _numpy.dtype({ + 'names': ['count', 'sensor'], + 'formats': [_numpy.uint32, (_py_anon_pod0_dtype, 3)], + 'offsets': [ + (&(pod.count)) - (pod), + (&(pod.sensor)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuThermalSettings_t), + }) + finally: + _cyb_free(pod) gpu_thermal_settings_dtype = _get_gpu_thermal_settings_dtype_offsets() @@ -23676,17 +24246,22 @@ cdef class GpuThermalSettings: cdef _get_clk_mon_status_dtype_offsets(): - cdef nvmlClkMonStatus_t pod - return _numpy.dtype({ - 'names': ['b_global_status', 'clk_mon_list_size', 'clk_mon_list'], - 'formats': [_numpy.uint32, _numpy.uint32, (clk_mon_fault_info_dtype, 32)], - 'offsets': [ - (&(pod.bGlobalStatus)) - (&pod), - (&(pod.clkMonListSize)) - (&pod), - (&(pod.clkMonList)) - (&pod), - ], - 'itemsize': sizeof(nvmlClkMonStatus_t), - }) + cdef nvmlClkMonStatus_t *pod = _cyb_calloc(1, sizeof(nvmlClkMonStatus_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlClkMonStatus_t") + try: + return _numpy.dtype({ + 'names': ['b_global_status', 'clk_mon_list_size', 'clk_mon_list'], + 'formats': [_numpy.uint32, _numpy.uint32, (clk_mon_fault_info_dtype, 32)], + 'offsets': [ + (&(pod.bGlobalStatus)) - (pod), + (&(pod.clkMonListSize)) - (pod), + (&(pod.clkMonList)) - (pod), + ], + 'itemsize': sizeof(nvmlClkMonStatus_t), + }) + finally: + _cyb_free(pod) clk_mon_status_dtype = _get_clk_mon_status_dtype_offsets() @@ -23825,18 +24400,23 @@ cdef class ClkMonStatus: cdef _get_processes_utilization_info_v1_dtype_offsets(): - cdef nvmlProcessesUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'process_samples_count', 'last_seen_time_stamp', 'proc_util_array'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.processSamplesCount)) - (&pod), - (&(pod.lastSeenTimeStamp)) - (&pod), - (&(pod.procUtilArray)) - (&pod), - ], - 'itemsize': sizeof(nvmlProcessesUtilizationInfo_v1_t), - }) + cdef nvmlProcessesUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlProcessesUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'process_samples_count', 'last_seen_time_stamp', 'proc_util_array'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.processSamplesCount)) - (pod), + (&(pod.lastSeenTimeStamp)) - (pod), + (&(pod.procUtilArray)) - (pod), + ], + 'itemsize': sizeof(nvmlProcessesUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) processes_utilization_info_v1_dtype = _get_processes_utilization_info_v1_dtype_offsets() @@ -23988,16 +24568,21 @@ cdef class ProcessesUtilizationInfo_v1: cdef _get_gpu_dynamic_pstates_info_dtype_offsets(): - cdef nvmlGpuDynamicPstatesInfo_t pod - return _numpy.dtype({ - 'names': ['flags_', 'utilization'], - 'formats': [_numpy.uint32, (_py_anon_pod1_dtype, 8)], - 'offsets': [ - (&(pod.flags)) - (&pod), - (&(pod.utilization)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuDynamicPstatesInfo_t), - }) + cdef nvmlGpuDynamicPstatesInfo_t *pod = _cyb_calloc(1, sizeof(nvmlGpuDynamicPstatesInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuDynamicPstatesInfo_t") + try: + return _numpy.dtype({ + 'names': ['flags_', 'utilization'], + 'formats': [_numpy.uint32, (_py_anon_pod1_dtype, 8)], + 'offsets': [ + (&(pod.flags)) - (pod), + (&(pod.utilization)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuDynamicPstatesInfo_t), + }) + finally: + _cyb_free(pod) gpu_dynamic_pstates_info_dtype = _get_gpu_dynamic_pstates_info_dtype_offsets() @@ -24133,18 +24718,23 @@ cdef class GpuDynamicPstatesInfo: cdef _get_vgpu_processes_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuProcessesUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'vgpu_process_count', 'last_seen_time_stamp', 'vgpu_proc_util_array'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.vgpuProcessCount)) - (&pod), - (&(pod.lastSeenTimeStamp)) - (&pod), - (&(pod.vgpuProcUtilArray)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), - }) + cdef nvmlVgpuProcessesUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuProcessesUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'vgpu_process_count', 'last_seen_time_stamp', 'vgpu_proc_util_array'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.vgpuProcessCount)) - (pod), + (&(pod.lastSeenTimeStamp)) - (pod), + (&(pod.vgpuProcUtilArray)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_processes_utilization_info_v1_dtype = _get_vgpu_processes_utilization_info_v1_dtype_offsets() @@ -24296,16 +24886,21 @@ cdef class VgpuProcessesUtilizationInfo_v1: cdef _get_vgpu_scheduler_params_dtype_offsets(): - cdef nvmlVgpuSchedulerParams_t pod - return _numpy.dtype({ - 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], - 'formats': [_py_anon_pod2_dtype, _py_anon_pod3_dtype], - 'offsets': [ - (&(pod.vgpuSchedDataWithARR)) - (&pod), - (&(pod.vgpuSchedData)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerParams_t), - }) + cdef nvmlVgpuSchedulerParams_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerParams_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerParams_t") + try: + return _numpy.dtype({ + 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], + 'formats': [_py_anon_pod2_dtype, _py_anon_pod3_dtype], + 'offsets': [ + (&(pod.vgpuSchedDataWithARR)) - (pod), + (&(pod.vgpuSchedData)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerParams_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_params_dtype = _get_vgpu_scheduler_params_dtype_offsets() @@ -24455,16 +25050,21 @@ cdef class VgpuSchedulerParams: cdef _get_vgpu_scheduler_set_params_dtype_offsets(): - cdef nvmlVgpuSchedulerSetParams_t pod - return _numpy.dtype({ - 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], - 'formats': [_py_anon_pod4_dtype, _py_anon_pod5_dtype], - 'offsets': [ - (&(pod.vgpuSchedDataWithARR)) - (&pod), - (&(pod.vgpuSchedData)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerSetParams_t), - }) + cdef nvmlVgpuSchedulerSetParams_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerSetParams_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerSetParams_t") + try: + return _numpy.dtype({ + 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], + 'formats': [_py_anon_pod4_dtype, _py_anon_pod5_dtype], + 'offsets': [ + (&(pod.vgpuSchedDataWithARR)) - (pod), + (&(pod.vgpuSchedData)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerSetParams_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_set_params_dtype = _get_vgpu_scheduler_set_params_dtype_offsets() @@ -24614,17 +25214,22 @@ cdef class VgpuSchedulerSetParams: cdef _get_vgpu_license_info_dtype_offsets(): - cdef nvmlVgpuLicenseInfo_t pod - return _numpy.dtype({ - 'names': ['is_licensed', 'license_expiry', 'current_state'], - 'formats': [_numpy.uint8, vgpu_license_expiry_dtype, _numpy.uint32], - 'offsets': [ - (&(pod.isLicensed)) - (&pod), - (&(pod.licenseExpiry)) - (&pod), - (&(pod.currentState)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuLicenseInfo_t), - }) + cdef nvmlVgpuLicenseInfo_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuLicenseInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuLicenseInfo_t") + try: + return _numpy.dtype({ + 'names': ['is_licensed', 'license_expiry', 'current_state'], + 'formats': [_numpy.uint8, vgpu_license_expiry_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.isLicensed)) - (pod), + (&(pod.licenseExpiry)) - (pod), + (&(pod.currentState)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuLicenseInfo_t), + }) + finally: + _cyb_free(pod) vgpu_license_info_dtype = _get_vgpu_license_info_dtype_offsets() @@ -24768,20 +25373,25 @@ cdef class VgpuLicenseInfo: cdef _get_grid_licensable_feature_dtype_offsets(): - cdef nvmlGridLicensableFeature_t pod - return _numpy.dtype({ - 'names': ['feature_code', 'feature_state', 'license_info', 'product_name', 'feature_enabled', 'license_expiry'], - 'formats': [_numpy.int32, _numpy.uint32, (_numpy.int8, 128), (_numpy.int8, 128), _numpy.uint32, grid_license_expiry_dtype], - 'offsets': [ - (&(pod.featureCode)) - (&pod), - (&(pod.featureState)) - (&pod), - (&(pod.licenseInfo)) - (&pod), - (&(pod.productName)) - (&pod), - (&(pod.featureEnabled)) - (&pod), - (&(pod.licenseExpiry)) - (&pod), - ], - 'itemsize': sizeof(nvmlGridLicensableFeature_t), - }) + cdef nvmlGridLicensableFeature_t *pod = _cyb_calloc(1, sizeof(nvmlGridLicensableFeature_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGridLicensableFeature_t") + try: + return _numpy.dtype({ + 'names': ['feature_code', 'feature_state', 'license_info', 'product_name', 'feature_enabled', 'license_expiry'], + 'formats': [_numpy.int32, _numpy.uint32, (_numpy.int8, 128), (_numpy.int8, 128), _numpy.uint32, grid_license_expiry_dtype], + 'offsets': [ + (&(pod.featureCode)) - (pod), + (&(pod.featureState)) - (pod), + (&(pod.licenseInfo)) - (pod), + (&(pod.productName)) - (pod), + (&(pod.featureEnabled)) - (pod), + (&(pod.licenseExpiry)) - (pod), + ], + 'itemsize': sizeof(nvmlGridLicensableFeature_t), + }) + finally: + _cyb_free(pod) grid_licensable_feature_dtype = _get_grid_licensable_feature_dtype_offsets() cdef object grid_licensable_feature_dtype_record = _numpy.dtype((_numpy.record, grid_licensable_feature_dtype)) @@ -24986,16 +25596,21 @@ cdef class GridLicensableFeature: cdef _get_unit_fan_speeds_dtype_offsets(): - cdef nvmlUnitFanSpeeds_t pod - return _numpy.dtype({ - 'names': ['fans', 'count'], - 'formats': [(unit_fan_info_dtype, 24), _numpy.uint32], - 'offsets': [ - (&(pod.fans)) - (&pod), - (&(pod.count)) - (&pod), - ], - 'itemsize': sizeof(nvmlUnitFanSpeeds_t), - }) + cdef nvmlUnitFanSpeeds_t *pod = _cyb_calloc(1, sizeof(nvmlUnitFanSpeeds_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlUnitFanSpeeds_t") + try: + return _numpy.dtype({ + 'names': ['fans', 'count'], + 'formats': [(unit_fan_info_dtype, 24), _numpy.uint32], + 'offsets': [ + (&(pod.fans)) - (pod), + (&(pod.count)) - (pod), + ], + 'itemsize': sizeof(nvmlUnitFanSpeeds_t), + }) + finally: + _cyb_free(pod) unit_fan_speeds_dtype = _get_unit_fan_speeds_dtype_offsets() @@ -25131,22 +25746,27 @@ cdef class UnitFanSpeeds: cdef _get_vgpu_pgpu_metadata_dtype_offsets(): - cdef nvmlVgpuPgpuMetadata_t pod - return _numpy.dtype({ - 'names': ['version', 'revision', 'host_driver_version', 'pgpu_virtualization_caps', 'reserved', 'host_supported_vgpu_range', 'opaque_data_size', 'opaque_data'], - 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 80), _numpy.uint32, (_numpy.uint32, 5), vgpu_version_dtype, _numpy.uint32, (_numpy.int8, 4)], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.revision)) - (&pod), - (&(pod.hostDriverVersion)) - (&pod), - (&(pod.pgpuVirtualizationCaps)) - (&pod), - (&(pod.reserved)) - (&pod), - (&(pod.hostSupportedVgpuRange)) - (&pod), - (&(pod.opaqueDataSize)) - (&pod), - (&(pod.opaqueData)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuPgpuMetadata_t), - }) + cdef nvmlVgpuPgpuMetadata_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuPgpuMetadata_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuPgpuMetadata_t") + try: + return _numpy.dtype({ + 'names': ['version', 'revision', 'host_driver_version', 'pgpu_virtualization_caps', 'reserved', 'host_supported_vgpu_range', 'opaque_data_size', 'opaque_data'], + 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 80), _numpy.uint32, (_numpy.uint32, 5), vgpu_version_dtype, _numpy.uint32, (_numpy.int8, 4)], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.revision)) - (pod), + (&(pod.hostDriverVersion)) - (pod), + (&(pod.pgpuVirtualizationCaps)) - (pod), + (&(pod.reserved)) - (pod), + (&(pod.hostSupportedVgpuRange)) - (pod), + (&(pod.opaqueDataSize)) - (pod), + (&(pod.opaqueData)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuPgpuMetadata_t), + }) + finally: + _cyb_free(pod) vgpu_pgpu_metadata_dtype = _get_vgpu_pgpu_metadata_dtype_offsets() @@ -25342,18 +25962,23 @@ cdef class VgpuPgpuMetadata: cdef _get_gpu_instance_info_dtype_offsets(): - cdef nvmlGpuInstanceInfo_t pod - return _numpy.dtype({ - 'names': ['device_', 'id', 'profile_id', 'placement'], - 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, gpu_instance_placement_dtype], - 'offsets': [ - (&(pod.device)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.profileId)) - (&pod), - (&(pod.placement)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuInstanceInfo_t), - }) + cdef nvmlGpuInstanceInfo_t *pod = _cyb_calloc(1, sizeof(nvmlGpuInstanceInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuInstanceInfo_t") + try: + return _numpy.dtype({ + 'names': ['device_', 'id', 'profile_id', 'placement'], + 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, gpu_instance_placement_dtype], + 'offsets': [ + (&(pod.device)) - (pod), + (&(pod.id)) - (pod), + (&(pod.profileId)) - (pod), + (&(pod.placement)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuInstanceInfo_t), + }) + finally: + _cyb_free(pod) gpu_instance_info_dtype = _get_gpu_instance_info_dtype_offsets() @@ -25509,19 +26134,24 @@ cdef class GpuInstanceInfo: cdef _get_compute_instance_info_dtype_offsets(): - cdef nvmlComputeInstanceInfo_t pod - return _numpy.dtype({ - 'names': ['device_', 'gpu_instance', 'id', 'profile_id', 'placement'], - 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.uint32, compute_instance_placement_dtype], - 'offsets': [ - (&(pod.device)) - (&pod), - (&(pod.gpuInstance)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.profileId)) - (&pod), - (&(pod.placement)) - (&pod), - ], - 'itemsize': sizeof(nvmlComputeInstanceInfo_t), - }) + cdef nvmlComputeInstanceInfo_t *pod = _cyb_calloc(1, sizeof(nvmlComputeInstanceInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlComputeInstanceInfo_t") + try: + return _numpy.dtype({ + 'names': ['device_', 'gpu_instance', 'id', 'profile_id', 'placement'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.uint32, compute_instance_placement_dtype], + 'offsets': [ + (&(pod.device)) - (pod), + (&(pod.gpuInstance)) - (pod), + (&(pod.id)) - (pod), + (&(pod.profileId)) - (pod), + (&(pod.placement)) - (pod), + ], + 'itemsize': sizeof(nvmlComputeInstanceInfo_t), + }) + finally: + _cyb_free(pod) compute_instance_info_dtype = _get_compute_instance_info_dtype_offsets() @@ -25688,17 +26318,22 @@ cdef class ComputeInstanceInfo: cdef _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets(): - cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'entry_count', 'entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.entryCount)) - (&pod), - (&(pod.entries)) - (&pod), - ], - 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), - }) + cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEccSramUniqueUncorrectedErrorCounts_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'entry_count', 'entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.entryCount)) - (pod), + (&(pod.entries)) - (pod), + ], + 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), + }) + finally: + _cyb_free(pod) ecc_sram_unique_uncorrected_error_counts_v1_dtype = _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets() @@ -25839,16 +26474,21 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: cdef _get_nvlink_firmware_info_dtype_offsets(): - cdef nvmlNvlinkFirmwareInfo_t pod - return _numpy.dtype({ - 'names': ['firmware_version', 'num_valid_entries'], - 'formats': [(nvlink_firmware_version_dtype, 100), _numpy.uint32], - 'offsets': [ - (&(pod.firmwareVersion)) - (&pod), - (&(pod.numValidEntries)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkFirmwareInfo_t), - }) + cdef nvmlNvlinkFirmwareInfo_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkFirmwareInfo_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkFirmwareInfo_t") + try: + return _numpy.dtype({ + 'names': ['firmware_version', 'num_valid_entries'], + 'formats': [(nvlink_firmware_version_dtype, 100), _numpy.uint32], + 'offsets': [ + (&(pod.firmwareVersion)) - (pod), + (&(pod.numValidEntries)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkFirmwareInfo_t), + }) + finally: + _cyb_free(pod) nvlink_firmware_info_dtype = _get_nvlink_firmware_info_dtype_offsets() @@ -25988,20 +26628,25 @@ cdef class NvlinkFirmwareInfo: cdef _get_vgpu_scheduler_log_info_v2_dtype_offsets(): - cdef nvmlVgpuSchedulerLogInfo_v2_t pod - return _numpy.dtype({ - 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice', 'entries_count', 'log_entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (vgpu_scheduler_log_entry_v2_dtype, 200)], - 'offsets': [ - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.avgFactor)) - (&pod), - (&(pod.timeslice)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v2_t), - }) + cdef nvmlVgpuSchedulerLogInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerLogInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice', 'entries_count', 'log_entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (vgpu_scheduler_log_entry_v2_dtype, 200)], + 'offsets': [ + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.avgFactor)) - (pod), + (&(pod.timeslice)) - (pod), + (&(pod.entriesCount)) - (pod), + (&(pod.logEntries)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v2_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_log_info_v2_dtype = _get_vgpu_scheduler_log_info_v2_dtype_offsets() @@ -26181,17 +26826,22 @@ cdef class VgpuSchedulerLogInfo_v2: cdef _get_get_cper_v1_dtype_offsets(): - cdef nvmlGetCPER_v1_t pod - return _numpy.dtype({ - 'names': ['cursor', 'buffer', 'buffer_size'], - 'formats': [cper_cursor_v1_dtype, _numpy.intp, _numpy.uint32], - 'offsets': [ - (&(pod.cursor)) - (&pod), - (&(pod.buffer)) - (&pod), - (&(pod.bufferSize)) - (&pod), - ], - 'itemsize': sizeof(nvmlGetCPER_v1_t), - }) + cdef nvmlGetCPER_v1_t *pod = _cyb_calloc(1, sizeof(nvmlGetCPER_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGetCPER_v1_t") + try: + return _numpy.dtype({ + 'names': ['cursor', 'buffer', 'buffer_size'], + 'formats': [cper_cursor_v1_dtype, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.cursor)) - (pod), + (&(pod.buffer)) - (pod), + (&(pod.bufferSize)) - (pod), + ], + 'itemsize': sizeof(nvmlGetCPER_v1_t), + }) + finally: + _cyb_free(pod) get_cper_v1_dtype = _get_get_cper_v1_dtype_offsets() @@ -26335,15 +26985,20 @@ cdef class GetCPER_v1: cdef _get_core_rail_metrics_dtype_offsets(): - cdef nvmlCoreRailMetrics_t pod - return _numpy.dtype({ - 'names': ['rails'], - 'formats': [(rail_metrics_dtype, 2)], - 'offsets': [ - (&(pod.rails)) - (&pod), - ], - 'itemsize': sizeof(nvmlCoreRailMetrics_t), - }) + cdef nvmlCoreRailMetrics_t *pod = _cyb_calloc(1, sizeof(nvmlCoreRailMetrics_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlCoreRailMetrics_t") + try: + return _numpy.dtype({ + 'names': ['rails'], + 'formats': [(rail_metrics_dtype, 2)], + 'offsets': [ + (&(pod.rails)) - (pod), + ], + 'itemsize': sizeof(nvmlCoreRailMetrics_t), + }) + finally: + _cyb_free(pod) core_rail_metrics_dtype = _get_core_rail_metrics_dtype_offsets() cdef object core_rail_metrics_dtype_record = _numpy.dtype((_numpy.record, core_rail_metrics_dtype)) @@ -26487,20 +27142,25 @@ cdef class CoreRailMetrics: cdef _get_pwr_model_metrics_pfpp1x_dtype_offsets(): - cdef nvmlPwrModelMetricsPfpp1x_t pod - return _numpy.dtype({ - 'names': ['num_vf_points', 'estimated_metrics', 'b_valid', 'max_perf_per_watt_point', 'fmax_at_vmax_point', 'tgp_headroomm_w'], - 'formats': [_numpy.uint8, (pwr_model_metrics_sample_pfpp1x_dtype, 32), _numpy.uint8, pwr_model_operating_point_pfpp1x_dtype, pwr_model_operating_point_pfpp1x_dtype, _numpy.uint32], - 'offsets': [ - (&(pod.numVfPoints)) - (&pod), - (&(pod.estimatedMetrics)) - (&pod), - (&(pod.bValid)) - (&pod), - (&(pod.maxPerfPerWattPoint)) - (&pod), - (&(pod.fmaxAtVmaxPoint)) - (&pod), - (&(pod.tgpHeadroommW)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelMetricsPfpp1x_t), - }) + cdef nvmlPwrModelMetricsPfpp1x_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelMetricsPfpp1x_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelMetricsPfpp1x_t") + try: + return _numpy.dtype({ + 'names': ['num_vf_points', 'estimated_metrics', 'b_valid', 'max_perf_per_watt_point', 'fmax_at_vmax_point', 'tgp_headroomm_w'], + 'formats': [_numpy.uint8, (pwr_model_metrics_sample_pfpp1x_dtype, 32), _numpy.uint8, pwr_model_operating_point_pfpp1x_dtype, pwr_model_operating_point_pfpp1x_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.numVfPoints)) - (pod), + (&(pod.estimatedMetrics)) - (pod), + (&(pod.bValid)) - (pod), + (&(pod.maxPerfPerWattPoint)) - (pod), + (&(pod.fmaxAtVmaxPoint)) - (pod), + (&(pod.tgpHeadroommW)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelMetricsPfpp1x_t), + }) + finally: + _cyb_free(pod) pwr_model_metrics_pfpp1x_dtype = _get_pwr_model_metrics_pfpp1x_dtype_offsets() cdef object pwr_model_metrics_pfpp1x_dtype_record = _numpy.dtype((_numpy.record, pwr_model_metrics_pfpp1x_dtype)) @@ -26702,21 +27362,26 @@ cdef class PwrModelMetricsPfpp1x: cdef _get_gpu_fabric_info_v4_dtype_offsets(): - cdef nvmlGpuFabricInfo_v4_t pod - return _numpy.dtype({ - 'names': ['cluster_uuid', 'status', 'cliques', 'num_cliques', 'state', 'health_mask', 'health_summary'], - 'formats': [(_numpy.uint8, 16), _numpy.int32, (gpu_fabric_clique_v1_dtype, 64), _numpy.uint32, _numpy.uint8, _numpy.uint32, _numpy.uint8], - 'offsets': [ - (&(pod.clusterUuid)) - (&pod), - (&(pod.status)) - (&pod), - (&(pod.cliques)) - (&pod), - (&(pod.numCliques)) - (&pod), - (&(pod.state)) - (&pod), - (&(pod.healthMask)) - (&pod), - (&(pod.healthSummary)) - (&pod), - ], - 'itemsize': sizeof(nvmlGpuFabricInfo_v4_t), - }) + cdef nvmlGpuFabricInfo_v4_t *pod = _cyb_calloc(1, sizeof(nvmlGpuFabricInfo_v4_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGpuFabricInfo_v4_t") + try: + return _numpy.dtype({ + 'names': ['cluster_uuid', 'status', 'cliques', 'num_cliques', 'state', 'health_mask', 'health_summary'], + 'formats': [(_numpy.uint8, 16), _numpy.int32, (gpu_fabric_clique_v1_dtype, 64), _numpy.uint32, _numpy.uint8, _numpy.uint32, _numpy.uint8], + 'offsets': [ + (&(pod.clusterUuid)) - (pod), + (&(pod.status)) - (pod), + (&(pod.cliques)) - (pod), + (&(pod.numCliques)) - (pod), + (&(pod.state)) - (pod), + (&(pod.healthMask)) - (pod), + (&(pod.healthSummary)) - (pod), + ], + 'itemsize': sizeof(nvmlGpuFabricInfo_v4_t), + }) + finally: + _cyb_free(pod) gpu_fabric_info_v4_dtype = _get_gpu_fabric_info_v4_dtype_offsets() @@ -26912,16 +27577,21 @@ cdef class GpuFabricInfo_v4: cdef _get_nvlink_telemetry_samples_v1_dtype_offsets(): - cdef nvmlNvlinkTelemetrySamples_v1_t pod - return _numpy.dtype({ - 'names': ['telemetry_count', 'telemetry_samples'], - 'formats': [_numpy.uint32, _numpy.intp], - 'offsets': [ - (&(pod.telemetryCount)) - (&pod), - (&(pod.telemetrySamples)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkTelemetrySamples_v1_t), - }) + cdef nvmlNvlinkTelemetrySamples_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkTelemetrySamples_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkTelemetrySamples_v1_t") + try: + return _numpy.dtype({ + 'names': ['telemetry_count', 'telemetry_samples'], + 'formats': [_numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.telemetryCount)) - (pod), + (&(pod.telemetrySamples)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkTelemetrySamples_v1_t), + }) + finally: + _cyb_free(pod) nvlink_telemetry_samples_v1_dtype = _get_nvlink_telemetry_samples_v1_dtype_offsets() @@ -27051,18 +27721,23 @@ cdef class NvlinkTelemetrySamples_v1: cdef _get_ecc_bank_remapper_status_v1_dtype_offsets(): - cdef nvmlEccBankRemapperStatus_v1_t pod - return _numpy.dtype({ - 'names': ['active_remappings', 'inactive_remappings', 'b_pending', 'histogram'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, ecc_bank_remapper_histogram_v1_dtype], - 'offsets': [ - (&(pod.activeRemappings)) - (&pod), - (&(pod.inactiveRemappings)) - (&pod), - (&(pod.bPending)) - (&pod), - (&(pod.histogram)) - (&pod), - ], - 'itemsize': sizeof(nvmlEccBankRemapperStatus_v1_t), - }) + cdef nvmlEccBankRemapperStatus_v1_t *pod = _cyb_calloc(1, sizeof(nvmlEccBankRemapperStatus_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlEccBankRemapperStatus_v1_t") + try: + return _numpy.dtype({ + 'names': ['active_remappings', 'inactive_remappings', 'b_pending', 'histogram'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, ecc_bank_remapper_histogram_v1_dtype], + 'offsets': [ + (&(pod.activeRemappings)) - (pod), + (&(pod.inactiveRemappings)) - (pod), + (&(pod.bPending)) - (pod), + (&(pod.histogram)) - (pod), + ], + 'itemsize': sizeof(nvmlEccBankRemapperStatus_v1_t), + }) + finally: + _cyb_free(pod) ecc_bank_remapper_status_v1_dtype = _get_ecc_bank_remapper_status_v1_dtype_offsets() @@ -27217,19 +27892,24 @@ cdef class EccBankRemapperStatus_v1: cdef _get_nvlink_setup_nvle_encryption_key_v1_dtype_offsets(): - cdef nvmlNvlinkSetupNvleEncryptionKey_v1_t pod - return _numpy.dtype({ - 'names': ['nvle_key', 'local_gpu_alid', 'remote_gpu_alid', 'local_gpu_nvle_private_info', 'remote_gpu_nvle_private_info'], - 'formats': [(_numpy.uint8, 32), _numpy.uint32, _numpy.uint32, nvlink_nvle_private_info_v1_dtype, nvlink_nvle_private_info_v1_dtype], - 'offsets': [ - (&(pod.nvleKey)) - (&pod), - (&(pod.localGpuAlid)) - (&pod), - (&(pod.remoteGpuAlid)) - (&pod), - (&(pod.localGpuNvlePrivateInfo)) - (&pod), - (&(pod.remoteGpuNvlePrivateInfo)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t), - }) + cdef nvmlNvlinkSetupNvleEncryptionKey_v1_t *pod = _cyb_calloc(1, sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvlinkSetupNvleEncryptionKey_v1_t") + try: + return _numpy.dtype({ + 'names': ['nvle_key', 'local_gpu_alid', 'remote_gpu_alid', 'local_gpu_nvle_private_info', 'remote_gpu_nvle_private_info'], + 'formats': [(_numpy.uint8, 32), _numpy.uint32, _numpy.uint32, nvlink_nvle_private_info_v1_dtype, nvlink_nvle_private_info_v1_dtype], + 'offsets': [ + (&(pod.nvleKey)) - (pod), + (&(pod.localGpuAlid)) - (pod), + (&(pod.remoteGpuAlid)) - (pod), + (&(pod.localGpuNvlePrivateInfo)) - (pod), + (&(pod.remoteGpuNvlePrivateInfo)) - (pod), + ], + 'itemsize': sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t), + }) + finally: + _cyb_free(pod) nvlink_setup_nvle_encryption_key_v1_dtype = _get_nvlink_setup_nvle_encryption_key_v1_dtype_offsets() @@ -27406,19 +28086,24 @@ cdef class NvlinkSetupNvleEncryptionKey_v1: cdef _get_vgpu_instances_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuInstancesUtilizationInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'sample_val_type', 'vgpu_instance_count', 'last_seen_time_stamp', 'vgpu_util_array'], - 'formats': [_numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint64, _numpy.intp], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.sampleValType)) - (&pod), - (&(pod.vgpuInstanceCount)) - (&pod), - (&(pod.lastSeenTimeStamp)) - (&pod), - (&(pod.vgpuUtilArray)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), - }) + cdef nvmlVgpuInstancesUtilizationInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuInstancesUtilizationInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'sample_val_type', 'vgpu_instance_count', 'last_seen_time_stamp', 'vgpu_util_array'], + 'formats': [_numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.sampleValType)) - (pod), + (&(pod.vgpuInstanceCount)) - (pod), + (&(pod.lastSeenTimeStamp)) - (pod), + (&(pod.vgpuUtilArray)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_instances_utilization_info_v1_dtype = _get_vgpu_instances_utilization_info_v1_dtype_offsets() @@ -27581,17 +28266,22 @@ cdef class VgpuInstancesUtilizationInfo_v1: cdef _get_prm_counter_v1_dtype_offsets(): - cdef nvmlPRMCounter_v1_t pod - return _numpy.dtype({ - 'names': ['counter_id', 'in_data', 'counter_value'], - 'formats': [_numpy.uint32, prm_counter_input_v1_dtype, prm_counter_value_v1_dtype], - 'offsets': [ - (&(pod.counterId)) - (&pod), - (&(pod.inData)) - (&pod), - (&(pod.counterValue)) - (&pod), - ], - 'itemsize': sizeof(nvmlPRMCounter_v1_t), - }) + cdef nvmlPRMCounter_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPRMCounter_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPRMCounter_v1_t") + try: + return _numpy.dtype({ + 'names': ['counter_id', 'in_data', 'counter_value'], + 'formats': [_numpy.uint32, prm_counter_input_v1_dtype, prm_counter_value_v1_dtype], + 'offsets': [ + (&(pod.counterId)) - (pod), + (&(pod.inData)) - (pod), + (&(pod.counterValue)) - (pod), + ], + 'itemsize': sizeof(nvmlPRMCounter_v1_t), + }) + finally: + _cyb_free(pod) prm_counter_v1_dtype = _get_prm_counter_v1_dtype_offsets() cdef object prm_counter_v1_dtype_record = _numpy.dtype((_numpy.record, prm_counter_v1_dtype)) @@ -27759,20 +28449,25 @@ cdef class PRMCounter_v1: cdef _get_vgpu_scheduler_log_dtype_offsets(): - cdef nvmlVgpuSchedulerLog_t pod - return _numpy.dtype({ - 'names': ['engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], - 'offsets': [ - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerLog_t), - }) + cdef nvmlVgpuSchedulerLog_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLog_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerLog_t") + try: + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], + 'offsets': [ + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.arrMode)) - (pod), + (&(pod.schedulerParams)) - (pod), + (&(pod.entriesCount)) - (pod), + (&(pod.logEntries)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLog_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_log_dtype = _get_vgpu_scheduler_log_dtype_offsets() @@ -27957,17 +28652,22 @@ cdef class VgpuSchedulerLog: cdef _get_vgpu_scheduler_get_state_dtype_offsets(): - cdef nvmlVgpuSchedulerGetState_t pod - return _numpy.dtype({ - 'names': ['scheduler_policy', 'arr_mode', 'scheduler_params'], - 'formats': [_numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], - 'offsets': [ - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerGetState_t), - }) + cdef nvmlVgpuSchedulerGetState_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerGetState_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerGetState_t") + try: + return _numpy.dtype({ + 'names': ['scheduler_policy', 'arr_mode', 'scheduler_params'], + 'formats': [_numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], + 'offsets': [ + (&(pod.schedulerPolicy)) - (pod), + (&(pod.arrMode)) - (pod), + (&(pod.schedulerParams)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerGetState_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_get_state_dtype = _get_vgpu_scheduler_get_state_dtype_offsets() @@ -28111,19 +28811,24 @@ cdef class VgpuSchedulerGetState: cdef _get_vgpu_scheduler_state_info_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerStateInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v1_t), - }) + cdef nvmlVgpuSchedulerStateInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerStateInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.arrMode)) - (pod), + (&(pod.schedulerParams)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_state_info_v1_dtype = _get_vgpu_scheduler_state_info_v1_dtype_offsets() @@ -28289,21 +28994,26 @@ cdef class VgpuSchedulerStateInfo_v1: cdef _get_vgpu_scheduler_log_info_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerLogInfo_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v1_t), - }) + cdef nvmlVgpuSchedulerLogInfo_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerLogInfo_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.arrMode)) - (pod), + (&(pod.schedulerParams)) - (pod), + (&(pod.entriesCount)) - (pod), + (&(pod.logEntries)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v1_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_log_info_v1_dtype = _get_vgpu_scheduler_log_info_v1_dtype_offsets() @@ -28499,19 +29209,24 @@ cdef class VgpuSchedulerLogInfo_v1: cdef _get_vgpu_scheduler_state_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerState_v1_t pod - return _numpy.dtype({ - 'names': ['version', 'engine_id', 'scheduler_policy', 'enable_arr_mode', 'scheduler_params'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_set_params_dtype], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.enableARRMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerState_v1_t), - }) + cdef nvmlVgpuSchedulerState_v1_t *pod = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerState_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlVgpuSchedulerState_v1_t") + try: + return _numpy.dtype({ + 'names': ['version', 'engine_id', 'scheduler_policy', 'enable_arr_mode', 'scheduler_params'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_set_params_dtype], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.engineId)) - (pod), + (&(pod.schedulerPolicy)) - (pod), + (&(pod.enableARRMode)) - (pod), + (&(pod.schedulerParams)) - (pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerState_v1_t), + }) + finally: + _cyb_free(pod) vgpu_scheduler_state_v1_dtype = _get_vgpu_scheduler_state_v1_dtype_offsets() @@ -28677,17 +29392,22 @@ cdef class VgpuSchedulerState_v1: cdef _get_grid_licensable_features_dtype_offsets(): - cdef nvmlGridLicensableFeatures_t pod - return _numpy.dtype({ - 'names': ['is_grid_license_supported', 'licensable_features_count', 'grid_licensable_features'], - 'formats': [_numpy.int32, _numpy.uint32, (grid_licensable_feature_dtype, 3)], - 'offsets': [ - (&(pod.isGridLicenseSupported)) - (&pod), - (&(pod.licensableFeaturesCount)) - (&pod), - (&(pod.gridLicensableFeatures)) - (&pod), - ], - 'itemsize': sizeof(nvmlGridLicensableFeatures_t), - }) + cdef nvmlGridLicensableFeatures_t *pod = _cyb_calloc(1, sizeof(nvmlGridLicensableFeatures_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlGridLicensableFeatures_t") + try: + return _numpy.dtype({ + 'names': ['is_grid_license_supported', 'licensable_features_count', 'grid_licensable_features'], + 'formats': [_numpy.int32, _numpy.uint32, (grid_licensable_feature_dtype, 3)], + 'offsets': [ + (&(pod.isGridLicenseSupported)) - (pod), + (&(pod.licensableFeaturesCount)) - (pod), + (&(pod.gridLicensableFeatures)) - (pod), + ], + 'itemsize': sizeof(nvmlGridLicensableFeatures_t), + }) + finally: + _cyb_free(pod) grid_licensable_features_dtype = _get_grid_licensable_features_dtype_offsets() @@ -28826,17 +29546,22 @@ cdef class GridLicensableFeatures: cdef _get_nv_link_info_v2_dtype_offsets(): - cdef nvmlNvLinkInfo_v2_t pod - return _numpy.dtype({ - 'names': ['version', 'is_nvle_enabled', 'firmware_info'], - 'formats': [_numpy.uint32, _numpy.uint32, nvlink_firmware_info_dtype], - 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.isNvleEnabled)) - (&pod), - (&(pod.firmwareInfo)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvLinkInfo_v2_t), - }) + cdef nvmlNvLinkInfo_v2_t *pod = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v2_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvLinkInfo_v2_t") + try: + return _numpy.dtype({ + 'names': ['version', 'is_nvle_enabled', 'firmware_info'], + 'formats': [_numpy.uint32, _numpy.uint32, nvlink_firmware_info_dtype], + 'offsets': [ + (&(pod.version)) - (pod), + (&(pod.isNvleEnabled)) - (pod), + (&(pod.firmwareInfo)) - (pod), + ], + 'itemsize': sizeof(nvmlNvLinkInfo_v2_t), + }) + finally: + _cyb_free(pod) nv_link_info_v2_dtype = _get_nv_link_info_v2_dtype_offsets() @@ -28980,17 +29705,22 @@ cdef class NvLinkInfo_v2: cdef _get_nv_link_info_v3_dtype_offsets(): - cdef nvmlNvLinkInfo_v3_t pod - return _numpy.dtype({ - 'names': ['is_nvle_enabled', 'firmware_info', 'is_nvle_ready'], - 'formats': [_numpy.uint32, nvlink_firmware_info_dtype, _numpy.uint32], - 'offsets': [ - (&(pod.isNvleEnabled)) - (&pod), - (&(pod.firmwareInfo)) - (&pod), - (&(pod.isNvleReady)) - (&pod), - ], - 'itemsize': sizeof(nvmlNvLinkInfo_v3_t), - }) + cdef nvmlNvLinkInfo_v3_t *pod = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v3_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlNvLinkInfo_v3_t") + try: + return _numpy.dtype({ + 'names': ['is_nvle_enabled', 'firmware_info', 'is_nvle_ready'], + 'formats': [_numpy.uint32, nvlink_firmware_info_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.isNvleEnabled)) - (pod), + (&(pod.firmwareInfo)) - (pod), + (&(pod.isNvleReady)) - (pod), + ], + 'itemsize': sizeof(nvmlNvLinkInfo_v3_t), + }) + finally: + _cyb_free(pod) nv_link_info_v3_dtype = _get_nv_link_info_v3_dtype_offsets() @@ -29134,19 +29864,24 @@ cdef class NvLinkInfo_v3: cdef _get_pwr_model_metrics_dlppm1x_dtype_offsets(): - cdef nvmlPwrModelMetricsDlppm1x_t pod - return _numpy.dtype({ - 'names': ['b_valid', 'core_rail', 'fb_rail', 'tgp_pwr_tuple', 'perf_metrics'], - 'formats': [_numpy.uint8, core_rail_metrics_dtype, rail_metrics_dtype, pmgr_pwr_tuple_dtype, pwr_model_metrics_dlppm1x_perf_dtype], - 'offsets': [ - (&(pod.bValid)) - (&pod), - (&(pod.coreRail)) - (&pod), - (&(pod.fbRail)) - (&pod), - (&(pod.tgpPwrTuple)) - (&pod), - (&(pod.perfMetrics)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1x_t), - }) + cdef nvmlPwrModelMetricsDlppm1x_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelMetricsDlppm1x_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelMetricsDlppm1x_t") + try: + return _numpy.dtype({ + 'names': ['b_valid', 'core_rail', 'fb_rail', 'tgp_pwr_tuple', 'perf_metrics'], + 'formats': [_numpy.uint8, core_rail_metrics_dtype, rail_metrics_dtype, pmgr_pwr_tuple_dtype, pwr_model_metrics_dlppm1x_perf_dtype], + 'offsets': [ + (&(pod.bValid)) - (pod), + (&(pod.coreRail)) - (pod), + (&(pod.fbRail)) - (pod), + (&(pod.tgpPwrTuple)) - (pod), + (&(pod.perfMetrics)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1x_t), + }) + finally: + _cyb_free(pod) pwr_model_metrics_dlppm1x_dtype = _get_pwr_model_metrics_dlppm1x_dtype_offsets() cdef object pwr_model_metrics_dlppm1x_dtype_record = _numpy.dtype((_numpy.record, pwr_model_metrics_dlppm1x_dtype)) @@ -29336,15 +30071,20 @@ cdef class PwrModelMetricsDlppm1x: cdef _get_perf_metrics_pfpp1x_sample_dtype_offsets(): - cdef nvmlPerfMetricsPfpp1xSample_t pod - return _numpy.dtype({ - 'names': ['estimated_metrics'], - 'formats': [pwr_model_metrics_pfpp1x_dtype], - 'offsets': [ - (&(pod.estimatedMetrics)) - (&pod), - ], - 'itemsize': sizeof(nvmlPerfMetricsPfpp1xSample_t), - }) + cdef nvmlPerfMetricsPfpp1xSample_t *pod = _cyb_calloc(1, sizeof(nvmlPerfMetricsPfpp1xSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPerfMetricsPfpp1xSample_t") + try: + return _numpy.dtype({ + 'names': ['estimated_metrics'], + 'formats': [pwr_model_metrics_pfpp1x_dtype], + 'offsets': [ + (&(pod.estimatedMetrics)) - (pod), + ], + 'itemsize': sizeof(nvmlPerfMetricsPfpp1xSample_t), + }) + finally: + _cyb_free(pod) perf_metrics_pfpp1x_sample_dtype = _get_perf_metrics_pfpp1x_sample_dtype_offsets() cdef object perf_metrics_pfpp1x_sample_dtype_record = _numpy.dtype((_numpy.record, perf_metrics_pfpp1x_sample_dtype)) @@ -29488,16 +30228,21 @@ cdef class PerfMetricsPfpp1xSample: cdef _get_pwr_model_metrics_dlppm1x_dramclk_estimates_dtype_offsets(): - cdef nvmlPwrModelMetricsDlppm1xDramclkEstimates_t pod - return _numpy.dtype({ - 'names': ['estimated_metrics', 'num_estimated_metrics'], - 'formats': [(pwr_model_metrics_dlppm1x_dtype, 8), _numpy.uint8], - 'offsets': [ - (&(pod.estimatedMetrics)) - (&pod), - (&(pod.numEstimatedMetrics)) - (&pod), - ], - 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xDramclkEstimates_t), - }) + cdef nvmlPwrModelMetricsDlppm1xDramclkEstimates_t *pod = _cyb_calloc(1, sizeof(nvmlPwrModelMetricsDlppm1xDramclkEstimates_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPwrModelMetricsDlppm1xDramclkEstimates_t") + try: + return _numpy.dtype({ + 'names': ['estimated_metrics', 'num_estimated_metrics'], + 'formats': [(pwr_model_metrics_dlppm1x_dtype, 8), _numpy.uint8], + 'offsets': [ + (&(pod.estimatedMetrics)) - (pod), + (&(pod.numEstimatedMetrics)) - (pod), + ], + 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xDramclkEstimates_t), + }) + finally: + _cyb_free(pod) pwr_model_metrics_dlppm1x_dramclk_estimates_dtype = _get_pwr_model_metrics_dlppm1x_dramclk_estimates_dtype_offsets() cdef object pwr_model_metrics_dlppm1x_dramclk_estimates_dtype_record = _numpy.dtype((_numpy.record, pwr_model_metrics_dlppm1x_dramclk_estimates_dtype)) @@ -29651,20 +30396,25 @@ cdef class PwrModelMetricsDlppm1xDramclkEstimates: cdef _get_observed_metrics_dtype_offsets(): - cdef nvmlObservedMetrics_t pod - return _numpy.dtype({ - 'names': ['initial_dramclk_est', 'b_valid', 'core_rail', 'fb_rail', 'tgp_pwr_tuple', 'perf_metrics'], - 'formats': [(pwr_model_metrics_dlppm1x_dramclk_estimates_dtype, 3), _numpy.uint8, core_rail_metrics_dtype, rail_metrics_dtype, pmgr_pwr_tuple_dtype, pwr_model_metrics_dlppm1x_perf_dtype], - 'offsets': [ - (&(pod.initialDramclkEst)) - (&pod), - (&(pod.bValid)) - (&pod), - (&(pod.coreRail)) - (&pod), - (&(pod.fbRail)) - (&pod), - (&(pod.tgpPwrTuple)) - (&pod), - (&(pod.perfMetrics)) - (&pod), - ], - 'itemsize': sizeof(nvmlObservedMetrics_t), - }) + cdef nvmlObservedMetrics_t *pod = _cyb_calloc(1, sizeof(nvmlObservedMetrics_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlObservedMetrics_t") + try: + return _numpy.dtype({ + 'names': ['initial_dramclk_est', 'b_valid', 'core_rail', 'fb_rail', 'tgp_pwr_tuple', 'perf_metrics'], + 'formats': [(pwr_model_metrics_dlppm1x_dramclk_estimates_dtype, 3), _numpy.uint8, core_rail_metrics_dtype, rail_metrics_dtype, pmgr_pwr_tuple_dtype, pwr_model_metrics_dlppm1x_perf_dtype], + 'offsets': [ + (&(pod.initialDramclkEst)) - (pod), + (&(pod.bValid)) - (pod), + (&(pod.coreRail)) - (pod), + (&(pod.fbRail)) - (pod), + (&(pod.tgpPwrTuple)) - (pod), + (&(pod.perfMetrics)) - (pod), + ], + 'itemsize': sizeof(nvmlObservedMetrics_t), + }) + finally: + _cyb_free(pod) observed_metrics_dtype = _get_observed_metrics_dtype_offsets() cdef object observed_metrics_dtype_record = _numpy.dtype((_numpy.record, observed_metrics_dtype)) @@ -29865,15 +30615,20 @@ cdef class ObservedMetrics: cdef _get_perf_metrics_dlppc2x_sample_dtype_offsets(): - cdef nvmlPerfMetricsDlppc2xSample_t pod - return _numpy.dtype({ - 'names': ['observed_metrics'], - 'formats': [observed_metrics_dtype], - 'offsets': [ - (&(pod.observedMetrics)) - (&pod), - ], - 'itemsize': sizeof(nvmlPerfMetricsDlppc2xSample_t), - }) + cdef nvmlPerfMetricsDlppc2xSample_t *pod = _cyb_calloc(1, sizeof(nvmlPerfMetricsDlppc2xSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPerfMetricsDlppc2xSample_t") + try: + return _numpy.dtype({ + 'names': ['observed_metrics'], + 'formats': [observed_metrics_dtype], + 'offsets': [ + (&(pod.observedMetrics)) - (pod), + ], + 'itemsize': sizeof(nvmlPerfMetricsDlppc2xSample_t), + }) + finally: + _cyb_free(pod) perf_metrics_dlppc2x_sample_dtype = _get_perf_metrics_dlppc2x_sample_dtype_offsets() cdef object perf_metrics_dlppc2x_sample_dtype_record = _numpy.dtype((_numpy.record, perf_metrics_dlppc2x_sample_dtype)) @@ -30017,16 +30772,21 @@ cdef class PerfMetricsDlppc2xSample: cdef _get__py_anon_pod8_dtype_offsets(): - cdef cuda_bindings_nvml__anon_pod8 pod - return _numpy.dtype({ - 'names': ['dlppc2x', 'pfpp1x'], - 'formats': [perf_metrics_dlppc2x_sample_dtype, perf_metrics_pfpp1x_sample_dtype], - 'offsets': [ - (&(pod.dlppc2x)) - (&pod), - (&(pod.pfpp1x)) - (&pod), - ], - 'itemsize': sizeof(cuda_bindings_nvml__anon_pod8), - }) + cdef cuda_bindings_nvml__anon_pod8 *pod = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod8)) + if pod == NULL: + raise MemoryError("Error allocating cuda_bindings_nvml__anon_pod8") + try: + return _numpy.dtype({ + 'names': ['dlppc2x', 'pfpp1x'], + 'formats': [perf_metrics_dlppc2x_sample_dtype, perf_metrics_pfpp1x_sample_dtype], + 'offsets': [ + (&(pod.dlppc2x)) - (pod), + (&(pod.pfpp1x)) - (pod), + ], + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod8), + }) + finally: + _cyb_free(pod) _py_anon_pod8_dtype = _get__py_anon_pod8_dtype_offsets() @@ -30178,16 +30938,21 @@ cdef class _py_anon_pod8: cdef _get_perf_metric_controller_sample_dtype_offsets(): - cdef nvmlPerfMetricControllerSample_t pod - return _numpy.dtype({ - 'names': ['controller_type', 'data_'], - 'formats': [_numpy.uint32, _py_anon_pod8_dtype], - 'offsets': [ - (&(pod.controllerType)) - (&pod), - (&(pod.data)) - (&pod), - ], - 'itemsize': sizeof(nvmlPerfMetricControllerSample_t), - }) + cdef nvmlPerfMetricControllerSample_t *pod = _cyb_calloc(1, sizeof(nvmlPerfMetricControllerSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPerfMetricControllerSample_t") + try: + return _numpy.dtype({ + 'names': ['controller_type', 'data_'], + 'formats': [_numpy.uint32, _py_anon_pod8_dtype], + 'offsets': [ + (&(pod.controllerType)) - (pod), + (&(pod.data)) - (pod), + ], + 'itemsize': sizeof(nvmlPerfMetricControllerSample_t), + }) + finally: + _cyb_free(pod) perf_metric_controller_sample_dtype = _get_perf_metric_controller_sample_dtype_offsets() cdef object perf_metric_controller_sample_dtype_record = _numpy.dtype((_numpy.record, perf_metric_controller_sample_dtype)) @@ -30344,16 +31109,21 @@ cdef class PerfMetricControllerSample: cdef _get_perf_metrics_sample_dtype_offsets(): - cdef nvmlPerfMetricsSample_t pod - return _numpy.dtype({ - 'names': ['num_controller_data', 'controller_data'], - 'formats': [_numpy.uint8, (perf_metric_controller_sample_dtype, 4)], - 'offsets': [ - (&(pod.numControllerData)) - (&pod), - (&(pod.controllerData)) - (&pod), - ], - 'itemsize': sizeof(nvmlPerfMetricsSample_t), - }) + cdef nvmlPerfMetricsSample_t *pod = _cyb_calloc(1, sizeof(nvmlPerfMetricsSample_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPerfMetricsSample_t") + try: + return _numpy.dtype({ + 'names': ['num_controller_data', 'controller_data'], + 'formats': [_numpy.uint8, (perf_metric_controller_sample_dtype, 4)], + 'offsets': [ + (&(pod.numControllerData)) - (pod), + (&(pod.controllerData)) - (pod), + ], + 'itemsize': sizeof(nvmlPerfMetricsSample_t), + }) + finally: + _cyb_free(pod) perf_metrics_sample_dtype = _get_perf_metrics_sample_dtype_offsets() cdef object perf_metrics_sample_dtype_record = _numpy.dtype((_numpy.record, perf_metrics_sample_dtype)) @@ -30507,16 +31277,21 @@ cdef class PerfMetricsSample: cdef _get_perf_metrics_samples_v1_dtype_offsets(): - cdef nvmlPerfMetricsSamples_v1_t pod - return _numpy.dtype({ - 'names': ['num_samples', 'samples'], - 'formats': [_numpy.uint32, (perf_metrics_sample_dtype, 13)], - 'offsets': [ - (&(pod.numSamples)) - (&pod), - (&(pod.samples)) - (&pod), - ], - 'itemsize': sizeof(nvmlPerfMetricsSamples_v1_t), - }) + cdef nvmlPerfMetricsSamples_v1_t *pod = _cyb_calloc(1, sizeof(nvmlPerfMetricsSamples_v1_t)) + if pod == NULL: + raise MemoryError("Error allocating nvmlPerfMetricsSamples_v1_t") + try: + return _numpy.dtype({ + 'names': ['num_samples', 'samples'], + 'formats': [_numpy.uint32, (perf_metrics_sample_dtype, 13)], + 'offsets': [ + (&(pod.numSamples)) - (pod), + (&(pod.samples)) - (pod), + ], + 'itemsize': sizeof(nvmlPerfMetricsSamples_v1_t), + }) + finally: + _cyb_free(pod) perf_metrics_samples_v1_dtype = _get_perf_metrics_samples_v1_dtype_offsets() @@ -33145,8 +33920,8 @@ cpdef unsigned long long device_get_total_ecc_errors(intptr_t device, int error_ device (intptr_t): The identifier of the target device. error_type (MemoryErrorType): Flag that specifies the type of the errors. - counter_type (EccCounterType): Flag that specifies the counter- - type of the errors. + counter_type (EccCounterType): Flag that specifies the + counter-type of the errors. Returns: unsigned long long: Reference in which to return the specified ECC @@ -33179,8 +33954,8 @@ cpdef unsigned long long device_get_memory_error_counter(intptr_t device, int er device (intptr_t): The identifier of the target device. error_type (MemoryErrorType): Flag that specifies the type of error. - counter_type (EccCounterType): Flag that specifies the counter- - type of the errors. + counter_type (EccCounterType): Flag that specifies the + counter-type of the errors. location_type (MemoryLocation): Specifies the location of the counter. @@ -33189,8 +33964,8 @@ cpdef unsigned long long device_get_memory_error_counter(intptr_t device, int er .. note:: On MIG-enabled GPUs, per instance information can be queried using specific MIG - device handles. Per instance information is currently only supported for non- - DRAM uncorrectable volatile errors. Querying volatile errors using device + device handles. Per instance information is currently only supported for + non-DRAM uncorrectable volatile errors. Querying volatile errors using device handles is currently not supported. .. seealso:: `nvmlDeviceGetMemoryErrorCounter` """ @@ -33590,9 +34365,9 @@ cpdef object device_get_compute_running_processes_v3(intptr_t device): .. note:: In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance - information can be queried by using specific MIG device handles. Querying per- - instance information using MIG device handles is not supported if the device is - in vGPU Host virtualization mode. + information can be queried by using specific MIG device handles. Querying + per-instance information using MIG device handles is not supported if the + device is in vGPU Host virtualization mode. .. seealso:: `nvmlDeviceGetComputeRunningProcesses_v3` """ cdef unsigned int[1] info_count = [0] @@ -33633,9 +34408,9 @@ cpdef object device_get_graphics_running_processes_v3(intptr_t device): .. note:: In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance - information can be queried by using specific MIG device handles. Querying per- - instance information using MIG device handles is not supported if the device is - in vGPU Host virtualization mode. + information can be queried by using specific MIG device handles. Querying + per-instance information using MIG device handles is not supported if the + device is in vGPU Host virtualization mode. .. seealso:: `nvmlDeviceGetGraphicsRunningProcesses_v3` """ cdef unsigned int[1] info_count = [0] @@ -33677,9 +34452,9 @@ cpdef object device_get_mps_compute_running_processes_v3(intptr_t device): .. note:: In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance - information can be queried by using specific MIG device handles. Querying per- - instance information using MIG device handles is not supported if the device is - in vGPU Host virtualization mode. + information can be queried by using specific MIG device handles. Querying + per-instance information using MIG device handles is not supported if the + device is in vGPU Host virtualization mode. .. seealso:: `nvmlDeviceGetMPSComputeRunningProcesses_v3` """ cdef unsigned int[1] info_count = [0] @@ -35951,8 +36726,8 @@ cpdef str vgpu_type_get_license(unsigned int vgpu_type_id): The license type and version required to run the specified vGPU type is returned as an alphanumeric string, in the form ",", for example "GRID-Virtual-PC,2.0". If a vGPU is runnable with* more than one type - of license, the licenses are delimited by a semicolon, for example "GRID- - Virtual-PC,2.0;GRID-Virtual-WS,2.0;GRID-Virtual-WS-Ext,2.0". + of license, the licenses are delimited by a semicolon, for example + "GRID-Virtual-PC,2.0;GRID-Virtual-WS,2.0;GRID-Virtual-WS-Ext,2.0". The total length of the returned string will not exceed 128 characters, including the NUL terminator. See nvmlVgpuConstants::NVML_GRID_LICENSE_BUFFER_SIZE. @@ -36823,13 +37598,13 @@ cpdef tuple device_get_vgpu_utilization(intptr_t device, unsigned long long last For Kepler ™️ or newer fully supported devices. Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder for vGPU instances running on a device. Utilization values - are returned as an array of utilization sample structures in the caller- - supplied buffer pointed at by ``utilization_samples``. One utilization sample - structure is returned per vGPU instance, and includes the CPU timestamp at - which the samples were recorded. Individual utilization values are returned as - "unsigned int" values in ``nvmlValue_t`` unions. The function sets the caller- - supplied ``sample_val_type`` to NVML_VALUE_TYPE_UNSIGNED_INT to indicate the - returned value type. + are returned as an array of utilization sample structures in the + caller-supplied buffer pointed at by ``utilization_samples``. One utilization + sample structure is returned per vGPU instance, and includes the CPU timestamp + at which the samples were recorded. Individual utilization values are returned + as "unsigned int" values in ``nvmlValue_t`` unions. The function sets the + caller-supplied ``sample_val_type`` to NVML_VALUE_TYPE_UNSIGNED_INT to indicate + the returned value type. To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with ``utilization_samples`` set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current vGPU diff --git a/cuda_bindings_13/cuda/bindings/nvvm.pyx b/cuda_bindings_13/cuda/bindings/nvvm.pyx index 52bfa173b5f..7b3664caac8 100644 --- a/cuda_bindings_13/cuda/bindings/nvvm.pyx +++ b/cuda_bindings_13/cuda/bindings/nvvm.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=737e7153c4954ec8a2b0dedd50729ee160589ccef13b0e3f512b6c7645d83f62 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=404e6696c1e11fe6b1854c8b341bfba192fb90689ae0a69b3110c86d7c51ac5f # <<<< PREAMBLE CONTENT >>>> @@ -303,13 +303,13 @@ cpdef compile_program(intptr_t prog, int num_options, options): - -prec-sqrt=. - 0 (use a faster approximation for single-precision floating-point square root). - - 1 (default, use IEEE round-to-nearest mode for single-precision floating- - point square root). + - 1 (default, use IEEE round-to-nearest mode for single-precision + floating-point square root). - -prec-div=. - 0 (use a faster approximation for single-precision floating-point division and reciprocals). - - 1 (default, use IEEE round-to-nearest mode for single-precision floating- - point division and reciprocals). + - 1 (default, use IEEE round-to-nearest mode for single-precision + floating-point division and reciprocals). - -fma=. - 0 (disable FMA contraction). - 1 (default, enable FMA contraction). diff --git a/cuda_bindings_13/cuda/bindings/runtime.pyx b/cuda_bindings_13/cuda/bindings/runtime.pyx index b2bf7901688..38302e89860 100644 --- a/cuda_bindings_13/cuda/bindings/runtime.pyx +++ b/cuda_bindings_13/cuda/bindings/runtime.pyx @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # This code was automatically generated with version 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fd56bdd31c4c12f8618529544aa12f69d7cb782da716c7e2eb06d3f3fdd1fecd +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b2610805a773c0962631e67e0bd215f5b5a613e533637c379ba70c29d1143947 from typing import Any, Optional import cython import ctypes @@ -20219,7 +20219,7 @@ cdef class anon_union13: def pArray(self): return [cudaArray_t(init_value=_pArray) for _pArray in self._pvt_ptr[0].frame.pArray] @pArray.setter - def pArray(self, pArray : list[cudaArray_t]): + def pArray(self, pArray : list[cudaArray_t | int]): if len(pArray) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pArray)) pArray = [int(_pArray) for _pArray in pArray]