diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pxi.in b/cuda_bindings/cuda/bindings/_lib/utils.pxi.in index 910e758e5d..f4af55b6a7 100644 --- a/cuda_bindings/cuda/bindings/_lib/utils.pxi.in +++ b/cuda_bindings/cuda/bindings/_lib/utils.pxi.in @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS @@ -6,7 +6,7 @@ from libc.stdlib cimport calloc, free from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t from libc.stddef cimport wchar_t from libc.string cimport memcpy -from enum import Enum as _Enum +from cuda.bindings.utils._fast_enum import _FastEnum import ctypes as _ctypes cimport cuda.bindings.cydriver as cydriver cimport cuda.bindings._lib.param_packer as param_packer @@ -73,7 +73,7 @@ cdef class _HelperKernelParams: self._ckernelParams[idx] = value.getPtr() elif isinstance(value, (_ctypes.Structure)): self._ckernelParams[idx] = _ctypes.addressof(value) - elif isinstance(value, (_Enum)): + elif isinstance(value, (_FastEnum)): self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) (self._ckernelParams[idx])[0] = value.value data_idx += sizeof(int) diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx.in index 4ed8409a4d..1f2585f3c2 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/cuda/bindings/driver.pyx.in @@ -3,7 +3,6 @@ # This code was automatically generated with version 13.1.0. Do not modify it directly. from typing import Any, Optional -from enum import IntEnum import cython import ctypes from libc.stdlib cimport calloc, malloc, free @@ -14,6 +13,7 @@ from libc.limits cimport CHAR_MIN from libcpp.vector cimport vector from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS from cpython.bytes cimport PyBytes_FromStringAndSize +from .utils._fast_enum import _FastEnum, _FastEnumMetaclass import cuda.bindings.driver from libcpp.map cimport map @@ -349,7 +349,7 @@ CUDA_EGL_INFINITE_TIMEOUT = cydriver.CUDA_EGL_INFINITE_TIMEOUT {{if 'CUipcMem_flags_enum' in found_types}} -class CUipcMem_flags(IntEnum): +class CUipcMem_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Ipc Mem Flags """ @@ -358,11 +358,10 @@ class CUipcMem_flags(IntEnum): #: Automatically enable peer access between remote devices as needed CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = cydriver.CUipcMem_flags_enum.CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS{{endif}} -_dict_CUipcMem_flags = dict(((int(v), v) for k, v in CUipcMem_flags.__members__.items())) {{endif}} {{if 'CUmemAttach_flags_enum' in found_types}} -class CUmemAttach_flags(IntEnum): +class CUmemAttach_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Mem Attach Flags """ @@ -380,11 +379,10 @@ class CUmemAttach_flags(IntEnum): #: device CU_MEM_ATTACH_SINGLE = cydriver.CUmemAttach_flags_enum.CU_MEM_ATTACH_SINGLE{{endif}} -_dict_CUmemAttach_flags = dict(((int(v), v) for k, v in CUmemAttach_flags.__members__.items())) {{endif}} {{if 'CUctx_flags_enum' in found_types}} -class CUctx_flags(IntEnum): +class CUctx_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Context creation flags """ @@ -434,11 +432,10 @@ class CUctx_flags(IntEnum): {{if 'CU_CTX_FLAGS_MASK' in found_values}} CU_CTX_FLAGS_MASK = cydriver.CUctx_flags_enum.CU_CTX_FLAGS_MASK{{endif}} -_dict_CUctx_flags = dict(((int(v), v) for k, v in CUctx_flags.__members__.items())) {{endif}} {{if 'CUevent_sched_flags_enum' in found_types}} -class CUevent_sched_flags(IntEnum): +class CUevent_sched_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Event sched flags """ @@ -459,11 +456,10 @@ class CUevent_sched_flags(IntEnum): #: Set blocking synchronization as default scheduling CU_EVENT_SCHED_BLOCKING_SYNC = cydriver.CUevent_sched_flags_enum.CU_EVENT_SCHED_BLOCKING_SYNC{{endif}} -_dict_CUevent_sched_flags = dict(((int(v), v) for k, v in CUevent_sched_flags.__members__.items())) {{endif}} {{if 'cl_event_flags_enum' in found_types}} -class cl_event_flags(IntEnum): +class cl_event_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ NVCL event scheduling flags """ @@ -484,11 +480,10 @@ class cl_event_flags(IntEnum): #: Set blocking synchronization as default scheduling NVCL_EVENT_SCHED_BLOCKING_SYNC = cydriver.cl_event_flags_enum.NVCL_EVENT_SCHED_BLOCKING_SYNC{{endif}} -_dict_cl_event_flags = dict(((int(v), v) for k, v in cl_event_flags.__members__.items())) {{endif}} {{if 'cl_context_flags_enum' in found_types}} -class cl_context_flags(IntEnum): +class cl_context_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ NVCL context scheduling flags """ @@ -509,11 +504,10 @@ class cl_context_flags(IntEnum): #: Set blocking synchronization as default scheduling NVCL_CTX_SCHED_BLOCKING_SYNC = cydriver.cl_context_flags_enum.NVCL_CTX_SCHED_BLOCKING_SYNC{{endif}} -_dict_cl_context_flags = dict(((int(v), v) for k, v in cl_context_flags.__members__.items())) {{endif}} {{if 'CUstream_flags_enum' in found_types}} -class CUstream_flags(IntEnum): +class CUstream_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Stream creation flags """ @@ -526,11 +520,10 @@ class CUstream_flags(IntEnum): #: Stream does not synchronize with stream 0 (the NULL stream) CU_STREAM_NON_BLOCKING = cydriver.CUstream_flags_enum.CU_STREAM_NON_BLOCKING{{endif}} -_dict_CUstream_flags = dict(((int(v), v) for k, v in CUstream_flags.__members__.items())) {{endif}} {{if 'CUevent_flags_enum' in found_types}} -class CUevent_flags(IntEnum): +class CUevent_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Event creation flags """ @@ -552,11 +545,10 @@ class CUevent_flags(IntEnum): #: be set CU_EVENT_INTERPROCESS = cydriver.CUevent_flags_enum.CU_EVENT_INTERPROCESS{{endif}} -_dict_CUevent_flags = dict(((int(v), v) for k, v in CUevent_flags.__members__.items())) {{endif}} {{if 'CUevent_record_flags_enum' in found_types}} -class CUevent_record_flags(IntEnum): +class CUevent_record_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Event record flags """ @@ -571,11 +563,10 @@ class CUevent_record_flags(IntEnum): #: capture. CU_EVENT_RECORD_EXTERNAL = cydriver.CUevent_record_flags_enum.CU_EVENT_RECORD_EXTERNAL{{endif}} -_dict_CUevent_record_flags = dict(((int(v), v) for k, v in CUevent_record_flags.__members__.items())) {{endif}} {{if 'CUevent_wait_flags_enum' in found_types}} -class CUevent_wait_flags(IntEnum): +class CUevent_wait_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Event wait flags """ @@ -589,11 +580,10 @@ class CUevent_wait_flags(IntEnum): #: default behavior. This flag is invalid when used outside of capture. CU_EVENT_WAIT_EXTERNAL = cydriver.CUevent_wait_flags_enum.CU_EVENT_WAIT_EXTERNAL{{endif}} -_dict_CUevent_wait_flags = dict(((int(v), v) for k, v in CUevent_wait_flags.__members__.items())) {{endif}} {{if 'CUatomicOperation_enum' in found_types}} -class CUatomicOperation(IntEnum): +class CUatomicOperation(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA-valid Atomic Operations """ @@ -626,11 +616,10 @@ class CUatomicOperation(IntEnum): {{if 'CU_ATOMIC_OPERATION_MAX' in found_values}} CU_ATOMIC_OPERATION_MAX = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_MAX{{endif}} -_dict_CUatomicOperation = dict(((int(v), v) for k, v in CUatomicOperation.__members__.items())) {{endif}} {{if 'CUatomicOperationCapability_enum' in found_types}} -class CUatomicOperationCapability(IntEnum): +class CUatomicOperationCapability(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA-valid Atomic Operation capabilities """ @@ -649,11 +638,10 @@ class CUatomicOperationCapability(IntEnum): {{if 'CU_ATOMIC_CAPABILITY_VECTOR_32x4' in found_values}} CU_ATOMIC_CAPABILITY_VECTOR_32x4 = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_VECTOR_32x4{{endif}} -_dict_CUatomicOperationCapability = dict(((int(v), v) for k, v in CUatomicOperationCapability.__members__.items())) {{endif}} {{if 'CUstreamWaitValue_flags_enum' in found_types}} -class CUstreamWaitValue_flags(IntEnum): +class CUstreamWaitValue_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for :py:obj:`~.cuStreamWaitValue32` and :py:obj:`~.cuStreamWaitValue64` @@ -692,11 +680,10 @@ class CUstreamWaitValue_flags(IntEnum): #: :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES`. CU_STREAM_WAIT_VALUE_FLUSH = cydriver.CUstreamWaitValue_flags_enum.CU_STREAM_WAIT_VALUE_FLUSH{{endif}} -_dict_CUstreamWaitValue_flags = dict(((int(v), v) for k, v in CUstreamWaitValue_flags.__members__.items())) {{endif}} {{if 'CUstreamWriteValue_flags_enum' in found_types}} -class CUstreamWriteValue_flags(IntEnum): +class CUstreamWriteValue_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for :py:obj:`~.cuStreamWriteValue32` """ @@ -714,11 +701,10 @@ class CUstreamWriteValue_flags(IntEnum): #: supported in the v2 API. CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER = cydriver.CUstreamWriteValue_flags_enum.CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER{{endif}} -_dict_CUstreamWriteValue_flags = dict(((int(v), v) for k, v in CUstreamWriteValue_flags.__members__.items())) {{endif}} {{if 'CUstreamBatchMemOpType_enum' in found_types}} -class CUstreamBatchMemOpType(IntEnum): +class CUstreamBatchMemOpType(_FastEnum, metaclass=_FastEnumMetaclass): """ Operations for :py:obj:`~.cuStreamBatchMemOp` """ @@ -753,11 +739,10 @@ class CUstreamBatchMemOpType(IntEnum): #: :py:obj:`~.CUstreamBatchMemOpParams`::atomicReduction CU_STREAM_MEM_OP_ATOMIC_REDUCTION = cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_ATOMIC_REDUCTION{{endif}} -_dict_CUstreamBatchMemOpType = dict(((int(v), v) for k, v in CUstreamBatchMemOpType.__members__.items())) {{endif}} {{if 'CUstreamMemoryBarrier_flags_enum' in found_types}} -class CUstreamMemoryBarrier_flags(IntEnum): +class CUstreamMemoryBarrier_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for :py:obj:`~.CUstreamBatchMemOpParams.memoryBarrier` """ @@ -770,11 +755,10 @@ class CUstreamMemoryBarrier_flags(IntEnum): #: Limit memory barrier scope to the GPU. CU_STREAM_MEMORY_BARRIER_TYPE_GPU = cydriver.CUstreamMemoryBarrier_flags_enum.CU_STREAM_MEMORY_BARRIER_TYPE_GPU{{endif}} -_dict_CUstreamMemoryBarrier_flags = dict(((int(v), v) for k, v in CUstreamMemoryBarrier_flags.__members__.items())) {{endif}} {{if 'CUstreamAtomicReductionOpType_enum' in found_types}} -class CUstreamAtomicReductionOpType(IntEnum): +class CUstreamAtomicReductionOpType(_FastEnum, metaclass=_FastEnumMetaclass): """ Atomic reduction operation types for :py:obj:`~.CUstreamBatchMemOpParams`::atomicReduction::reductionOp @@ -792,11 +776,10 @@ class CUstreamAtomicReductionOpType(IntEnum): #: Performs an atomic OR: *(address) = *(address) | value CU_STREAM_ATOMIC_REDUCTION_OP_OR = cydriver.CUstreamAtomicReductionOpType_enum.CU_STREAM_ATOMIC_REDUCTION_OP_OR{{endif}} -_dict_CUstreamAtomicReductionOpType = dict(((int(v), v) for k, v in CUstreamAtomicReductionOpType.__members__.items())) {{endif}} {{if 'CUstreamAtomicReductionDataType_enum' in found_types}} -class CUstreamAtomicReductionDataType(IntEnum): +class CUstreamAtomicReductionDataType(_FastEnum, metaclass=_FastEnumMetaclass): """ Atomic reduction data types for :py:obj:`~.CUstreamBatchMemOpParams`::atomicReduction::dataType @@ -806,11 +789,10 @@ class CUstreamAtomicReductionDataType(IntEnum): {{if 'CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64' in found_values}} CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64 = cydriver.CUstreamAtomicReductionDataType_enum.CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64{{endif}} -_dict_CUstreamAtomicReductionDataType = dict(((int(v), v) for k, v in CUstreamAtomicReductionDataType.__members__.items())) {{endif}} {{if 'CUoccupancy_flags_enum' in found_types}} -class CUoccupancy_flags(IntEnum): +class CUoccupancy_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Occupancy calculator flag """ @@ -824,11 +806,10 @@ class CUoccupancy_flags(IntEnum): #: off CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = cydriver.CUoccupancy_flags_enum.CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE{{endif}} -_dict_CUoccupancy_flags = dict(((int(v), v) for k, v in CUoccupancy_flags.__members__.items())) {{endif}} {{if 'CUstreamUpdateCaptureDependencies_flags_enum' in found_types}} -class CUstreamUpdateCaptureDependencies_flags(IntEnum): +class CUstreamUpdateCaptureDependencies_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for :py:obj:`~.cuStreamUpdateCaptureDependencies` """ @@ -841,11 +822,10 @@ class CUstreamUpdateCaptureDependencies_flags(IntEnum): #: Replace the dependency set with the new nodes CU_STREAM_SET_CAPTURE_DEPENDENCIES = cydriver.CUstreamUpdateCaptureDependencies_flags_enum.CU_STREAM_SET_CAPTURE_DEPENDENCIES{{endif}} -_dict_CUstreamUpdateCaptureDependencies_flags = dict(((int(v), v) for k, v in CUstreamUpdateCaptureDependencies_flags.__members__.items())) {{endif}} {{if 'CUasyncNotificationType_enum' in found_types}} -class CUasyncNotificationType(IntEnum): +class CUasyncNotificationType(_FastEnum, metaclass=_FastEnumMetaclass): """ Types of async notification that can be sent """ @@ -854,11 +834,10 @@ class CUasyncNotificationType(IntEnum): #: Sent when the process has exceeded its device memory budget CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET = cydriver.CUasyncNotificationType_enum.CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET{{endif}} -_dict_CUasyncNotificationType = dict(((int(v), v) for k, v in CUasyncNotificationType.__members__.items())) {{endif}} {{if 'CUarray_format_enum' in found_types}} -class CUarray_format(IntEnum): +class CUarray_format(_FastEnum, metaclass=_FastEnumMetaclass): """ Array formats """ @@ -1142,11 +1121,10 @@ class CUarray_format(IntEnum): {{if 'CU_AD_FORMAT_MAX' in found_values}} CU_AD_FORMAT_MAX = cydriver.CUarray_format_enum.CU_AD_FORMAT_MAX{{endif}} -_dict_CUarray_format = dict(((int(v), v) for k, v in CUarray_format.__members__.items())) {{endif}} {{if 'CUaddress_mode_enum' in found_types}} -class CUaddress_mode(IntEnum): +class CUaddress_mode(_FastEnum, metaclass=_FastEnumMetaclass): """ Texture reference addressing modes """ @@ -1167,11 +1145,10 @@ class CUaddress_mode(IntEnum): #: Border address mode CU_TR_ADDRESS_MODE_BORDER = cydriver.CUaddress_mode_enum.CU_TR_ADDRESS_MODE_BORDER{{endif}} -_dict_CUaddress_mode = dict(((int(v), v) for k, v in CUaddress_mode.__members__.items())) {{endif}} {{if 'CUfilter_mode_enum' in found_types}} -class CUfilter_mode(IntEnum): +class CUfilter_mode(_FastEnum, metaclass=_FastEnumMetaclass): """ Texture reference filtering modes """ @@ -1184,11 +1161,10 @@ class CUfilter_mode(IntEnum): #: Linear filter mode CU_TR_FILTER_MODE_LINEAR = cydriver.CUfilter_mode_enum.CU_TR_FILTER_MODE_LINEAR{{endif}} -_dict_CUfilter_mode = dict(((int(v), v) for k, v in CUfilter_mode.__members__.items())) {{endif}} {{if 'CUdevice_attribute_enum' in found_types}} -class CUdevice_attribute(IntEnum): +class CUdevice_attribute(_FastEnum, metaclass=_FastEnumMetaclass): """ Device properties """ @@ -1868,11 +1844,10 @@ class CUdevice_attribute(IntEnum): {{if 'CU_DEVICE_ATTRIBUTE_MAX' in found_values}} CU_DEVICE_ATTRIBUTE_MAX = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX{{endif}} -_dict_CUdevice_attribute = dict(((int(v), v) for k, v in CUdevice_attribute.__members__.items())) {{endif}} {{if 'CUpointer_attribute_enum' in found_types}} -class CUpointer_attribute(IntEnum): +class CUpointer_attribute(_FastEnum, metaclass=_FastEnumMetaclass): """ Pointer information """ @@ -1976,11 +1951,10 @@ class CUpointer_attribute(IntEnum): #: decompression. CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE = cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE{{endif}} -_dict_CUpointer_attribute = dict(((int(v), v) for k, v in CUpointer_attribute.__members__.items())) {{endif}} {{if 'CUfunction_attribute_enum' in found_types}} -class CUfunction_attribute(IntEnum): +class CUfunction_attribute(_FastEnum, metaclass=_FastEnumMetaclass): """ Function properties """ @@ -2125,11 +2099,10 @@ class CUfunction_attribute(IntEnum): {{if 'CU_FUNC_ATTRIBUTE_MAX' in found_values}} CU_FUNC_ATTRIBUTE_MAX = cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX{{endif}} -_dict_CUfunction_attribute = dict(((int(v), v) for k, v in CUfunction_attribute.__members__.items())) {{endif}} {{if 'CUfunc_cache_enum' in found_types}} -class CUfunc_cache(IntEnum): +class CUfunc_cache(_FastEnum, metaclass=_FastEnumMetaclass): """ Function cache configurations """ @@ -2150,11 +2123,10 @@ class CUfunc_cache(IntEnum): #: prefer equal sized L1 cache and shared memory CU_FUNC_CACHE_PREFER_EQUAL = cydriver.CUfunc_cache_enum.CU_FUNC_CACHE_PREFER_EQUAL{{endif}} -_dict_CUfunc_cache = dict(((int(v), v) for k, v in CUfunc_cache.__members__.items())) {{endif}} {{if 'CUsharedconfig_enum' in found_types}} -class CUsharedconfig(IntEnum): +class CUsharedconfig(_FastEnum, metaclass=_FastEnumMetaclass): """ [Deprecated] Shared memory configurations """ @@ -2171,11 +2143,10 @@ class CUsharedconfig(IntEnum): #: set shared memory bank width to eight bytes CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE = cydriver.CUsharedconfig_enum.CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE{{endif}} -_dict_CUsharedconfig = dict(((int(v), v) for k, v in CUsharedconfig.__members__.items())) {{endif}} {{if 'CUshared_carveout_enum' in found_types}} -class CUshared_carveout(IntEnum): +class CUshared_carveout(_FastEnum, metaclass=_FastEnumMetaclass): """ Shared memory carveout configurations. These may be passed to :py:obj:`~.cuFuncSetAttribute` or :py:obj:`~.cuKernelSetAttribute` @@ -2193,11 +2164,10 @@ class CUshared_carveout(IntEnum): #: Prefer maximum available shared memory, minimum L1 cache CU_SHAREDMEM_CARVEOUT_MAX_SHARED = cydriver.CUshared_carveout_enum.CU_SHAREDMEM_CARVEOUT_MAX_SHARED{{endif}} -_dict_CUshared_carveout = dict(((int(v), v) for k, v in CUshared_carveout.__members__.items())) {{endif}} {{if 'CUmemorytype_enum' in found_types}} -class CUmemorytype(IntEnum): +class CUmemorytype(_FastEnum, metaclass=_FastEnumMetaclass): """ Memory types """ @@ -2218,11 +2188,10 @@ class CUmemorytype(IntEnum): #: Unified device or host memory CU_MEMORYTYPE_UNIFIED = cydriver.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED{{endif}} -_dict_CUmemorytype = dict(((int(v), v) for k, v in CUmemorytype.__members__.items())) {{endif}} {{if 'CUcomputemode_enum' in found_types}} -class CUcomputemode(IntEnum): +class CUcomputemode(_FastEnum, metaclass=_FastEnumMetaclass): """ Compute Modes """ @@ -2241,11 +2210,10 @@ class CUcomputemode(IntEnum): #: process can be present on this device at a time) CU_COMPUTEMODE_EXCLUSIVE_PROCESS = cydriver.CUcomputemode_enum.CU_COMPUTEMODE_EXCLUSIVE_PROCESS{{endif}} -_dict_CUcomputemode = dict(((int(v), v) for k, v in CUcomputemode.__members__.items())) {{endif}} {{if 'CUmem_advise_enum' in found_types}} -class CUmem_advise(IntEnum): +class CUmem_advise(_FastEnum, metaclass=_FastEnumMetaclass): """ Memory advise values """ @@ -2276,11 +2244,10 @@ class CUmem_advise(IntEnum): #: for the specified device CU_MEM_ADVISE_UNSET_ACCESSED_BY = cydriver.CUmem_advise_enum.CU_MEM_ADVISE_UNSET_ACCESSED_BY{{endif}} -_dict_CUmem_advise = dict(((int(v), v) for k, v in CUmem_advise.__members__.items())) {{endif}} {{if 'CUmem_range_attribute_enum' in found_types}} -class CUmem_range_attribute(IntEnum): +class CUmem_range_attribute(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -2319,11 +2286,10 @@ class CUmem_range_attribute(IntEnum): #: The last location id to which the range was prefetched CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID = cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID{{endif}} -_dict_CUmem_range_attribute = dict(((int(v), v) for k, v in CUmem_range_attribute.__members__.items())) {{endif}} {{if 'CUjit_option_enum' in found_types}} -class CUjit_option(IntEnum): +class CUjit_option(_FastEnum, metaclass=_FastEnumMetaclass): """ Online compiler and linker options """ @@ -2608,11 +2574,10 @@ class CUjit_option(IntEnum): {{if 'CU_JIT_NUM_OPTIONS' in found_values}} CU_JIT_NUM_OPTIONS = cydriver.CUjit_option_enum.CU_JIT_NUM_OPTIONS{{endif}} -_dict_CUjit_option = dict(((int(v), v) for k, v in CUjit_option.__members__.items())) {{endif}} {{if 'CUjit_target_enum' in found_types}} -class CUjit_target(IntEnum): +class CUjit_target(_FastEnum, metaclass=_FastEnumMetaclass): """ Online compilation targets """ @@ -2752,11 +2717,10 @@ class CUjit_target(IntEnum): {{if 'CU_TARGET_COMPUTE_121F' in found_values}} CU_TARGET_COMPUTE_121F = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_121F{{endif}} -_dict_CUjit_target = dict(((int(v), v) for k, v in CUjit_target.__members__.items())) {{endif}} {{if 'CUjit_fallback_enum' in found_types}} -class CUjit_fallback(IntEnum): +class CUjit_fallback(_FastEnum, metaclass=_FastEnumMetaclass): """ Cubin matching fallback strategies """ @@ -2770,11 +2734,10 @@ class CUjit_fallback(IntEnum): #: found CU_PREFER_BINARY = cydriver.CUjit_fallback_enum.CU_PREFER_BINARY{{endif}} -_dict_CUjit_fallback = dict(((int(v), v) for k, v in CUjit_fallback.__members__.items())) {{endif}} {{if 'CUjit_cacheMode_enum' in found_types}} -class CUjit_cacheMode(IntEnum): +class CUjit_cacheMode(_FastEnum, metaclass=_FastEnumMetaclass): """ Caching modes for dlcm """ @@ -2791,11 +2754,10 @@ class CUjit_cacheMode(IntEnum): #: Compile with L1 cache enabled CU_JIT_CACHE_OPTION_CA = cydriver.CUjit_cacheMode_enum.CU_JIT_CACHE_OPTION_CA{{endif}} -_dict_CUjit_cacheMode = dict(((int(v), v) for k, v in CUjit_cacheMode.__members__.items())) {{endif}} {{if 'CUjitInputType_enum' in found_types}} -class CUjitInputType(IntEnum): +class CUjitInputType(_FastEnum, metaclass=_FastEnumMetaclass): """ Device code formats """ @@ -2836,11 +2798,10 @@ class CUjitInputType(IntEnum): {{if 'CU_JIT_NUM_INPUT_TYPES' in found_values}} CU_JIT_NUM_INPUT_TYPES = cydriver.CUjitInputType_enum.CU_JIT_NUM_INPUT_TYPES{{endif}} -_dict_CUjitInputType = dict(((int(v), v) for k, v in CUjitInputType.__members__.items())) {{endif}} {{if 'CUgraphicsRegisterFlags_enum' in found_types}} -class CUgraphicsRegisterFlags(IntEnum): +class CUgraphicsRegisterFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags to register a graphics resource """ @@ -2855,11 +2816,10 @@ class CUgraphicsRegisterFlags(IntEnum): {{if 'CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER' in found_values}} CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = cydriver.CUgraphicsRegisterFlags_enum.CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER{{endif}} -_dict_CUgraphicsRegisterFlags = dict(((int(v), v) for k, v in CUgraphicsRegisterFlags.__members__.items())) {{endif}} {{if 'CUgraphicsMapResourceFlags_enum' in found_types}} -class CUgraphicsMapResourceFlags(IntEnum): +class CUgraphicsMapResourceFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for mapping and unmapping interop resources """ @@ -2870,11 +2830,10 @@ class CUgraphicsMapResourceFlags(IntEnum): {{if 'CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD' in found_values}} CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = cydriver.CUgraphicsMapResourceFlags_enum.CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD{{endif}} -_dict_CUgraphicsMapResourceFlags = dict(((int(v), v) for k, v in CUgraphicsMapResourceFlags.__members__.items())) {{endif}} {{if 'CUarray_cubemap_face_enum' in found_types}} -class CUarray_cubemap_face(IntEnum): +class CUarray_cubemap_face(_FastEnum, metaclass=_FastEnumMetaclass): """ Array indices for cube faces """ @@ -2903,11 +2862,10 @@ class CUarray_cubemap_face(IntEnum): #: Negative Z face of cubemap CU_CUBEMAP_FACE_NEGATIVE_Z = cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_NEGATIVE_Z{{endif}} -_dict_CUarray_cubemap_face = dict(((int(v), v) for k, v in CUarray_cubemap_face.__members__.items())) {{endif}} {{if 'CUlimit_enum' in found_types}} -class CUlimit(IntEnum): +class CUlimit(_FastEnum, metaclass=_FastEnumMetaclass): """ Limits """ @@ -2959,11 +2917,10 @@ class CUlimit(IntEnum): {{if 'CU_LIMIT_MAX' in found_values}} CU_LIMIT_MAX = cydriver.CUlimit_enum.CU_LIMIT_MAX{{endif}} -_dict_CUlimit = dict(((int(v), v) for k, v in CUlimit.__members__.items())) {{endif}} {{if 'CUresourcetype_enum' in found_types}} -class CUresourcetype(IntEnum): +class CUresourcetype(_FastEnum, metaclass=_FastEnumMetaclass): """ Resource types """ @@ -2984,11 +2941,10 @@ class CUresourcetype(IntEnum): #: Pitch 2D resource CU_RESOURCE_TYPE_PITCH2D = cydriver.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D{{endif}} -_dict_CUresourcetype = dict(((int(v), v) for k, v in CUresourcetype.__members__.items())) {{endif}} {{if 'CUaccessProperty_enum' in found_types}} -class CUaccessProperty(IntEnum): +class CUaccessProperty(_FastEnum, metaclass=_FastEnumMetaclass): """ Specifies performance hint with :py:obj:`~.CUaccessPolicyWindow` for hitProp and missProp members. @@ -3006,11 +2962,10 @@ class CUaccessProperty(IntEnum): #: Persisting access is more likely to persist in cache. CU_ACCESS_PROPERTY_PERSISTING = cydriver.CUaccessProperty_enum.CU_ACCESS_PROPERTY_PERSISTING{{endif}} -_dict_CUaccessProperty = dict(((int(v), v) for k, v in CUaccessProperty.__members__.items())) {{endif}} {{if 'CUgraphConditionalNodeType_enum' in found_types}} -class CUgraphConditionalNodeType(IntEnum): +class CUgraphConditionalNodeType(_FastEnum, metaclass=_FastEnumMetaclass): """ Conditional node types """ @@ -3032,11 +2987,10 @@ class CUgraphConditionalNodeType(IntEnum): #: index, no body is launched. CU_GRAPH_COND_TYPE_SWITCH = cydriver.CUgraphConditionalNodeType_enum.CU_GRAPH_COND_TYPE_SWITCH{{endif}} -_dict_CUgraphConditionalNodeType = dict(((int(v), v) for k, v in CUgraphConditionalNodeType.__members__.items())) {{endif}} {{if 'CUgraphNodeType_enum' in found_types}} -class CUgraphNodeType(IntEnum): +class CUgraphNodeType(_FastEnum, metaclass=_FastEnumMetaclass): """ Graph node types """ @@ -3122,11 +3076,10 @@ class CUgraphNodeType(IntEnum): #: :py:obj:`~.cudaGraphSetConditional` from device code. CU_GRAPH_NODE_TYPE_CONDITIONAL = cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL{{endif}} -_dict_CUgraphNodeType = dict(((int(v), v) for k, v in CUgraphNodeType.__members__.items())) {{endif}} {{if 'CUgraphDependencyType_enum' in found_types}} -class CUgraphDependencyType(IntEnum): +class CUgraphDependencyType(_FastEnum, metaclass=_FastEnumMetaclass): """ Type annotations that can be applied to graph edges as part of :py:obj:`~.CUgraphEdgeData`. @@ -3144,11 +3097,10 @@ class CUgraphDependencyType(IntEnum): #: :py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER` outgoing port. CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC = cydriver.CUgraphDependencyType_enum.CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC{{endif}} -_dict_CUgraphDependencyType = dict(((int(v), v) for k, v in CUgraphDependencyType.__members__.items())) {{endif}} {{if 'CUgraphInstantiateResult_enum' in found_types}} -class CUgraphInstantiateResult(IntEnum): +class CUgraphInstantiateResult(_FastEnum, metaclass=_FastEnumMetaclass): """ Graph instantiation results """ @@ -3181,11 +3133,10 @@ class CUgraphInstantiateResult(IntEnum): #: nodes CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED = cydriver.CUgraphInstantiateResult_enum.CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED{{endif}} -_dict_CUgraphInstantiateResult = dict(((int(v), v) for k, v in CUgraphInstantiateResult.__members__.items())) {{endif}} {{if 'CUsynchronizationPolicy_enum' in found_types}} -class CUsynchronizationPolicy(IntEnum): +class CUsynchronizationPolicy(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -3198,11 +3149,10 @@ class CUsynchronizationPolicy(IntEnum): {{if 'CU_SYNC_POLICY_BLOCKING_SYNC' in found_values}} CU_SYNC_POLICY_BLOCKING_SYNC = cydriver.CUsynchronizationPolicy_enum.CU_SYNC_POLICY_BLOCKING_SYNC{{endif}} -_dict_CUsynchronizationPolicy = dict(((int(v), v) for k, v in CUsynchronizationPolicy.__members__.items())) {{endif}} {{if 'CUclusterSchedulingPolicy_enum' in found_types}} -class CUclusterSchedulingPolicy(IntEnum): +class CUclusterSchedulingPolicy(_FastEnum, metaclass=_FastEnumMetaclass): """ Cluster scheduling policies. These may be passed to :py:obj:`~.cuFuncSetAttribute` or :py:obj:`~.cuKernelSetAttribute` @@ -3221,11 +3171,10 @@ class CUclusterSchedulingPolicy(IntEnum): #: SMs CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING = cydriver.CUclusterSchedulingPolicy_enum.CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING{{endif}} -_dict_CUclusterSchedulingPolicy = dict(((int(v), v) for k, v in CUclusterSchedulingPolicy.__members__.items())) {{endif}} {{if 'CUlaunchMemSyncDomain_enum' in found_types}} -class CUlaunchMemSyncDomain(IntEnum): +class CUlaunchMemSyncDomain(_FastEnum, metaclass=_FastEnumMetaclass): """ Memory Synchronization Domain A kernel can be launched in a specified memory synchronization domain that affects all memory @@ -3255,11 +3204,10 @@ class CUlaunchMemSyncDomain(IntEnum): #: Launch kernels in the remote domain CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE = cydriver.CUlaunchMemSyncDomain_enum.CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE{{endif}} -_dict_CUlaunchMemSyncDomain = dict(((int(v), v) for k, v in CUlaunchMemSyncDomain.__members__.items())) {{endif}} {{if 'CUlaunchAttributeID_enum' in found_types}} -class CUlaunchAttributeID(IntEnum): +class CUlaunchAttributeID(_FastEnum, metaclass=_FastEnumMetaclass): """ Launch attributes enum; used as id field of :py:obj:`~.CUlaunchAttribute` @@ -3470,11 +3418,10 @@ class CUlaunchAttributeID(IntEnum): #: 0 (disabled) and 1 (enabled). CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING{{endif}} -_dict_CUlaunchAttributeID = dict(((int(v), v) for k, v in CUlaunchAttributeID.__members__.items())) {{endif}} {{if 'CUstreamCaptureStatus_enum' in found_types}} -class CUstreamCaptureStatus(IntEnum): +class CUstreamCaptureStatus(_FastEnum, metaclass=_FastEnumMetaclass): """ Possible stream capture statuses returned by :py:obj:`~.cuStreamIsCapturing` @@ -3493,11 +3440,10 @@ class CUstreamCaptureStatus(IntEnum): #: not terminated CU_STREAM_CAPTURE_STATUS_INVALIDATED = cydriver.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_INVALIDATED{{endif}} -_dict_CUstreamCaptureStatus = dict(((int(v), v) for k, v in CUstreamCaptureStatus.__members__.items())) {{endif}} {{if 'CUstreamCaptureMode_enum' in found_types}} -class CUstreamCaptureMode(IntEnum): +class CUstreamCaptureMode(_FastEnum, metaclass=_FastEnumMetaclass): """ Possible modes for stream capture thread interactions. For more details see :py:obj:`~.cuStreamBeginCapture` and @@ -3510,11 +3456,10 @@ class CUstreamCaptureMode(IntEnum): {{if 'CU_STREAM_CAPTURE_MODE_RELAXED' in found_values}} CU_STREAM_CAPTURE_MODE_RELAXED = cydriver.CUstreamCaptureMode_enum.CU_STREAM_CAPTURE_MODE_RELAXED{{endif}} -_dict_CUstreamCaptureMode = dict(((int(v), v) for k, v in CUstreamCaptureMode.__members__.items())) {{endif}} {{if 'CUdriverProcAddress_flags_enum' in found_types}} -class CUdriverProcAddress_flags(IntEnum): +class CUdriverProcAddress_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags to specify search options. For more details see :py:obj:`~.cuGetProcAddress` @@ -3532,11 +3477,10 @@ class CUdriverProcAddress_flags(IntEnum): #: Search for per-thread versions of driver symbols. CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM = cydriver.CUdriverProcAddress_flags_enum.CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM{{endif}} -_dict_CUdriverProcAddress_flags = dict(((int(v), v) for k, v in CUdriverProcAddress_flags.__members__.items())) {{endif}} {{if 'CUdriverProcAddressQueryResult_enum' in found_types}} -class CUdriverProcAddressQueryResult(IntEnum): +class CUdriverProcAddressQueryResult(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags to indicate search status. For more details see :py:obj:`~.cuGetProcAddress` @@ -3554,11 +3498,10 @@ class CUdriverProcAddressQueryResult(IntEnum): #: Symbol was found but version supplied was not sufficient CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT = cydriver.CUdriverProcAddressQueryResult_enum.CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT{{endif}} -_dict_CUdriverProcAddressQueryResult = dict(((int(v), v) for k, v in CUdriverProcAddressQueryResult.__members__.items())) {{endif}} {{if 'CUexecAffinityType_enum' in found_types}} -class CUexecAffinityType(IntEnum): +class CUexecAffinityType(_FastEnum, metaclass=_FastEnumMetaclass): """ Execution Affinity Types """ @@ -3569,11 +3512,10 @@ class CUexecAffinityType(IntEnum): {{if 'CU_EXEC_AFFINITY_TYPE_MAX' in found_values}} CU_EXEC_AFFINITY_TYPE_MAX = cydriver.CUexecAffinityType_enum.CU_EXEC_AFFINITY_TYPE_MAX{{endif}} -_dict_CUexecAffinityType = dict(((int(v), v) for k, v in CUexecAffinityType.__members__.items())) {{endif}} {{if 'CUcigDataType_enum' in found_types}} -class CUcigDataType(IntEnum): +class CUcigDataType(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -3584,11 +3526,10 @@ class CUcigDataType(IntEnum): #: D3D12 Command Queue Handle CIG_DATA_TYPE_NV_BLOB = cydriver.CUcigDataType_enum.CIG_DATA_TYPE_NV_BLOB{{endif}} -_dict_CUcigDataType = dict(((int(v), v) for k, v in CUcigDataType.__members__.items())) {{endif}} {{if 'CUlibraryOption_enum' in found_types}} -class CUlibraryOption(IntEnum): +class CUlibraryOption(_FastEnum, metaclass=_FastEnumMetaclass): """ Library options to be specified with :py:obj:`~.cuLibraryLoadData()` or @@ -3611,11 +3552,10 @@ class CUlibraryOption(IntEnum): {{if 'CU_LIBRARY_NUM_OPTIONS' in found_values}} CU_LIBRARY_NUM_OPTIONS = cydriver.CUlibraryOption_enum.CU_LIBRARY_NUM_OPTIONS{{endif}} -_dict_CUlibraryOption = dict(((int(v), v) for k, v in CUlibraryOption.__members__.items())) {{endif}} {{if 'cudaError_enum' in found_types}} -class CUresult(IntEnum): +class CUresult(_FastEnum, metaclass=_FastEnumMetaclass): """ Error codes """ @@ -4213,11 +4153,10 @@ class CUresult(IntEnum): #: This indicates that an unknown internal error has occurred. CUDA_ERROR_UNKNOWN = cydriver.cudaError_enum.CUDA_ERROR_UNKNOWN{{endif}} -_dict_CUresult = dict(((int(v), v) for k, v in CUresult.__members__.items())) {{endif}} {{if 'CUdevice_P2PAttribute_enum' in found_types}} -class CUdevice_P2PAttribute(IntEnum): +class CUdevice_P2PAttribute(_FastEnum, metaclass=_FastEnumMetaclass): """ P2P Attributes """ @@ -4247,11 +4186,10 @@ class CUdevice_P2PAttribute(IntEnum): #: Only some CUDA-valid atomic operations over the link are supported. CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED = cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED{{endif}} -_dict_CUdevice_P2PAttribute = dict(((int(v), v) for k, v in CUdevice_P2PAttribute.__members__.items())) {{endif}} {{if 'CUresourceViewFormat_enum' in found_types}} -class CUresourceViewFormat(IntEnum): +class CUresourceViewFormat(_FastEnum, metaclass=_FastEnumMetaclass): """ Resource view format """ @@ -4396,11 +4334,10 @@ class CUresourceViewFormat(IntEnum): #: Block compressed 7 CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC7{{endif}} -_dict_CUresourceViewFormat = dict(((int(v), v) for k, v in CUresourceViewFormat.__members__.items())) {{endif}} {{if 'CUtensorMapDataType_enum' in found_types}} -class CUtensorMapDataType(IntEnum): +class CUtensorMapDataType(_FastEnum, metaclass=_FastEnumMetaclass): """ Tensor map data type """ @@ -4437,11 +4374,10 @@ class CUtensorMapDataType(IntEnum): {{if 'CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B' in found_values}} CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B{{endif}} -_dict_CUtensorMapDataType = dict(((int(v), v) for k, v in CUtensorMapDataType.__members__.items())) {{endif}} {{if 'CUtensorMapInterleave_enum' in found_types}} -class CUtensorMapInterleave(IntEnum): +class CUtensorMapInterleave(_FastEnum, metaclass=_FastEnumMetaclass): """ Tensor map interleave layout type """ @@ -4452,11 +4388,10 @@ class CUtensorMapInterleave(IntEnum): {{if 'CU_TENSOR_MAP_INTERLEAVE_32B' in found_values}} CU_TENSOR_MAP_INTERLEAVE_32B = cydriver.CUtensorMapInterleave_enum.CU_TENSOR_MAP_INTERLEAVE_32B{{endif}} -_dict_CUtensorMapInterleave = dict(((int(v), v) for k, v in CUtensorMapInterleave.__members__.items())) {{endif}} {{if 'CUtensorMapSwizzle_enum' in found_types}} -class CUtensorMapSwizzle(IntEnum): +class CUtensorMapSwizzle(_FastEnum, metaclass=_FastEnumMetaclass): """ Tensor map swizzling mode of shared memory banks """ @@ -4475,11 +4410,10 @@ class CUtensorMapSwizzle(IntEnum): {{if 'CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B' in found_values}} CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B{{endif}} -_dict_CUtensorMapSwizzle = dict(((int(v), v) for k, v in CUtensorMapSwizzle.__members__.items())) {{endif}} {{if 'CUtensorMapL2promotion_enum' in found_types}} -class CUtensorMapL2promotion(IntEnum): +class CUtensorMapL2promotion(_FastEnum, metaclass=_FastEnumMetaclass): """ Tensor map L2 promotion type """ @@ -4492,11 +4426,10 @@ class CUtensorMapL2promotion(IntEnum): {{if 'CU_TENSOR_MAP_L2_PROMOTION_L2_256B' in found_values}} CU_TENSOR_MAP_L2_PROMOTION_L2_256B = cydriver.CUtensorMapL2promotion_enum.CU_TENSOR_MAP_L2_PROMOTION_L2_256B{{endif}} -_dict_CUtensorMapL2promotion = dict(((int(v), v) for k, v in CUtensorMapL2promotion.__members__.items())) {{endif}} {{if 'CUtensorMapFloatOOBfill_enum' in found_types}} -class CUtensorMapFloatOOBfill(IntEnum): +class CUtensorMapFloatOOBfill(_FastEnum, metaclass=_FastEnumMetaclass): """ Tensor map out-of-bounds fill type """ @@ -4505,11 +4438,10 @@ class CUtensorMapFloatOOBfill(IntEnum): {{if 'CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA' in found_values}} CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA = cydriver.CUtensorMapFloatOOBfill_enum.CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA{{endif}} -_dict_CUtensorMapFloatOOBfill = dict(((int(v), v) for k, v in CUtensorMapFloatOOBfill.__members__.items())) {{endif}} {{if 'CUtensorMapIm2ColWideMode_enum' in found_types}} -class CUtensorMapIm2ColWideMode(IntEnum): +class CUtensorMapIm2ColWideMode(_FastEnum, metaclass=_FastEnumMetaclass): """ Tensor map Im2Col wide mode """ @@ -4518,11 +4450,10 @@ class CUtensorMapIm2ColWideMode(IntEnum): {{if 'CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128' in found_values}} CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 = cydriver.CUtensorMapIm2ColWideMode_enum.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128{{endif}} -_dict_CUtensorMapIm2ColWideMode = dict(((int(v), v) for k, v in CUtensorMapIm2ColWideMode.__members__.items())) {{endif}} {{if 'CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum' in found_types}} -class CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS(IntEnum): +class CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS(_FastEnum, metaclass=_FastEnumMetaclass): """ Access flags that specify the level of access the current context's device has on the memory referenced. @@ -4544,11 +4475,10 @@ class CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS(IntEnum): #: memory CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE = cydriver.CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE{{endif}} -_dict_CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS = dict(((int(v), v) for k, v in CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS.__members__.items())) {{endif}} {{if 'CUexternalMemoryHandleType_enum' in found_types}} -class CUexternalMemoryHandleType(IntEnum): +class CUexternalMemoryHandleType(_FastEnum, metaclass=_FastEnumMetaclass): """ External memory handle types """ @@ -4589,11 +4519,10 @@ class CUexternalMemoryHandleType(IntEnum): #: Handle is a dma_buf file descriptor CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD = cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD{{endif}} -_dict_CUexternalMemoryHandleType = dict(((int(v), v) for k, v in CUexternalMemoryHandleType.__members__.items())) {{endif}} {{if 'CUexternalSemaphoreHandleType_enum' in found_types}} -class CUexternalSemaphoreHandleType(IntEnum): +class CUexternalSemaphoreHandleType(_FastEnum, metaclass=_FastEnumMetaclass): """ External semaphore handle types """ @@ -4640,11 +4569,10 @@ class CUexternalSemaphoreHandleType(IntEnum): #: semaphore CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 = cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32{{endif}} -_dict_CUexternalSemaphoreHandleType = dict(((int(v), v) for k, v in CUexternalSemaphoreHandleType.__members__.items())) {{endif}} {{if 'CUmemAllocationHandleType_enum' in found_types}} -class CUmemAllocationHandleType(IntEnum): +class CUmemAllocationHandleType(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for specifying particular handle types """ @@ -4672,11 +4600,10 @@ class CUmemAllocationHandleType(IntEnum): {{if 'CU_MEM_HANDLE_TYPE_MAX' in found_values}} CU_MEM_HANDLE_TYPE_MAX = cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_MAX{{endif}} -_dict_CUmemAllocationHandleType = dict(((int(v), v) for k, v in CUmemAllocationHandleType.__members__.items())) {{endif}} {{if 'CUmemAccess_flags_enum' in found_types}} -class CUmemAccess_flags(IntEnum): +class CUmemAccess_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Specifies the memory protection flags for mapping. """ @@ -4695,11 +4622,10 @@ class CUmemAccess_flags(IntEnum): {{if 'CU_MEM_ACCESS_FLAGS_PROT_MAX' in found_values}} CU_MEM_ACCESS_FLAGS_PROT_MAX = cydriver.CUmemAccess_flags_enum.CU_MEM_ACCESS_FLAGS_PROT_MAX{{endif}} -_dict_CUmemAccess_flags = dict(((int(v), v) for k, v in CUmemAccess_flags.__members__.items())) {{endif}} {{if 'CUmemLocationType_enum' in found_types}} -class CUmemLocationType(IntEnum): +class CUmemLocationType(_FastEnum, metaclass=_FastEnumMetaclass): """ Specifies the type of location """ @@ -4729,11 +4655,10 @@ class CUmemLocationType(IntEnum): {{if 'CU_MEM_LOCATION_TYPE_MAX' in found_values}} CU_MEM_LOCATION_TYPE_MAX = cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_MAX{{endif}} -_dict_CUmemLocationType = dict(((int(v), v) for k, v in CUmemLocationType.__members__.items())) {{endif}} {{if 'CUmemAllocationType_enum' in found_types}} -class CUmemAllocationType(IntEnum): +class CUmemAllocationType(_FastEnum, metaclass=_FastEnumMetaclass): """ Defines the allocation types available """ @@ -4751,11 +4676,10 @@ class CUmemAllocationType(IntEnum): {{if 'CU_MEM_ALLOCATION_TYPE_MAX' in found_values}} CU_MEM_ALLOCATION_TYPE_MAX = cydriver.CUmemAllocationType_enum.CU_MEM_ALLOCATION_TYPE_MAX{{endif}} -_dict_CUmemAllocationType = dict(((int(v), v) for k, v in CUmemAllocationType.__members__.items())) {{endif}} {{if 'CUmemAllocationGranularity_flags_enum' in found_types}} -class CUmemAllocationGranularity_flags(IntEnum): +class CUmemAllocationGranularity_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flag for requesting different optimal and required granularities for an allocation. @@ -4769,11 +4693,10 @@ class CUmemAllocationGranularity_flags(IntEnum): #: Recommended granularity for allocation for best performance CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = cydriver.CUmemAllocationGranularity_flags_enum.CU_MEM_ALLOC_GRANULARITY_RECOMMENDED{{endif}} -_dict_CUmemAllocationGranularity_flags = dict(((int(v), v) for k, v in CUmemAllocationGranularity_flags.__members__.items())) {{endif}} {{if 'CUmemRangeHandleType_enum' in found_types}} -class CUmemRangeHandleType(IntEnum): +class CUmemRangeHandleType(_FastEnum, metaclass=_FastEnumMetaclass): """ Specifies the handle type for address range """ @@ -4782,11 +4705,10 @@ class CUmemRangeHandleType(IntEnum): {{if 'CU_MEM_RANGE_HANDLE_TYPE_MAX' in found_values}} CU_MEM_RANGE_HANDLE_TYPE_MAX = cydriver.CUmemRangeHandleType_enum.CU_MEM_RANGE_HANDLE_TYPE_MAX{{endif}} -_dict_CUmemRangeHandleType = dict(((int(v), v) for k, v in CUmemRangeHandleType.__members__.items())) {{endif}} {{if 'CUmemRangeFlags_enum' in found_types}} -class CUmemRangeFlags(IntEnum): +class CUmemRangeFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flag for requesting handle type for address range. """ @@ -4795,11 +4717,10 @@ class CUmemRangeFlags(IntEnum): #: Indicates that DMA_BUF handle should be mapped via PCIe BAR1 CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE = cydriver.CUmemRangeFlags_enum.CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE{{endif}} -_dict_CUmemRangeFlags = dict(((int(v), v) for k, v in CUmemRangeFlags.__members__.items())) {{endif}} {{if 'CUarraySparseSubresourceType_enum' in found_types}} -class CUarraySparseSubresourceType(IntEnum): +class CUarraySparseSubresourceType(_FastEnum, metaclass=_FastEnumMetaclass): """ Sparse subresource types """ @@ -4808,11 +4729,10 @@ class CUarraySparseSubresourceType(IntEnum): {{if 'CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL' in found_values}} CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = cydriver.CUarraySparseSubresourceType_enum.CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL{{endif}} -_dict_CUarraySparseSubresourceType = dict(((int(v), v) for k, v in CUarraySparseSubresourceType.__members__.items())) {{endif}} {{if 'CUmemOperationType_enum' in found_types}} -class CUmemOperationType(IntEnum): +class CUmemOperationType(_FastEnum, metaclass=_FastEnumMetaclass): """ Memory operation types """ @@ -4821,22 +4741,20 @@ class CUmemOperationType(IntEnum): {{if 'CU_MEM_OPERATION_TYPE_UNMAP' in found_values}} CU_MEM_OPERATION_TYPE_UNMAP = cydriver.CUmemOperationType_enum.CU_MEM_OPERATION_TYPE_UNMAP{{endif}} -_dict_CUmemOperationType = dict(((int(v), v) for k, v in CUmemOperationType.__members__.items())) {{endif}} {{if 'CUmemHandleType_enum' in found_types}} -class CUmemHandleType(IntEnum): +class CUmemHandleType(_FastEnum, metaclass=_FastEnumMetaclass): """ Memory handle types """ {{if 'CU_MEM_HANDLE_TYPE_GENERIC' in found_values}} CU_MEM_HANDLE_TYPE_GENERIC = cydriver.CUmemHandleType_enum.CU_MEM_HANDLE_TYPE_GENERIC{{endif}} -_dict_CUmemHandleType = dict(((int(v), v) for k, v in CUmemHandleType.__members__.items())) {{endif}} {{if 'CUmemAllocationCompType_enum' in found_types}} -class CUmemAllocationCompType(IntEnum): +class CUmemAllocationCompType(_FastEnum, metaclass=_FastEnumMetaclass): """ Specifies compression attribute for an allocation. """ @@ -4849,11 +4767,10 @@ class CUmemAllocationCompType(IntEnum): #: Allocating compressible memory CU_MEM_ALLOCATION_COMP_GENERIC = cydriver.CUmemAllocationCompType_enum.CU_MEM_ALLOCATION_COMP_GENERIC{{endif}} -_dict_CUmemAllocationCompType = dict(((int(v), v) for k, v in CUmemAllocationCompType.__members__.items())) {{endif}} {{if 'CUmulticastGranularity_flags_enum' in found_types}} -class CUmulticastGranularity_flags(IntEnum): +class CUmulticastGranularity_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for querying different granularities for a multicast object """ @@ -4866,11 +4783,10 @@ class CUmulticastGranularity_flags(IntEnum): #: Recommended granularity for best performance CU_MULTICAST_GRANULARITY_RECOMMENDED = cydriver.CUmulticastGranularity_flags_enum.CU_MULTICAST_GRANULARITY_RECOMMENDED{{endif}} -_dict_CUmulticastGranularity_flags = dict(((int(v), v) for k, v in CUmulticastGranularity_flags.__members__.items())) {{endif}} {{if 'CUgraphExecUpdateResult_enum' in found_types}} -class CUgraphExecUpdateResult(IntEnum): +class CUgraphExecUpdateResult(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Graph Update error types """ @@ -4916,11 +4832,10 @@ class CUgraphExecUpdateResult(IntEnum): #: is not supported CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED = cydriver.CUgraphExecUpdateResult_enum.CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED{{endif}} -_dict_CUgraphExecUpdateResult = dict(((int(v), v) for k, v in CUgraphExecUpdateResult.__members__.items())) {{endif}} {{if 'CUmemPool_attribute_enum' in found_types}} -class CUmemPool_attribute(IntEnum): +class CUmemPool_attribute(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA memory pool attributes """ @@ -4975,11 +4890,10 @@ class CUmemPool_attribute(IntEnum): #: it was reset. High watermark can only be reset to zero. CU_MEMPOOL_ATTR_USED_MEM_HIGH = cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_HIGH{{endif}} -_dict_CUmemPool_attribute = dict(((int(v), v) for k, v in CUmemPool_attribute.__members__.items())) {{endif}} {{if 'CUmemcpyFlags_enum' in found_types}} -class CUmemcpyFlags(IntEnum): +class CUmemcpyFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags to specify for copies within a batch. For more details see :py:obj:`~.cuMemcpyBatchAsync`. @@ -4992,11 +4906,10 @@ class CUmemcpyFlags(IntEnum): #: the SMs. CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE = cydriver.CUmemcpyFlags_enum.CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE{{endif}} -_dict_CUmemcpyFlags = dict(((int(v), v) for k, v in CUmemcpyFlags.__members__.items())) {{endif}} {{if 'CUmemcpySrcAccessOrder_enum' in found_types}} -class CUmemcpySrcAccessOrder(IntEnum): +class CUmemcpySrcAccessOrder(_FastEnum, metaclass=_FastEnumMetaclass): """ These flags allow applications to convey the source access ordering CUDA must maintain. The destination will always be accessed in @@ -5034,11 +4947,10 @@ class CUmemcpySrcAccessOrder(IntEnum): {{if 'CU_MEMCPY_SRC_ACCESS_ORDER_MAX' in found_values}} CU_MEMCPY_SRC_ACCESS_ORDER_MAX = cydriver.CUmemcpySrcAccessOrder_enum.CU_MEMCPY_SRC_ACCESS_ORDER_MAX{{endif}} -_dict_CUmemcpySrcAccessOrder = dict(((int(v), v) for k, v in CUmemcpySrcAccessOrder.__members__.items())) {{endif}} {{if 'CUmemcpy3DOperandType_enum' in found_types}} -class CUmemcpy3DOperandType(IntEnum): +class CUmemcpy3DOperandType(_FastEnum, metaclass=_FastEnumMetaclass): """ These flags allow applications to convey the operand type for individual copies specified in :py:obj:`~.cuMemcpy3DBatchAsync`. @@ -5054,11 +4966,10 @@ class CUmemcpy3DOperandType(IntEnum): {{if 'CU_MEMCPY_OPERAND_TYPE_MAX' in found_values}} CU_MEMCPY_OPERAND_TYPE_MAX = cydriver.CUmemcpy3DOperandType_enum.CU_MEMCPY_OPERAND_TYPE_MAX{{endif}} -_dict_CUmemcpy3DOperandType = dict(((int(v), v) for k, v in CUmemcpy3DOperandType.__members__.items())) {{endif}} {{if 'CUgraphMem_attribute_enum' in found_types}} -class CUgraphMem_attribute(IntEnum): +class CUgraphMem_attribute(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -5085,11 +4996,10 @@ class CUgraphMem_attribute(IntEnum): #: allocator. CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH = cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH{{endif}} -_dict_CUgraphMem_attribute = dict(((int(v), v) for k, v in CUgraphMem_attribute.__members__.items())) {{endif}} {{if 'CUgraphChildGraphNodeOwnership_enum' in found_types}} -class CUgraphChildGraphNodeOwnership(IntEnum): +class CUgraphChildGraphNodeOwnership(_FastEnum, metaclass=_FastEnumMetaclass): """ Child graph node ownership """ @@ -5112,11 +5022,10 @@ class CUgraphChildGraphNodeOwnership(IntEnum): #: memory allocation or free nodes added. CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE = cydriver.CUgraphChildGraphNodeOwnership_enum.CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE{{endif}} -_dict_CUgraphChildGraphNodeOwnership = dict(((int(v), v) for k, v in CUgraphChildGraphNodeOwnership.__members__.items())) {{endif}} {{if 'CUflushGPUDirectRDMAWritesOptions_enum' in found_types}} -class CUflushGPUDirectRDMAWritesOptions(IntEnum): +class CUflushGPUDirectRDMAWritesOptions(_FastEnum, metaclass=_FastEnumMetaclass): """ Bitmasks for :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS` @@ -5133,11 +5042,10 @@ class CUflushGPUDirectRDMAWritesOptions(IntEnum): #: on the device. CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS = cydriver.CUflushGPUDirectRDMAWritesOptions_enum.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS{{endif}} -_dict_CUflushGPUDirectRDMAWritesOptions = dict(((int(v), v) for k, v in CUflushGPUDirectRDMAWritesOptions.__members__.items())) {{endif}} {{if 'CUGPUDirectRDMAWritesOrdering_enum' in found_types}} -class CUGPUDirectRDMAWritesOrdering(IntEnum): +class CUGPUDirectRDMAWritesOrdering(_FastEnum, metaclass=_FastEnumMetaclass): """ Platform native ordering for GPUDirect RDMA writes """ @@ -5158,11 +5066,10 @@ class CUGPUDirectRDMAWritesOrdering(IntEnum): #: to this device. CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES = cydriver.CUGPUDirectRDMAWritesOrdering_enum.CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES{{endif}} -_dict_CUGPUDirectRDMAWritesOrdering = dict(((int(v), v) for k, v in CUGPUDirectRDMAWritesOrdering.__members__.items())) {{endif}} {{if 'CUflushGPUDirectRDMAWritesScope_enum' in found_types}} -class CUflushGPUDirectRDMAWritesScope(IntEnum): +class CUflushGPUDirectRDMAWritesScope(_FastEnum, metaclass=_FastEnumMetaclass): """ The scopes for :py:obj:`~.cuFlushGPUDirectRDMAWrites` """ @@ -5176,11 +5083,10 @@ class CUflushGPUDirectRDMAWritesScope(IntEnum): #: Blocks until remote writes are visible to all CUDA device contexts. CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES = cydriver.CUflushGPUDirectRDMAWritesScope_enum.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES{{endif}} -_dict_CUflushGPUDirectRDMAWritesScope = dict(((int(v), v) for k, v in CUflushGPUDirectRDMAWritesScope.__members__.items())) {{endif}} {{if 'CUflushGPUDirectRDMAWritesTarget_enum' in found_types}} -class CUflushGPUDirectRDMAWritesTarget(IntEnum): +class CUflushGPUDirectRDMAWritesTarget(_FastEnum, metaclass=_FastEnumMetaclass): """ The targets for :py:obj:`~.cuFlushGPUDirectRDMAWrites` """ @@ -5190,11 +5096,10 @@ class CUflushGPUDirectRDMAWritesTarget(IntEnum): #: currently active CUDA device context. CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX = cydriver.CUflushGPUDirectRDMAWritesTarget_enum.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX{{endif}} -_dict_CUflushGPUDirectRDMAWritesTarget = dict(((int(v), v) for k, v in CUflushGPUDirectRDMAWritesTarget.__members__.items())) {{endif}} {{if 'CUgraphDebugDot_flags_enum' in found_types}} -class CUgraphDebugDot_flags(IntEnum): +class CUgraphDebugDot_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ The additional write options for :py:obj:`~.cuGraphDebugDotPrint` """ @@ -5263,11 +5168,10 @@ class CUgraphDebugDot_flags(IntEnum): #: Adds conditional node parameters to output CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS = cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS{{endif}} -_dict_CUgraphDebugDot_flags = dict(((int(v), v) for k, v in CUgraphDebugDot_flags.__members__.items())) {{endif}} {{if 'CUuserObject_flags_enum' in found_types}} -class CUuserObject_flags(IntEnum): +class CUuserObject_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for user objects for graphs """ @@ -5277,11 +5181,10 @@ class CUuserObject_flags(IntEnum): #: handle. CU_USER_OBJECT_NO_DESTRUCTOR_SYNC = cydriver.CUuserObject_flags_enum.CU_USER_OBJECT_NO_DESTRUCTOR_SYNC{{endif}} -_dict_CUuserObject_flags = dict(((int(v), v) for k, v in CUuserObject_flags.__members__.items())) {{endif}} {{if 'CUuserObjectRetain_flags_enum' in found_types}} -class CUuserObjectRetain_flags(IntEnum): +class CUuserObjectRetain_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for retaining user object references for graphs """ @@ -5291,11 +5194,10 @@ class CUuserObjectRetain_flags(IntEnum): #: references. CU_GRAPH_USER_OBJECT_MOVE = cydriver.CUuserObjectRetain_flags_enum.CU_GRAPH_USER_OBJECT_MOVE{{endif}} -_dict_CUuserObjectRetain_flags = dict(((int(v), v) for k, v in CUuserObjectRetain_flags.__members__.items())) {{endif}} {{if 'CUgraphInstantiate_flags_enum' in found_types}} -class CUgraphInstantiate_flags(IntEnum): +class CUgraphInstantiate_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for instantiating a graph """ @@ -5322,11 +5224,10 @@ class CUgraphInstantiate_flags(IntEnum): #: priority of the stream it is launched into. CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY = cydriver.CUgraphInstantiate_flags_enum.CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY{{endif}} -_dict_CUgraphInstantiate_flags = dict(((int(v), v) for k, v in CUgraphInstantiate_flags.__members__.items())) {{endif}} {{if 'CUdeviceNumaConfig_enum' in found_types}} -class CUdeviceNumaConfig(IntEnum): +class CUdeviceNumaConfig(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA device NUMA configuration """ @@ -5340,11 +5241,10 @@ class CUdeviceNumaConfig(IntEnum): #: NUMA ID CU_DEVICE_NUMA_CONFIG_NUMA_NODE = cydriver.CUdeviceNumaConfig_enum.CU_DEVICE_NUMA_CONFIG_NUMA_NODE{{endif}} -_dict_CUdeviceNumaConfig = dict(((int(v), v) for k, v in CUdeviceNumaConfig.__members__.items())) {{endif}} {{if 'CUprocessState_enum' in found_types}} -class CUprocessState(IntEnum): +class CUprocessState(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Process States """ @@ -5367,11 +5267,10 @@ class CUprocessState(IntEnum): #: checkpoint/restore process CU_PROCESS_STATE_FAILED = cydriver.CUprocessState_enum.CU_PROCESS_STATE_FAILED{{endif}} -_dict_CUprocessState = dict(((int(v), v) for k, v in CUprocessState.__members__.items())) {{endif}} {{if 'CUmoduleLoadingMode_enum' in found_types}} -class CUmoduleLoadingMode(IntEnum): +class CUmoduleLoadingMode(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Lazy Loading status """ @@ -5384,11 +5283,10 @@ class CUmoduleLoadingMode(IntEnum): #: Lazy Kernel Loading is enabled CU_MODULE_LAZY_LOADING = cydriver.CUmoduleLoadingMode_enum.CU_MODULE_LAZY_LOADING{{endif}} -_dict_CUmoduleLoadingMode = dict(((int(v), v) for k, v in CUmoduleLoadingMode.__members__.items())) {{endif}} {{if 'CUmemDecompressAlgorithm_enum' in found_types}} -class CUmemDecompressAlgorithm(IntEnum): +class CUmemDecompressAlgorithm(_FastEnum, metaclass=_FastEnumMetaclass): """ Bitmasks for CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK. """ @@ -5409,11 +5307,10 @@ class CUmemDecompressAlgorithm(IntEnum): #: LZ4 is supported. CU_MEM_DECOMPRESS_ALGORITHM_LZ4 = cydriver.CUmemDecompressAlgorithm_enum.CU_MEM_DECOMPRESS_ALGORITHM_LZ4{{endif}} -_dict_CUmemDecompressAlgorithm = dict(((int(v), v) for k, v in CUmemDecompressAlgorithm.__members__.items())) {{endif}} {{if 'CUfunctionLoadingState_enum' in found_types}} -class CUfunctionLoadingState(IntEnum): +class CUfunctionLoadingState(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -5424,11 +5321,10 @@ class CUfunctionLoadingState(IntEnum): {{if 'CU_FUNCTION_LOADING_STATE_MAX' in found_values}} CU_FUNCTION_LOADING_STATE_MAX = cydriver.CUfunctionLoadingState_enum.CU_FUNCTION_LOADING_STATE_MAX{{endif}} -_dict_CUfunctionLoadingState = dict(((int(v), v) for k, v in CUfunctionLoadingState.__members__.items())) {{endif}} {{if 'CUcoredumpSettings_enum' in found_types}} -class CUcoredumpSettings(IntEnum): +class CUcoredumpSettings(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for choosing a coredump attribute to get/set """ @@ -5449,11 +5345,10 @@ class CUcoredumpSettings(IntEnum): {{if 'CU_COREDUMP_MAX' in found_values}} CU_COREDUMP_MAX = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_MAX{{endif}} -_dict_CUcoredumpSettings = dict(((int(v), v) for k, v in CUcoredumpSettings.__members__.items())) {{endif}} {{if 'CUCoredumpGenerationFlags' in found_types}} -class CUCoredumpGenerationFlags(IntEnum): +class CUCoredumpGenerationFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for controlling coredump contents """ @@ -5476,11 +5371,10 @@ class CUCoredumpGenerationFlags(IntEnum): {{if 'CU_COREDUMP_GZIP_COMPRESS' in found_values}} CU_COREDUMP_GZIP_COMPRESS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_GZIP_COMPRESS{{endif}} -_dict_CUCoredumpGenerationFlags = dict(((int(v), v) for k, v in CUCoredumpGenerationFlags.__members__.items())) {{endif}} {{if 'CUgreenCtxCreate_flags' in found_types}} -class CUgreenCtxCreate_flags(IntEnum): +class CUgreenCtxCreate_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -5489,11 +5383,10 @@ class CUgreenCtxCreate_flags(IntEnum): #: Required. Creates a default stream to use inside the green context CU_GREEN_CTX_DEFAULT_STREAM = cydriver.CUgreenCtxCreate_flags.CU_GREEN_CTX_DEFAULT_STREAM{{endif}} -_dict_CUgreenCtxCreate_flags = dict(((int(v), v) for k, v in CUgreenCtxCreate_flags.__members__.items())) {{endif}} {{if 'CUdevSmResourceGroup_flags' in found_types}} -class CUdevSmResourceGroup_flags(IntEnum): +class CUdevSmResourceGroup_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -5502,11 +5395,10 @@ class CUdevSmResourceGroup_flags(IntEnum): {{if 'CU_DEV_SM_RESOURCE_GROUP_BACKFILL' in found_values}} CU_DEV_SM_RESOURCE_GROUP_BACKFILL = cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_BACKFILL{{endif}} -_dict_CUdevSmResourceGroup_flags = dict(((int(v), v) for k, v in CUdevSmResourceGroup_flags.__members__.items())) {{endif}} {{if 'CUdevSmResourceSplitByCount_flags' in found_types}} -class CUdevSmResourceSplitByCount_flags(IntEnum): +class CUdevSmResourceSplitByCount_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -5515,11 +5407,10 @@ class CUdevSmResourceSplitByCount_flags(IntEnum): {{if 'CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE' in found_values}} CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE = cydriver.CUdevSmResourceSplitByCount_flags.CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE{{endif}} -_dict_CUdevSmResourceSplitByCount_flags = dict(((int(v), v) for k, v in CUdevSmResourceSplitByCount_flags.__members__.items())) {{endif}} {{if 'CUdevResourceType' in found_types}} -class CUdevResourceType(IntEnum): +class CUdevResourceType(_FastEnum, metaclass=_FastEnumMetaclass): """ Type of resource """ @@ -5538,11 +5429,10 @@ class CUdevResourceType(IntEnum): #: Pre-existing workqueue related information CU_DEV_RESOURCE_TYPE_WORKQUEUE = cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_WORKQUEUE{{endif}} -_dict_CUdevResourceType = dict(((int(v), v) for k, v in CUdevResourceType.__members__.items())) {{endif}} {{if 'CUdevWorkqueueConfigScope' in found_types}} -class CUdevWorkqueueConfigScope(IntEnum): +class CUdevWorkqueueConfigScope(_FastEnum, metaclass=_FastEnumMetaclass): """ Sharing scope for workqueues """ @@ -5557,11 +5447,10 @@ class CUdevWorkqueueConfigScope(IntEnum): #: balanced green contexts. CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED = cydriver.CUdevWorkqueueConfigScope.CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED{{endif}} -_dict_CUdevWorkqueueConfigScope = dict(((int(v), v) for k, v in CUdevWorkqueueConfigScope.__members__.items())) {{endif}} {{if 'CUlogLevel_enum' in found_types}} -class CUlogLevel(IntEnum): +class CUlogLevel(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -5570,11 +5459,10 @@ class CUlogLevel(IntEnum): {{if 'CU_LOG_LEVEL_WARNING' in found_values}} CU_LOG_LEVEL_WARNING = cydriver.CUlogLevel_enum.CU_LOG_LEVEL_WARNING{{endif}} -_dict_CUlogLevel = dict(((int(v), v) for k, v in CUlogLevel.__members__.items())) {{endif}} {{if 'CUoutput_mode_enum' in found_types}} -class CUoutput_mode(IntEnum): +class CUoutput_mode(_FastEnum, metaclass=_FastEnumMetaclass): """ Profiler Output Modes """ @@ -5587,11 +5475,10 @@ class CUoutput_mode(IntEnum): #: Output mode Comma separated values format. CU_OUT_CSV = cydriver.CUoutput_mode_enum.CU_OUT_CSV{{endif}} -_dict_CUoutput_mode = dict(((int(v), v) for k, v in CUoutput_mode.__members__.items())) {{endif}} {{if True}} -class CUeglFrameType(IntEnum): +class CUeglFrameType(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA EglFrame type - array or pointer """ @@ -5604,11 +5491,10 @@ class CUeglFrameType(IntEnum): #: Frame type pointer CU_EGL_FRAME_TYPE_PITCH = cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH{{endif}} -_dict_CUeglFrameType = dict(((int(v), v) for k, v in CUeglFrameType.__members__.items())) {{endif}} {{if True}} -class CUeglResourceLocationFlags(IntEnum): +class CUeglResourceLocationFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Resource location flags- sysmem or vidmem For CUDA context on iGPU, since video and system memory are equivalent - these flags @@ -5631,11 +5517,10 @@ class CUeglResourceLocationFlags(IntEnum): #: Resource location vidmem CU_EGL_RESOURCE_LOCATION_VIDMEM = cydriver.CUeglResourceLocationFlags_enum.CU_EGL_RESOURCE_LOCATION_VIDMEM{{endif}} -_dict_CUeglResourceLocationFlags = dict(((int(v), v) for k, v in CUeglResourceLocationFlags.__members__.items())) {{endif}} {{if True}} -class CUeglColorFormat(IntEnum): +class CUeglColorFormat(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA EGL Color Format - The different planar and multiplanar formats currently supported for CUDA_EGL interops. Three channel @@ -6211,11 +6096,10 @@ class CUeglColorFormat(IntEnum): {{if True}} CU_EGL_COLOR_FORMAT_MAX = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_MAX{{endif}} -_dict_CUeglColorFormat = dict(((int(v), v) for k, v in CUeglColorFormat.__members__.items())) {{endif}} {{if True}} -class CUGLDeviceList(IntEnum): +class CUGLDeviceList(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA devices corresponding to an OpenGL device """ @@ -6234,11 +6118,10 @@ class CUGLDeviceList(IntEnum): #: context in the next frame CU_GL_DEVICE_LIST_NEXT_FRAME = cydriver.CUGLDeviceList_enum.CU_GL_DEVICE_LIST_NEXT_FRAME{{endif}} -_dict_CUGLDeviceList = dict(((int(v), v) for k, v in CUGLDeviceList.__members__.items())) {{endif}} {{if True}} -class CUGLmap_flags(IntEnum): +class CUGLmap_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags to map or unmap a resource """ @@ -6249,7 +6132,6 @@ class CUGLmap_flags(IntEnum): {{if True}} CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = cydriver.CUGLmap_flags_enum.CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD{{endif}} -_dict_CUGLmap_flags = dict(((int(v), v) for k, v in CUGLmap_flags.__members__.items())) {{endif}} {{if 'CUdeviceptr' in found_types}} @@ -6401,7 +6283,7 @@ cdef class CUgraphConditionalHandle: {{if 'CUlaunchAttributeID_enum' in found_types}} -class CUkernelNodeAttrID(IntEnum): +class CUkernelNodeAttrID(_FastEnum, metaclass=_FastEnumMetaclass): """ Launch attributes enum; used as id field of :py:obj:`~.CUlaunchAttribute` @@ -6612,11 +6494,10 @@ class CUkernelNodeAttrID(IntEnum): #: 0 (disabled) and 1 (enabled). CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING{{endif}} -_dict_CUlaunchAttributeID = dict(((int(v), v) for k, v in CUlaunchAttributeID.__members__.items())) {{endif}} {{if 'CUlaunchAttributeID_enum' in found_types}} -class CUstreamAttrID(IntEnum): +class CUstreamAttrID(_FastEnum, metaclass=_FastEnumMetaclass): """ Launch attributes enum; used as id field of :py:obj:`~.CUlaunchAttribute` @@ -6827,7 +6708,6 @@ class CUstreamAttrID(IntEnum): #: 0 (disabled) and 1 (enabled). CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING{{endif}} -_dict_CUlaunchAttributeID = dict(((int(v), v) for k, v in CUlaunchAttributeID.__members__.items())) {{endif}} {{if 'CUmemGenericAllocationHandle' in found_types}} @@ -8393,9 +8273,7 @@ cdef class CUstreamMemOpWaitValueParams_st: {{if 'CUstreamBatchMemOpParams_union.waitValue.operation' in found_struct}} @property def operation(self): - if self._pvt_ptr[0].waitValue.operation not in _dict_CUstreamBatchMemOpType: - return None - return _dict_CUstreamBatchMemOpType[self._pvt_ptr[0].waitValue.operation] + return CUstreamBatchMemOpType(self._pvt_ptr[0].waitValue.operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].waitValue.operation = int(operation) @@ -8583,9 +8461,7 @@ cdef class CUstreamMemOpWriteValueParams_st: {{if 'CUstreamBatchMemOpParams_union.writeValue.operation' in found_struct}} @property def operation(self): - if self._pvt_ptr[0].writeValue.operation not in _dict_CUstreamBatchMemOpType: - return None - return _dict_CUstreamBatchMemOpType[self._pvt_ptr[0].writeValue.operation] + return CUstreamBatchMemOpType(self._pvt_ptr[0].writeValue.operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].writeValue.operation = int(operation) @@ -8721,9 +8597,7 @@ cdef class CUstreamMemOpFlushRemoteWritesParams_st: {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites.operation' in found_struct}} @property def operation(self): - if self._pvt_ptr[0].flushRemoteWrites.operation not in _dict_CUstreamBatchMemOpType: - return None - return _dict_CUstreamBatchMemOpType[self._pvt_ptr[0].flushRemoteWrites.operation] + return CUstreamBatchMemOpType(self._pvt_ptr[0].flushRemoteWrites.operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].flushRemoteWrites.operation = int(operation) @@ -8787,9 +8661,7 @@ cdef class CUstreamMemOpMemoryBarrierParams_st: {{if 'CUstreamBatchMemOpParams_union.memoryBarrier.operation' in found_struct}} @property def operation(self): - if self._pvt_ptr[0].memoryBarrier.operation not in _dict_CUstreamBatchMemOpType: - return None - return _dict_CUstreamBatchMemOpType[self._pvt_ptr[0].memoryBarrier.operation] + return CUstreamBatchMemOpType(self._pvt_ptr[0].memoryBarrier.operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].memoryBarrier.operation = int(operation) @@ -8912,9 +8784,7 @@ cdef class CUstreamMemOpAtomicReductionParams_st: {{if 'CUstreamBatchMemOpParams_union.atomicReduction.operation' in found_struct}} @property def operation(self): - if self._pvt_ptr[0].atomicReduction.operation not in _dict_CUstreamBatchMemOpType: - return None - return _dict_CUstreamBatchMemOpType[self._pvt_ptr[0].atomicReduction.operation] + return CUstreamBatchMemOpType(self._pvt_ptr[0].atomicReduction.operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].atomicReduction.operation = int(operation) @@ -8930,9 +8800,7 @@ cdef class CUstreamMemOpAtomicReductionParams_st: {{if 'CUstreamBatchMemOpParams_union.atomicReduction.reductionOp' in found_struct}} @property def reductionOp(self): - if self._pvt_ptr[0].atomicReduction.reductionOp not in _dict_CUstreamAtomicReductionOpType: - return None - return _dict_CUstreamAtomicReductionOpType[self._pvt_ptr[0].atomicReduction.reductionOp] + return CUstreamAtomicReductionOpType(self._pvt_ptr[0].atomicReduction.reductionOp) @reductionOp.setter def reductionOp(self, reductionOp not None : CUstreamAtomicReductionOpType): self._pvt_ptr[0].atomicReduction.reductionOp = int(reductionOp) @@ -8940,9 +8808,7 @@ cdef class CUstreamMemOpAtomicReductionParams_st: {{if 'CUstreamBatchMemOpParams_union.atomicReduction.dataType' in found_struct}} @property def dataType(self): - if self._pvt_ptr[0].atomicReduction.dataType not in _dict_CUstreamAtomicReductionDataType: - return None - return _dict_CUstreamAtomicReductionDataType[self._pvt_ptr[0].atomicReduction.dataType] + return CUstreamAtomicReductionDataType(self._pvt_ptr[0].atomicReduction.dataType) @dataType.setter def dataType(self, dataType not None : CUstreamAtomicReductionDataType): self._pvt_ptr[0].atomicReduction.dataType = int(dataType) @@ -9124,9 +8990,7 @@ cdef class CUstreamBatchMemOpParams_union: {{if 'CUstreamBatchMemOpParams_union.operation' in found_struct}} @property def operation(self): - if self._pvt_ptr[0].operation not in _dict_CUstreamBatchMemOpType: - return None - return _dict_CUstreamBatchMemOpType[self._pvt_ptr[0].operation] + return CUstreamBatchMemOpType(self._pvt_ptr[0].operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].operation = int(operation) @@ -9607,9 +9471,7 @@ cdef class CUasyncNotificationInfo_st: {{if 'CUasyncNotificationInfo_st.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_CUasyncNotificationType: - return None - return _dict_CUasyncNotificationType[self._pvt_ptr[0].type] + return CUasyncNotificationType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUasyncNotificationType): self._pvt_ptr[0].type = int(type) @@ -9956,9 +9818,7 @@ cdef class CUaccessPolicyWindow_st: {{if 'CUaccessPolicyWindow_st.hitProp' in found_struct}} @property def hitProp(self): - if self._pvt_ptr[0].hitProp not in _dict_CUaccessProperty: - return None - return _dict_CUaccessProperty[self._pvt_ptr[0].hitProp] + return CUaccessProperty(self._pvt_ptr[0].hitProp) @hitProp.setter def hitProp(self, hitProp not None : CUaccessProperty): self._pvt_ptr[0].hitProp = int(hitProp) @@ -9966,9 +9826,7 @@ cdef class CUaccessPolicyWindow_st: {{if 'CUaccessPolicyWindow_st.missProp' in found_struct}} @property def missProp(self): - if self._pvt_ptr[0].missProp not in _dict_CUaccessProperty: - return None - return _dict_CUaccessProperty[self._pvt_ptr[0].missProp] + return CUaccessProperty(self._pvt_ptr[0].missProp) @missProp.setter def missProp(self, missProp not None : CUaccessProperty): self._pvt_ptr[0].missProp = int(missProp) @@ -11398,9 +11256,7 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: {{if 'CUDA_CONDITIONAL_NODE_PARAMS.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_CUgraphConditionalNodeType: - return None - return _dict_CUgraphConditionalNodeType[self._pvt_ptr[0].type] + return CUgraphConditionalNodeType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUgraphConditionalNodeType): self._pvt_ptr[0].type = int(type) @@ -11698,9 +11554,7 @@ cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.result_out' in found_struct}} @property def result_out(self): - if self._pvt_ptr[0].result_out not in _dict_CUgraphInstantiateResult: - return None - return _dict_CUgraphInstantiateResult[self._pvt_ptr[0].result_out] + return CUgraphInstantiateResult(self._pvt_ptr[0].result_out) @result_out.setter def result_out(self, result_out not None : CUgraphInstantiateResult): self._pvt_ptr[0].result_out = int(result_out) @@ -12481,9 +12335,7 @@ cdef class CUlaunchAttributeValue_union: {{if 'CUlaunchAttributeValue_union.syncPolicy' in found_struct}} @property def syncPolicy(self): - if self._pvt_ptr[0].syncPolicy not in _dict_CUsynchronizationPolicy: - return None - return _dict_CUsynchronizationPolicy[self._pvt_ptr[0].syncPolicy] + return CUsynchronizationPolicy(self._pvt_ptr[0].syncPolicy) @syncPolicy.setter def syncPolicy(self, syncPolicy not None : CUsynchronizationPolicy): self._pvt_ptr[0].syncPolicy = int(syncPolicy) @@ -12499,9 +12351,7 @@ cdef class CUlaunchAttributeValue_union: {{if 'CUlaunchAttributeValue_union.clusterSchedulingPolicyPreference' in found_struct}} @property def clusterSchedulingPolicyPreference(self): - if self._pvt_ptr[0].clusterSchedulingPolicyPreference not in _dict_CUclusterSchedulingPolicy: - return None - return _dict_CUclusterSchedulingPolicy[self._pvt_ptr[0].clusterSchedulingPolicyPreference] + return CUclusterSchedulingPolicy(self._pvt_ptr[0].clusterSchedulingPolicyPreference) @clusterSchedulingPolicyPreference.setter def clusterSchedulingPolicyPreference(self, clusterSchedulingPolicyPreference not None : CUclusterSchedulingPolicy): self._pvt_ptr[0].clusterSchedulingPolicyPreference = int(clusterSchedulingPolicyPreference) @@ -12549,9 +12399,7 @@ cdef class CUlaunchAttributeValue_union: {{if 'CUlaunchAttributeValue_union.memSyncDomain' in found_struct}} @property def memSyncDomain(self): - if self._pvt_ptr[0].memSyncDomain not in _dict_CUlaunchMemSyncDomain: - return None - return _dict_CUlaunchMemSyncDomain[self._pvt_ptr[0].memSyncDomain] + return CUlaunchMemSyncDomain(self._pvt_ptr[0].memSyncDomain) @memSyncDomain.setter def memSyncDomain(self, memSyncDomain not None : CUlaunchMemSyncDomain): self._pvt_ptr[0].memSyncDomain = int(memSyncDomain) @@ -12646,9 +12494,7 @@ cdef class CUlaunchAttribute_st: {{if 'CUlaunchAttribute_st.id' in found_struct}} @property def id(self): - if self._pvt_ptr[0].id not in _dict_CUlaunchAttributeID: - return None - return _dict_CUlaunchAttributeID[self._pvt_ptr[0].id] + return CUlaunchAttributeID(self._pvt_ptr[0].id) @id.setter def id(self, id not None : CUlaunchAttributeID): self._pvt_ptr[0].id = int(id) @@ -13063,9 +12909,7 @@ cdef class CUexecAffinityParam_st: {{if 'CUexecAffinityParam_st.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_CUexecAffinityType: - return None - return _dict_CUexecAffinityType[self._pvt_ptr[0].type] + return CUexecAffinityType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUexecAffinityType): self._pvt_ptr[0].type = int(type) @@ -13133,9 +12977,7 @@ cdef class CUctxCigParam_st: {{if 'CUctxCigParam_st.sharedDataType' in found_struct}} @property def sharedDataType(self): - if self._pvt_ptr[0].sharedDataType not in _dict_CUcigDataType: - return None - return _dict_CUcigDataType[self._pvt_ptr[0].sharedDataType] + return CUcigDataType(self._pvt_ptr[0].sharedDataType) @sharedDataType.setter def sharedDataType(self, sharedDataType not None : CUcigDataType): self._pvt_ptr[0].sharedDataType = int(sharedDataType) @@ -13601,9 +13443,7 @@ cdef class CUDA_MEMCPY2D_st: {{if 'CUDA_MEMCPY2D_st.srcMemoryType' in found_struct}} @property def srcMemoryType(self): - if self._pvt_ptr[0].srcMemoryType not in _dict_CUmemorytype: - return None - return _dict_CUmemorytype[self._pvt_ptr[0].srcMemoryType] + return CUmemorytype(self._pvt_ptr[0].srcMemoryType) @srcMemoryType.setter def srcMemoryType(self, srcMemoryType not None : CUmemorytype): self._pvt_ptr[0].srcMemoryType = int(srcMemoryType) @@ -13679,9 +13519,7 @@ cdef class CUDA_MEMCPY2D_st: {{if 'CUDA_MEMCPY2D_st.dstMemoryType' in found_struct}} @property def dstMemoryType(self): - if self._pvt_ptr[0].dstMemoryType not in _dict_CUmemorytype: - return None - return _dict_CUmemorytype[self._pvt_ptr[0].dstMemoryType] + return CUmemorytype(self._pvt_ptr[0].dstMemoryType) @dstMemoryType.setter def dstMemoryType(self, dstMemoryType not None : CUmemorytype): self._pvt_ptr[0].dstMemoryType = int(dstMemoryType) @@ -14084,9 +13922,7 @@ cdef class CUDA_MEMCPY3D_st: {{if 'CUDA_MEMCPY3D_st.srcMemoryType' in found_struct}} @property def srcMemoryType(self): - if self._pvt_ptr[0].srcMemoryType not in _dict_CUmemorytype: - return None - return _dict_CUmemorytype[self._pvt_ptr[0].srcMemoryType] + return CUmemorytype(self._pvt_ptr[0].srcMemoryType) @srcMemoryType.setter def srcMemoryType(self, srcMemoryType not None : CUmemorytype): self._pvt_ptr[0].srcMemoryType = int(srcMemoryType) @@ -14195,9 +14031,7 @@ cdef class CUDA_MEMCPY3D_st: {{if 'CUDA_MEMCPY3D_st.dstMemoryType' in found_struct}} @property def dstMemoryType(self): - if self._pvt_ptr[0].dstMemoryType not in _dict_CUmemorytype: - return None - return _dict_CUmemorytype[self._pvt_ptr[0].dstMemoryType] + return CUmemorytype(self._pvt_ptr[0].dstMemoryType) @dstMemoryType.setter def dstMemoryType(self, dstMemoryType not None : CUmemorytype): self._pvt_ptr[0].dstMemoryType = int(dstMemoryType) @@ -14632,9 +14466,7 @@ cdef class CUDA_MEMCPY3D_PEER_st: {{if 'CUDA_MEMCPY3D_PEER_st.srcMemoryType' in found_struct}} @property def srcMemoryType(self): - if self._pvt_ptr[0].srcMemoryType not in _dict_CUmemorytype: - return None - return _dict_CUmemorytype[self._pvt_ptr[0].srcMemoryType] + return CUmemorytype(self._pvt_ptr[0].srcMemoryType) @srcMemoryType.setter def srcMemoryType(self, srcMemoryType not None : CUmemorytype): self._pvt_ptr[0].srcMemoryType = int(srcMemoryType) @@ -14751,9 +14583,7 @@ cdef class CUDA_MEMCPY3D_PEER_st: {{if 'CUDA_MEMCPY3D_PEER_st.dstMemoryType' in found_struct}} @property def dstMemoryType(self): - if self._pvt_ptr[0].dstMemoryType not in _dict_CUmemorytype: - return None - return _dict_CUmemorytype[self._pvt_ptr[0].dstMemoryType] + return CUmemorytype(self._pvt_ptr[0].dstMemoryType) @dstMemoryType.setter def dstMemoryType(self, dstMemoryType not None : CUmemorytype): self._pvt_ptr[0].dstMemoryType = int(dstMemoryType) @@ -15069,9 +14899,7 @@ cdef class CUDA_ARRAY_DESCRIPTOR_st: {{if 'CUDA_ARRAY_DESCRIPTOR_st.Format' in found_struct}} @property def Format(self): - if self._pvt_ptr[0].Format not in _dict_CUarray_format: - return None - return _dict_CUarray_format[self._pvt_ptr[0].Format] + return CUarray_format(self._pvt_ptr[0].Format) @Format.setter def Format(self, Format not None : CUarray_format): self._pvt_ptr[0].Format = int(Format) @@ -15203,9 +15031,7 @@ cdef class CUDA_ARRAY3D_DESCRIPTOR_st: {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Format' in found_struct}} @property def Format(self): - if self._pvt_ptr[0].Format not in _dict_CUarray_format: - return None - return _dict_CUarray_format[self._pvt_ptr[0].Format] + return CUarray_format(self._pvt_ptr[0].Format) @Format.setter def Format(self, Format not None : CUarray_format): self._pvt_ptr[0].Format = int(Format) @@ -15728,9 +15554,7 @@ cdef class anon_struct9: {{if 'CUDA_RESOURCE_DESC_st.res.linear.format' in found_struct}} @property def format(self): - if self._pvt_ptr[0].res.linear.format not in _dict_CUarray_format: - return None - return _dict_CUarray_format[self._pvt_ptr[0].res.linear.format] + return CUarray_format(self._pvt_ptr[0].res.linear.format) @format.setter def format(self, format not None : CUarray_format): self._pvt_ptr[0].res.linear.format = int(format) @@ -15863,9 +15687,7 @@ cdef class anon_struct10: {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.format' in found_struct}} @property def format(self): - if self._pvt_ptr[0].res.pitch2D.format not in _dict_CUarray_format: - return None - return _dict_CUarray_format[self._pvt_ptr[0].res.pitch2D.format] + return CUarray_format(self._pvt_ptr[0].res.pitch2D.format) @format.setter def format(self, format not None : CUarray_format): self._pvt_ptr[0].res.pitch2D.format = int(format) @@ -16151,9 +15973,7 @@ cdef class CUDA_RESOURCE_DESC_st: {{if 'CUDA_RESOURCE_DESC_st.resType' in found_struct}} @property def resType(self): - if self._pvt_ptr[0].resType not in _dict_CUresourcetype: - return None - return _dict_CUresourcetype[self._pvt_ptr[0].resType] + return CUresourcetype(self._pvt_ptr[0].resType) @resType.setter def resType(self, resType not None : CUresourcetype): self._pvt_ptr[0].resType = int(resType) @@ -16309,7 +16129,7 @@ cdef class CUDA_TEXTURE_DESC_st: {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} @property def addressMode(self): - return [_dict_CUaddress_mode[_x] if _x in _dict_CUaddress_mode else None for _x in list(self._pvt_ptr[0].addressMode)] + return [CUaddress_mode(_x) for _x in list(self._pvt_ptr[0].addressMode)] @addressMode.setter def addressMode(self, addressMode): self._pvt_ptr[0].addressMode = [int(_x) for _x in addressMode] @@ -16317,9 +16137,7 @@ cdef class CUDA_TEXTURE_DESC_st: {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} @property def filterMode(self): - if self._pvt_ptr[0].filterMode not in _dict_CUfilter_mode: - return None - return _dict_CUfilter_mode[self._pvt_ptr[0].filterMode] + return CUfilter_mode(self._pvt_ptr[0].filterMode) @filterMode.setter def filterMode(self, filterMode not None : CUfilter_mode): self._pvt_ptr[0].filterMode = int(filterMode) @@ -16343,9 +16161,7 @@ cdef class CUDA_TEXTURE_DESC_st: {{if 'CUDA_TEXTURE_DESC_st.mipmapFilterMode' in found_struct}} @property def mipmapFilterMode(self): - if self._pvt_ptr[0].mipmapFilterMode not in _dict_CUfilter_mode: - return None - return _dict_CUfilter_mode[self._pvt_ptr[0].mipmapFilterMode] + return CUfilter_mode(self._pvt_ptr[0].mipmapFilterMode) @mipmapFilterMode.setter def mipmapFilterMode(self, mipmapFilterMode not None : CUfilter_mode): self._pvt_ptr[0].mipmapFilterMode = int(mipmapFilterMode) @@ -16515,9 +16331,7 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: {{if 'CUDA_RESOURCE_VIEW_DESC_st.format' in found_struct}} @property def format(self): - if self._pvt_ptr[0].format not in _dict_CUresourceViewFormat: - return None - return _dict_CUresourceViewFormat[self._pvt_ptr[0].format] + return CUresourceViewFormat(self._pvt_ptr[0].format) @format.setter def format(self, format not None : CUresourceViewFormat): self._pvt_ptr[0].format = int(format) @@ -17185,9 +16999,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_CUexternalMemoryHandleType: - return None - return _dict_CUexternalMemoryHandleType[self._pvt_ptr[0].type] + return CUexternalMemoryHandleType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUexternalMemoryHandleType): self._pvt_ptr[0].type = int(type) @@ -17668,9 +17480,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_CUexternalSemaphoreHandleType: - return None - return _dict_CUexternalSemaphoreHandleType[self._pvt_ptr[0].type] + return CUexternalSemaphoreHandleType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUexternalSemaphoreHandleType): self._pvt_ptr[0].type = int(type) @@ -19569,9 +19379,7 @@ cdef class CUarrayMapInfo_st: {{if 'CUarrayMapInfo_st.resourceType' in found_struct}} @property def resourceType(self): - if self._pvt_ptr[0].resourceType not in _dict_CUresourcetype: - return None - return _dict_CUresourcetype[self._pvt_ptr[0].resourceType] + return CUresourcetype(self._pvt_ptr[0].resourceType) @resourceType.setter def resourceType(self, resourceType not None : CUresourcetype): self._pvt_ptr[0].resourceType = int(resourceType) @@ -19587,9 +19395,7 @@ cdef class CUarrayMapInfo_st: {{if 'CUarrayMapInfo_st.subresourceType' in found_struct}} @property def subresourceType(self): - if self._pvt_ptr[0].subresourceType not in _dict_CUarraySparseSubresourceType: - return None - return _dict_CUarraySparseSubresourceType[self._pvt_ptr[0].subresourceType] + return CUarraySparseSubresourceType(self._pvt_ptr[0].subresourceType) @subresourceType.setter def subresourceType(self, subresourceType not None : CUarraySparseSubresourceType): self._pvt_ptr[0].subresourceType = int(subresourceType) @@ -19605,9 +19411,7 @@ cdef class CUarrayMapInfo_st: {{if 'CUarrayMapInfo_st.memOperationType' in found_struct}} @property def memOperationType(self): - if self._pvt_ptr[0].memOperationType not in _dict_CUmemOperationType: - return None - return _dict_CUmemOperationType[self._pvt_ptr[0].memOperationType] + return CUmemOperationType(self._pvt_ptr[0].memOperationType) @memOperationType.setter def memOperationType(self, memOperationType not None : CUmemOperationType): self._pvt_ptr[0].memOperationType = int(memOperationType) @@ -19615,9 +19419,7 @@ cdef class CUarrayMapInfo_st: {{if 'CUarrayMapInfo_st.memHandleType' in found_struct}} @property def memHandleType(self): - if self._pvt_ptr[0].memHandleType not in _dict_CUmemHandleType: - return None - return _dict_CUmemHandleType[self._pvt_ptr[0].memHandleType] + return CUmemHandleType(self._pvt_ptr[0].memHandleType) @memHandleType.setter def memHandleType(self, memHandleType not None : CUmemHandleType): self._pvt_ptr[0].memHandleType = int(memHandleType) @@ -19717,9 +19519,7 @@ cdef class CUmemLocation_st: {{if 'CUmemLocation_st.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_CUmemLocationType: - return None - return _dict_CUmemLocationType[self._pvt_ptr[0].type] + return CUmemLocationType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUmemLocationType): self._pvt_ptr[0].type = int(type) @@ -19930,9 +19730,7 @@ cdef class CUmemAllocationProp_st: {{if 'CUmemAllocationProp_st.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_CUmemAllocationType: - return None - return _dict_CUmemAllocationType[self._pvt_ptr[0].type] + return CUmemAllocationType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUmemAllocationType): self._pvt_ptr[0].type = int(type) @@ -19940,9 +19738,7 @@ cdef class CUmemAllocationProp_st: {{if 'CUmemAllocationProp_st.requestedHandleTypes' in found_struct}} @property def requestedHandleTypes(self): - if self._pvt_ptr[0].requestedHandleTypes not in _dict_CUmemAllocationHandleType: - return None - return _dict_CUmemAllocationHandleType[self._pvt_ptr[0].requestedHandleTypes] + return CUmemAllocationHandleType(self._pvt_ptr[0].requestedHandleTypes) @requestedHandleTypes.setter def requestedHandleTypes(self, requestedHandleTypes not None : CUmemAllocationHandleType): self._pvt_ptr[0].requestedHandleTypes = int(requestedHandleTypes) @@ -20145,9 +19941,7 @@ cdef class CUmemAccessDesc_st: {{if 'CUmemAccessDesc_st.flags' in found_struct}} @property def flags(self): - if self._pvt_ptr[0].flags not in _dict_CUmemAccess_flags: - return None - return _dict_CUmemAccess_flags[self._pvt_ptr[0].flags] + return CUmemAccess_flags(self._pvt_ptr[0].flags) @flags.setter def flags(self, flags not None : CUmemAccess_flags): self._pvt_ptr[0].flags = int(flags) @@ -20226,9 +20020,7 @@ cdef class CUgraphExecUpdateResultInfo_st: {{if 'CUgraphExecUpdateResultInfo_st.result' in found_struct}} @property def result(self): - if self._pvt_ptr[0].result not in _dict_CUgraphExecUpdateResult: - return None - return _dict_CUgraphExecUpdateResult[self._pvt_ptr[0].result] + return CUgraphExecUpdateResult(self._pvt_ptr[0].result) @result.setter def result(self, result not None : CUgraphExecUpdateResult): self._pvt_ptr[0].result = int(result) @@ -20381,9 +20173,7 @@ cdef class CUmemPoolProps_st: {{if 'CUmemPoolProps_st.allocType' in found_struct}} @property def allocType(self): - if self._pvt_ptr[0].allocType not in _dict_CUmemAllocationType: - return None - return _dict_CUmemAllocationType[self._pvt_ptr[0].allocType] + return CUmemAllocationType(self._pvt_ptr[0].allocType) @allocType.setter def allocType(self, allocType not None : CUmemAllocationType): self._pvt_ptr[0].allocType = int(allocType) @@ -20391,9 +20181,7 @@ cdef class CUmemPoolProps_st: {{if 'CUmemPoolProps_st.handleTypes' in found_struct}} @property def handleTypes(self): - if self._pvt_ptr[0].handleTypes not in _dict_CUmemAllocationHandleType: - return None - return _dict_CUmemAllocationHandleType[self._pvt_ptr[0].handleTypes] + return CUmemAllocationHandleType(self._pvt_ptr[0].handleTypes) @handleTypes.setter def handleTypes(self, handleTypes not None : CUmemAllocationHandleType): self._pvt_ptr[0].handleTypes = int(handleTypes) @@ -20580,9 +20368,7 @@ cdef class CUmemcpyAttributes_st: {{if 'CUmemcpyAttributes_st.srcAccessOrder' in found_struct}} @property def srcAccessOrder(self): - if self._pvt_ptr[0].srcAccessOrder not in _dict_CUmemcpySrcAccessOrder: - return None - return _dict_CUmemcpySrcAccessOrder[self._pvt_ptr[0].srcAccessOrder] + return CUmemcpySrcAccessOrder(self._pvt_ptr[0].srcAccessOrder) @srcAccessOrder.setter def srcAccessOrder(self, srcAccessOrder not None : CUmemcpySrcAccessOrder): self._pvt_ptr[0].srcAccessOrder = int(srcAccessOrder) @@ -21108,9 +20894,7 @@ cdef class CUmemcpy3DOperand_st: {{if 'CUmemcpy3DOperand_st.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_CUmemcpy3DOperandType: - return None - return _dict_CUmemcpy3DOperandType[self._pvt_ptr[0].type] + return CUmemcpy3DOperandType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUmemcpy3DOperandType): self._pvt_ptr[0].type = int(type) @@ -21240,9 +21024,7 @@ cdef class CUDA_MEMCPY3D_BATCH_OP_st: {{if 'CUDA_MEMCPY3D_BATCH_OP_st.srcAccessOrder' in found_struct}} @property def srcAccessOrder(self): - if self._pvt_ptr[0].srcAccessOrder not in _dict_CUmemcpySrcAccessOrder: - return None - return _dict_CUmemcpySrcAccessOrder[self._pvt_ptr[0].srcAccessOrder] + return CUmemcpySrcAccessOrder(self._pvt_ptr[0].srcAccessOrder) @srcAccessOrder.setter def srcAccessOrder(self, srcAccessOrder not None : CUmemcpySrcAccessOrder): self._pvt_ptr[0].srcAccessOrder = int(srcAccessOrder) @@ -21719,9 +21501,7 @@ cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.ownership' in found_struct}} @property def ownership(self): - if self._pvt_ptr[0].ownership not in _dict_CUgraphChildGraphNodeOwnership: - return None - return _dict_CUgraphChildGraphNodeOwnership[self._pvt_ptr[0].ownership] + return CUgraphChildGraphNodeOwnership(self._pvt_ptr[0].ownership) @ownership.setter def ownership(self, ownership not None : CUgraphChildGraphNodeOwnership): self._pvt_ptr[0].ownership = int(ownership) @@ -22096,9 +21876,7 @@ cdef class CUgraphNodeParams_st: {{if 'CUgraphNodeParams_st.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_CUgraphNodeType: - return None - return _dict_CUgraphNodeType[self._pvt_ptr[0].type] + return CUgraphNodeType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUgraphNodeType): self._pvt_ptr[0].type = int(type) @@ -22797,9 +22575,7 @@ cdef class CUmemDecompressParams_st: {{if 'CUmemDecompressParams_st.algo' in found_struct}} @property def algo(self): - if self._pvt_ptr[0].algo not in _dict_CUmemDecompressAlgorithm: - return None - return _dict_CUmemDecompressAlgorithm[self._pvt_ptr[0].algo] + return CUmemDecompressAlgorithm(self._pvt_ptr[0].algo) @algo.setter def algo(self, algo not None : CUmemDecompressAlgorithm): self._pvt_ptr[0].algo = int(algo) @@ -23014,9 +22790,7 @@ cdef class CUdevWorkqueueConfigResource_st: {{if 'CUdevWorkqueueConfigResource_st.sharingScope' in found_struct}} @property def sharingScope(self): - if self._pvt_ptr[0].sharingScope not in _dict_CUdevWorkqueueConfigScope: - return None - return _dict_CUdevWorkqueueConfigScope[self._pvt_ptr[0].sharingScope] + return CUdevWorkqueueConfigScope(self._pvt_ptr[0].sharingScope) @sharingScope.setter def sharingScope(self, sharingScope not None : CUdevWorkqueueConfigScope): self._pvt_ptr[0].sharingScope = int(sharingScope) @@ -23315,9 +23089,7 @@ cdef class CUdevResource_st: {{if 'CUdevResource_st.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_CUdevResourceType: - return None - return _dict_CUdevResourceType[self._pvt_ptr[0].type] + return CUdevResourceType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUdevResourceType): self._pvt_ptr[0].type = int(type) @@ -23662,9 +23434,7 @@ cdef class CUeglFrame_st: {{if True}} @property def frameType(self): - if self._pvt_ptr[0].frameType not in _dict_CUeglFrameType: - return None - return _dict_CUeglFrameType[self._pvt_ptr[0].frameType] + return CUeglFrameType(self._pvt_ptr[0].frameType) @frameType.setter def frameType(self, frameType not None : CUeglFrameType): self._pvt_ptr[0].frameType = int(frameType) @@ -23672,9 +23442,7 @@ cdef class CUeglFrame_st: {{if True}} @property def eglColorFormat(self): - if self._pvt_ptr[0].eglColorFormat not in _dict_CUeglColorFormat: - return None - return _dict_CUeglColorFormat[self._pvt_ptr[0].eglColorFormat] + return CUeglColorFormat(self._pvt_ptr[0].eglColorFormat) @eglColorFormat.setter def eglColorFormat(self, eglColorFormat not None : CUeglColorFormat): self._pvt_ptr[0].eglColorFormat = int(eglColorFormat) @@ -23682,9 +23450,7 @@ cdef class CUeglFrame_st: {{if True}} @property def cuFormat(self): - if self._pvt_ptr[0].cuFormat not in _dict_CUarray_format: - return None - return _dict_CUarray_format[self._pvt_ptr[0].cuFormat] + return CUarray_format(self._pvt_ptr[0].cuFormat) @cuFormat.setter def cuFormat(self, cuFormat not None : CUarray_format): self._pvt_ptr[0].cuFormat = int(cuFormat) @@ -24150,8 +23916,8 @@ def cuGetErrorString(error not None : CUresult): with nogil: err = cydriver.cuGetErrorString(cyerror, &pStr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pStr if pStr != NULL else None) + return (CUresult(err), None) + return (CUresult(err), pStr if pStr != NULL else None) {{endif}} {{if 'cuGetErrorName' in found_functions}} @@ -24186,8 +23952,8 @@ def cuGetErrorName(error not None : CUresult): with nogil: err = cydriver.cuGetErrorName(cyerror, &pStr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pStr if pStr != NULL else None) + return (CUresult(err), None) + return (CUresult(err), pStr if pStr != NULL else None) {{endif}} {{if 'cuInit' in found_functions}} @@ -24214,7 +23980,7 @@ def cuInit(unsigned int Flags): """ with nogil: err = cydriver.cuInit(Flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuDriverGetVersion' in found_functions}} @@ -24245,8 +24011,8 @@ def cuDriverGetVersion(): with nogil: err = cydriver.cuDriverGetVersion(&driverVersion) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], driverVersion) + return (CUresult(err), None) + return (CUresult(err), driverVersion) {{endif}} {{if 'cuDeviceGet' in found_functions}} @@ -24278,8 +24044,8 @@ def cuDeviceGet(int ordinal): with nogil: err = cydriver.cuDeviceGet(device._pvt_ptr, ordinal) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], device) + return (CUresult(err), None) + return (CUresult(err), device) {{endif}} {{if 'cuDeviceGetCount' in found_functions}} @@ -24307,8 +24073,8 @@ def cuDeviceGetCount(): with nogil: err = cydriver.cuDeviceGetCount(&count) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], count) + return (CUresult(err), None) + return (CUresult(err), count) {{endif}} {{if 'cuDeviceGetName' in found_functions}} @@ -24353,8 +24119,8 @@ def cuDeviceGetName(int length, dev): with nogil: err = cydriver.cuDeviceGetName(name, length, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pyname) + return (CUresult(err), None) + return (CUresult(err), pyname) {{endif}} {{if 'cuDeviceGetUuid_v2' in found_functions}} @@ -24395,8 +24161,8 @@ def cuDeviceGetUuid(dev): with nogil: err = cydriver.cuDeviceGetUuid(uuid._pvt_ptr, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], uuid) + return (CUresult(err), None) + return (CUresult(err), uuid) {{endif}} {{if 'cuDeviceGetLuid' in found_functions}} @@ -24439,8 +24205,8 @@ def cuDeviceGetLuid(dev): with nogil: err = cydriver.cuDeviceGetLuid(luid, &deviceNodeMask, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], luid, deviceNodeMask) + return (CUresult(err), None, None) + return (CUresult(err), luid, deviceNodeMask) {{endif}} {{if 'cuDeviceTotalMem_v2' in found_functions}} @@ -24480,8 +24246,8 @@ def cuDeviceTotalMem(dev): with nogil: err = cydriver.cuDeviceTotalMem(&numbytes, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], numbytes) + return (CUresult(err), None) + return (CUresult(err), numbytes) {{endif}} {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} @@ -24528,8 +24294,8 @@ def cuDeviceGetTexture1DLinearMaxWidth(pformat not None : CUarray_format, unsign with nogil: err = cydriver.cuDeviceGetTexture1DLinearMaxWidth(&maxWidthInElements, cypformat, numChannels, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], maxWidthInElements) + return (CUresult(err), None) + return (CUresult(err), maxWidthInElements) {{endif}} {{if 'cuDeviceGetAttribute' in found_functions}} @@ -24572,8 +24338,8 @@ def cuDeviceGetAttribute(attrib not None : CUdevice_attribute, dev): with nogil: err = cydriver.cuDeviceGetAttribute(&pi, cyattrib, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pi) + return (CUresult(err), None) + return (CUresult(err), pi) {{endif}} {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} @@ -24643,8 +24409,8 @@ def cuDeviceGetHostAtomicCapabilities(operations : Optional[tuple[CUatomicOperat if cycapabilities is not NULL: free(cycapabilities) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pycapabilities) + return (CUresult(err), None) + return (CUresult(err), pycapabilities) {{endif}} {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} @@ -24742,7 +24508,7 @@ def cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, int flags): cdef void* cynvSciSyncAttrList_ptr = cynvSciSyncAttrList.cptr with nogil: err = cydriver.cuDeviceGetNvSciSyncAttributes(cynvSciSyncAttrList_ptr, cydev, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuDeviceSetMemPool' in found_functions}} @@ -24794,7 +24560,7 @@ def cuDeviceSetMemPool(dev, pool): cydev = pdev with nogil: err = cydriver.cuDeviceSetMemPool(cydev, cypool) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuDeviceGetMemPool' in found_functions}} @@ -24837,8 +24603,8 @@ def cuDeviceGetMemPool(dev): with nogil: err = cydriver.cuDeviceGetMemPool(pool._pvt_ptr, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pool) + return (CUresult(err), None) + return (CUresult(err), pool) {{endif}} {{if 'cuDeviceGetDefaultMemPool' in found_functions}} @@ -24878,8 +24644,8 @@ def cuDeviceGetDefaultMemPool(dev): with nogil: err = cydriver.cuDeviceGetDefaultMemPool(pool_out._pvt_ptr, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pool_out) + return (CUresult(err), None) + return (CUresult(err), pool_out) {{endif}} {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} @@ -24926,8 +24692,8 @@ def cuDeviceGetExecAffinitySupport(typename not None : CUexecAffinityType, dev): with nogil: err = cydriver.cuDeviceGetExecAffinitySupport(&pi, cytypename, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pi) + return (CUresult(err), None) + return (CUresult(err), pi) {{endif}} {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} @@ -24978,7 +24744,7 @@ def cuFlushGPUDirectRDMAWrites(target not None : CUflushGPUDirectRDMAWritesTarge cdef cydriver.CUflushGPUDirectRDMAWritesScope cyscope = int(scope) with nogil: err = cydriver.cuFlushGPUDirectRDMAWrites(cytarget, cyscope) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuDeviceGetProperties' in found_functions}} @@ -25057,8 +24823,8 @@ def cuDeviceGetProperties(dev): with nogil: err = cydriver.cuDeviceGetProperties(prop._pvt_ptr, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], prop) + return (CUresult(err), None) + return (CUresult(err), prop) {{endif}} {{if 'cuDeviceComputeCapability' in found_functions}} @@ -25106,8 +24872,8 @@ def cuDeviceComputeCapability(dev): with nogil: err = cydriver.cuDeviceComputeCapability(&major, &minor, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], major, minor) + return (CUresult(err), None, None) + return (CUresult(err), major, minor) {{endif}} {{if 'cuDevicePrimaryCtxRetain' in found_functions}} @@ -25164,8 +24930,8 @@ def cuDevicePrimaryCtxRetain(dev): with nogil: err = cydriver.cuDevicePrimaryCtxRetain(pctx._pvt_ptr, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pctx) + return (CUresult(err), None) + return (CUresult(err), pctx) {{endif}} {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} @@ -25211,7 +24977,7 @@ def cuDevicePrimaryCtxRelease(dev): cydev = pdev with nogil: err = cydriver.cuDevicePrimaryCtxRelease(cydev) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} @@ -25325,7 +25091,7 @@ def cuDevicePrimaryCtxSetFlags(dev, unsigned int flags): cydev = pdev with nogil: err = cydriver.cuDevicePrimaryCtxSetFlags(cydev, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuDevicePrimaryCtxGetState' in found_functions}} @@ -25369,8 +25135,8 @@ def cuDevicePrimaryCtxGetState(dev): with nogil: err = cydriver.cuDevicePrimaryCtxGetState(cydev, &flags, &active) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], flags, active) + return (CUresult(err), None, None) + return (CUresult(err), flags, active) {{endif}} {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} @@ -25415,7 +25181,7 @@ def cuDevicePrimaryCtxReset(dev): cydev = pdev with nogil: err = cydriver.cuDevicePrimaryCtxReset(cydev) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxCreate_v4' in found_functions}} @@ -25597,8 +25363,8 @@ def cuCtxCreate(ctxCreateParams : Optional[CUctxCreateParams], unsigned int flag with nogil: err = cydriver.cuCtxCreate(pctx._pvt_ptr, cyctxCreateParams_ptr, flags, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pctx) + return (CUresult(err), None) + return (CUresult(err), pctx) {{endif}} {{if 'cuCtxDestroy_v2' in found_functions}} @@ -25661,7 +25427,7 @@ def cuCtxDestroy(ctx): cyctx = pctx with nogil: err = cydriver.cuCtxDestroy(cyctx) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxPushCurrent_v2' in found_functions}} @@ -25702,7 +25468,7 @@ def cuCtxPushCurrent(ctx): cyctx = pctx with nogil: err = cydriver.cuCtxPushCurrent(cyctx) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxPopCurrent_v2' in found_functions}} @@ -25734,8 +25500,8 @@ def cuCtxPopCurrent(): with nogil: err = cydriver.cuCtxPopCurrent(pctx._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pctx) + return (CUresult(err), None) + return (CUresult(err), pctx) {{endif}} {{if 'cuCtxSetCurrent' in found_functions}} @@ -25778,7 +25544,7 @@ def cuCtxSetCurrent(ctx): cyctx = pctx with nogil: err = cydriver.cuCtxSetCurrent(cyctx) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxGetCurrent' in found_functions}} @@ -25806,8 +25572,8 @@ def cuCtxGetCurrent(): with nogil: err = cydriver.cuCtxGetCurrent(pctx._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pctx) + return (CUresult(err), None) + return (CUresult(err), pctx) {{endif}} {{if 'cuCtxGetDevice' in found_functions}} @@ -25833,8 +25599,8 @@ def cuCtxGetDevice(): with nogil: err = cydriver.cuCtxGetDevice(device._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], device) + return (CUresult(err), None) + return (CUresult(err), device) {{endif}} {{if 'cuCtxGetDevice_v2' in found_functions}} @@ -25875,8 +25641,8 @@ def cuCtxGetDevice_v2(ctx): with nogil: err = cydriver.cuCtxGetDevice_v2(device._pvt_ptr, cyctx) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], device) + return (CUresult(err), None) + return (CUresult(err), device) {{endif}} {{if 'cuCtxGetFlags' in found_functions}} @@ -25903,8 +25669,8 @@ def cuCtxGetFlags(): with nogil: err = cydriver.cuCtxGetFlags(&flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], flags) + return (CUresult(err), None) + return (CUresult(err), flags) {{endif}} {{if 'cuCtxSetFlags' in found_functions}} @@ -25932,7 +25698,7 @@ def cuCtxSetFlags(unsigned int flags): """ with nogil: err = cydriver.cuCtxSetFlags(flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxGetId' in found_functions}} @@ -25974,8 +25740,8 @@ def cuCtxGetId(ctx): with nogil: err = cydriver.cuCtxGetId(cyctx, &ctxId) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], ctxId) + return (CUresult(err), None) + return (CUresult(err), ctxId) {{endif}} {{if 'cuCtxSynchronize' in found_functions}} @@ -26003,7 +25769,7 @@ def cuCtxSynchronize(): """ with nogil: err = cydriver.cuCtxSynchronize() - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxSynchronize_v2' in found_functions}} @@ -26048,7 +25814,7 @@ def cuCtxSynchronize_v2(ctx): cyctx = pctx with nogil: err = cydriver.cuCtxSynchronize_v2(cyctx) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxSetLimit' in found_functions}} @@ -26155,7 +25921,7 @@ def cuCtxSetLimit(limit not None : CUlimit, size_t value): cdef cydriver.CUlimit cylimit = int(limit) with nogil: err = cydriver.cuCtxSetLimit(cylimit, value) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxGetLimit' in found_functions}} @@ -26213,8 +25979,8 @@ def cuCtxGetLimit(limit not None : CUlimit): with nogil: err = cydriver.cuCtxGetLimit(&pvalue, cylimit) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pvalue) + return (CUresult(err), None) + return (CUresult(err), pvalue) {{endif}} {{if 'cuCtxGetCacheConfig' in found_functions}} @@ -26261,8 +26027,8 @@ def cuCtxGetCacheConfig(): with nogil: err = cydriver.cuCtxGetCacheConfig(&pconfig) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUfunc_cache(pconfig)) + return (CUresult(err), None) + return (CUresult(err), CUfunc_cache(pconfig)) {{endif}} {{if 'cuCtxSetCacheConfig' in found_functions}} @@ -26320,7 +26086,7 @@ def cuCtxSetCacheConfig(config not None : CUfunc_cache): cdef cydriver.CUfunc_cache cyconfig = int(config) with nogil: err = cydriver.cuCtxSetCacheConfig(cyconfig) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxGetApiVersion' in found_functions}} @@ -26367,8 +26133,8 @@ def cuCtxGetApiVersion(ctx): with nogil: err = cydriver.cuCtxGetApiVersion(cyctx, &version) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], version) + return (CUresult(err), None) + return (CUresult(err), version) {{endif}} {{if 'cuCtxGetStreamPriorityRange' in found_functions}} @@ -26413,8 +26179,8 @@ def cuCtxGetStreamPriorityRange(): with nogil: err = cydriver.cuCtxGetStreamPriorityRange(&leastPriority, &greatestPriority) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], leastPriority, greatestPriority) + return (CUresult(err), None, None) + return (CUresult(err), leastPriority, greatestPriority) {{endif}} {{if 'cuCtxResetPersistingL2Cache' in found_functions}} @@ -26437,7 +26203,7 @@ def cuCtxResetPersistingL2Cache(): """ with nogil: err = cydriver.cuCtxResetPersistingL2Cache() - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxGetExecAffinity' in found_functions}} @@ -26473,8 +26239,8 @@ def cuCtxGetExecAffinity(typename not None : CUexecAffinityType): with nogil: err = cydriver.cuCtxGetExecAffinity(pExecAffinity._pvt_ptr, cytypename) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pExecAffinity) + return (CUresult(err), None) + return (CUresult(err), pExecAffinity) {{endif}} {{if 'cuCtxRecordEvent' in found_functions}} @@ -26534,7 +26300,7 @@ def cuCtxRecordEvent(hCtx, hEvent): cyhCtx = phCtx with nogil: err = cydriver.cuCtxRecordEvent(cyhCtx, cyhEvent) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxWaitEvent' in found_functions}} @@ -26593,7 +26359,7 @@ def cuCtxWaitEvent(hCtx, hEvent): cyhCtx = phCtx with nogil: err = cydriver.cuCtxWaitEvent(cyhCtx, cyhEvent) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxAttach' in found_functions}} @@ -26633,8 +26399,8 @@ def cuCtxAttach(unsigned int flags): with nogil: err = cydriver.cuCtxAttach(pctx._pvt_ptr, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pctx) + return (CUresult(err), None) + return (CUresult(err), pctx) {{endif}} {{if 'cuCtxDetach' in found_functions}} @@ -26676,7 +26442,7 @@ def cuCtxDetach(ctx): cyctx = pctx with nogil: err = cydriver.cuCtxDetach(cyctx) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxGetSharedMemConfig' in found_functions}} @@ -26718,8 +26484,8 @@ def cuCtxGetSharedMemConfig(): with nogil: err = cydriver.cuCtxGetSharedMemConfig(&pConfig) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUsharedconfig(pConfig)) + return (CUresult(err), None) + return (CUresult(err), CUsharedconfig(pConfig)) {{endif}} {{if 'cuCtxSetSharedMemConfig' in found_functions}} @@ -26774,7 +26540,7 @@ def cuCtxSetSharedMemConfig(config not None : CUsharedconfig): cdef cydriver.CUsharedconfig cyconfig = int(config) with nogil: err = cydriver.cuCtxSetSharedMemConfig(cyconfig) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuModuleLoad' in found_functions}} @@ -26812,8 +26578,8 @@ def cuModuleLoad(char* fname): with nogil: err = cydriver.cuModuleLoad(module._pvt_ptr, fname) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], module) + return (CUresult(err), None) + return (CUresult(err), module) {{endif}} {{if 'cuModuleLoadData' in found_functions}} @@ -26849,8 +26615,8 @@ def cuModuleLoadData(image): with nogil: err = cydriver.cuModuleLoadData(module._pvt_ptr, cyimage_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], module) + return (CUresult(err), None) + return (CUresult(err), module) {{endif}} {{if 'cuModuleLoadDataEx' in found_functions}} @@ -26902,8 +26668,8 @@ def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[tuple[ with nogil: err = cydriver.cuModuleLoadDataEx(module._pvt_ptr, cyimage_ptr, numOptions, cyoptions.data(), cyoptionValues_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], module) + return (CUresult(err), None) + return (CUresult(err), module) {{endif}} {{if 'cuModuleLoadFatBinary' in found_functions}} @@ -26945,8 +26711,8 @@ def cuModuleLoadFatBinary(fatCubin): with nogil: err = cydriver.cuModuleLoadFatBinary(module._pvt_ptr, cyfatCubin_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], module) + return (CUresult(err), None) + return (CUresult(err), module) {{endif}} {{if 'cuModuleUnload' in found_functions}} @@ -26984,7 +26750,7 @@ def cuModuleUnload(hmod): cyhmod = phmod with nogil: err = cydriver.cuModuleUnload(cyhmod) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuModuleGetLoadingMode' in found_functions}} @@ -27011,8 +26777,8 @@ def cuModuleGetLoadingMode(): with nogil: err = cydriver.cuModuleGetLoadingMode(&mode) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUmoduleLoadingMode(mode)) + return (CUresult(err), None) + return (CUresult(err), CUmoduleLoadingMode(mode)) {{endif}} {{if 'cuModuleGetFunction' in found_functions}} @@ -27056,8 +26822,8 @@ def cuModuleGetFunction(hmod, char* name): with nogil: err = cydriver.cuModuleGetFunction(hfunc._pvt_ptr, cyhmod, name) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], hfunc) + return (CUresult(err), None) + return (CUresult(err), hfunc) {{endif}} {{if 'cuModuleGetFunctionCount' in found_functions}} @@ -27092,8 +26858,8 @@ def cuModuleGetFunctionCount(mod): with nogil: err = cydriver.cuModuleGetFunctionCount(&count, cymod) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], count) + return (CUresult(err), None) + return (CUresult(err), count) {{endif}} {{if 'cuModuleEnumerateFunctions' in found_functions}} @@ -27151,8 +26917,8 @@ def cuModuleEnumerateFunctions(unsigned int numFunctions, mod): if cyfunctions is not NULL: free(cyfunctions) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pyfunctions) + return (CUresult(err), None) + return (CUresult(err), pyfunctions) {{endif}} {{if 'cuModuleGetGlobal_v2' in found_functions}} @@ -27200,8 +26966,8 @@ def cuModuleGetGlobal(hmod, char* name): with nogil: err = cydriver.cuModuleGetGlobal(dptr._pvt_ptr, &numbytes, cyhmod, name) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], dptr, numbytes) + return (CUresult(err), None, None) + return (CUresult(err), dptr, numbytes) {{endif}} {{if 'cuLinkCreate_v2' in found_functions}} @@ -27274,8 +27040,8 @@ def cuLinkCreate(unsigned int numOptions, options : Optional[tuple[CUjit_option] for option in pylist: stateOut._keepalive.append(option) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], stateOut) + return (CUresult(err), None) + return (CUresult(err), stateOut) {{endif}} {{if 'cuLinkAddData_v2' in found_functions}} @@ -27349,7 +27115,7 @@ def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr with nogil: err = cydriver.cuLinkAddData(cystate, cytypename, cydata_ptr, size, name, numOptions, cyoptions.data(), cyoptionValues_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLinkAddFile_v2' in found_functions}} @@ -27419,7 +27185,7 @@ def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigne cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr with nogil: err = cydriver.cuLinkAddFile(cystate, cytypename, path, numOptions, cyoptions.data(), cyoptionValues_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLinkComplete' in found_functions}} @@ -27465,8 +27231,8 @@ def cuLinkComplete(state): with nogil: err = cydriver.cuLinkComplete(cystate, &cubinOut, &sizeOut) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], cubinOut, sizeOut) + return (CUresult(err), None, None) + return (CUresult(err), cubinOut, sizeOut) {{endif}} {{if 'cuLinkDestroy' in found_functions}} @@ -27499,7 +27265,7 @@ def cuLinkDestroy(state): cystate = pstate with nogil: err = cydriver.cuLinkDestroy(cystate) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuModuleGetTexRef' in found_functions}} @@ -27547,8 +27313,8 @@ def cuModuleGetTexRef(hmod, char* name): with nogil: err = cydriver.cuModuleGetTexRef(pTexRef._pvt_ptr, cyhmod, name) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pTexRef) + return (CUresult(err), None) + return (CUresult(err), pTexRef) {{endif}} {{if 'cuModuleGetSurfRef' in found_functions}} @@ -27594,8 +27360,8 @@ def cuModuleGetSurfRef(hmod, char* name): with nogil: err = cydriver.cuModuleGetSurfRef(pSurfRef._pvt_ptr, cyhmod, name) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pSurfRef) + return (CUresult(err), None) + return (CUresult(err), pSurfRef) {{endif}} {{if 'cuLibraryLoadData' in found_functions}} @@ -27693,8 +27459,8 @@ def cuLibraryLoadData(code, jitOptions : Optional[tuple[CUjit_option] | list[CUj with nogil: err = cydriver.cuLibraryLoadData(library._pvt_ptr, cycode_ptr, cyjitOptions.data(), cyjitOptionsValues_ptr, numJitOptions, cylibraryOptions.data(), cylibraryOptionValues_ptr, numLibraryOptions) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], library) + return (CUresult(err), None) + return (CUresult(err), library) {{endif}} {{if 'cuLibraryLoadFromFile' in found_functions}} @@ -27790,8 +27556,8 @@ def cuLibraryLoadFromFile(char* fileName, jitOptions : Optional[tuple[CUjit_opti with nogil: err = cydriver.cuLibraryLoadFromFile(library._pvt_ptr, fileName, cyjitOptions.data(), cyjitOptionsValues_ptr, numJitOptions, cylibraryOptions.data(), cylibraryOptionValues_ptr, numLibraryOptions) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], library) + return (CUresult(err), None) + return (CUresult(err), library) {{endif}} {{if 'cuLibraryUnload' in found_functions}} @@ -27826,7 +27592,7 @@ def cuLibraryUnload(library): cylibrary = plibrary with nogil: err = cydriver.cuLibraryUnload(cylibrary) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLibraryGetKernel' in found_functions}} @@ -27869,8 +27635,8 @@ def cuLibraryGetKernel(library, char* name): with nogil: err = cydriver.cuLibraryGetKernel(pKernel._pvt_ptr, cylibrary, name) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pKernel) + return (CUresult(err), None) + return (CUresult(err), pKernel) {{endif}} {{if 'cuLibraryGetKernelCount' in found_functions}} @@ -27905,8 +27671,8 @@ def cuLibraryGetKernelCount(lib): with nogil: err = cydriver.cuLibraryGetKernelCount(&count, cylib) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], count) + return (CUresult(err), None) + return (CUresult(err), count) {{endif}} {{if 'cuLibraryEnumerateKernels' in found_functions}} @@ -27958,8 +27724,8 @@ def cuLibraryEnumerateKernels(unsigned int numKernels, lib): if cykernels is not NULL: free(cykernels) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pykernels) + return (CUresult(err), None) + return (CUresult(err), pykernels) {{endif}} {{if 'cuLibraryGetModule' in found_functions}} @@ -28000,8 +27766,8 @@ def cuLibraryGetModule(library): with nogil: err = cydriver.cuLibraryGetModule(pMod._pvt_ptr, cylibrary) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pMod) + return (CUresult(err), None) + return (CUresult(err), pMod) {{endif}} {{if 'cuKernelGetFunction' in found_functions}} @@ -28042,8 +27808,8 @@ def cuKernelGetFunction(kernel): with nogil: err = cydriver.cuKernelGetFunction(pFunc._pvt_ptr, cykernel) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pFunc) + return (CUresult(err), None) + return (CUresult(err), pFunc) {{endif}} {{if 'cuKernelGetLibrary' in found_functions}} @@ -28083,8 +27849,8 @@ def cuKernelGetLibrary(kernel): with nogil: err = cydriver.cuKernelGetLibrary(pLib._pvt_ptr, cykernel) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pLib) + return (CUresult(err), None) + return (CUresult(err), pLib) {{endif}} {{if 'cuLibraryGetGlobal' in found_functions}} @@ -28132,8 +27898,8 @@ def cuLibraryGetGlobal(library, char* name): with nogil: err = cydriver.cuLibraryGetGlobal(dptr._pvt_ptr, &numbytes, cylibrary, name) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], dptr, numbytes) + return (CUresult(err), None, None) + return (CUresult(err), dptr, numbytes) {{endif}} {{if 'cuLibraryGetManaged' in found_functions}} @@ -28183,8 +27949,8 @@ def cuLibraryGetManaged(library, char* name): with nogil: err = cydriver.cuLibraryGetManaged(dptr._pvt_ptr, &numbytes, cylibrary, name) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], dptr, numbytes) + return (CUresult(err), None, None) + return (CUresult(err), dptr, numbytes) {{endif}} {{if 'cuLibraryGetUnifiedFunction' in found_functions}} @@ -28230,8 +27996,8 @@ def cuLibraryGetUnifiedFunction(library, char* symbol): with nogil: err = cydriver.cuLibraryGetUnifiedFunction(&fptr, cylibrary, symbol) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], fptr) + return (CUresult(err), None) + return (CUresult(err), fptr) {{endif}} {{if 'cuKernelGetAttribute' in found_functions}} @@ -28365,8 +28131,8 @@ def cuKernelGetAttribute(attrib not None : CUfunction_attribute, kernel, dev): with nogil: err = cydriver.cuKernelGetAttribute(&pi, cyattrib, cykernel, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pi) + return (CUresult(err), None) + return (CUresult(err), pi) {{endif}} {{if 'cuKernelSetAttribute' in found_functions}} @@ -28481,7 +28247,7 @@ def cuKernelSetAttribute(attrib not None : CUfunction_attribute, int val, kernel cdef cydriver.CUfunction_attribute cyattrib = int(attrib) with nogil: err = cydriver.cuKernelSetAttribute(cyattrib, val, cykernel, cydev) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuKernelSetCacheConfig' in found_functions}} @@ -28565,7 +28331,7 @@ def cuKernelSetCacheConfig(kernel, config not None : CUfunc_cache, dev): cdef cydriver.CUfunc_cache cyconfig = int(config) with nogil: err = cydriver.cuKernelSetCacheConfig(cykernel, cyconfig, cydev) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuKernelGetName' in found_functions}} @@ -28606,8 +28372,8 @@ def cuKernelGetName(hfunc): with nogil: err = cydriver.cuKernelGetName(&name, cyhfunc) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], name if name != NULL else None) + return (CUresult(err), None) + return (CUresult(err), name if name != NULL else None) {{endif}} {{if 'cuKernelGetParamInfo' in found_functions}} @@ -28661,8 +28427,8 @@ def cuKernelGetParamInfo(kernel, size_t paramIndex): with nogil: err = cydriver.cuKernelGetParamInfo(cykernel, paramIndex, ¶mOffset, ¶mSize) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], paramOffset, paramSize) + return (CUresult(err), None, None) + return (CUresult(err), paramOffset, paramSize) {{endif}} {{if 'cuMemGetInfo_v2' in found_functions}} @@ -28706,8 +28472,8 @@ def cuMemGetInfo(): with nogil: err = cydriver.cuMemGetInfo(&free, &total) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], free, total) + return (CUresult(err), None, None) + return (CUresult(err), free, total) {{endif}} {{if 'cuMemAlloc_v2' in found_functions}} @@ -28742,8 +28508,8 @@ def cuMemAlloc(size_t bytesize): with nogil: err = cydriver.cuMemAlloc(dptr._pvt_ptr, bytesize) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], dptr) + return (CUresult(err), None) + return (CUresult(err), dptr) {{endif}} {{if 'cuMemAllocPitch_v2' in found_functions}} @@ -28811,8 +28577,8 @@ def cuMemAllocPitch(size_t WidthInBytes, size_t Height, unsigned int ElementSize with nogil: err = cydriver.cuMemAllocPitch(dptr._pvt_ptr, &pPitch, WidthInBytes, Height, ElementSizeBytes) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], dptr, pPitch) + return (CUresult(err), None, None) + return (CUresult(err), dptr, pPitch) {{endif}} {{if 'cuMemFree_v2' in found_functions}} @@ -28860,7 +28626,7 @@ def cuMemFree(dptr): cydptr = pdptr with nogil: err = cydriver.cuMemFree(cydptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemGetAddressRange_v2' in found_functions}} @@ -28905,8 +28671,8 @@ def cuMemGetAddressRange(dptr): with nogil: err = cydriver.cuMemGetAddressRange(pbase._pvt_ptr, &psize, cydptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], pbase, psize) + return (CUresult(err), None, None) + return (CUresult(err), pbase, psize) {{endif}} {{if 'cuMemAllocHost_v2' in found_functions}} @@ -28962,8 +28728,8 @@ def cuMemAllocHost(size_t bytesize): with nogil: err = cydriver.cuMemAllocHost(&pp, bytesize) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pp) + return (CUresult(err), None) + return (CUresult(err), pp) {{endif}} {{if 'cuMemFreeHost' in found_functions}} @@ -28993,7 +28759,7 @@ def cuMemFreeHost(p): cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemFreeHost(cyp_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemHostAlloc' in found_functions}} @@ -29085,8 +28851,8 @@ def cuMemHostAlloc(size_t bytesize, unsigned int Flags): with nogil: err = cydriver.cuMemHostAlloc(&pp, bytesize, Flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pp) + return (CUresult(err), None) + return (CUresult(err), pp) {{endif}} {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} @@ -29148,8 +28914,8 @@ def cuMemHostGetDevicePointer(p, unsigned int Flags): with nogil: err = cydriver.cuMemHostGetDevicePointer(pdptr._pvt_ptr, cyp_ptr, Flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pdptr) + return (CUresult(err), None) + return (CUresult(err), pdptr) {{endif}} {{if 'cuMemHostGetFlags' in found_functions}} @@ -29187,8 +28953,8 @@ def cuMemHostGetFlags(p): with nogil: err = cydriver.cuMemHostGetFlags(&pFlags, cyp_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pFlags) + return (CUresult(err), None) + return (CUresult(err), pFlags) {{endif}} {{if 'cuMemAllocManaged' in found_functions}} @@ -29324,8 +29090,8 @@ def cuMemAllocManaged(size_t bytesize, unsigned int flags): with nogil: err = cydriver.cuMemAllocManaged(dptr._pvt_ptr, bytesize, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], dptr) + return (CUresult(err), None) + return (CUresult(err), dptr) {{endif}} {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} @@ -29419,8 +29185,8 @@ def cuDeviceRegisterAsyncNotification(device, callbackFunc, userData): else: m_global._allocated[int(callback)] = cbData if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], callback) + return (CUresult(err), None) + return (CUresult(err), callback) {{endif}} {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} @@ -29470,7 +29236,7 @@ def cuDeviceUnregisterAsyncNotification(device, callback): if err == cydriver.CUDA_SUCCESS: free(m_global._allocated[pcallback]) m_global._allocated.erase(pcallback) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuDeviceGetByPCIBusId' in found_functions}} @@ -29504,8 +29270,8 @@ def cuDeviceGetByPCIBusId(char* pciBusId): with nogil: err = cydriver.cuDeviceGetByPCIBusId(dev._pvt_ptr, pciBusId) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], dev) + return (CUresult(err), None) + return (CUresult(err), dev) {{endif}} {{if 'cuDeviceGetPCIBusId' in found_functions}} @@ -29553,8 +29319,8 @@ def cuDeviceGetPCIBusId(int length, dev): with nogil: err = cydriver.cuDeviceGetPCIBusId(pciBusId, length, cydev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pypciBusId) + return (CUresult(err), None) + return (CUresult(err), pypciBusId) {{endif}} {{if 'cuIpcGetEventHandle' in found_functions}} @@ -29614,8 +29380,8 @@ def cuIpcGetEventHandle(event): with nogil: err = cydriver.cuIpcGetEventHandle(pHandle._pvt_ptr, cyevent) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pHandle) + return (CUresult(err), None) + return (CUresult(err), pHandle) {{endif}} {{if 'cuIpcOpenEventHandle' in found_functions}} @@ -29661,8 +29427,8 @@ def cuIpcOpenEventHandle(handle not None : CUipcEventHandle): with nogil: err = cydriver.cuIpcOpenEventHandle(phEvent._pvt_ptr, handle._pvt_ptr[0]) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phEvent) + return (CUresult(err), None) + return (CUresult(err), phEvent) {{endif}} {{if 'cuIpcGetMemHandle' in found_functions}} @@ -29717,8 +29483,8 @@ def cuIpcGetMemHandle(dptr): with nogil: err = cydriver.cuIpcGetMemHandle(pHandle._pvt_ptr, cydptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pHandle) + return (CUresult(err), None) + return (CUresult(err), pHandle) {{endif}} {{if 'cuIpcOpenMemHandle_v2' in found_functions}} @@ -29786,8 +29552,8 @@ def cuIpcOpenMemHandle(handle not None : CUipcMemHandle, unsigned int Flags): with nogil: err = cydriver.cuIpcOpenMemHandle(pdptr._pvt_ptr, handle._pvt_ptr[0], Flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pdptr) + return (CUresult(err), None) + return (CUresult(err), pdptr) {{endif}} {{if 'cuIpcCloseMemHandle' in found_functions}} @@ -29836,7 +29602,7 @@ def cuIpcCloseMemHandle(dptr): cydptr = pdptr with nogil: err = cydriver.cuIpcCloseMemHandle(cydptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemHostRegister_v2' in found_functions}} @@ -29941,7 +29707,7 @@ def cuMemHostRegister(p, size_t bytesize, unsigned int Flags): cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemHostRegister(cyp_ptr, bytesize, Flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemHostUnregister' in found_functions}} @@ -29974,7 +29740,7 @@ def cuMemHostUnregister(p): cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemHostUnregister(cyp_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpy' in found_functions}} @@ -30026,7 +29792,7 @@ def cuMemcpy(dst, src, size_t ByteCount): cydst = pdst with nogil: err = cydriver.cuMemcpy(cydst, cysrc, ByteCount) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyPeer' in found_functions}} @@ -30097,7 +29863,7 @@ def cuMemcpyPeer(dstDevice, dstContext, srcDevice, srcContext, size_t ByteCount) cydstDevice = pdstDevice with nogil: err = cydriver.cuMemcpyPeer(cydstDevice, cydstContext, cysrcDevice, cysrcContext, ByteCount) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyHtoD_v2' in found_functions}} @@ -30140,7 +29906,7 @@ def cuMemcpyHtoD(dstDevice, srcHost, size_t ByteCount): cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoD(cydstDevice, cysrcHost_ptr, ByteCount) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyDtoH_v2' in found_functions}} @@ -30183,7 +29949,7 @@ def cuMemcpyDtoH(dstHost, srcDevice, size_t ByteCount): cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyDtoH(cydstHost_ptr, cysrcDevice, ByteCount) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyDtoD_v2' in found_functions}} @@ -30232,7 +29998,7 @@ def cuMemcpyDtoD(dstDevice, srcDevice, size_t ByteCount): cydstDevice = pdstDevice with nogil: err = cydriver.cuMemcpyDtoD(cydstDevice, cysrcDevice, ByteCount) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyDtoA_v2' in found_functions}} @@ -30284,7 +30050,7 @@ def cuMemcpyDtoA(dstArray, size_t dstOffset, srcDevice, size_t ByteCount): cydstArray = pdstArray with nogil: err = cydriver.cuMemcpyDtoA(cydstArray, dstOffset, cysrcDevice, ByteCount) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyAtoD_v2' in found_functions}} @@ -30338,7 +30104,7 @@ def cuMemcpyAtoD(dstDevice, srcArray, size_t srcOffset, size_t ByteCount): cydstDevice = pdstDevice with nogil: err = cydriver.cuMemcpyAtoD(cydstDevice, cysrcArray, srcOffset, ByteCount) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyHtoA_v2' in found_functions}} @@ -30384,7 +30150,7 @@ def cuMemcpyHtoA(dstArray, size_t dstOffset, srcHost, size_t ByteCount): cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoA(cydstArray, dstOffset, cysrcHost_ptr, ByteCount) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyAtoH_v2' in found_functions}} @@ -30430,7 +30196,7 @@ def cuMemcpyAtoH(dstHost, srcArray, size_t srcOffset, size_t ByteCount): cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyAtoH(cydstHost_ptr, cysrcArray, srcOffset, ByteCount) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyAtoA_v2' in found_functions}} @@ -30487,7 +30253,7 @@ def cuMemcpyAtoA(dstArray, size_t dstOffset, srcArray, size_t srcOffset, size_t cydstArray = pdstArray with nogil: err = cydriver.cuMemcpyAtoA(cydstArray, dstOffset, cysrcArray, srcOffset, ByteCount) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpy2D_v2' in found_functions}} @@ -30614,7 +30380,7 @@ def cuMemcpy2D(pCopy : Optional[CUDA_MEMCPY2D]): cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy2D(cypCopy_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} @@ -30741,7 +30507,7 @@ def cuMemcpy2DUnaligned(pCopy : Optional[CUDA_MEMCPY2D]): cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy2DUnaligned(cypCopy_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpy3D_v2' in found_functions}} @@ -30871,7 +30637,7 @@ def cuMemcpy3D(pCopy : Optional[CUDA_MEMCPY3D]): cdef cydriver.CUDA_MEMCPY3D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3D(cypCopy_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpy3DPeer' in found_functions}} @@ -30901,7 +30667,7 @@ def cuMemcpy3DPeer(pCopy : Optional[CUDA_MEMCPY3D_PEER]): cdef cydriver.CUDA_MEMCPY3D_PEER* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3DPeer(cypCopy_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyAsync' in found_functions}} @@ -30963,7 +30729,7 @@ def cuMemcpyAsync(dst, src, size_t ByteCount, hStream): cydst = pdst with nogil: err = cydriver.cuMemcpyAsync(cydst, cysrc, ByteCount, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyPeerAsync' in found_functions}} @@ -31044,7 +30810,7 @@ def cuMemcpyPeerAsync(dstDevice, dstContext, srcDevice, srcContext, size_t ByteC cydstDevice = pdstDevice with nogil: err = cydriver.cuMemcpyPeerAsync(cydstDevice, cydstContext, cysrcDevice, cysrcContext, ByteCount, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} @@ -31097,7 +30863,7 @@ def cuMemcpyHtoDAsync(dstDevice, srcHost, size_t ByteCount, hStream): cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoDAsync(cydstDevice, cysrcHost_ptr, ByteCount, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} @@ -31150,7 +30916,7 @@ def cuMemcpyDtoHAsync(dstHost, srcDevice, size_t ByteCount, hStream): cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyDtoHAsync(cydstHost_ptr, cysrcDevice, ByteCount, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} @@ -31209,7 +30975,7 @@ def cuMemcpyDtoDAsync(dstDevice, srcDevice, size_t ByteCount, hStream): cydstDevice = pdstDevice with nogil: err = cydriver.cuMemcpyDtoDAsync(cydstDevice, cysrcDevice, ByteCount, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} @@ -31265,7 +31031,7 @@ def cuMemcpyHtoAAsync(dstArray, size_t dstOffset, srcHost, size_t ByteCount, hSt cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoAAsync(cydstArray, dstOffset, cysrcHost_ptr, ByteCount, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} @@ -31321,7 +31087,7 @@ def cuMemcpyAtoHAsync(dstHost, srcArray, size_t srcOffset, size_t ByteCount, hSt cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyAtoHAsync(cydstHost_ptr, cysrcArray, srcOffset, ByteCount, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpy2DAsync_v2' in found_functions}} @@ -31465,7 +31231,7 @@ def cuMemcpy2DAsync(pCopy : Optional[CUDA_MEMCPY2D], hStream): cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy2DAsync(cypCopy_ptr, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpy3DAsync_v2' in found_functions}} @@ -31605,7 +31371,7 @@ def cuMemcpy3DAsync(pCopy : Optional[CUDA_MEMCPY3D], hStream): cdef cydriver.CUDA_MEMCPY3D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3DAsync(cypCopy_ptr, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpy3DPeerAsync' in found_functions}} @@ -31645,7 +31411,7 @@ def cuMemcpy3DPeerAsync(pCopy : Optional[CUDA_MEMCPY3D_PEER], hStream): cdef cydriver.CUDA_MEMCPY3D_PEER* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3DPeerAsync(cypCopy_ptr, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpyBatchAsync_v2' in found_functions}} @@ -31817,7 +31583,7 @@ def cuMemcpyBatchAsync(dsts : Optional[tuple[CUdeviceptr] | list[CUdeviceptr]], free(cysrcs) if len(attrs) > 1 and cyattrs is not NULL: free(cyattrs) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} @@ -31948,7 +31714,7 @@ def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[CUDA_MEMCPY3D_BA err = cydriver.cuMemcpy3DBatchAsync(numOps, cyopList, flags, cyhStream) if len(opList) > 1 and cyopList is not NULL: free(cyopList) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD8_v2' in found_functions}} @@ -31987,7 +31753,7 @@ def cuMemsetD8(dstDevice, unsigned char uc, size_t N): cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD8(cydstDevice, uc, N) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD16_v2' in found_functions}} @@ -32027,7 +31793,7 @@ def cuMemsetD16(dstDevice, unsigned short us, size_t N): cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD16(cydstDevice, us, N) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD32_v2' in found_functions}} @@ -32067,7 +31833,7 @@ def cuMemsetD32(dstDevice, unsigned int ui, size_t N): cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD32(cydstDevice, ui, N) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD2D8_v2' in found_functions}} @@ -32114,7 +31880,7 @@ def cuMemsetD2D8(dstDevice, size_t dstPitch, unsigned char uc, size_t Width, siz cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD2D8(cydstDevice, dstPitch, uc, Width, Height) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD2D16_v2' in found_functions}} @@ -32162,7 +31928,7 @@ def cuMemsetD2D16(dstDevice, size_t dstPitch, unsigned short us, size_t Width, s cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD2D16(cydstDevice, dstPitch, us, Width, Height) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD2D32_v2' in found_functions}} @@ -32210,7 +31976,7 @@ def cuMemsetD2D32(dstDevice, size_t dstPitch, unsigned int ui, size_t Width, siz cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD2D32(cydstDevice, dstPitch, ui, Width, Height) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD8Async' in found_functions}} @@ -32259,7 +32025,7 @@ def cuMemsetD8Async(dstDevice, unsigned char uc, size_t N, hStream): cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD8Async(cydstDevice, uc, N, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD16Async' in found_functions}} @@ -32309,7 +32075,7 @@ def cuMemsetD16Async(dstDevice, unsigned short us, size_t N, hStream): cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD16Async(cydstDevice, us, N, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD32Async' in found_functions}} @@ -32359,7 +32125,7 @@ def cuMemsetD32Async(dstDevice, unsigned int ui, size_t N, hStream): cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD32Async(cydstDevice, ui, N, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD2D8Async' in found_functions}} @@ -32416,7 +32182,7 @@ def cuMemsetD2D8Async(dstDevice, size_t dstPitch, unsigned char uc, size_t Width cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD2D8Async(cydstDevice, dstPitch, uc, Width, Height, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD2D16Async' in found_functions}} @@ -32474,7 +32240,7 @@ def cuMemsetD2D16Async(dstDevice, size_t dstPitch, unsigned short us, size_t Wid cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD2D16Async(cydstDevice, dstPitch, us, Width, Height, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemsetD2D32Async' in found_functions}} @@ -32532,7 +32298,7 @@ def cuMemsetD2D32Async(dstDevice, size_t dstPitch, unsigned int ui, size_t Width cydstDevice = pdstDevice with nogil: err = cydriver.cuMemsetD2D32Async(cydstDevice, dstPitch, ui, Width, Height, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuArrayCreate_v2' in found_functions}} @@ -32602,8 +32368,8 @@ def cuArrayCreate(pAllocateArray : Optional[CUDA_ARRAY_DESCRIPTOR]): with nogil: err = cydriver.cuArrayCreate(pHandle._pvt_ptr, cypAllocateArray_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pHandle) + return (CUresult(err), None) + return (CUresult(err), pHandle) {{endif}} {{if 'cuArrayGetDescriptor_v2' in found_functions}} @@ -32645,8 +32411,8 @@ def cuArrayGetDescriptor(hArray): with nogil: err = cydriver.cuArrayGetDescriptor(pArrayDescriptor._pvt_ptr, cyhArray) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pArrayDescriptor) + return (CUresult(err), None) + return (CUresult(err), pArrayDescriptor) {{endif}} {{if 'cuArrayGetSparseProperties' in found_functions}} @@ -32701,8 +32467,8 @@ def cuArrayGetSparseProperties(array): with nogil: err = cydriver.cuArrayGetSparseProperties(sparseProperties._pvt_ptr, cyarray) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], sparseProperties) + return (CUresult(err), None) + return (CUresult(err), sparseProperties) {{endif}} {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} @@ -32759,8 +32525,8 @@ def cuMipmappedArrayGetSparseProperties(mipmap): with nogil: err = cydriver.cuMipmappedArrayGetSparseProperties(sparseProperties._pvt_ptr, cymipmap) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], sparseProperties) + return (CUresult(err), None) + return (CUresult(err), sparseProperties) {{endif}} {{if 'cuArrayGetMemoryRequirements' in found_functions}} @@ -32817,8 +32583,8 @@ def cuArrayGetMemoryRequirements(array, device): with nogil: err = cydriver.cuArrayGetMemoryRequirements(memoryRequirements._pvt_ptr, cyarray, cydevice) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], memoryRequirements) + return (CUresult(err), None) + return (CUresult(err), memoryRequirements) {{endif}} {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} @@ -32876,8 +32642,8 @@ def cuMipmappedArrayGetMemoryRequirements(mipmap, device): with nogil: err = cydriver.cuMipmappedArrayGetMemoryRequirements(memoryRequirements._pvt_ptr, cymipmap, cydevice) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], memoryRequirements) + return (CUresult(err), None) + return (CUresult(err), memoryRequirements) {{endif}} {{if 'cuArrayGetPlane' in found_functions}} @@ -32932,8 +32698,8 @@ def cuArrayGetPlane(hArray, unsigned int planeIdx): with nogil: err = cydriver.cuArrayGetPlane(pPlaneArray._pvt_ptr, cyhArray, planeIdx) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pPlaneArray) + return (CUresult(err), None) + return (CUresult(err), pPlaneArray) {{endif}} {{if 'cuArrayDestroy' in found_functions}} @@ -32968,7 +32734,7 @@ def cuArrayDestroy(hArray): cyhArray = phArray with nogil: err = cydriver.cuArrayDestroy(cyhArray) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuArray3DCreate_v2' in found_functions}} @@ -33102,8 +32868,8 @@ def cuArray3DCreate(pAllocateArray : Optional[CUDA_ARRAY3D_DESCRIPTOR]): with nogil: err = cydriver.cuArray3DCreate(pHandle._pvt_ptr, cypAllocateArray_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pHandle) + return (CUresult(err), None) + return (CUresult(err), pHandle) {{endif}} {{if 'cuArray3DGetDescriptor_v2' in found_functions}} @@ -33149,8 +32915,8 @@ def cuArray3DGetDescriptor(hArray): with nogil: err = cydriver.cuArray3DGetDescriptor(pArrayDescriptor._pvt_ptr, cyhArray) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pArrayDescriptor) + return (CUresult(err), None) + return (CUresult(err), pArrayDescriptor) {{endif}} {{if 'cuMipmappedArrayCreate' in found_functions}} @@ -33272,8 +33038,8 @@ def cuMipmappedArrayCreate(pMipmappedArrayDesc : Optional[CUDA_ARRAY3D_DESCRIPTO with nogil: err = cydriver.cuMipmappedArrayCreate(pHandle._pvt_ptr, cypMipmappedArrayDesc_ptr, numMipmapLevels) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pHandle) + return (CUresult(err), None) + return (CUresult(err), pHandle) {{endif}} {{if 'cuMipmappedArrayGetLevel' in found_functions}} @@ -33318,8 +33084,8 @@ def cuMipmappedArrayGetLevel(hMipmappedArray, unsigned int level): with nogil: err = cydriver.cuMipmappedArrayGetLevel(pLevelArray._pvt_ptr, cyhMipmappedArray, level) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pLevelArray) + return (CUresult(err), None) + return (CUresult(err), pLevelArray) {{endif}} {{if 'cuMipmappedArrayDestroy' in found_functions}} @@ -33354,7 +33120,7 @@ def cuMipmappedArrayDestroy(hMipmappedArray): cyhMipmappedArray = phMipmappedArray with nogil: err = cydriver.cuMipmappedArrayDestroy(cyhMipmappedArray) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemGetHandleForAddressRange' in found_functions}} @@ -33435,8 +33201,8 @@ def cuMemGetHandleForAddressRange(dptr, size_t size, handleType not None : CUmem with nogil: err = cydriver.cuMemGetHandleForAddressRange(cyhandle_ptr, cydptr, size, cyhandleType, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], handle) + return (CUresult(err), None) + return (CUresult(err), handle) {{endif}} {{if 'cuMemBatchDecompressAsync' in found_functions}} @@ -33520,8 +33286,8 @@ def cuMemBatchDecompressAsync(paramsArray : Optional[CUmemDecompressParams], siz with nogil: err = cydriver.cuMemBatchDecompressAsync(cyparamsArray_ptr, count, flags, &errorIndex, cystream) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], errorIndex) + return (CUresult(err), None) + return (CUresult(err), errorIndex) {{endif}} {{if 'cuMemAddressReserve' in found_functions}} @@ -33573,8 +33339,8 @@ def cuMemAddressReserve(size_t size, size_t alignment, addr, unsigned long long with nogil: err = cydriver.cuMemAddressReserve(ptr._pvt_ptr, size, alignment, cyaddr, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], ptr) + return (CUresult(err), None) + return (CUresult(err), ptr) {{endif}} {{if 'cuMemAddressFree' in found_functions}} @@ -33613,7 +33379,7 @@ def cuMemAddressFree(ptr, size_t size): cyptr = pptr with nogil: err = cydriver.cuMemAddressFree(cyptr, size) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemCreate' in found_functions}} @@ -33705,8 +33471,8 @@ def cuMemCreate(size_t size, prop : Optional[CUmemAllocationProp], unsigned long with nogil: err = cydriver.cuMemCreate(handle._pvt_ptr, size, cyprop_ptr, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], handle) + return (CUresult(err), None) + return (CUresult(err), handle) {{endif}} {{if 'cuMemRelease' in found_functions}} @@ -33750,7 +33516,7 @@ def cuMemRelease(handle): cyhandle = phandle with nogil: err = cydriver.cuMemRelease(cyhandle) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemMap' in found_functions}} @@ -33833,7 +33599,7 @@ def cuMemMap(ptr, size_t size, size_t offset, handle, unsigned long long flags): cyptr = pptr with nogil: err = cydriver.cuMemMap(cyptr, size, offset, cyhandle, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemMapArrayAsync' in found_functions}} @@ -34007,7 +33773,7 @@ def cuMemMapArrayAsync(mapInfoList : Optional[tuple[CUarrayMapInfo] | list[CUarr err = cydriver.cuMemMapArrayAsync(cymapInfoList, count, cyhStream) if len(mapInfoList) > 1 and cymapInfoList is not NULL: free(cymapInfoList) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemUnmap' in found_functions}} @@ -34055,7 +33821,7 @@ def cuMemUnmap(ptr, size_t size): cyptr = pptr with nogil: err = cydriver.cuMemUnmap(cyptr, size) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemSetAccess' in found_functions}} @@ -34128,7 +33894,7 @@ def cuMemSetAccess(ptr, size_t size, desc : Optional[tuple[CUmemAccessDesc] | li err = cydriver.cuMemSetAccess(cyptr, size, cydesc, count) if len(desc) > 1 and cydesc is not NULL: free(cydesc) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemGetAccess' in found_functions}} @@ -34168,8 +33934,8 @@ def cuMemGetAccess(location : Optional[CUmemLocation], ptr): with nogil: err = cydriver.cuMemGetAccess(&flags, cylocation_ptr, cyptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], flags) + return (CUresult(err), None) + return (CUresult(err), flags) {{endif}} {{if 'cuMemExportToShareableHandle' in found_functions}} @@ -34228,8 +33994,8 @@ def cuMemExportToShareableHandle(handle, handleType not None : CUmemAllocationHa with nogil: err = cydriver.cuMemExportToShareableHandle(cyshareableHandle_ptr, cyhandle, cyhandleType, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], cyshareableHandle.pyObj()) + return (CUresult(err), None) + return (CUresult(err), cyshareableHandle.pyObj()) {{endif}} {{if 'cuMemImportFromShareableHandle' in found_functions}} @@ -34278,8 +34044,8 @@ def cuMemImportFromShareableHandle(osHandle, shHandleType not None : CUmemAlloca with nogil: err = cydriver.cuMemImportFromShareableHandle(handle._pvt_ptr, cyosHandle_ptr, cyshHandleType) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], handle) + return (CUresult(err), None) + return (CUresult(err), handle) {{endif}} {{if 'cuMemGetAllocationGranularity' in found_functions}} @@ -34317,8 +34083,8 @@ def cuMemGetAllocationGranularity(prop : Optional[CUmemAllocationProp], option n with nogil: err = cydriver.cuMemGetAllocationGranularity(&granularity, cyprop_ptr, cyoption) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], granularity) + return (CUresult(err), None) + return (CUresult(err), granularity) {{endif}} {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} @@ -34356,8 +34122,8 @@ def cuMemGetAllocationPropertiesFromHandle(handle): with nogil: err = cydriver.cuMemGetAllocationPropertiesFromHandle(prop._pvt_ptr, cyhandle) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], prop) + return (CUresult(err), None) + return (CUresult(err), prop) {{endif}} {{if 'cuMemRetainAllocationHandle' in found_functions}} @@ -34397,8 +34163,8 @@ def cuMemRetainAllocationHandle(addr): with nogil: err = cydriver.cuMemRetainAllocationHandle(handle._pvt_ptr, cyaddr_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], handle) + return (CUresult(err), None) + return (CUresult(err), handle) {{endif}} {{if 'cuMemFreeAsync' in found_functions}} @@ -34446,7 +34212,7 @@ def cuMemFreeAsync(dptr, hStream): cydptr = pdptr with nogil: err = cydriver.cuMemFreeAsync(cydptr, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemAllocAsync' in found_functions}} @@ -34499,8 +34265,8 @@ def cuMemAllocAsync(size_t bytesize, hStream): with nogil: err = cydriver.cuMemAllocAsync(dptr._pvt_ptr, bytesize, cyhStream) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], dptr) + return (CUresult(err), None) + return (CUresult(err), dptr) {{endif}} {{if 'cuMemPoolTrimTo' in found_functions}} @@ -34550,7 +34316,7 @@ def cuMemPoolTrimTo(pool, size_t minBytesToKeep): cypool = ppool with nogil: err = cydriver.cuMemPoolTrimTo(cypool, minBytesToKeep) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemPoolSetAttribute' in found_functions}} @@ -34625,7 +34391,7 @@ def cuMemPoolSetAttribute(pool, attr not None : CUmemPool_attribute, value): cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cydriver.cuMemPoolSetAttribute(cypool, cyattr, cyvalue_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemPoolGetAttribute' in found_functions}} @@ -34708,8 +34474,8 @@ def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): with nogil: err = cydriver.cuMemPoolGetAttribute(cypool, cyattr, cyvalue_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], cyvalue.pyObj()) + return (CUresult(err), None) + return (CUresult(err), cyvalue.pyObj()) {{endif}} {{if 'cuMemPoolSetAccess' in found_functions}} @@ -34762,7 +34528,7 @@ def cuMemPoolSetAccess(pool, map : Optional[tuple[CUmemAccessDesc] | list[CUmemA err = cydriver.cuMemPoolSetAccess(cypool, cymap, count) if len(map) > 1 and cymap is not NULL: free(cymap) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemPoolGetAccess' in found_functions}} @@ -34805,8 +34571,8 @@ def cuMemPoolGetAccess(memPool, location : Optional[CUmemLocation]): with nogil: err = cydriver.cuMemPoolGetAccess(&flags, cymemPool, cylocation_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUmemAccess_flags(flags)) + return (CUresult(err), None) + return (CUresult(err), CUmemAccess_flags(flags)) {{endif}} {{if 'cuMemPoolCreate' in found_functions}} @@ -34904,8 +34670,8 @@ def cuMemPoolCreate(poolProps : Optional[CUmemPoolProps]): with nogil: err = cydriver.cuMemPoolCreate(pool._pvt_ptr, cypoolProps_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pool) + return (CUresult(err), None) + return (CUresult(err), pool) {{endif}} {{if 'cuMemPoolDestroy' in found_functions}} @@ -34951,7 +34717,7 @@ def cuMemPoolDestroy(pool): cypool = ppool with nogil: err = cydriver.cuMemPoolDestroy(cypool) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemGetDefaultMemPool' in found_functions}} @@ -34995,8 +34761,8 @@ def cuMemGetDefaultMemPool(location : Optional[CUmemLocation], typename not None with nogil: err = cydriver.cuMemGetDefaultMemPool(pool_out._pvt_ptr, cylocation_ptr, cytypename) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pool_out) + return (CUresult(err), None) + return (CUresult(err), pool_out) {{endif}} {{if 'cuMemGetMemPool' in found_functions}} @@ -35048,8 +34814,8 @@ def cuMemGetMemPool(location : Optional[CUmemLocation], typename not None : CUme with nogil: err = cydriver.cuMemGetMemPool(pool._pvt_ptr, cylocation_ptr, cytypename) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pool) + return (CUresult(err), None) + return (CUresult(err), pool) {{endif}} {{if 'cuMemSetMemPool' in found_functions}} @@ -35115,7 +34881,7 @@ def cuMemSetMemPool(location : Optional[CUmemLocation], typename not None : CUme cdef cydriver.CUmemAllocationType cytypename = int(typename) with nogil: err = cydriver.cuMemSetMemPool(cylocation_ptr, cytypename, cypool) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemAllocFromPoolAsync' in found_functions}} @@ -35173,8 +34939,8 @@ def cuMemAllocFromPoolAsync(size_t bytesize, pool, hStream): with nogil: err = cydriver.cuMemAllocFromPoolAsync(dptr._pvt_ptr, bytesize, cypool, cyhStream) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], dptr) + return (CUresult(err), None) + return (CUresult(err), dptr) {{endif}} {{if 'cuMemPoolExportToShareableHandle' in found_functions}} @@ -35230,8 +34996,8 @@ def cuMemPoolExportToShareableHandle(pool, handleType not None : CUmemAllocation with nogil: err = cydriver.cuMemPoolExportToShareableHandle(cyhandle_out_ptr, cypool, cyhandleType, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], cyhandle_out.pyObj()) + return (CUresult(err), None) + return (CUresult(err), cyhandle_out.pyObj()) {{endif}} {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} @@ -35279,8 +35045,8 @@ def cuMemPoolImportFromShareableHandle(handle, handleType not None : CUmemAlloca with nogil: err = cydriver.cuMemPoolImportFromShareableHandle(pool_out._pvt_ptr, cyhandle_ptr, cyhandleType, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pool_out) + return (CUresult(err), None) + return (CUresult(err), pool_out) {{endif}} {{if 'cuMemPoolExportPointer' in found_functions}} @@ -35322,8 +35088,8 @@ def cuMemPoolExportPointer(ptr): with nogil: err = cydriver.cuMemPoolExportPointer(shareData_out._pvt_ptr, cyptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], shareData_out) + return (CUresult(err), None) + return (CUresult(err), shareData_out) {{endif}} {{if 'cuMemPoolImportPointer' in found_functions}} @@ -35375,8 +35141,8 @@ def cuMemPoolImportPointer(pool, shareData : Optional[CUmemPoolPtrExportData]): with nogil: err = cydriver.cuMemPoolImportPointer(ptr_out._pvt_ptr, cypool, cyshareData_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], ptr_out) + return (CUresult(err), None) + return (CUresult(err), ptr_out) {{endif}} {{if 'cuMulticastCreate' in found_functions}} @@ -35438,8 +35204,8 @@ def cuMulticastCreate(prop : Optional[CUmulticastObjectProp]): with nogil: err = cydriver.cuMulticastCreate(mcHandle._pvt_ptr, cyprop_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], mcHandle) + return (CUresult(err), None) + return (CUresult(err), mcHandle) {{endif}} {{if 'cuMulticastAddDevice' in found_functions}} @@ -35496,7 +35262,7 @@ def cuMulticastAddDevice(mcHandle, dev): cymcHandle = pmcHandle with nogil: err = cydriver.cuMulticastAddDevice(cymcHandle, cydev) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMulticastBindMem' in found_functions}} @@ -35578,7 +35344,7 @@ def cuMulticastBindMem(mcHandle, size_t mcOffset, memHandle, size_t memOffset, s cymcHandle = pmcHandle with nogil: err = cydriver.cuMulticastBindMem(cymcHandle, mcOffset, cymemHandle, memOffset, size, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMulticastBindMem_v2' in found_functions}} @@ -35679,7 +35445,7 @@ def cuMulticastBindMem_v2(mcHandle, dev, size_t mcOffset, memHandle, size_t memO cymcHandle = pmcHandle with nogil: err = cydriver.cuMulticastBindMem_v2(cymcHandle, cydev, mcOffset, cymemHandle, memOffset, size, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMulticastBindAddr' in found_functions}} @@ -35757,7 +35523,7 @@ def cuMulticastBindAddr(mcHandle, size_t mcOffset, memptr, size_t size, unsigned cymcHandle = pmcHandle with nogil: err = cydriver.cuMulticastBindAddr(cymcHandle, mcOffset, cymemptr, size, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMulticastBindAddr_v2' in found_functions}} @@ -35852,7 +35618,7 @@ def cuMulticastBindAddr_v2(mcHandle, dev, size_t mcOffset, memptr, size_t size, cymcHandle = pmcHandle with nogil: err = cydriver.cuMulticastBindAddr_v2(cymcHandle, cydev, mcOffset, cymemptr, size, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMulticastUnbind' in found_functions}} @@ -35913,7 +35679,7 @@ def cuMulticastUnbind(mcHandle, dev, size_t mcOffset, size_t size): cymcHandle = pmcHandle with nogil: err = cydriver.cuMulticastUnbind(cymcHandle, cydev, mcOffset, size) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMulticastGetGranularity' in found_functions}} @@ -35953,8 +35719,8 @@ def cuMulticastGetGranularity(prop : Optional[CUmulticastObjectProp], option not with nogil: err = cydriver.cuMulticastGetGranularity(&granularity, cyprop_ptr, cyoption) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], granularity) + return (CUresult(err), None) + return (CUresult(err), granularity) {{endif}} {{if 'cuPointerGetAttribute' in found_functions}} @@ -36166,8 +35932,8 @@ def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): with nogil: err = cydriver.cuPointerGetAttribute(cydata_ptr, cyattribute, cyptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], cydata.pyObj()) + return (CUresult(err), None) + return (CUresult(err), cydata.pyObj()) {{endif}} {{if 'cuMemPrefetchAsync_v2' in found_functions}} @@ -36290,7 +36056,7 @@ def cuMemPrefetchAsync(devPtr, size_t count, location not None : CUmemLocation, cydevPtr = pdevPtr with nogil: err = cydriver.cuMemPrefetchAsync(cydevPtr, count, location._pvt_ptr[0], flags, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemAdvise_v2' in found_functions}} @@ -36495,7 +36261,7 @@ def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location n cdef cydriver.CUmem_advise cyadvice = int(advice) with nogil: err = cydriver.cuMemAdvise(cydevPtr, count, cyadvice, location._pvt_ptr[0]) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemPrefetchBatchAsync' in found_functions}} @@ -36615,7 +36381,7 @@ def cuMemPrefetchBatchAsync(dptrs : Optional[tuple[CUdeviceptr] | list[CUdevicep free(cydptrs) if len(prefetchLocs) > 1 and cyprefetchLocs is not NULL: free(cyprefetchLocs) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemDiscardBatchAsync' in found_functions}} @@ -36700,7 +36466,7 @@ def cuMemDiscardBatchAsync(dptrs : Optional[tuple[CUdeviceptr] | list[CUdevicept err = cydriver.cuMemDiscardBatchAsync(cydptrs, cysizes.data(), count, flags, cyhStream) if len(dptrs) > 1 and cydptrs is not NULL: free(cydptrs) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} @@ -36828,7 +36594,7 @@ def cuMemDiscardAndPrefetchBatchAsync(dptrs : Optional[tuple[CUdeviceptr] | list free(cydptrs) if len(prefetchLocs) > 1 and cyprefetchLocs is not NULL: free(cyprefetchLocs) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuMemRangeGetAttribute' in found_functions}} @@ -36985,8 +36751,8 @@ def cuMemRangeGetAttribute(size_t dataSize, attribute not None : CUmem_range_att with nogil: err = cydriver.cuMemRangeGetAttribute(cydata_ptr, dataSize, cyattribute, cydevPtr, count) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], cydata.pyObj()) + return (CUresult(err), None) + return (CUresult(err), cydata.pyObj()) {{endif}} {{if 'cuMemRangeGetAttributes' in found_functions}} @@ -37072,8 +36838,8 @@ def cuMemRangeGetAttributes(dataSizes : tuple[int] | list[int], attributes : Opt with nogil: err = cydriver.cuMemRangeGetAttributes(cyvoidStarHelper_ptr, cydataSizes.data(), cyattributes.data(), numAttributes, cydevPtr, count) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], [obj.pyObj() for obj in pylist]) + return (CUresult(err), None) + return (CUresult(err), [obj.pyObj() for obj in pylist]) {{endif}} {{if 'cuPointerSetAttribute' in found_functions}} @@ -37129,7 +36895,7 @@ def cuPointerSetAttribute(value, attribute not None : CUpointer_attribute, ptr): cdef cydriver.CUpointer_attribute cyattribute = int(attribute) with nogil: err = cydriver.cuPointerSetAttribute(cyvalue_ptr, cyattribute, cyptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuPointerGetAttributes' in found_functions}} @@ -37222,8 +36988,8 @@ def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[tup with nogil: err = cydriver.cuPointerGetAttributes(numAttributes, cyattributes.data(), cyvoidStarHelper_ptr, cyptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], [obj.pyObj() for obj in pylist]) + return (CUresult(err), None) + return (CUresult(err), [obj.pyObj() for obj in pylist]) {{endif}} {{if 'cuStreamCreate' in found_functions}} @@ -37264,8 +37030,8 @@ def cuStreamCreate(unsigned int Flags): with nogil: err = cydriver.cuStreamCreate(phStream._pvt_ptr, Flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phStream) + return (CUresult(err), None) + return (CUresult(err), phStream) {{endif}} {{if 'cuStreamCreateWithPriority' in found_functions}} @@ -37319,8 +37085,8 @@ def cuStreamCreateWithPriority(unsigned int flags, int priority): with nogil: err = cydriver.cuStreamCreateWithPriority(phStream._pvt_ptr, flags, priority) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phStream) + return (CUresult(err), None) + return (CUresult(err), phStream) {{endif}} {{if 'cuStreamGetPriority' in found_functions}} @@ -37367,8 +37133,8 @@ def cuStreamGetPriority(hStream): with nogil: err = cydriver.cuStreamGetPriority(cyhStream, &priority) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], priority) + return (CUresult(err), None) + return (CUresult(err), priority) {{endif}} {{if 'cuStreamGetDevice' in found_functions}} @@ -37407,8 +37173,8 @@ def cuStreamGetDevice(hStream): with nogil: err = cydriver.cuStreamGetDevice(cyhStream, device._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], device) + return (CUresult(err), None) + return (CUresult(err), device) {{endif}} {{if 'cuStreamGetFlags' in found_functions}} @@ -37452,8 +37218,8 @@ def cuStreamGetFlags(hStream): with nogil: err = cydriver.cuStreamGetFlags(cyhStream, &flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], flags) + return (CUresult(err), None) + return (CUresult(err), flags) {{endif}} {{if 'cuStreamGetId' in found_functions}} @@ -37509,8 +37275,8 @@ def cuStreamGetId(hStream): with nogil: err = cydriver.cuStreamGetId(cyhStream, &streamId) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], streamId) + return (CUresult(err), None) + return (CUresult(err), streamId) {{endif}} {{if 'cuStreamGetCtx' in found_functions}} @@ -37574,8 +37340,8 @@ def cuStreamGetCtx(hStream): with nogil: err = cydriver.cuStreamGetCtx(cyhStream, pctx._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pctx) + return (CUresult(err), None) + return (CUresult(err), pctx) {{endif}} {{if 'cuStreamGetCtx_v2' in found_functions}} @@ -37652,8 +37418,8 @@ def cuStreamGetCtx_v2(hStream): with nogil: err = cydriver.cuStreamGetCtx_v2(cyhStream, pCtx._pvt_ptr, pGreenCtx._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], pCtx, pGreenCtx) + return (CUresult(err), None, None) + return (CUresult(err), pCtx, pGreenCtx) {{endif}} {{if 'cuStreamWaitEvent' in found_functions}} @@ -37712,7 +37478,7 @@ def cuStreamWaitEvent(hStream, hEvent, unsigned int Flags): cyhStream = phStream with nogil: err = cydriver.cuStreamWaitEvent(cyhStream, cyhEvent, Flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamAddCallback' in found_functions}} @@ -37829,7 +37595,7 @@ def cuStreamAddCallback(hStream, callback, userData, unsigned int flags): err = cydriver.cuStreamAddCallback(cyhStream, cuStreamCallbackWrapper, cbData, flags) if err != cydriver.CUDA_SUCCESS: free(cbData) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamBeginCapture_v2' in found_functions}} @@ -37885,7 +37651,7 @@ def cuStreamBeginCapture(hStream, mode not None : CUstreamCaptureMode): cdef cydriver.CUstreamCaptureMode cymode = int(mode) with nogil: err = cydriver.cuStreamBeginCapture(cyhStream, cymode) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamBeginCaptureToGraph' in found_functions}} @@ -37991,7 +37757,7 @@ def cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies : Optional[tuple[C free(cydependencies) if len(dependencyData) > 1 and cydependencyData is not NULL: free(cydependencyData) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} @@ -38064,8 +37830,8 @@ def cuThreadExchangeStreamCaptureMode(mode not None : CUstreamCaptureMode): with nogil: err = cydriver.cuThreadExchangeStreamCaptureMode(&cymode) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUstreamCaptureMode(cymode)) + return (CUresult(err), None) + return (CUresult(err), CUstreamCaptureMode(cymode)) {{endif}} {{if 'cuStreamEndCapture' in found_functions}} @@ -38112,8 +37878,8 @@ def cuStreamEndCapture(hStream): with nogil: err = cydriver.cuStreamEndCapture(cyhStream, phGraph._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraph) + return (CUresult(err), None) + return (CUresult(err), phGraph) {{endif}} {{if 'cuStreamIsCapturing' in found_functions}} @@ -38175,8 +37941,8 @@ def cuStreamIsCapturing(hStream): with nogil: err = cydriver.cuStreamIsCapturing(cyhStream, &captureStatus) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUstreamCaptureStatus(captureStatus)) + return (CUresult(err), None) + return (CUresult(err), CUstreamCaptureStatus(captureStatus)) {{endif}} {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} @@ -38275,8 +38041,8 @@ def cuStreamGetCaptureInfo(hStream): if CUresult(err) == CUresult(0): pyedgeData_out = [CUgraphEdgeData(_ptr=&cyedgeData_out[idx]) for idx in range(numDependencies_out)] if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None, None, None, None, None) - return (_dict_CUresult[err], CUstreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, pyedgeData_out, numDependencies_out) + return (CUresult(err), None, None, None, None, None, None) + return (CUresult(err), CUstreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, pyedgeData_out, numDependencies_out) {{endif}} {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} @@ -38363,7 +38129,7 @@ def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[tuple[CUg free(cydependencies) if len(dependencyData) > 1 and cydependencyData is not NULL: free(cydependencyData) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamAttachMemAsync' in found_functions}} @@ -38476,7 +38242,7 @@ def cuStreamAttachMemAsync(hStream, dptr, size_t length, unsigned int flags): cyhStream = phStream with nogil: err = cydriver.cuStreamAttachMemAsync(cyhStream, cydptr, length, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamQuery' in found_functions}} @@ -38517,7 +38283,7 @@ def cuStreamQuery(hStream): cyhStream = phStream with nogil: err = cydriver.cuStreamQuery(cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamSynchronize' in found_functions}} @@ -38557,7 +38323,7 @@ def cuStreamSynchronize(hStream): cyhStream = phStream with nogil: err = cydriver.cuStreamSynchronize(cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamDestroy_v2' in found_functions}} @@ -38598,7 +38364,7 @@ def cuStreamDestroy(hStream): cyhStream = phStream with nogil: err = cydriver.cuStreamDestroy(cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamCopyAttributes' in found_functions}} @@ -38644,7 +38410,7 @@ def cuStreamCopyAttributes(dst, src): cydst = pdst with nogil: err = cydriver.cuStreamCopyAttributes(cydst, cysrc) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamGetAttribute' in found_functions}} @@ -38687,8 +38453,8 @@ def cuStreamGetAttribute(hStream, attr not None : CUstreamAttrID): with nogil: err = cydriver.cuStreamGetAttribute(cyhStream, cyattr, value_out._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], value_out) + return (CUresult(err), None) + return (CUresult(err), value_out) {{endif}} {{if 'cuStreamSetAttribute' in found_functions}} @@ -38731,7 +38497,7 @@ def cuStreamSetAttribute(hStream, attr not None : CUstreamAttrID, value : Option cdef cydriver.CUstreamAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cydriver.cuStreamSetAttribute(cyhStream, cyattr, cyvalue_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuEventCreate' in found_functions}} @@ -38781,8 +38547,8 @@ def cuEventCreate(unsigned int Flags): with nogil: err = cydriver.cuEventCreate(phEvent._pvt_ptr, Flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phEvent) + return (CUresult(err), None) + return (CUresult(err), phEvent) {{endif}} {{if 'cuEventRecord' in found_functions}} @@ -38842,7 +38608,7 @@ def cuEventRecord(hEvent, hStream): cyhEvent = phEvent with nogil: err = cydriver.cuEventRecord(cyhEvent, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuEventRecordWithFlags' in found_functions}} @@ -38912,7 +38678,7 @@ def cuEventRecordWithFlags(hEvent, hStream, unsigned int flags): cyhEvent = phEvent with nogil: err = cydriver.cuEventRecordWithFlags(cyhEvent, cyhStream, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuEventQuery' in found_functions}} @@ -38957,7 +38723,7 @@ def cuEventQuery(hEvent): cyhEvent = phEvent with nogil: err = cydriver.cuEventQuery(cyhEvent) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuEventSynchronize' in found_functions}} @@ -39001,7 +38767,7 @@ def cuEventSynchronize(hEvent): cyhEvent = phEvent with nogil: err = cydriver.cuEventSynchronize(cyhEvent) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuEventDestroy_v2' in found_functions}} @@ -39042,7 +38808,7 @@ def cuEventDestroy(hEvent): cyhEvent = phEvent with nogil: err = cydriver.cuEventDestroy(cyhEvent) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuEventElapsedTime_v2' in found_functions}} @@ -39114,8 +38880,8 @@ def cuEventElapsedTime(hStart, hEnd): with nogil: err = cydriver.cuEventElapsedTime(&pMilliseconds, cyhStart, cyhEnd) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pMilliseconds) + return (CUresult(err), None) + return (CUresult(err), pMilliseconds) {{endif}} {{if 'cuImportExternalMemory' in found_functions}} @@ -39280,8 +39046,8 @@ def cuImportExternalMemory(memHandleDesc : Optional[CUDA_EXTERNAL_MEMORY_HANDLE_ with nogil: err = cydriver.cuImportExternalMemory(extMem_out._pvt_ptr, cymemHandleDesc_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], extMem_out) + return (CUresult(err), None) + return (CUresult(err), extMem_out) {{endif}} {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} @@ -39350,8 +39116,8 @@ def cuExternalMemoryGetMappedBuffer(extMem, bufferDesc : Optional[CUDA_EXTERNAL_ with nogil: err = cydriver.cuExternalMemoryGetMappedBuffer(devPtr._pvt_ptr, cyextMem, cybufferDesc_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], devPtr) + return (CUresult(err), None) + return (CUresult(err), devPtr) {{endif}} {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} @@ -39426,8 +39192,8 @@ def cuExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[CUDA_E with nogil: err = cydriver.cuExternalMemoryGetMappedMipmappedArray(mipmap._pvt_ptr, cyextMem, cymipmapDesc_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], mipmap) + return (CUresult(err), None) + return (CUresult(err), mipmap) {{endif}} {{if 'cuDestroyExternalMemory' in found_functions}} @@ -39465,7 +39231,7 @@ def cuDestroyExternalMemory(extMem): cyextMem = pextMem with nogil: err = cydriver.cuDestroyExternalMemory(cyextMem) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuImportExternalSemaphore' in found_functions}} @@ -39615,8 +39381,8 @@ def cuImportExternalSemaphore(semHandleDesc : Optional[CUDA_EXTERNAL_SEMAPHORE_H with nogil: err = cydriver.cuImportExternalSemaphore(extSem_out._pvt_ptr, cysemHandleDesc_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], extSem_out) + return (CUresult(err), None) + return (CUresult(err), extSem_out) {{endif}} {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} @@ -39769,7 +39535,7 @@ def cuSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemap free(cyextSemArray) if len(paramsArray) > 1 and cyparamsArray is not NULL: free(cyparamsArray) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} @@ -39899,7 +39665,7 @@ def cuWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemapho free(cyextSemArray) if len(paramsArray) > 1 and cyparamsArray is not NULL: free(cyparamsArray) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuDestroyExternalSemaphore' in found_functions}} @@ -39936,7 +39702,7 @@ def cuDestroyExternalSemaphore(extSem): cyextSem = pextSem with nogil: err = cydriver.cuDestroyExternalSemaphore(cyextSem) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamWaitValue32_v2' in found_functions}} @@ -40010,7 +39776,7 @@ def cuStreamWaitValue32(stream, addr, value, unsigned int flags): cystream = pstream with nogil: err = cydriver.cuStreamWaitValue32(cystream, cyaddr, cyvalue, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamWaitValue64_v2' in found_functions}} @@ -40082,7 +39848,7 @@ def cuStreamWaitValue64(stream, addr, value, unsigned int flags): cystream = pstream with nogil: err = cydriver.cuStreamWaitValue64(cystream, cyaddr, cyvalue, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamWriteValue32_v2' in found_functions}} @@ -40144,7 +39910,7 @@ def cuStreamWriteValue32(stream, addr, value, unsigned int flags): cystream = pstream with nogil: err = cydriver.cuStreamWriteValue32(cystream, cyaddr, cyvalue, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamWriteValue64_v2' in found_functions}} @@ -40208,7 +39974,7 @@ def cuStreamWriteValue64(stream, addr, value, unsigned int flags): cystream = pstream with nogil: err = cydriver.cuStreamWriteValue64(cystream, cyaddr, cyvalue, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamBatchMemOp_v2' in found_functions}} @@ -40281,7 +40047,7 @@ def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[tuple[C err = cydriver.cuStreamBatchMemOp(cystream, count, cyparamArray, flags) if len(paramArray) > 1 and cyparamArray is not NULL: free(cyparamArray) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuFuncGetAttribute' in found_functions}} @@ -40416,8 +40182,8 @@ def cuFuncGetAttribute(attrib not None : CUfunction_attribute, hfunc): with nogil: err = cydriver.cuFuncGetAttribute(&pi, cyattrib, cyhfunc) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pi) + return (CUresult(err), None) + return (CUresult(err), pi) {{endif}} {{if 'cuFuncSetAttribute' in found_functions}} @@ -40511,7 +40277,7 @@ def cuFuncSetAttribute(hfunc, attrib not None : CUfunction_attribute, int value) cdef cydriver.CUfunction_attribute cyattrib = int(attrib) with nogil: err = cydriver.cuFuncSetAttribute(cyhfunc, cyattrib, value) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuFuncSetCacheConfig' in found_functions}} @@ -40577,7 +40343,7 @@ def cuFuncSetCacheConfig(hfunc, config not None : CUfunc_cache): cdef cydriver.CUfunc_cache cyconfig = int(config) with nogil: err = cydriver.cuFuncSetCacheConfig(cyhfunc, cyconfig) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuFuncGetModule' in found_functions}} @@ -40620,8 +40386,8 @@ def cuFuncGetModule(hfunc): with nogil: err = cydriver.cuFuncGetModule(hmod._pvt_ptr, cyhfunc) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], hmod) + return (CUresult(err), None) + return (CUresult(err), hmod) {{endif}} {{if 'cuFuncGetName' in found_functions}} @@ -40662,8 +40428,8 @@ def cuFuncGetName(hfunc): with nogil: err = cydriver.cuFuncGetName(&name, cyhfunc) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], name if name != NULL else None) + return (CUresult(err), None) + return (CUresult(err), name if name != NULL else None) {{endif}} {{if 'cuFuncGetParamInfo' in found_functions}} @@ -40717,8 +40483,8 @@ def cuFuncGetParamInfo(func, size_t paramIndex): with nogil: err = cydriver.cuFuncGetParamInfo(cyfunc, paramIndex, ¶mOffset, ¶mSize) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], paramOffset, paramSize) + return (CUresult(err), None, None) + return (CUresult(err), paramOffset, paramSize) {{endif}} {{if 'cuFuncIsLoaded' in found_functions}} @@ -40757,8 +40523,8 @@ def cuFuncIsLoaded(function): with nogil: err = cydriver.cuFuncIsLoaded(&state, cyfunction) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUfunctionLoadingState(state)) + return (CUresult(err), None) + return (CUresult(err), CUfunctionLoadingState(state)) {{endif}} {{if 'cuFuncLoad' in found_functions}} @@ -40794,7 +40560,7 @@ def cuFuncLoad(function): cyfunction = pfunction with nogil: err = cydriver.cuFuncLoad(cyfunction) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLaunchKernel' in found_functions}} @@ -40927,7 +40693,7 @@ def cuLaunchKernel(f, unsigned int gridDimX, unsigned int gridDimY, unsigned int cdef void** cykernelParams_ptr = cykernelParams.ckernelParams with nogil: err = cydriver.cuLaunchKernel(cyf, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, cyhStream, cykernelParams_ptr, extra) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLaunchKernelEx' in found_functions}} @@ -41168,7 +40934,7 @@ def cuLaunchKernelEx(config : Optional[CUlaunchConfig], f, kernelParams, void_pt cdef void** cykernelParams_ptr = cykernelParams.ckernelParams with nogil: err = cydriver.cuLaunchKernelEx(cyconfig_ptr, cyf, cykernelParams_ptr, extra) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLaunchCooperativeKernel' in found_functions}} @@ -41281,7 +41047,7 @@ def cuLaunchCooperativeKernel(f, unsigned int gridDimX, unsigned int gridDimY, u cdef void** cykernelParams_ptr = cykernelParams.ckernelParams with nogil: err = cydriver.cuLaunchCooperativeKernel(cyf, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, cyhStream, cykernelParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} @@ -41455,7 +41221,7 @@ def cuLaunchCooperativeKernelMultiDevice(launchParamsList : Optional[tuple[CUDA_ err = cydriver.cuLaunchCooperativeKernelMultiDevice(cylaunchParamsList, numDevices, flags) if len(launchParamsList) > 1 and cylaunchParamsList is not NULL: free(cylaunchParamsList) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLaunchHostFunc' in found_functions}} @@ -41564,7 +41330,7 @@ def cuLaunchHostFunc(hStream, fn, userData): err = cydriver.cuLaunchHostFunc(cyhStream, cuHostCallbackWrapper, cbData) if err != cydriver.CUDA_SUCCESS: free(cbData) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuFuncSetBlockShape' in found_functions}} @@ -41608,7 +41374,7 @@ def cuFuncSetBlockShape(hfunc, int x, int y, int z): cyhfunc = phfunc with nogil: err = cydriver.cuFuncSetBlockShape(cyhfunc, x, y, z) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuFuncSetSharedSize' in found_functions}} @@ -41649,7 +41415,7 @@ def cuFuncSetSharedSize(hfunc, unsigned int numbytes): cyhfunc = phfunc with nogil: err = cydriver.cuFuncSetSharedSize(cyhfunc, numbytes) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuParamSetSize' in found_functions}} @@ -41689,7 +41455,7 @@ def cuParamSetSize(hfunc, unsigned int numbytes): cyhfunc = phfunc with nogil: err = cydriver.cuParamSetSize(cyhfunc, numbytes) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuParamSeti' in found_functions}} @@ -41732,7 +41498,7 @@ def cuParamSeti(hfunc, int offset, unsigned int value): cyhfunc = phfunc with nogil: err = cydriver.cuParamSeti(cyhfunc, offset, value) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuParamSetf' in found_functions}} @@ -41775,7 +41541,7 @@ def cuParamSetf(hfunc, int offset, float value): cyhfunc = phfunc with nogil: err = cydriver.cuParamSetf(cyhfunc, offset, value) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuParamSetv' in found_functions}} @@ -41822,7 +41588,7 @@ def cuParamSetv(hfunc, int offset, ptr, unsigned int numbytes): cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cydriver.cuParamSetv(cyhfunc, offset, cyptr_ptr, numbytes) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLaunch' in found_functions}} @@ -41873,7 +41639,7 @@ def cuLaunch(f): cyf = pf with nogil: err = cydriver.cuLaunch(cyf) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLaunchGrid' in found_functions}} @@ -41928,7 +41694,7 @@ def cuLaunchGrid(f, int grid_width, int grid_height): cyf = pf with nogil: err = cydriver.cuLaunchGrid(cyf, grid_width, grid_height) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLaunchGridAsync' in found_functions}} @@ -41999,7 +41765,7 @@ def cuLaunchGridAsync(f, int grid_width, int grid_height, hStream): cyf = pf with nogil: err = cydriver.cuLaunchGridAsync(cyf, grid_width, grid_height, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuParamSetTexRef' in found_functions}} @@ -42048,7 +41814,7 @@ def cuParamSetTexRef(hfunc, int texunit, hTexRef): cyhfunc = phfunc with nogil: err = cydriver.cuParamSetTexRef(cyhfunc, texunit, cyhTexRef) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuFuncSetSharedMemConfig' in found_functions}} @@ -42121,7 +41887,7 @@ def cuFuncSetSharedMemConfig(hfunc, config not None : CUsharedconfig): cdef cydriver.CUsharedconfig cyconfig = int(config) with nogil: err = cydriver.cuFuncSetSharedMemConfig(cyhfunc, cyconfig) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphCreate' in found_functions}} @@ -42152,8 +41918,8 @@ def cuGraphCreate(unsigned int flags): with nogil: err = cydriver.cuGraphCreate(phGraph._pvt_ptr, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraph) + return (CUresult(err), None) + return (CUresult(err), phGraph) {{endif}} {{if 'cuGraphAddKernelNode_v2' in found_functions}} @@ -42276,8 +42042,8 @@ def cuGraphAddKernelNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} @@ -42325,8 +42091,8 @@ def cuGraphKernelNodeGetParams(hNode): with nogil: err = cydriver.cuGraphKernelNodeGetParams(cyhNode, nodeParams._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], nodeParams) + return (CUresult(err), None) + return (CUresult(err), nodeParams) {{endif}} {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} @@ -42364,7 +42130,7 @@ def cuGraphKernelNodeSetParams(hNode, nodeParams : Optional[CUDA_KERNEL_NODE_PAR cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphKernelNodeSetParams(cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphAddMemcpyNode' in found_functions}} @@ -42454,8 +42220,8 @@ def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} @@ -42494,8 +42260,8 @@ def cuGraphMemcpyNodeGetParams(hNode): with nogil: err = cydriver.cuGraphMemcpyNodeGetParams(cyhNode, nodeParams._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], nodeParams) + return (CUresult(err), None) + return (CUresult(err), nodeParams) {{endif}} {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} @@ -42533,7 +42299,7 @@ def cuGraphMemcpyNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMCPY3D]): cdef cydriver.CUDA_MEMCPY3D* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphMemcpyNodeSetParams(cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphAddMemsetNode' in found_functions}} @@ -42613,8 +42379,8 @@ def cuGraphAddMemsetNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphMemsetNodeGetParams' in found_functions}} @@ -42653,8 +42419,8 @@ def cuGraphMemsetNodeGetParams(hNode): with nogil: err = cydriver.cuGraphMemsetNodeGetParams(cyhNode, nodeParams._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], nodeParams) + return (CUresult(err), None) + return (CUresult(err), nodeParams) {{endif}} {{if 'cuGraphMemsetNodeSetParams' in found_functions}} @@ -42692,7 +42458,7 @@ def cuGraphMemsetNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMSET_NODE_PAR cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphMemsetNodeSetParams(cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphAddHostNode' in found_functions}} @@ -42762,8 +42528,8 @@ def cuGraphAddHostNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphHostNodeGetParams' in found_functions}} @@ -42802,8 +42568,8 @@ def cuGraphHostNodeGetParams(hNode): with nogil: err = cydriver.cuGraphHostNodeGetParams(cyhNode, nodeParams._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], nodeParams) + return (CUresult(err), None) + return (CUresult(err), nodeParams) {{endif}} {{if 'cuGraphHostNodeSetParams' in found_functions}} @@ -42841,7 +42607,7 @@ def cuGraphHostNodeSetParams(hNode, nodeParams : Optional[CUDA_HOST_NODE_PARAMS] cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphHostNodeSetParams(cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphAddChildGraphNode' in found_functions}} @@ -42921,8 +42687,8 @@ def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[tuple[CUgraphNode] if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} @@ -42966,8 +42732,8 @@ def cuGraphChildGraphNodeGetGraph(hNode): with nogil: err = cydriver.cuGraphChildGraphNodeGetGraph(cyhNode, phGraph._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraph) + return (CUresult(err), None) + return (CUresult(err), phGraph) {{endif}} {{if 'cuGraphAddEmptyNode' in found_functions}} @@ -43037,8 +42803,8 @@ def cuGraphAddEmptyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | lis if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphAddEventRecordNode' in found_functions}} @@ -43115,8 +42881,8 @@ def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[tuple[CUgraphNode] if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} @@ -43155,8 +42921,8 @@ def cuGraphEventRecordNodeGetEvent(hNode): with nogil: err = cydriver.cuGraphEventRecordNodeGetEvent(cyhNode, event_out._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], event_out) + return (CUresult(err), None) + return (CUresult(err), event_out) {{endif}} {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} @@ -43201,7 +42967,7 @@ def cuGraphEventRecordNodeSetEvent(hNode, event): cyhNode = phNode with nogil: err = cydriver.cuGraphEventRecordNodeSetEvent(cyhNode, cyevent) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphAddEventWaitNode' in found_functions}} @@ -43280,8 +43046,8 @@ def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} @@ -43320,8 +43086,8 @@ def cuGraphEventWaitNodeGetEvent(hNode): with nogil: err = cydriver.cuGraphEventWaitNodeGetEvent(cyhNode, event_out._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], event_out) + return (CUresult(err), None) + return (CUresult(err), event_out) {{endif}} {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} @@ -43366,7 +43132,7 @@ def cuGraphEventWaitNodeSetEvent(hNode, event): cyhNode = phNode with nogil: err = cydriver.cuGraphEventWaitNodeSetEvent(cyhNode, cyevent) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} @@ -43437,8 +43203,8 @@ def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[tuple if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} @@ -43483,8 +43249,8 @@ def cuGraphExternalSemaphoresSignalNodeGetParams(hNode): with nogil: err = cydriver.cuGraphExternalSemaphoresSignalNodeGetParams(cyhNode, params_out._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], params_out) + return (CUresult(err), None) + return (CUresult(err), params_out) {{endif}} {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} @@ -43523,7 +43289,7 @@ def cuGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[CU cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExternalSemaphoresSignalNodeSetParams(cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} @@ -43594,8 +43360,8 @@ def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[tuple[C if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} @@ -43640,8 +43406,8 @@ def cuGraphExternalSemaphoresWaitNodeGetParams(hNode): with nogil: err = cydriver.cuGraphExternalSemaphoresWaitNodeGetParams(cyhNode, params_out._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], params_out) + return (CUresult(err), None) + return (CUresult(err), params_out) {{endif}} {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} @@ -43680,7 +43446,7 @@ def cuGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[CUDA cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExternalSemaphoresWaitNodeSetParams(cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphAddBatchMemOpNode' in found_functions}} @@ -43754,8 +43520,8 @@ def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[tuple[CUgraphNode] if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} @@ -43799,8 +43565,8 @@ def cuGraphBatchMemOpNodeGetParams(hNode): with nogil: err = cydriver.cuGraphBatchMemOpNodeGetParams(cyhNode, nodeParams_out._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], nodeParams_out) + return (CUresult(err), None) + return (CUresult(err), nodeParams_out) {{endif}} {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} @@ -43841,7 +43607,7 @@ def cuGraphBatchMemOpNodeSetParams(hNode, nodeParams : Optional[CUDA_BATCH_MEM_O cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphBatchMemOpNodeSetParams(cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} @@ -43912,7 +43678,7 @@ def cuGraphExecBatchMemOpNodeSetParams(hGraphExec, hNode, nodeParams : Optional[ cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecBatchMemOpNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphAddMemAllocNode' in found_functions}} @@ -44023,8 +43789,8 @@ def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} @@ -44066,8 +43832,8 @@ def cuGraphMemAllocNodeGetParams(hNode): with nogil: err = cydriver.cuGraphMemAllocNodeGetParams(cyhNode, params_out._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], params_out) + return (CUresult(err), None) + return (CUresult(err), params_out) {{endif}} {{if 'cuGraphAddMemFreeNode' in found_functions}} @@ -44162,8 +43928,8 @@ def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | l if len(dependencies) > 1 and cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} @@ -44202,8 +43968,8 @@ def cuGraphMemFreeNodeGetParams(hNode): with nogil: err = cydriver.cuGraphMemFreeNodeGetParams(cyhNode, dptr_out._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], dptr_out) + return (CUresult(err), None) + return (CUresult(err), dptr_out) {{endif}} {{if 'cuDeviceGraphMemTrim' in found_functions}} @@ -44240,7 +44006,7 @@ def cuDeviceGraphMemTrim(device): cydevice = pdevice with nogil: err = cydriver.cuDeviceGraphMemTrim(cydevice) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} @@ -44298,8 +44064,8 @@ def cuDeviceGetGraphMemAttribute(device, attr not None : CUgraphMem_attribute): with nogil: err = cydriver.cuDeviceGetGraphMemAttribute(cydevice, cyattr, cyvalue_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], cyvalue.pyObj()) + return (CUresult(err), None) + return (CUresult(err), cyvalue.pyObj()) {{endif}} {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} @@ -44349,7 +44115,7 @@ def cuDeviceSetGraphMemAttribute(device, attr not None : CUgraphMem_attribute, v cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cydriver.cuDeviceSetGraphMemAttribute(cydevice, cyattr, cyvalue_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphClone' in found_functions}} @@ -44398,8 +44164,8 @@ def cuGraphClone(originalGraph): with nogil: err = cydriver.cuGraphClone(phGraphClone._pvt_ptr, cyoriginalGraph) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphClone) + return (CUresult(err), None) + return (CUresult(err), phGraphClone) {{endif}} {{if 'cuGraphNodeFindInClone' in found_functions}} @@ -44455,8 +44221,8 @@ def cuGraphNodeFindInClone(hOriginalNode, hClonedGraph): with nogil: err = cydriver.cuGraphNodeFindInClone(phNode._pvt_ptr, cyhOriginalNode, cyhClonedGraph) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phNode) + return (CUresult(err), None) + return (CUresult(err), phNode) {{endif}} {{if 'cuGraphNodeGetType' in found_functions}} @@ -44495,8 +44261,8 @@ def cuGraphNodeGetType(hNode): with nogil: err = cydriver.cuGraphNodeGetType(cyhNode, &typename) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUgraphNodeType(typename)) + return (CUresult(err), None) + return (CUresult(err), CUgraphNodeType(typename)) {{endif}} {{if 'cuGraphNodeGetContainingGraph' in found_functions}} @@ -44536,8 +44302,8 @@ def cuGraphNodeGetContainingGraph(hNode): with nogil: err = cydriver.cuGraphNodeGetContainingGraph(cyhNode, phGraph._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraph) + return (CUresult(err), None) + return (CUresult(err), phGraph) {{endif}} {{if 'cuGraphNodeGetLocalId' in found_functions}} @@ -44578,8 +44344,8 @@ def cuGraphNodeGetLocalId(hNode): with nogil: err = cydriver.cuGraphNodeGetLocalId(cyhNode, &nodeId) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], nodeId) + return (CUresult(err), None) + return (CUresult(err), nodeId) {{endif}} {{if 'cuGraphNodeGetToolsId' in found_functions}} @@ -44616,8 +44382,8 @@ def cuGraphNodeGetToolsId(hNode): with nogil: err = cydriver.cuGraphNodeGetToolsId(cyhNode, &toolsNodeId) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], toolsNodeId) + return (CUresult(err), None) + return (CUresult(err), toolsNodeId) {{endif}} {{if 'cuGraphGetId' in found_functions}} @@ -44657,8 +44423,8 @@ def cuGraphGetId(hGraph): with nogil: err = cydriver.cuGraphGetId(cyhGraph, &graphId) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], graphId) + return (CUresult(err), None) + return (CUresult(err), graphId) {{endif}} {{if 'cuGraphExecGetId' in found_functions}} @@ -44698,8 +44464,8 @@ def cuGraphExecGetId(hGraphExec): with nogil: err = cydriver.cuGraphExecGetId(cyhGraphExec, &graphId) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], graphId) + return (CUresult(err), None) + return (CUresult(err), graphId) {{endif}} {{if 'cuGraphGetNodes' in found_functions}} @@ -44757,8 +44523,8 @@ def cuGraphGetNodes(hGraph, size_t numNodes = 0): if cynodes is not NULL: free(cynodes) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], pynodes, numNodes) + return (CUresult(err), None, None) + return (CUresult(err), pynodes, numNodes) {{endif}} {{if 'cuGraphGetRootNodes' in found_functions}} @@ -44816,8 +44582,8 @@ def cuGraphGetRootNodes(hGraph, size_t numRootNodes = 0): if cyrootNodes is not NULL: free(cyrootNodes) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], pyrootNodes, numRootNodes) + return (CUresult(err), None, None) + return (CUresult(err), pyrootNodes, numRootNodes) {{endif}} {{if 'cuGraphGetEdges_v2' in found_functions}} @@ -44906,8 +44672,8 @@ def cuGraphGetEdges(hGraph, size_t numEdges = 0): if cyedgeData is not NULL: free(cyedgeData) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None, None, None) - return (_dict_CUresult[err], pyfrom_, pyto, pyedgeData, numEdges) + return (CUresult(err), None, None, None, None) + return (CUresult(err), pyfrom_, pyto, pyedgeData, numEdges) {{endif}} {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} @@ -44983,8 +44749,8 @@ def cuGraphNodeGetDependencies(hNode, size_t numDependencies = 0): if cyedgeData is not NULL: free(cyedgeData) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None, None) - return (_dict_CUresult[err], pydependencies, pyedgeData, numDependencies) + return (CUresult(err), None, None, None) + return (CUresult(err), pydependencies, pyedgeData, numDependencies) {{endif}} {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} @@ -45060,8 +44826,8 @@ def cuGraphNodeGetDependentNodes(hNode, size_t numDependentNodes = 0): if cyedgeData is not NULL: free(cyedgeData) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None, None) - return (_dict_CUresult[err], pydependentNodes, pyedgeData, numDependentNodes) + return (CUresult(err), None, None, None) + return (CUresult(err), pydependentNodes, pyedgeData, numDependentNodes) {{endif}} {{if 'cuGraphAddDependencies_v2' in found_functions}} @@ -45154,7 +44920,7 @@ def cuGraphAddDependencies(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CU free(cyto) if len(edgeData) > 1 and cyedgeData is not NULL: free(cyedgeData) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphRemoveDependencies_v2' in found_functions}} @@ -45253,7 +45019,7 @@ def cuGraphRemoveDependencies(hGraph, from_ : Optional[tuple[CUgraphNode] | list free(cyto) if len(edgeData) > 1 and cyedgeData is not NULL: free(cyedgeData) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphDestroyNode' in found_functions}} @@ -45292,7 +45058,7 @@ def cuGraphDestroyNode(hNode): cyhNode = phNode with nogil: err = cydriver.cuGraphDestroyNode(cyhNode) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphInstantiateWithFlags' in found_functions}} @@ -45396,8 +45162,8 @@ def cuGraphInstantiate(hGraph, unsigned long long flags): with nogil: err = cydriver.cuGraphInstantiate(phGraphExec._pvt_ptr, cyhGraph, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphExec) + return (CUresult(err), None) + return (CUresult(err), phGraphExec) {{endif}} {{if 'cuGraphInstantiateWithParams' in found_functions}} @@ -45542,8 +45308,8 @@ def cuGraphInstantiateWithParams(hGraph, instantiateParams : Optional[CUDA_GRAPH with nogil: err = cydriver.cuGraphInstantiateWithParams(phGraphExec._pvt_ptr, cyhGraph, cyinstantiateParams_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphExec) + return (CUresult(err), None) + return (CUresult(err), phGraphExec) {{endif}} {{if 'cuGraphExecGetFlags' in found_functions}} @@ -45585,8 +45351,8 @@ def cuGraphExecGetFlags(hGraphExec): with nogil: err = cydriver.cuGraphExecGetFlags(cyhGraphExec, flags._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], flags) + return (CUresult(err), None) + return (CUresult(err), flags) {{endif}} {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} @@ -45667,7 +45433,7 @@ def cuGraphExecKernelNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecKernelNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} @@ -45742,7 +45508,7 @@ def cuGraphExecMemcpyNodeSetParams(hGraphExec, hNode, copyParams : Optional[CUDA cdef cydriver.CUDA_MEMCPY3D* cycopyParams_ptr = copyParams._pvt_ptr if copyParams is not None else NULL with nogil: err = cydriver.cuGraphExecMemcpyNodeSetParams(cyhGraphExec, cyhNode, cycopyParams_ptr, cyctx) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} @@ -45822,7 +45588,7 @@ def cuGraphExecMemsetNodeSetParams(hGraphExec, hNode, memsetParams : Optional[CU cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cymemsetParams_ptr = memsetParams._pvt_ptr if memsetParams is not None else NULL with nogil: err = cydriver.cuGraphExecMemsetNodeSetParams(cyhGraphExec, cyhNode, cymemsetParams_ptr, cyctx) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecHostNodeSetParams' in found_functions}} @@ -45877,7 +45643,7 @@ def cuGraphExecHostNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_H cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecHostNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} @@ -45947,7 +45713,7 @@ def cuGraphExecChildGraphNodeSetParams(hGraphExec, hNode, childGraph): cyhGraphExec = phGraphExec with nogil: err = cydriver.cuGraphExecChildGraphNodeSetParams(cyhGraphExec, cyhNode, cychildGraph) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} @@ -46010,7 +45776,7 @@ def cuGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event): cyhGraphExec = phGraphExec with nogil: err = cydriver.cuGraphExecEventRecordNodeSetEvent(cyhGraphExec, cyhNode, cyevent) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} @@ -46073,7 +45839,7 @@ def cuGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event): cyhGraphExec = phGraphExec with nogil: err = cydriver.cuGraphExecEventWaitNodeSetEvent(cyhGraphExec, cyhNode, cyevent) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} @@ -46133,7 +45899,7 @@ def cuGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodePara cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecExternalSemaphoresSignalNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} @@ -46193,7 +45959,7 @@ def cuGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecExternalSemaphoresWaitNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphNodeSetEnabled' in found_functions}} @@ -46262,7 +46028,7 @@ def cuGraphNodeSetEnabled(hGraphExec, hNode, unsigned int isEnabled): cyhGraphExec = phGraphExec with nogil: err = cydriver.cuGraphNodeSetEnabled(cyhGraphExec, cyhNode, isEnabled) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphNodeGetEnabled' in found_functions}} @@ -46322,8 +46088,8 @@ def cuGraphNodeGetEnabled(hGraphExec, hNode): with nogil: err = cydriver.cuGraphNodeGetEnabled(cyhGraphExec, cyhNode, &isEnabled) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], isEnabled) + return (CUresult(err), None) + return (CUresult(err), isEnabled) {{endif}} {{if 'cuGraphUpload' in found_functions}} @@ -46372,7 +46138,7 @@ def cuGraphUpload(hGraphExec, hStream): cyhGraphExec = phGraphExec with nogil: err = cydriver.cuGraphUpload(cyhGraphExec, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphLaunch' in found_functions}} @@ -46426,7 +46192,7 @@ def cuGraphLaunch(hGraphExec, hStream): cyhGraphExec = phGraphExec with nogil: err = cydriver.cuGraphLaunch(cyhGraphExec, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecDestroy' in found_functions}} @@ -46463,7 +46229,7 @@ def cuGraphExecDestroy(hGraphExec): cyhGraphExec = phGraphExec with nogil: err = cydriver.cuGraphExecDestroy(cyhGraphExec) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphDestroy' in found_functions}} @@ -46498,7 +46264,7 @@ def cuGraphDestroy(hGraph): cyhGraph = phGraph with nogil: err = cydriver.cuGraphDestroy(cyhGraph) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecUpdate_v2' in found_functions}} @@ -46677,8 +46443,8 @@ def cuGraphExecUpdate(hGraphExec, hGraph): with nogil: err = cydriver.cuGraphExecUpdate(cyhGraphExec, cyhGraph, resultInfo._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], resultInfo) + return (CUresult(err), None) + return (CUresult(err), resultInfo) {{endif}} {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} @@ -46725,7 +46491,7 @@ def cuGraphKernelNodeCopyAttributes(dst, src): cydst = pdst with nogil: err = cydriver.cuGraphKernelNodeCopyAttributes(cydst, cysrc) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} @@ -46768,8 +46534,8 @@ def cuGraphKernelNodeGetAttribute(hNode, attr not None : CUkernelNodeAttrID): with nogil: err = cydriver.cuGraphKernelNodeGetAttribute(cyhNode, cyattr, value_out._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], value_out) + return (CUresult(err), None) + return (CUresult(err), value_out) {{endif}} {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} @@ -46811,7 +46577,7 @@ def cuGraphKernelNodeSetAttribute(hNode, attr not None : CUkernelNodeAttrID, val cdef cydriver.CUkernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cydriver.cuGraphKernelNodeSetAttribute(cyhNode, cyattr, cyvalue_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphDebugDotPrint' in found_functions}} @@ -46851,7 +46617,7 @@ def cuGraphDebugDotPrint(hGraph, char* path, unsigned int flags): cyhGraph = phGraph with nogil: err = cydriver.cuGraphDebugDotPrint(cyhGraph, path, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuUserObjectCreate' in found_functions}} @@ -46912,8 +46678,8 @@ def cuUserObjectCreate(ptr, destroy, unsigned int initialRefcount, unsigned int with nogil: err = cydriver.cuUserObjectCreate(object_out._pvt_ptr, cyptr_ptr, cydestroy, initialRefcount, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], object_out) + return (CUresult(err), None) + return (CUresult(err), object_out) {{endif}} {{if 'cuUserObjectRetain' in found_functions}} @@ -46955,7 +46721,7 @@ def cuUserObjectRetain(object, unsigned int count): cyobject = pobject with nogil: err = cydriver.cuUserObjectRetain(cyobject, count) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuUserObjectRelease' in found_functions}} @@ -47000,7 +46766,7 @@ def cuUserObjectRelease(object, unsigned int count): cyobject = pobject with nogil: err = cydriver.cuUserObjectRelease(cyobject, count) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphRetainUserObject' in found_functions}} @@ -47056,7 +46822,7 @@ def cuGraphRetainUserObject(graph, object, unsigned int count, unsigned int flag cygraph = pgraph with nogil: err = cydriver.cuGraphRetainUserObject(cygraph, cyobject, count, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphReleaseUserObject' in found_functions}} @@ -47107,7 +46873,7 @@ def cuGraphReleaseUserObject(graph, object, unsigned int count): cygraph = pgraph with nogil: err = cydriver.cuGraphReleaseUserObject(cygraph, cyobject, count) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphAddNode_v2' in found_functions}} @@ -47202,8 +46968,8 @@ def cuGraphAddNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUg if len(dependencyData) > 1 and cydependencyData is not NULL: free(cydependencyData) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phGraphNode) + return (CUresult(err), None) + return (CUresult(err), phGraphNode) {{endif}} {{if 'cuGraphNodeSetParams' in found_functions}} @@ -47247,7 +47013,7 @@ def cuGraphNodeSetParams(hNode, nodeParams : Optional[CUgraphNodeParams]): cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphNodeSetParams(cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphExecNodeSetParams' in found_functions}} @@ -47307,7 +47073,7 @@ def cuGraphExecNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUgraphNod cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphConditionalHandleCreate' in found_functions}} @@ -47371,8 +47137,8 @@ def cuGraphConditionalHandleCreate(hGraph, ctx, unsigned int defaultLaunchValue, with nogil: err = cydriver.cuGraphConditionalHandleCreate(pHandle_out._pvt_ptr, cyhGraph, cyctx, defaultLaunchValue, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pHandle_out) + return (CUresult(err), None) + return (CUresult(err), pHandle_out) {{endif}} {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} @@ -47422,8 +47188,8 @@ def cuOccupancyMaxActiveBlocksPerMultiprocessor(func, int blockSize, size_t dyna with nogil: err = cydriver.cuOccupancyMaxActiveBlocksPerMultiprocessor(&numBlocks, cyfunc, blockSize, dynamicSMemSize) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], numBlocks) + return (CUresult(err), None) + return (CUresult(err), numBlocks) {{endif}} {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} @@ -47491,8 +47257,8 @@ def cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(func, int blockSize, si with nogil: err = cydriver.cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(&numBlocks, cyfunc, blockSize, dynamicSMemSize, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], numBlocks) + return (CUresult(err), None) + return (CUresult(err), numBlocks) {{endif}} {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} @@ -47578,8 +47344,8 @@ def cuOccupancyMaxPotentialBlockSize(func, blockSizeToDynamicSMemSize, size_t dy with nogil: err = cydriver.cuOccupancyMaxPotentialBlockSize(&minGridSize, &blockSize, cyfunc, cyblockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], minGridSize, blockSize) + return (CUresult(err), None, None) + return (CUresult(err), minGridSize, blockSize) {{endif}} {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} @@ -47664,8 +47430,8 @@ def cuOccupancyMaxPotentialBlockSizeWithFlags(func, blockSizeToDynamicSMemSize, with nogil: err = cydriver.cuOccupancyMaxPotentialBlockSizeWithFlags(&minGridSize, &blockSize, cyfunc, cyblockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], minGridSize, blockSize) + return (CUresult(err), None, None) + return (CUresult(err), minGridSize, blockSize) {{endif}} {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} @@ -47711,8 +47477,8 @@ def cuOccupancyAvailableDynamicSMemPerBlock(func, int numBlocks, int blockSize): with nogil: err = cydriver.cuOccupancyAvailableDynamicSMemPerBlock(&dynamicSmemSize, cyfunc, numBlocks, blockSize) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], dynamicSmemSize) + return (CUresult(err), None) + return (CUresult(err), dynamicSmemSize) {{endif}} {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} @@ -47771,8 +47537,8 @@ def cuOccupancyMaxPotentialClusterSize(func, config : Optional[CUlaunchConfig]): with nogil: err = cydriver.cuOccupancyMaxPotentialClusterSize(&clusterSize, cyfunc, cyconfig_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], clusterSize) + return (CUresult(err), None) + return (CUresult(err), clusterSize) {{endif}} {{if 'cuOccupancyMaxActiveClusters' in found_functions}} @@ -47831,8 +47597,8 @@ def cuOccupancyMaxActiveClusters(func, config : Optional[CUlaunchConfig]): with nogil: err = cydriver.cuOccupancyMaxActiveClusters(&numClusters, cyfunc, cyconfig_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], numClusters) + return (CUresult(err), None) + return (CUresult(err), numClusters) {{endif}} {{if 'cuTexRefSetArray' in found_functions}} @@ -47885,7 +47651,7 @@ def cuTexRefSetArray(hTexRef, hArray, unsigned int Flags): cyhTexRef = phTexRef with nogil: err = cydriver.cuTexRefSetArray(cyhTexRef, cyhArray, Flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefSetMipmappedArray' in found_functions}} @@ -47938,7 +47704,7 @@ def cuTexRefSetMipmappedArray(hTexRef, hMipmappedArray, unsigned int Flags): cyhTexRef = phTexRef with nogil: err = cydriver.cuTexRefSetMipmappedArray(cyhTexRef, cyhMipmappedArray, Flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefSetAddress_v2' in found_functions}} @@ -48012,8 +47778,8 @@ def cuTexRefSetAddress(hTexRef, dptr, size_t numbytes): with nogil: err = cydriver.cuTexRefSetAddress(&ByteOffset, cyhTexRef, cydptr, numbytes) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], ByteOffset) + return (CUresult(err), None) + return (CUresult(err), ByteOffset) {{endif}} {{if 'cuTexRefSetAddress2D_v3' in found_functions}} @@ -48094,7 +47860,7 @@ def cuTexRefSetAddress2D(hTexRef, desc : Optional[CUDA_ARRAY_DESCRIPTOR], dptr, cdef cydriver.CUDA_ARRAY_DESCRIPTOR* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cydriver.cuTexRefSetAddress2D(cyhTexRef, cydesc_ptr, cydptr, Pitch) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefSetFormat' in found_functions}} @@ -48140,7 +47906,7 @@ def cuTexRefSetFormat(hTexRef, fmt not None : CUarray_format, int NumPackedCompo cdef cydriver.CUarray_format cyfmt = int(fmt) with nogil: err = cydriver.cuTexRefSetFormat(cyhTexRef, cyfmt, NumPackedComponents) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefSetAddressMode' in found_functions}} @@ -48193,7 +47959,7 @@ def cuTexRefSetAddressMode(hTexRef, int dim, am not None : CUaddress_mode): cdef cydriver.CUaddress_mode cyam = int(am) with nogil: err = cydriver.cuTexRefSetAddressMode(cyhTexRef, dim, cyam) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefSetFilterMode' in found_functions}} @@ -48240,7 +48006,7 @@ def cuTexRefSetFilterMode(hTexRef, fm not None : CUfilter_mode): cdef cydriver.CUfilter_mode cyfm = int(fm) with nogil: err = cydriver.cuTexRefSetFilterMode(cyhTexRef, cyfm) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} @@ -48287,7 +48053,7 @@ def cuTexRefSetMipmapFilterMode(hTexRef, fm not None : CUfilter_mode): cdef cydriver.CUfilter_mode cyfm = int(fm) with nogil: err = cydriver.cuTexRefSetMipmapFilterMode(cyhTexRef, cyfm) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} @@ -48331,7 +48097,7 @@ def cuTexRefSetMipmapLevelBias(hTexRef, float bias): cyhTexRef = phTexRef with nogil: err = cydriver.cuTexRefSetMipmapLevelBias(cyhTexRef, bias) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} @@ -48377,7 +48143,7 @@ def cuTexRefSetMipmapLevelClamp(hTexRef, float minMipmapLevelClamp, float maxMip cyhTexRef = phTexRef with nogil: err = cydriver.cuTexRefSetMipmapLevelClamp(cyhTexRef, minMipmapLevelClamp, maxMipmapLevelClamp) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} @@ -48420,7 +48186,7 @@ def cuTexRefSetMaxAnisotropy(hTexRef, unsigned int maxAniso): cyhTexRef = phTexRef with nogil: err = cydriver.cuTexRefSetMaxAnisotropy(cyhTexRef, maxAniso) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefSetBorderColor' in found_functions}} @@ -48468,7 +48234,7 @@ def cuTexRefSetBorderColor(hTexRef, float pBorderColor): cyhTexRef = phTexRef with nogil: err = cydriver.cuTexRefSetBorderColor(cyhTexRef, &pBorderColor) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefSetFlags' in found_functions}} @@ -48526,7 +48292,7 @@ def cuTexRefSetFlags(hTexRef, unsigned int Flags): cyhTexRef = phTexRef with nogil: err = cydriver.cuTexRefSetFlags(cyhTexRef, Flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexRefGetAddress_v2' in found_functions}} @@ -48569,8 +48335,8 @@ def cuTexRefGetAddress(hTexRef): with nogil: err = cydriver.cuTexRefGetAddress(pdptr._pvt_ptr, cyhTexRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pdptr) + return (CUresult(err), None) + return (CUresult(err), pdptr) {{endif}} {{if 'cuTexRefGetArray' in found_functions}} @@ -48613,8 +48379,8 @@ def cuTexRefGetArray(hTexRef): with nogil: err = cydriver.cuTexRefGetArray(phArray._pvt_ptr, cyhTexRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phArray) + return (CUresult(err), None) + return (CUresult(err), phArray) {{endif}} {{if 'cuTexRefGetMipmappedArray' in found_functions}} @@ -48658,8 +48424,8 @@ def cuTexRefGetMipmappedArray(hTexRef): with nogil: err = cydriver.cuTexRefGetMipmappedArray(phMipmappedArray._pvt_ptr, cyhTexRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phMipmappedArray) + return (CUresult(err), None) + return (CUresult(err), phMipmappedArray) {{endif}} {{if 'cuTexRefGetAddressMode' in found_functions}} @@ -48704,8 +48470,8 @@ def cuTexRefGetAddressMode(hTexRef, int dim): with nogil: err = cydriver.cuTexRefGetAddressMode(&pam, cyhTexRef, dim) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUaddress_mode(pam)) + return (CUresult(err), None) + return (CUresult(err), CUaddress_mode(pam)) {{endif}} {{if 'cuTexRefGetFilterMode' in found_functions}} @@ -48747,8 +48513,8 @@ def cuTexRefGetFilterMode(hTexRef): with nogil: err = cydriver.cuTexRefGetFilterMode(&pfm, cyhTexRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUfilter_mode(pfm)) + return (CUresult(err), None) + return (CUresult(err), CUfilter_mode(pfm)) {{endif}} {{if 'cuTexRefGetFormat' in found_functions}} @@ -48794,8 +48560,8 @@ def cuTexRefGetFormat(hTexRef): with nogil: err = cydriver.cuTexRefGetFormat(&pFormat, &pNumChannels, cyhTexRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], CUarray_format(pFormat), pNumChannels) + return (CUresult(err), None, None) + return (CUresult(err), CUarray_format(pFormat), pNumChannels) {{endif}} {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} @@ -48837,8 +48603,8 @@ def cuTexRefGetMipmapFilterMode(hTexRef): with nogil: err = cydriver.cuTexRefGetMipmapFilterMode(&pfm, cyhTexRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUfilter_mode(pfm)) + return (CUresult(err), None) + return (CUresult(err), CUfilter_mode(pfm)) {{endif}} {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} @@ -48881,8 +48647,8 @@ def cuTexRefGetMipmapLevelBias(hTexRef): with nogil: err = cydriver.cuTexRefGetMipmapLevelBias(&pbias, cyhTexRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pbias) + return (CUresult(err), None) + return (CUresult(err), pbias) {{endif}} {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} @@ -48928,8 +48694,8 @@ def cuTexRefGetMipmapLevelClamp(hTexRef): with nogil: err = cydriver.cuTexRefGetMipmapLevelClamp(&pminMipmapLevelClamp, &pmaxMipmapLevelClamp, cyhTexRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], pminMipmapLevelClamp, pmaxMipmapLevelClamp) + return (CUresult(err), None, None) + return (CUresult(err), pminMipmapLevelClamp, pmaxMipmapLevelClamp) {{endif}} {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} @@ -48971,8 +48737,8 @@ def cuTexRefGetMaxAnisotropy(hTexRef): with nogil: err = cydriver.cuTexRefGetMaxAnisotropy(&pmaxAniso, cyhTexRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pmaxAniso) + return (CUresult(err), None) + return (CUresult(err), pmaxAniso) {{endif}} {{if 'cuTexRefGetBorderColor' in found_functions}} @@ -49017,8 +48783,8 @@ def cuTexRefGetBorderColor(hTexRef): with nogil: err = cydriver.cuTexRefGetBorderColor(&pBorderColor, cyhTexRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pBorderColor) + return (CUresult(err), None) + return (CUresult(err), pBorderColor) {{endif}} {{if 'cuTexRefGetFlags' in found_functions}} @@ -49059,8 +48825,8 @@ def cuTexRefGetFlags(hTexRef): with nogil: err = cydriver.cuTexRefGetFlags(&pFlags, cyhTexRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pFlags) + return (CUresult(err), None) + return (CUresult(err), pFlags) {{endif}} {{if 'cuTexRefCreate' in found_functions}} @@ -49093,8 +48859,8 @@ def cuTexRefCreate(): with nogil: err = cydriver.cuTexRefCreate(pTexRef._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pTexRef) + return (CUresult(err), None) + return (CUresult(err), pTexRef) {{endif}} {{if 'cuTexRefDestroy' in found_functions}} @@ -49131,7 +48897,7 @@ def cuTexRefDestroy(hTexRef): cyhTexRef = phTexRef with nogil: err = cydriver.cuTexRefDestroy(cyhTexRef) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuSurfRefSetArray' in found_functions}} @@ -49185,7 +48951,7 @@ def cuSurfRefSetArray(hSurfRef, hArray, unsigned int Flags): cyhSurfRef = phSurfRef with nogil: err = cydriver.cuSurfRefSetArray(cyhSurfRef, cyhArray, Flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuSurfRefGetArray' in found_functions}} @@ -49228,8 +48994,8 @@ def cuSurfRefGetArray(hSurfRef): with nogil: err = cydriver.cuSurfRefGetArray(phArray._pvt_ptr, cyhSurfRef) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phArray) + return (CUresult(err), None) + return (CUresult(err), phArray) {{endif}} {{if 'cuTexObjectCreate' in found_functions}} @@ -49468,8 +49234,8 @@ def cuTexObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC], pTexDesc : Option with nogil: err = cydriver.cuTexObjectCreate(pTexObject._pvt_ptr, cypResDesc_ptr, cypTexDesc_ptr, cypResViewDesc_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pTexObject) + return (CUresult(err), None) + return (CUresult(err), pTexObject) {{endif}} {{if 'cuTexObjectDestroy' in found_functions}} @@ -49504,7 +49270,7 @@ def cuTexObjectDestroy(texObject): cytexObject = ptexObject with nogil: err = cydriver.cuTexObjectDestroy(cytexObject) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuTexObjectGetResourceDesc' in found_functions}} @@ -49544,8 +49310,8 @@ def cuTexObjectGetResourceDesc(texObject): with nogil: err = cydriver.cuTexObjectGetResourceDesc(pResDesc._pvt_ptr, cytexObject) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pResDesc) + return (CUresult(err), None) + return (CUresult(err), pResDesc) {{endif}} {{if 'cuTexObjectGetTextureDesc' in found_functions}} @@ -49585,8 +49351,8 @@ def cuTexObjectGetTextureDesc(texObject): with nogil: err = cydriver.cuTexObjectGetTextureDesc(pTexDesc._pvt_ptr, cytexObject) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pTexDesc) + return (CUresult(err), None) + return (CUresult(err), pTexDesc) {{endif}} {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} @@ -49627,8 +49393,8 @@ def cuTexObjectGetResourceViewDesc(texObject): with nogil: err = cydriver.cuTexObjectGetResourceViewDesc(pResViewDesc._pvt_ptr, cytexObject) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pResViewDesc) + return (CUresult(err), None) + return (CUresult(err), pResViewDesc) {{endif}} {{if 'cuSurfObjectCreate' in found_functions}} @@ -49670,8 +49436,8 @@ def cuSurfObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC]): with nogil: err = cydriver.cuSurfObjectCreate(pSurfObject._pvt_ptr, cypResDesc_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pSurfObject) + return (CUresult(err), None) + return (CUresult(err), pSurfObject) {{endif}} {{if 'cuSurfObjectDestroy' in found_functions}} @@ -49706,7 +49472,7 @@ def cuSurfObjectDestroy(surfObject): cysurfObject = psurfObject with nogil: err = cydriver.cuSurfObjectDestroy(cysurfObject) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuSurfObjectGetResourceDesc' in found_functions}} @@ -49746,8 +49512,8 @@ def cuSurfObjectGetResourceDesc(surfObject): with nogil: err = cydriver.cuSurfObjectGetResourceDesc(pResDesc._pvt_ptr, cysurfObject) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pResDesc) + return (CUresult(err), None) + return (CUresult(err), pResDesc) {{endif}} {{if 'cuTensorMapEncodeTiled' in found_functions}} @@ -50057,8 +49823,8 @@ def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensor if len(elementStrides) > 1 and cyelementStrides is not NULL: free(cyelementStrides) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], tensorMap) + return (CUresult(err), None) + return (CUresult(err), tensorMap) {{endif}} {{if 'cuTensorMapEncodeIm2col' in found_functions}} @@ -50404,8 +50170,8 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso if len(elementStrides) > 1 and cyelementStrides is not NULL: free(cyelementStrides) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], tensorMap) + return (CUresult(err), None) + return (CUresult(err), tensorMap) {{endif}} {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} @@ -50731,8 +50497,8 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t if len(elementStrides) > 1 and cyelementStrides is not NULL: free(cyelementStrides) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], tensorMap) + return (CUresult(err), None) + return (CUresult(err), tensorMap) {{endif}} {{if 'cuTensorMapReplaceAddress' in found_functions}} @@ -50770,7 +50536,7 @@ def cuTensorMapReplaceAddress(tensorMap : Optional[CUtensorMap], globalAddress): cdef void* cyglobalAddress_ptr = cyglobalAddress.cptr with nogil: err = cydriver.cuTensorMapReplaceAddress(cytensorMap_ptr, cyglobalAddress_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuDeviceCanAccessPeer' in found_functions}} @@ -50825,8 +50591,8 @@ def cuDeviceCanAccessPeer(dev, peerDev): with nogil: err = cydriver.cuDeviceCanAccessPeer(&canAccessPeer, cydev, cypeerDev) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], canAccessPeer) + return (CUresult(err), None) + return (CUresult(err), canAccessPeer) {{endif}} {{if 'cuCtxEnablePeerAccess' in found_functions}} @@ -50896,7 +50662,7 @@ def cuCtxEnablePeerAccess(peerContext, unsigned int Flags): cypeerContext = ppeerContext with nogil: err = cydriver.cuCtxEnablePeerAccess(cypeerContext, Flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxDisablePeerAccess' in found_functions}} @@ -50936,7 +50702,7 @@ def cuCtxDisablePeerAccess(peerContext): cypeerContext = ppeerContext with nogil: err = cydriver.cuCtxDisablePeerAccess(cypeerContext) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuDeviceGetP2PAttribute' in found_functions}} @@ -51014,8 +50780,8 @@ def cuDeviceGetP2PAttribute(attrib not None : CUdevice_P2PAttribute, srcDevice, with nogil: err = cydriver.cuDeviceGetP2PAttribute(&value, cyattrib, cysrcDevice, cydstDevice) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], value) + return (CUresult(err), None) + return (CUresult(err), value) {{endif}} {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} @@ -51097,8 +50863,8 @@ def cuDeviceGetP2PAtomicCapabilities(operations : Optional[tuple[CUatomicOperati if cycapabilities is not NULL: free(cycapabilities) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pycapabilities) + return (CUresult(err), None) + return (CUresult(err), pycapabilities) {{endif}} {{if 'cuGraphicsUnregisterResource' in found_functions}} @@ -51137,7 +50903,7 @@ def cuGraphicsUnregisterResource(resource): cyresource = presource with nogil: err = cydriver.cuGraphicsUnregisterResource(cyresource) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} @@ -51194,8 +50960,8 @@ def cuGraphicsSubResourceGetMappedArray(resource, unsigned int arrayIndex, unsig with nogil: err = cydriver.cuGraphicsSubResourceGetMappedArray(pArray._pvt_ptr, cyresource, arrayIndex, mipLevel) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pArray) + return (CUresult(err), None) + return (CUresult(err), pArray) {{endif}} {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} @@ -51241,8 +51007,8 @@ def cuGraphicsResourceGetMappedMipmappedArray(resource): with nogil: err = cydriver.cuGraphicsResourceGetMappedMipmappedArray(pMipmappedArray._pvt_ptr, cyresource) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pMipmappedArray) + return (CUresult(err), None) + return (CUresult(err), pMipmappedArray) {{endif}} {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} @@ -51288,8 +51054,8 @@ def cuGraphicsResourceGetMappedPointer(resource): with nogil: err = cydriver.cuGraphicsResourceGetMappedPointer(pDevPtr._pvt_ptr, &pSize, cyresource) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], pDevPtr, pSize) + return (CUresult(err), None, None) + return (CUresult(err), pDevPtr, pSize) {{endif}} {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} @@ -51348,7 +51114,7 @@ def cuGraphicsResourceSetMapFlags(resource, unsigned int flags): cyresource = presource with nogil: err = cydriver.cuGraphicsResourceSetMapFlags(cyresource, flags) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphicsMapResources' in found_functions}} @@ -51411,7 +51177,7 @@ def cuGraphicsMapResources(unsigned int count, resources, hStream): raise TypeError("Argument 'resources' is not instance of type (expected , found " + str(type(resources))) with nogil: err = cydriver.cuGraphicsMapResources(count, cyresources, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGraphicsUnmapResources' in found_functions}} @@ -51472,7 +51238,7 @@ def cuGraphicsUnmapResources(unsigned int count, resources, hStream): raise TypeError("Argument 'resources' is not instance of type (expected , found " + str(type(resources))) with nogil: err = cydriver.cuGraphicsUnmapResources(count, cyresources, cyhStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGetProcAddress_v2' in found_functions}} @@ -51577,8 +51343,8 @@ def cuGetProcAddress(char* symbol, int cudaVersion, flags): with nogil: err = cydriver.cuGetProcAddress(symbol, &pfn, cudaVersion, cyflags, &symbolStatus) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], pfn, CUdriverProcAddressQueryResult(symbolStatus)) + return (CUresult(err), None, None) + return (CUresult(err), pfn, CUdriverProcAddressQueryResult(symbolStatus)) {{endif}} {{if 'cuCoredumpGetAttribute' in found_functions}} @@ -51697,8 +51463,8 @@ def cuCoredumpGetAttribute(attrib not None : CUcoredumpSettings): with nogil: err = cydriver.cuCoredumpGetAttribute(cyattrib, cyvalue_ptr, &size) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], cyvalue.pyObj()) + return (CUresult(err), None) + return (CUresult(err), cyvalue.pyObj()) {{endif}} {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} @@ -51813,8 +51579,8 @@ def cuCoredumpGetAttributeGlobal(attrib not None : CUcoredumpSettings): with nogil: err = cydriver.cuCoredumpGetAttributeGlobal(cyattrib, cyvalue_ptr, &size) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], cyvalue.pyObj()) + return (CUresult(err), None) + return (CUresult(err), cyvalue.pyObj()) {{endif}} {{if 'cuCoredumpSetAttribute' in found_functions}} @@ -51935,7 +51701,7 @@ def cuCoredumpSetAttribute(attrib not None : CUcoredumpSettings, value): cdef size_t size = cyvalue.size() with nogil: err = cydriver.cuCoredumpSetAttribute(cyattrib, cyvalue_ptr, &size) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} @@ -52061,7 +51827,7 @@ def cuCoredumpSetAttributeGlobal(attrib not None : CUcoredumpSettings, value): cdef size_t size = cyvalue.size() with nogil: err = cydriver.cuCoredumpSetAttributeGlobal(cyattrib, cyvalue_ptr, &size) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGetExportTable' in found_functions}} @@ -52087,8 +51853,8 @@ def cuGetExportTable(pExportTableId : Optional[CUuuid]): with nogil: err = cydriver.cuGetExportTable(&ppExportTable, cypExportTableId_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], ppExportTable) + return (CUresult(err), None) + return (CUresult(err), ppExportTable) {{endif}} {{if 'cuGreenCtxCreate' in found_functions}} @@ -52163,8 +51929,8 @@ def cuGreenCtxCreate(desc, dev, unsigned int flags): with nogil: err = cydriver.cuGreenCtxCreate(phCtx._pvt_ptr, cydesc, cydev, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phCtx) + return (CUresult(err), None) + return (CUresult(err), phCtx) {{endif}} {{if 'cuGreenCtxDestroy' in found_functions}} @@ -52214,7 +51980,7 @@ def cuGreenCtxDestroy(hCtx): cyhCtx = phCtx with nogil: err = cydriver.cuGreenCtxDestroy(cyhCtx) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCtxFromGreenCtx' in found_functions}} @@ -52262,8 +52028,8 @@ def cuCtxFromGreenCtx(hCtx): with nogil: err = cydriver.cuCtxFromGreenCtx(pContext._pvt_ptr, cyhCtx) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pContext) + return (CUresult(err), None) + return (CUresult(err), pContext) {{endif}} {{if 'cuDeviceGetDevResource' in found_functions}} @@ -52309,8 +52075,8 @@ def cuDeviceGetDevResource(device, typename not None : CUdevResourceType): with nogil: err = cydriver.cuDeviceGetDevResource(cydevice, resource._pvt_ptr, cytypename) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], resource) + return (CUresult(err), None) + return (CUresult(err), resource) {{endif}} {{if 'cuCtxGetDevResource' in found_functions}} @@ -52353,8 +52119,8 @@ def cuCtxGetDevResource(hCtx, typename not None : CUdevResourceType): with nogil: err = cydriver.cuCtxGetDevResource(cyhCtx, resource._pvt_ptr, cytypename) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], resource) + return (CUresult(err), None) + return (CUresult(err), resource) {{endif}} {{if 'cuGreenCtxGetDevResource' in found_functions}} @@ -52397,8 +52163,8 @@ def cuGreenCtxGetDevResource(hCtx, typename not None : CUdevResourceType): with nogil: err = cydriver.cuGreenCtxGetDevResource(cyhCtx, resource._pvt_ptr, cytypename) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], resource) + return (CUresult(err), None) + return (CUresult(err), resource) {{endif}} {{if 'cuDevSmResourceSplitByCount' in found_functions}} @@ -52521,8 +52287,8 @@ def cuDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[CUdevRe if cyresult is not NULL: free(cyresult) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None, None) - return (_dict_CUresult[err], pyresult, cynbGroups, remainder) + return (CUresult(err), None, None, None) + return (CUresult(err), pyresult, cynbGroups, remainder) {{endif}} {{if 'cuDevSmResourceSplit' in found_functions}} @@ -52682,8 +52448,8 @@ def cuDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[CUdevResource] if cyresult is not NULL: free(cyresult) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], pyresult, remainder) + return (CUresult(err), None, None) + return (CUresult(err), pyresult, remainder) {{endif}} {{if 'cuDevResourceGenerateDesc' in found_functions}} @@ -52750,8 +52516,8 @@ def cuDevResourceGenerateDesc(resources : Optional[tuple[CUdevResource] | list[C if len(resources) > 1 and cyresources is not NULL: free(cyresources) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phDesc) + return (CUresult(err), None) + return (CUresult(err), phDesc) {{endif}} {{if 'cuGreenCtxRecordEvent' in found_functions}} @@ -52806,7 +52572,7 @@ def cuGreenCtxRecordEvent(hCtx, hEvent): cyhCtx = phCtx with nogil: err = cydriver.cuGreenCtxRecordEvent(cyhCtx, cyhEvent) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuGreenCtxWaitEvent' in found_functions}} @@ -52861,7 +52627,7 @@ def cuGreenCtxWaitEvent(hCtx, hEvent): cyhCtx = phCtx with nogil: err = cydriver.cuGreenCtxWaitEvent(cyhCtx, cyhEvent) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuStreamGetGreenCtx' in found_functions}} @@ -52920,8 +52686,8 @@ def cuStreamGetGreenCtx(hStream): with nogil: err = cydriver.cuStreamGetGreenCtx(cyhStream, phCtx._pvt_ptr) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phCtx) + return (CUresult(err), None) + return (CUresult(err), phCtx) {{endif}} {{if 'cuGreenCtxStreamCreate' in found_functions}} @@ -52995,8 +52761,8 @@ def cuGreenCtxStreamCreate(greenCtx, unsigned int flags, int priority): with nogil: err = cydriver.cuGreenCtxStreamCreate(phStream._pvt_ptr, cygreenCtx, flags, priority) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phStream) + return (CUresult(err), None) + return (CUresult(err), phStream) {{endif}} {{if 'cuGreenCtxGetId' in found_functions}} @@ -53039,8 +52805,8 @@ def cuGreenCtxGetId(greenCtx): with nogil: err = cydriver.cuGreenCtxGetId(cygreenCtx, &greenCtxId) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], greenCtxId) + return (CUresult(err), None) + return (CUresult(err), greenCtxId) {{endif}} {{if 'cuStreamGetDevResource' in found_functions}} @@ -53087,8 +52853,8 @@ def cuStreamGetDevResource(hStream, typename not None : CUdevResourceType): with nogil: err = cydriver.cuStreamGetDevResource(cyhStream, resource._pvt_ptr, cytypename) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], resource) + return (CUresult(err), None) + return (CUresult(err), resource) {{endif}} {{if 'cuLogsRegisterCallback' in found_functions}} @@ -53151,8 +52917,8 @@ def cuLogsRegisterCallback(callbackFunc, userData): else: m_global._allocated[int(callback_out)] = cbData if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], callback_out) + return (CUresult(err), None) + return (CUresult(err), callback_out) {{endif}} {{if 'cuLogsUnregisterCallback' in found_functions}} @@ -53184,7 +52950,7 @@ def cuLogsUnregisterCallback(callback): if err == cydriver.CUDA_SUCCESS: free(m_global._allocated[pcallback]) m_global._allocated.erase(pcallback) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuLogsCurrent' in found_functions}} @@ -53209,8 +52975,8 @@ def cuLogsCurrent(unsigned int flags): with nogil: err = cydriver.cuLogsCurrent(iterator_out._pvt_ptr, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], iterator_out) + return (CUresult(err), None) + return (CUresult(err), iterator_out) {{endif}} {{if 'cuLogsDumpToFile' in found_functions}} @@ -53253,8 +53019,8 @@ def cuLogsDumpToFile(iterator : Optional[CUlogIterator], char* pathToFile, unsig with nogil: err = cydriver.cuLogsDumpToFile(cyiterator, pathToFile, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], iterator) + return (CUresult(err), None) + return (CUresult(err), iterator) {{endif}} {{if 'cuLogsDumpToMemory' in found_functions}} @@ -53311,8 +53077,8 @@ def cuLogsDumpToMemory(iterator : Optional[CUlogIterator], char* buffer, size_t with nogil: err = cydriver.cuLogsDumpToMemory(cyiterator, buffer, &size, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], iterator, size) + return (CUresult(err), None, None) + return (CUresult(err), iterator, size) {{endif}} {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} @@ -53340,8 +53106,8 @@ def cuCheckpointProcessGetRestoreThreadId(int pid): with nogil: err = cydriver.cuCheckpointProcessGetRestoreThreadId(pid, &tid) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], tid) + return (CUresult(err), None) + return (CUresult(err), tid) {{endif}} {{if 'cuCheckpointProcessGetState' in found_functions}} @@ -53369,8 +53135,8 @@ def cuCheckpointProcessGetState(int pid): with nogil: err = cydriver.cuCheckpointProcessGetState(pid, &state) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], CUprocessState(state)) + return (CUresult(err), None) + return (CUresult(err), CUprocessState(state)) {{endif}} {{if 'cuCheckpointProcessLock' in found_functions}} @@ -53402,7 +53168,7 @@ def cuCheckpointProcessLock(int pid, args : Optional[CUcheckpointLockArgs]): cdef cydriver.CUcheckpointLockArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessLock(pid, cyargs_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCheckpointProcessCheckpoint' in found_functions}} @@ -53433,7 +53199,7 @@ def cuCheckpointProcessCheckpoint(int pid, args : Optional[CUcheckpointCheckpoin cdef cydriver.CUcheckpointCheckpointArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessCheckpoint(pid, cyargs_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCheckpointProcessRestore' in found_functions}} @@ -53474,7 +53240,7 @@ def cuCheckpointProcessRestore(int pid, args : Optional[CUcheckpointRestoreArgs] cdef cydriver.CUcheckpointRestoreArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessRestore(pid, cyargs_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuCheckpointProcessUnlock' in found_functions}} @@ -53503,7 +53269,7 @@ def cuCheckpointProcessUnlock(int pid, args : Optional[CUcheckpointUnlockArgs]): cdef cydriver.CUcheckpointUnlockArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessUnlock(pid, cyargs_ptr) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuProfilerStart' in found_functions}} @@ -53531,7 +53297,7 @@ def cuProfilerStart(): """ with nogil: err = cydriver.cuProfilerStart() - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if 'cuProfilerStop' in found_functions}} @@ -53559,7 +53325,7 @@ def cuProfilerStop(): """ with nogil: err = cydriver.cuProfilerStop() - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if True}} @@ -53634,8 +53400,8 @@ def cuGraphicsEGLRegisterImage(image, unsigned int flags): with nogil: err = cydriver.cuGraphicsEGLRegisterImage(pCudaResource._pvt_ptr, cyimage, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pCudaResource) + return (CUresult(err), None) + return (CUresult(err), pCudaResource) {{endif}} {{if True}} @@ -53677,8 +53443,8 @@ def cuEGLStreamConsumerConnect(stream): with nogil: err = cydriver.cuEGLStreamConsumerConnect(conn._pvt_ptr, cystream) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], conn) + return (CUresult(err), None) + return (CUresult(err), conn) {{endif}} {{if True}} @@ -53724,8 +53490,8 @@ def cuEGLStreamConsumerConnectWithFlags(stream, unsigned int flags): with nogil: err = cydriver.cuEGLStreamConsumerConnectWithFlags(conn._pvt_ptr, cystream, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], conn) + return (CUresult(err), None) + return (CUresult(err), conn) {{endif}} {{if True}} @@ -53762,7 +53528,7 @@ def cuEGLStreamConsumerDisconnect(conn): raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) with nogil: err = cydriver.cuEGLStreamConsumerDisconnect(cyconn) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if True}} @@ -53834,7 +53600,7 @@ def cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, unsigned int t raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) with nogil: err = cydriver.cuEGLStreamConsumerAcquireFrame(cyconn, cypCudaResource, cypStream, timeout) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if True}} @@ -53897,7 +53663,7 @@ def cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream): raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) with nogil: err = cydriver.cuEGLStreamConsumerReleaseFrame(cyconn, cypCudaResource, cypStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if True}} @@ -53959,8 +53725,8 @@ def cuEGLStreamProducerConnect(stream, width, height): with nogil: err = cydriver.cuEGLStreamProducerConnect(conn._pvt_ptr, cystream, cywidth, cyheight) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], conn) + return (CUresult(err), None) + return (CUresult(err), conn) {{endif}} {{if True}} @@ -53997,7 +53763,7 @@ def cuEGLStreamProducerDisconnect(conn): raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) with nogil: err = cydriver.cuEGLStreamProducerDisconnect(cyconn) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if True}} @@ -54067,7 +53833,7 @@ def cuEGLStreamProducerPresentFrame(conn, eglframe not None : CUeglFrame, pStrea raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) with nogil: err = cydriver.cuEGLStreamProducerPresentFrame(cyconn, eglframe._pvt_ptr[0], cypStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if True}} @@ -54122,7 +53888,7 @@ def cuEGLStreamProducerReturnFrame(conn, eglframe : Optional[CUeglFrame], pStrea cdef cydriver.CUeglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe is not None else NULL with nogil: err = cydriver.cuEGLStreamProducerReturnFrame(cyconn, cyeglframe_ptr, cypStream) - return (_dict_CUresult[err],) + return (CUresult(err),) {{endif}} {{if True}} @@ -54170,8 +53936,8 @@ def cuGraphicsResourceGetMappedEglFrame(resource, unsigned int index, unsigned i with nogil: err = cydriver.cuGraphicsResourceGetMappedEglFrame(eglFrame._pvt_ptr, cyresource, index, mipLevel) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], eglFrame) + return (CUresult(err), None) + return (CUresult(err), eglFrame) {{endif}} {{if True}} @@ -54229,8 +53995,8 @@ def cuEventCreateFromEGLSync(eglSync, unsigned int flags): with nogil: err = cydriver.cuEventCreateFromEGLSync(phEvent._pvt_ptr, cyeglSync, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], phEvent) + return (CUresult(err), None) + return (CUresult(err), phEvent) {{endif}} {{if True}} @@ -54286,8 +54052,8 @@ def cuGraphicsGLRegisterBuffer(buffer, unsigned int Flags): with nogil: err = cydriver.cuGraphicsGLRegisterBuffer(pCudaResource._pvt_ptr, cybuffer, Flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pCudaResource) + return (CUresult(err), None) + return (CUresult(err), pCudaResource) {{endif}} {{if True}} @@ -54386,8 +54152,8 @@ def cuGraphicsGLRegisterImage(image, target, unsigned int Flags): with nogil: err = cydriver.cuGraphicsGLRegisterImage(pCudaResource._pvt_ptr, cyimage, cytarget, Flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pCudaResource) + return (CUresult(err), None) + return (CUresult(err), pCudaResource) {{endif}} {{if True}} @@ -54455,8 +54221,8 @@ def cuGLGetDevices(unsigned int cudaDeviceCount, deviceList not None : CUGLDevic if cypCudaDevices is not NULL: free(cypCudaDevices) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None, None) - return (_dict_CUresult[err], pCudaDeviceCount, pypCudaDevices) + return (CUresult(err), None, None) + return (CUresult(err), pCudaDeviceCount, pypCudaDevices) {{endif}} {{if True}} @@ -54508,8 +54274,8 @@ def cuVDPAUGetDevice(vdpDevice, vdpGetProcAddress): with nogil: err = cydriver.cuVDPAUGetDevice(pDevice._pvt_ptr, cyvdpDevice, cyvdpGetProcAddress) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pDevice) + return (CUresult(err), None) + return (CUresult(err), pDevice) {{endif}} {{if True}} @@ -54576,8 +54342,8 @@ def cuVDPAUCtxCreate(unsigned int flags, device, vdpDevice, vdpGetProcAddress): with nogil: err = cydriver.cuVDPAUCtxCreate(pCtx._pvt_ptr, flags, cydevice, cyvdpDevice, cyvdpGetProcAddress) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pCtx) + return (CUresult(err), None) + return (CUresult(err), pCtx) {{endif}} {{if True}} @@ -54639,8 +54405,8 @@ def cuGraphicsVDPAURegisterVideoSurface(vdpSurface, unsigned int flags): with nogil: err = cydriver.cuGraphicsVDPAURegisterVideoSurface(pCudaResource._pvt_ptr, cyvdpSurface, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pCudaResource) + return (CUresult(err), None) + return (CUresult(err), pCudaResource) {{endif}} {{if True}} @@ -54702,8 +54468,8 @@ def cuGraphicsVDPAURegisterOutputSurface(vdpSurface, unsigned int flags): with nogil: err = cydriver.cuGraphicsVDPAURegisterOutputSurface(pCudaResource._pvt_ptr, cyvdpSurface, flags) if err != cydriver.CUDA_SUCCESS: - return (_dict_CUresult[err], None) - return (_dict_CUresult[err], pCudaResource) + return (CUresult(err), None) + return (CUresult(err), pCudaResource) {{endif}} diff --git a/cuda_bindings/cuda/bindings/nvrtc.pyx.in b/cuda_bindings/cuda/bindings/nvrtc.pyx.in index 913d913008..37382791b5 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/nvrtc.pyx.in @@ -3,7 +3,6 @@ # This code was automatically generated with version 13.1.0. Do not modify it directly. from typing import Any, Optional -from enum import IntEnum import cython import ctypes from libc.stdlib cimport calloc, malloc, free @@ -14,6 +13,7 @@ from libc.limits cimport CHAR_MIN from libcpp.vector cimport vector from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS from cpython.bytes cimport PyBytes_FromStringAndSize +from .utils._fast_enum import _FastEnum, _FastEnumMetaclass import cuda.bindings.driver as _driver _driver = _driver.__dict__ @@ -46,7 +46,7 @@ ctypedef unsigned long long void_ptr {{if 'nvrtcResult' in found_types}} -class nvrtcResult(IntEnum): +class nvrtcResult(_FastEnum, metaclass=_FastEnumMetaclass): """ The enumerated type nvrtcResult defines API call result codes. NVRTC API functions return nvrtcResult to indicate the call result. @@ -88,7 +88,6 @@ class nvrtcResult(IntEnum): {{if 'NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED' in found_values}} NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED = cynvrtc.nvrtcResult.NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED{{endif}} -_dict_nvrtcResult = dict(((int(v), v) for k, v in nvrtcResult.__members__.items())) {{endif}} {{if 'nvrtcProgram' in found_types}} @@ -172,8 +171,8 @@ def nvrtcVersion(): with nogil: err = cynvrtc.nvrtcVersion(&major, &minor) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None, None) - return (_dict_nvrtcResult[err], major, minor) + return (nvrtcResult(err), None, None) + return (nvrtcResult(err), major, minor) {{endif}} {{if 'nvrtcGetNumSupportedArchs' in found_functions}} @@ -196,8 +195,8 @@ def nvrtcGetNumSupportedArchs(): with nogil: err = cynvrtc.nvrtcGetNumSupportedArchs(&numArchs) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], numArchs) + return (nvrtcResult(err), None) + return (nvrtcResult(err), numArchs) {{endif}} {{if 'nvrtcGetSupportedArchs' in found_functions}} @@ -223,8 +222,8 @@ def nvrtcGetSupportedArchs(): with nogil: err = cynvrtc.nvrtcGetSupportedArchs(supportedArchs.data()) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], supportedArchs) + return (nvrtcResult(err), None) + return (nvrtcResult(err), supportedArchs) {{endif}} {{if 'nvrtcCreateProgram' in found_functions}} @@ -281,8 +280,8 @@ def nvrtcCreateProgram(char* src, char* name, int numHeaders, headers : Optional with nogil: err = cynvrtc.nvrtcCreateProgram(prog._pvt_ptr, src, name, numHeaders, cyheaders.data(), cyincludeNames.data()) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], prog) + return (nvrtcResult(err), None) + return (nvrtcResult(err), prog) {{endif}} {{if 'nvrtcDestroyProgram' in found_functions}} @@ -318,7 +317,7 @@ def nvrtcDestroyProgram(prog): raise TypeError("Argument 'prog' is not instance of type (expected , found " + str(type(prog))) with nogil: err = cynvrtc.nvrtcDestroyProgram(cyprog) - return (_dict_nvrtcResult[err],) + return (nvrtcResult(err),) {{endif}} {{if 'nvrtcCompileProgram' in found_functions}} @@ -368,7 +367,7 @@ def nvrtcCompileProgram(prog, int numOptions, options : Optional[tuple[bytes] | cdef vector[const char*] cyoptions = options with nogil: err = cynvrtc.nvrtcCompileProgram(cyprog, numOptions, cyoptions.data()) - return (_dict_nvrtcResult[err],) + return (nvrtcResult(err),) {{endif}} {{if 'nvrtcGetPTXSize' in found_functions}} @@ -407,8 +406,8 @@ def nvrtcGetPTXSize(prog): with nogil: err = cynvrtc.nvrtcGetPTXSize(cyprog, &ptxSizeRet) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], ptxSizeRet) + return (nvrtcResult(err), None) + return (nvrtcResult(err), ptxSizeRet) {{endif}} {{if 'nvrtcGetPTX' in found_functions}} @@ -445,7 +444,7 @@ def nvrtcGetPTX(prog, char* ptx): cyprog = pprog with nogil: err = cynvrtc.nvrtcGetPTX(cyprog, ptx) - return (_dict_nvrtcResult[err],) + return (nvrtcResult(err),) {{endif}} {{if 'nvrtcGetCUBINSize' in found_functions}} @@ -484,8 +483,8 @@ def nvrtcGetCUBINSize(prog): with nogil: err = cynvrtc.nvrtcGetCUBINSize(cyprog, &cubinSizeRet) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], cubinSizeRet) + return (nvrtcResult(err), None) + return (nvrtcResult(err), cubinSizeRet) {{endif}} {{if 'nvrtcGetCUBIN' in found_functions}} @@ -522,7 +521,7 @@ def nvrtcGetCUBIN(prog, char* cubin): cyprog = pprog with nogil: err = cynvrtc.nvrtcGetCUBIN(cyprog, cubin) - return (_dict_nvrtcResult[err],) + return (nvrtcResult(err),) {{endif}} {{if 'nvrtcGetLTOIRSize' in found_functions}} @@ -561,8 +560,8 @@ def nvrtcGetLTOIRSize(prog): with nogil: err = cynvrtc.nvrtcGetLTOIRSize(cyprog, <OIRSizeRet) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], LTOIRSizeRet) + return (nvrtcResult(err), None) + return (nvrtcResult(err), LTOIRSizeRet) {{endif}} {{if 'nvrtcGetLTOIR' in found_functions}} @@ -599,7 +598,7 @@ def nvrtcGetLTOIR(prog, char* LTOIR): cyprog = pprog with nogil: err = cynvrtc.nvrtcGetLTOIR(cyprog, LTOIR) - return (_dict_nvrtcResult[err],) + return (nvrtcResult(err),) {{endif}} {{if 'nvrtcGetOptiXIRSize' in found_functions}} @@ -638,8 +637,8 @@ def nvrtcGetOptiXIRSize(prog): with nogil: err = cynvrtc.nvrtcGetOptiXIRSize(cyprog, &optixirSizeRet) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], optixirSizeRet) + return (nvrtcResult(err), None) + return (nvrtcResult(err), optixirSizeRet) {{endif}} {{if 'nvrtcGetOptiXIR' in found_functions}} @@ -676,7 +675,7 @@ def nvrtcGetOptiXIR(prog, char* optixir): cyprog = pprog with nogil: err = cynvrtc.nvrtcGetOptiXIR(cyprog, optixir) - return (_dict_nvrtcResult[err],) + return (nvrtcResult(err),) {{endif}} {{if 'nvrtcGetProgramLogSize' in found_functions}} @@ -718,8 +717,8 @@ def nvrtcGetProgramLogSize(prog): with nogil: err = cynvrtc.nvrtcGetProgramLogSize(cyprog, &logSizeRet) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], logSizeRet) + return (nvrtcResult(err), None) + return (nvrtcResult(err), logSizeRet) {{endif}} {{if 'nvrtcGetProgramLog' in found_functions}} @@ -756,7 +755,7 @@ def nvrtcGetProgramLog(prog, char* log): cyprog = pprog with nogil: err = cynvrtc.nvrtcGetProgramLog(cyprog, log) - return (_dict_nvrtcResult[err],) + return (nvrtcResult(err),) {{endif}} {{if 'nvrtcAddNameExpression' in found_functions}} @@ -798,7 +797,7 @@ def nvrtcAddNameExpression(prog, char* name_expression): cyprog = pprog with nogil: err = cynvrtc.nvrtcAddNameExpression(cyprog, name_expression) - return (_dict_nvrtcResult[err],) + return (nvrtcResult(err),) {{endif}} {{if 'nvrtcGetLoweredName' in found_functions}} @@ -842,8 +841,8 @@ def nvrtcGetLoweredName(prog, char* name_expression): with nogil: err = cynvrtc.nvrtcGetLoweredName(cyprog, name_expression, &lowered_name) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], lowered_name if lowered_name != NULL else None) + return (nvrtcResult(err), None) + return (nvrtcResult(err), lowered_name if lowered_name != NULL else None) {{endif}} {{if 'nvrtcGetPCHHeapSize' in found_functions}} @@ -864,8 +863,8 @@ def nvrtcGetPCHHeapSize(): with nogil: err = cynvrtc.nvrtcGetPCHHeapSize(&ret) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], ret) + return (nvrtcResult(err), None) + return (nvrtcResult(err), ret) {{endif}} {{if 'nvrtcSetPCHHeapSize' in found_functions}} @@ -890,7 +889,7 @@ def nvrtcSetPCHHeapSize(size_t size): """ with nogil: err = cynvrtc.nvrtcSetPCHHeapSize(size) - return (_dict_nvrtcResult[err],) + return (nvrtcResult(err),) {{endif}} {{if 'nvrtcGetPCHCreateStatus' in found_functions}} @@ -938,7 +937,7 @@ def nvrtcGetPCHCreateStatus(prog): cyprog = pprog with nogil: err = cynvrtc.nvrtcGetPCHCreateStatus(cyprog) - return (_dict_nvrtcResult[err],) + return (nvrtcResult(err),) {{endif}} {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} @@ -974,8 +973,8 @@ def nvrtcGetPCHHeapSizeRequired(prog): with nogil: err = cynvrtc.nvrtcGetPCHHeapSizeRequired(cyprog, &size) if err != cynvrtc.NVRTC_SUCCESS: - return (_dict_nvrtcResult[err], None) - return (_dict_nvrtcResult[err], size) + return (nvrtcResult(err), None) + return (nvrtcResult(err), size) {{endif}} {{if 'nvrtcSetFlowCallback' in found_functions}} @@ -1036,7 +1035,7 @@ def nvrtcSetFlowCallback(prog, callback, payload): cdef void* cypayload_ptr = cypayload.cptr with nogil: err = cynvrtc.nvrtcSetFlowCallback(cyprog, cycallback_ptr, cypayload_ptr) - return (_dict_nvrtcResult[err],) + return (nvrtcResult(err),) {{endif}} @cython.embedsignature(True) diff --git a/cuda_bindings/cuda/bindings/runtime.pyx.in b/cuda_bindings/cuda/bindings/runtime.pyx.in index 66517b201e..d1e977012c 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx.in +++ b/cuda_bindings/cuda/bindings/runtime.pyx.in @@ -3,7 +3,6 @@ # This code was automatically generated with version 13.1.0. Do not modify it directly. from typing import Any, Optional -from enum import IntEnum import cython import ctypes from libc.stdlib cimport calloc, malloc, free @@ -14,6 +13,7 @@ from libc.limits cimport CHAR_MIN from libcpp.vector cimport vector from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS from cpython.bytes cimport PyBytes_FromStringAndSize +from .utils._fast_enum import _FastEnum, _FastEnumMetaclass import cuda.bindings.driver from libcpp.map cimport map @@ -339,7 +339,7 @@ CUDA_EGL_MAX_PLANES = cyruntime.CUDA_EGL_MAX_PLANES {{if 'cudaError' in found_types}} -class cudaError_t(IntEnum): +class cudaError_t(_FastEnum, metaclass=_FastEnumMetaclass): """ impl_private CUDA error types """ @@ -1160,11 +1160,10 @@ class cudaError_t(IntEnum): {{if 'cudaErrorApiFailureBase' in found_values}} cudaErrorApiFailureBase = cyruntime.cudaError.cudaErrorApiFailureBase{{endif}} -_dict_cudaError_t = dict(((int(v), v) for k, v in cudaError_t.__members__.items())) {{endif}} {{if 'cudaGraphDependencyType_enum' in found_types}} -class cudaGraphDependencyType(IntEnum): +class cudaGraphDependencyType(_FastEnum, metaclass=_FastEnumMetaclass): """ Type annotations that can be applied to graph edges as part of :py:obj:`~.cudaGraphEdgeData`. @@ -1182,11 +1181,10 @@ class cudaGraphDependencyType(IntEnum): #: :py:obj:`~.cudaGraphKernelNodePortLaunchCompletion` outgoing port. cudaGraphDependencyTypeProgrammatic = cyruntime.cudaGraphDependencyType_enum.cudaGraphDependencyTypeProgrammatic{{endif}} -_dict_cudaGraphDependencyType = dict(((int(v), v) for k, v in cudaGraphDependencyType.__members__.items())) {{endif}} {{if 'cudaGraphInstantiateResult' in found_types}} -class cudaGraphInstantiateResult(IntEnum): +class cudaGraphInstantiateResult(_FastEnum, metaclass=_FastEnumMetaclass): """ Graph instantiation results """ @@ -1219,11 +1217,10 @@ class cudaGraphInstantiateResult(IntEnum): #: nodes cudaGraphInstantiateConditionalHandleUnused = cyruntime.cudaGraphInstantiateResult.cudaGraphInstantiateConditionalHandleUnused{{endif}} -_dict_cudaGraphInstantiateResult = dict(((int(v), v) for k, v in cudaGraphInstantiateResult.__members__.items())) {{endif}} {{if 'cudaLaunchMemSyncDomain' in found_types}} -class cudaLaunchMemSyncDomain(IntEnum): +class cudaLaunchMemSyncDomain(_FastEnum, metaclass=_FastEnumMetaclass): """ Memory Synchronization Domain A kernel can be launched in a specified memory synchronization domain that affects all memory @@ -1253,11 +1250,10 @@ class cudaLaunchMemSyncDomain(IntEnum): #: Launch kernels in the remote domain cudaLaunchMemSyncDomainRemote = cyruntime.cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainRemote{{endif}} -_dict_cudaLaunchMemSyncDomain = dict(((int(v), v) for k, v in cudaLaunchMemSyncDomain.__members__.items())) {{endif}} {{if 'cudaLaunchAttributeID' in found_types}} -class cudaLaunchAttributeID(IntEnum): +class cudaLaunchAttributeID(_FastEnum, metaclass=_FastEnumMetaclass): """ Launch attributes enum; used as id field of :py:obj:`~.cudaLaunchAttribute` @@ -1467,11 +1463,10 @@ class cudaLaunchAttributeID(IntEnum): #: 0 (disabled) and 1 (enabled). cudaLaunchAttributeNvlinkUtilCentricScheduling = cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeNvlinkUtilCentricScheduling{{endif}} -_dict_cudaLaunchAttributeID = dict(((int(v), v) for k, v in cudaLaunchAttributeID.__members__.items())) {{endif}} {{if 'cudaAsyncNotificationType_enum' in found_types}} -class cudaAsyncNotificationType(IntEnum): +class cudaAsyncNotificationType(_FastEnum, metaclass=_FastEnumMetaclass): """ Types of async notification that can occur """ @@ -1480,11 +1475,10 @@ class cudaAsyncNotificationType(IntEnum): #: Sent when the process has exceeded its device memory budget cudaAsyncNotificationTypeOverBudget = cyruntime.cudaAsyncNotificationType_enum.cudaAsyncNotificationTypeOverBudget{{endif}} -_dict_cudaAsyncNotificationType = dict(((int(v), v) for k, v in cudaAsyncNotificationType.__members__.items())) {{endif}} {{if 'CUDAlogLevel_enum' in found_types}} -class cudaLogLevel(IntEnum): +class cudaLogLevel(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -1493,11 +1487,10 @@ class cudaLogLevel(IntEnum): {{if 'cudaLogLevelWarning' in found_values}} cudaLogLevelWarning = cyruntime.CUDAlogLevel_enum.cudaLogLevelWarning{{endif}} -_dict_cudaLogLevel = dict(((int(v), v) for k, v in cudaLogLevel.__members__.items())) {{endif}} {{if 'cudaDataType_t' in found_types}} -class cudaDataType(IntEnum): +class cudaDataType(_FastEnum, metaclass=_FastEnumMetaclass): """""" {{if 'CUDA_R_32F' in found_values}} CUDA_R_32F = cyruntime.cudaDataType_t.CUDA_R_32F{{endif}} @@ -1570,11 +1563,10 @@ class cudaDataType(IntEnum): {{if 'CUDA_R_4F_E2M1' in found_values}} CUDA_R_4F_E2M1 = cyruntime.cudaDataType_t.CUDA_R_4F_E2M1{{endif}} -_dict_cudaDataType = dict(((int(v), v) for k, v in cudaDataType.__members__.items())) {{endif}} {{if 'cudaEmulationStrategy_t' in found_types}} -class cudaEmulationStrategy(IntEnum): +class cudaEmulationStrategy(_FastEnum, metaclass=_FastEnumMetaclass): """""" {{if 'CUDA_EMULATION_STRATEGY_DEFAULT' in found_values}} CUDA_EMULATION_STRATEGY_DEFAULT = cyruntime.cudaEmulationStrategy_t.CUDA_EMULATION_STRATEGY_DEFAULT{{endif}} @@ -1583,22 +1575,20 @@ class cudaEmulationStrategy(IntEnum): {{if 'CUDA_EMULATION_STRATEGY_EAGER' in found_values}} CUDA_EMULATION_STRATEGY_EAGER = cyruntime.cudaEmulationStrategy_t.CUDA_EMULATION_STRATEGY_EAGER{{endif}} -_dict_cudaEmulationStrategy = dict(((int(v), v) for k, v in cudaEmulationStrategy.__members__.items())) {{endif}} {{if 'cudaEmulationMantissaControl_t' in found_types}} -class cudaEmulationMantissaControl(IntEnum): +class cudaEmulationMantissaControl(_FastEnum, metaclass=_FastEnumMetaclass): """""" {{if 'CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC' in found_values}} CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC = cyruntime.cudaEmulationMantissaControl_t.CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC{{endif}} {{if 'CUDA_EMULATION_MANTISSA_CONTROL_FIXED' in found_values}} CUDA_EMULATION_MANTISSA_CONTROL_FIXED = cyruntime.cudaEmulationMantissaControl_t.CUDA_EMULATION_MANTISSA_CONTROL_FIXED{{endif}} -_dict_cudaEmulationMantissaControl = dict(((int(v), v) for k, v in cudaEmulationMantissaControl.__members__.items())) {{endif}} {{if 'cudaEmulationSpecialValuesSupport_t' in found_types}} -class cudaEmulationSpecialValuesSupport(IntEnum): +class cudaEmulationSpecialValuesSupport(_FastEnum, metaclass=_FastEnumMetaclass): """""" {{if 'CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE' in found_values}} CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE = cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE{{endif}} @@ -1609,11 +1599,10 @@ class cudaEmulationSpecialValuesSupport(IntEnum): {{if 'CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT' in found_values}} CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT = cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT{{endif}} -_dict_cudaEmulationSpecialValuesSupport = dict(((int(v), v) for k, v in cudaEmulationSpecialValuesSupport.__members__.items())) {{endif}} {{if 'libraryPropertyType_t' in found_types}} -class libraryPropertyType(IntEnum): +class libraryPropertyType(_FastEnum, metaclass=_FastEnumMetaclass): """""" {{if 'MAJOR_VERSION' in found_values}} MAJOR_VERSION = cyruntime.libraryPropertyType_t.MAJOR_VERSION{{endif}} @@ -1622,11 +1611,10 @@ class libraryPropertyType(IntEnum): {{if 'PATCH_LEVEL' in found_values}} PATCH_LEVEL = cyruntime.libraryPropertyType_t.PATCH_LEVEL{{endif}} -_dict_libraryPropertyType = dict(((int(v), v) for k, v in libraryPropertyType.__members__.items())) {{endif}} {{if True}} -class cudaEglFrameType(IntEnum): +class cudaEglFrameType(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA EglFrame type - array or pointer """ @@ -1639,11 +1627,10 @@ class cudaEglFrameType(IntEnum): #: Frame type CUDA pointer cudaEglFrameTypePitch = cyruntime.cudaEglFrameType_enum.cudaEglFrameTypePitch{{endif}} -_dict_cudaEglFrameType = dict(((int(v), v) for k, v in cudaEglFrameType.__members__.items())) {{endif}} {{if True}} -class cudaEglResourceLocationFlags(IntEnum): +class cudaEglResourceLocationFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Resource location flags- sysmem or vidmem For CUDA context on iGPU, since video and system memory are equivalent - these flags @@ -1666,11 +1653,10 @@ class cudaEglResourceLocationFlags(IntEnum): #: Resource location vidmem cudaEglResourceLocationVidmem = cyruntime.cudaEglResourceLocationFlags_enum.cudaEglResourceLocationVidmem{{endif}} -_dict_cudaEglResourceLocationFlags = dict(((int(v), v) for k, v in cudaEglResourceLocationFlags.__members__.items())) {{endif}} {{if True}} -class cudaEglColorFormat(IntEnum): +class cudaEglColorFormat(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA EGL Color Format - The different planar and multiplanar formats currently supported for CUDA_EGL interops. @@ -2222,11 +2208,10 @@ class cudaEglColorFormat(IntEnum): #: Y, U, V in one surface, interleaved as UYVY in one channel. cudaEglColorFormatUYVY2020 = cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatUYVY2020{{endif}} -_dict_cudaEglColorFormat = dict(((int(v), v) for k, v in cudaEglColorFormat.__members__.items())) {{endif}} {{if 'cudaChannelFormatKind' in found_types}} -class cudaChannelFormatKind(IntEnum): +class cudaChannelFormatKind(_FastEnum, metaclass=_FastEnumMetaclass): """ Channel format kind """ @@ -2373,11 +2358,10 @@ class cudaChannelFormatKind(IntEnum): #: 4 channel unsigned normalized (10-bit, 10-bit, 10-bit, 2-bit) format cudaChannelFormatKindUnsignedNormalized1010102 = cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102{{endif}} -_dict_cudaChannelFormatKind = dict(((int(v), v) for k, v in cudaChannelFormatKind.__members__.items())) {{endif}} {{if 'cudaMemoryType' in found_types}} -class cudaMemoryType(IntEnum): +class cudaMemoryType(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA memory types """ @@ -2398,11 +2382,10 @@ class cudaMemoryType(IntEnum): #: Managed memory cudaMemoryTypeManaged = cyruntime.cudaMemoryType.cudaMemoryTypeManaged{{endif}} -_dict_cudaMemoryType = dict(((int(v), v) for k, v in cudaMemoryType.__members__.items())) {{endif}} {{if 'cudaMemcpyKind' in found_types}} -class cudaMemcpyKind(IntEnum): +class cudaMemcpyKind(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA memory copy types """ @@ -2428,11 +2411,10 @@ class cudaMemcpyKind(IntEnum): #: Requires unified virtual addressing cudaMemcpyDefault = cyruntime.cudaMemcpyKind.cudaMemcpyDefault{{endif}} -_dict_cudaMemcpyKind = dict(((int(v), v) for k, v in cudaMemcpyKind.__members__.items())) {{endif}} {{if 'cudaAccessProperty' in found_types}} -class cudaAccessProperty(IntEnum): +class cudaAccessProperty(_FastEnum, metaclass=_FastEnumMetaclass): """ Specifies performance hint with :py:obj:`~.cudaAccessPolicyWindow` for hitProp and missProp members. @@ -2450,11 +2432,10 @@ class cudaAccessProperty(IntEnum): #: Persisting access is more likely to persist in cache. cudaAccessPropertyPersisting = cyruntime.cudaAccessProperty.cudaAccessPropertyPersisting{{endif}} -_dict_cudaAccessProperty = dict(((int(v), v) for k, v in cudaAccessProperty.__members__.items())) {{endif}} {{if 'cudaStreamCaptureStatus' in found_types}} -class cudaStreamCaptureStatus(IntEnum): +class cudaStreamCaptureStatus(_FastEnum, metaclass=_FastEnumMetaclass): """ Possible stream capture statuses returned by :py:obj:`~.cudaStreamIsCapturing` @@ -2473,11 +2454,10 @@ class cudaStreamCaptureStatus(IntEnum): #: not terminated cudaStreamCaptureStatusInvalidated = cyruntime.cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated{{endif}} -_dict_cudaStreamCaptureStatus = dict(((int(v), v) for k, v in cudaStreamCaptureStatus.__members__.items())) {{endif}} {{if 'cudaStreamCaptureMode' in found_types}} -class cudaStreamCaptureMode(IntEnum): +class cudaStreamCaptureMode(_FastEnum, metaclass=_FastEnumMetaclass): """ Possible modes for stream capture thread interactions. For more details see :py:obj:`~.cudaStreamBeginCapture` and @@ -2490,11 +2470,10 @@ class cudaStreamCaptureMode(IntEnum): {{if 'cudaStreamCaptureModeRelaxed' in found_values}} cudaStreamCaptureModeRelaxed = cyruntime.cudaStreamCaptureMode.cudaStreamCaptureModeRelaxed{{endif}} -_dict_cudaStreamCaptureMode = dict(((int(v), v) for k, v in cudaStreamCaptureMode.__members__.items())) {{endif}} {{if 'cudaSynchronizationPolicy' in found_types}} -class cudaSynchronizationPolicy(IntEnum): +class cudaSynchronizationPolicy(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -2507,11 +2486,10 @@ class cudaSynchronizationPolicy(IntEnum): {{if 'cudaSyncPolicyBlockingSync' in found_values}} cudaSyncPolicyBlockingSync = cyruntime.cudaSynchronizationPolicy.cudaSyncPolicyBlockingSync{{endif}} -_dict_cudaSynchronizationPolicy = dict(((int(v), v) for k, v in cudaSynchronizationPolicy.__members__.items())) {{endif}} {{if 'cudaClusterSchedulingPolicy' in found_types}} -class cudaClusterSchedulingPolicy(IntEnum): +class cudaClusterSchedulingPolicy(_FastEnum, metaclass=_FastEnumMetaclass): """ Cluster scheduling policies. These may be passed to :py:obj:`~.cudaFuncSetAttribute` @@ -2530,11 +2508,10 @@ class cudaClusterSchedulingPolicy(IntEnum): #: SMs cudaClusterSchedulingPolicyLoadBalancing = cyruntime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyLoadBalancing{{endif}} -_dict_cudaClusterSchedulingPolicy = dict(((int(v), v) for k, v in cudaClusterSchedulingPolicy.__members__.items())) {{endif}} {{if 'cudaStreamUpdateCaptureDependenciesFlags' in found_types}} -class cudaStreamUpdateCaptureDependenciesFlags(IntEnum): +class cudaStreamUpdateCaptureDependenciesFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for :py:obj:`~.cudaStreamUpdateCaptureDependencies` """ @@ -2547,11 +2524,10 @@ class cudaStreamUpdateCaptureDependenciesFlags(IntEnum): #: Replace the dependency set with the new nodes cudaStreamSetCaptureDependencies = cyruntime.cudaStreamUpdateCaptureDependenciesFlags.cudaStreamSetCaptureDependencies{{endif}} -_dict_cudaStreamUpdateCaptureDependenciesFlags = dict(((int(v), v) for k, v in cudaStreamUpdateCaptureDependenciesFlags.__members__.items())) {{endif}} {{if 'cudaUserObjectFlags' in found_types}} -class cudaUserObjectFlags(IntEnum): +class cudaUserObjectFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for user objects for graphs """ @@ -2561,11 +2537,10 @@ class cudaUserObjectFlags(IntEnum): #: handle. cudaUserObjectNoDestructorSync = cyruntime.cudaUserObjectFlags.cudaUserObjectNoDestructorSync{{endif}} -_dict_cudaUserObjectFlags = dict(((int(v), v) for k, v in cudaUserObjectFlags.__members__.items())) {{endif}} {{if 'cudaUserObjectRetainFlags' in found_types}} -class cudaUserObjectRetainFlags(IntEnum): +class cudaUserObjectRetainFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for retaining user object references for graphs """ @@ -2575,11 +2550,10 @@ class cudaUserObjectRetainFlags(IntEnum): #: references. cudaGraphUserObjectMove = cyruntime.cudaUserObjectRetainFlags.cudaGraphUserObjectMove{{endif}} -_dict_cudaUserObjectRetainFlags = dict(((int(v), v) for k, v in cudaUserObjectRetainFlags.__members__.items())) {{endif}} {{if 'cudaGraphicsRegisterFlags' in found_types}} -class cudaGraphicsRegisterFlags(IntEnum): +class cudaGraphicsRegisterFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA graphics interop register flags """ @@ -2604,11 +2578,10 @@ class cudaGraphicsRegisterFlags(IntEnum): #: CUDA will perform texture gather operations on this resource cudaGraphicsRegisterFlagsTextureGather = cyruntime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsTextureGather{{endif}} -_dict_cudaGraphicsRegisterFlags = dict(((int(v), v) for k, v in cudaGraphicsRegisterFlags.__members__.items())) {{endif}} {{if 'cudaGraphicsMapFlags' in found_types}} -class cudaGraphicsMapFlags(IntEnum): +class cudaGraphicsMapFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA graphics interop map flags """ @@ -2625,11 +2598,10 @@ class cudaGraphicsMapFlags(IntEnum): #: CUDA will only write to and will not read from this resource cudaGraphicsMapFlagsWriteDiscard = cyruntime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsWriteDiscard{{endif}} -_dict_cudaGraphicsMapFlags = dict(((int(v), v) for k, v in cudaGraphicsMapFlags.__members__.items())) {{endif}} {{if 'cudaGraphicsCubeFace' in found_types}} -class cudaGraphicsCubeFace(IntEnum): +class cudaGraphicsCubeFace(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA graphics interop array indices for cube maps """ @@ -2658,11 +2630,10 @@ class cudaGraphicsCubeFace(IntEnum): #: Negative Z face of cubemap cudaGraphicsCubeFaceNegativeZ = cyruntime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeZ{{endif}} -_dict_cudaGraphicsCubeFace = dict(((int(v), v) for k, v in cudaGraphicsCubeFace.__members__.items())) {{endif}} {{if 'cudaResourceType' in found_types}} -class cudaResourceType(IntEnum): +class cudaResourceType(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA resource types """ @@ -2683,11 +2654,10 @@ class cudaResourceType(IntEnum): #: Pitch 2D resource cudaResourceTypePitch2D = cyruntime.cudaResourceType.cudaResourceTypePitch2D{{endif}} -_dict_cudaResourceType = dict(((int(v), v) for k, v in cudaResourceType.__members__.items())) {{endif}} {{if 'cudaResourceViewFormat' in found_types}} -class cudaResourceViewFormat(IntEnum): +class cudaResourceViewFormat(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA texture resource view formats """ @@ -2832,11 +2802,10 @@ class cudaResourceViewFormat(IntEnum): #: Block compressed 7 cudaResViewFormatUnsignedBlockCompressed7 = cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed7{{endif}} -_dict_cudaResourceViewFormat = dict(((int(v), v) for k, v in cudaResourceViewFormat.__members__.items())) {{endif}} {{if 'cudaFuncAttribute' in found_types}} -class cudaFuncAttribute(IntEnum): +class cudaFuncAttribute(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA function attributes that can be set using :py:obj:`~.cudaFuncSetAttribute` @@ -2877,11 +2846,10 @@ class cudaFuncAttribute(IntEnum): {{if 'cudaFuncAttributeMax' in found_values}} cudaFuncAttributeMax = cyruntime.cudaFuncAttribute.cudaFuncAttributeMax{{endif}} -_dict_cudaFuncAttribute = dict(((int(v), v) for k, v in cudaFuncAttribute.__members__.items())) {{endif}} {{if 'cudaFuncCache' in found_types}} -class cudaFuncCache(IntEnum): +class cudaFuncCache(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA function cache configurations """ @@ -2902,11 +2870,10 @@ class cudaFuncCache(IntEnum): #: Prefer equal size L1 cache and shared memory cudaFuncCachePreferEqual = cyruntime.cudaFuncCache.cudaFuncCachePreferEqual{{endif}} -_dict_cudaFuncCache = dict(((int(v), v) for k, v in cudaFuncCache.__members__.items())) {{endif}} {{if 'cudaSharedMemConfig' in found_types}} -class cudaSharedMemConfig(IntEnum): +class cudaSharedMemConfig(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA shared memory configuration [Deprecated] """ @@ -2917,11 +2884,10 @@ class cudaSharedMemConfig(IntEnum): {{if 'cudaSharedMemBankSizeEightByte' in found_values}} cudaSharedMemBankSizeEightByte = cyruntime.cudaSharedMemConfig.cudaSharedMemBankSizeEightByte{{endif}} -_dict_cudaSharedMemConfig = dict(((int(v), v) for k, v in cudaSharedMemConfig.__members__.items())) {{endif}} {{if 'cudaSharedCarveout' in found_types}} -class cudaSharedCarveout(IntEnum): +class cudaSharedCarveout(_FastEnum, metaclass=_FastEnumMetaclass): """ Shared memory carveout configurations. These may be passed to cudaFuncSetAttribute @@ -2939,11 +2905,10 @@ class cudaSharedCarveout(IntEnum): #: Prefer maximum available shared memory, minimum L1 cache cudaSharedmemCarveoutMaxShared = cyruntime.cudaSharedCarveout.cudaSharedmemCarveoutMaxShared{{endif}} -_dict_cudaSharedCarveout = dict(((int(v), v) for k, v in cudaSharedCarveout.__members__.items())) {{endif}} {{if 'cudaComputeMode' in found_types}} -class cudaComputeMode(IntEnum): +class cudaComputeMode(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA device compute modes """ @@ -2968,11 +2933,10 @@ class cudaComputeMode(IntEnum): #: able to use :py:obj:`~.cudaSetDevice()` with this device) cudaComputeModeExclusiveProcess = cyruntime.cudaComputeMode.cudaComputeModeExclusiveProcess{{endif}} -_dict_cudaComputeMode = dict(((int(v), v) for k, v in cudaComputeMode.__members__.items())) {{endif}} {{if 'cudaLimit' in found_types}} -class cudaLimit(IntEnum): +class cudaLimit(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Limits """ @@ -3006,11 +2970,10 @@ class cudaLimit(IntEnum): #: A size in bytes for L2 persisting lines cache size cudaLimitPersistingL2CacheSize = cyruntime.cudaLimit.cudaLimitPersistingL2CacheSize{{endif}} -_dict_cudaLimit = dict(((int(v), v) for k, v in cudaLimit.__members__.items())) {{endif}} {{if 'cudaMemoryAdvise' in found_types}} -class cudaMemoryAdvise(IntEnum): +class cudaMemoryAdvise(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Memory Advise values """ @@ -3041,11 +3004,10 @@ class cudaMemoryAdvise(IntEnum): #: for the specified device cudaMemAdviseUnsetAccessedBy = cyruntime.cudaMemoryAdvise.cudaMemAdviseUnsetAccessedBy{{endif}} -_dict_cudaMemoryAdvise = dict(((int(v), v) for k, v in cudaMemoryAdvise.__members__.items())) {{endif}} {{if 'cudaMemRangeAttribute' in found_types}} -class cudaMemRangeAttribute(IntEnum): +class cudaMemRangeAttribute(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA range attributes """ @@ -3084,11 +3046,10 @@ class cudaMemRangeAttribute(IntEnum): #: The last location id to which the range was prefetched cudaMemRangeAttributeLastPrefetchLocationId = cyruntime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationId{{endif}} -_dict_cudaMemRangeAttribute = dict(((int(v), v) for k, v in cudaMemRangeAttribute.__members__.items())) {{endif}} {{if 'cudaFlushGPUDirectRDMAWritesOptions' in found_types}} -class cudaFlushGPUDirectRDMAWritesOptions(IntEnum): +class cudaFlushGPUDirectRDMAWritesOptions(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA GPUDirect RDMA flush writes APIs supported on the device """ @@ -3104,11 +3065,10 @@ class cudaFlushGPUDirectRDMAWritesOptions(IntEnum): #: on the CUDA device. cudaFlushGPUDirectRDMAWritesOptionMemOps = cyruntime.cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionMemOps{{endif}} -_dict_cudaFlushGPUDirectRDMAWritesOptions = dict(((int(v), v) for k, v in cudaFlushGPUDirectRDMAWritesOptions.__members__.items())) {{endif}} {{if 'cudaGPUDirectRDMAWritesOrdering' in found_types}} -class cudaGPUDirectRDMAWritesOrdering(IntEnum): +class cudaGPUDirectRDMAWritesOrdering(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA GPUDirect RDMA flush writes ordering features of the device """ @@ -3129,11 +3089,10 @@ class cudaGPUDirectRDMAWritesOrdering(IntEnum): #: RDMA writes to this device. cudaGPUDirectRDMAWritesOrderingAllDevices = cyruntime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingAllDevices{{endif}} -_dict_cudaGPUDirectRDMAWritesOrdering = dict(((int(v), v) for k, v in cudaGPUDirectRDMAWritesOrdering.__members__.items())) {{endif}} {{if 'cudaFlushGPUDirectRDMAWritesScope' in found_types}} -class cudaFlushGPUDirectRDMAWritesScope(IntEnum): +class cudaFlushGPUDirectRDMAWritesScope(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA GPUDirect RDMA flush writes scopes """ @@ -3147,11 +3106,10 @@ class cudaFlushGPUDirectRDMAWritesScope(IntEnum): #: Blocks until remote writes are visible to all CUDA device contexts. cudaFlushGPUDirectRDMAWritesToAllDevices = cyruntime.cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToAllDevices{{endif}} -_dict_cudaFlushGPUDirectRDMAWritesScope = dict(((int(v), v) for k, v in cudaFlushGPUDirectRDMAWritesScope.__members__.items())) {{endif}} {{if 'cudaFlushGPUDirectRDMAWritesTarget' in found_types}} -class cudaFlushGPUDirectRDMAWritesTarget(IntEnum): +class cudaFlushGPUDirectRDMAWritesTarget(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA GPUDirect RDMA flush writes targets """ @@ -3161,11 +3119,10 @@ class cudaFlushGPUDirectRDMAWritesTarget(IntEnum): #: to the currently active CUDA device context. cudaFlushGPUDirectRDMAWritesTargetCurrentDevice = cyruntime.cudaFlushGPUDirectRDMAWritesTarget.cudaFlushGPUDirectRDMAWritesTargetCurrentDevice{{endif}} -_dict_cudaFlushGPUDirectRDMAWritesTarget = dict(((int(v), v) for k, v in cudaFlushGPUDirectRDMAWritesTarget.__members__.items())) {{endif}} {{if 'cudaDeviceAttr' in found_types}} -class cudaDeviceAttr(IntEnum): +class cudaDeviceAttr(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA device attributes """ @@ -3722,11 +3679,10 @@ class cudaDeviceAttr(IntEnum): {{if 'cudaDevAttrMax' in found_values}} cudaDevAttrMax = cyruntime.cudaDeviceAttr.cudaDevAttrMax{{endif}} -_dict_cudaDeviceAttr = dict(((int(v), v) for k, v in cudaDeviceAttr.__members__.items())) {{endif}} {{if 'cudaMemPoolAttr' in found_types}} -class cudaMemPoolAttr(IntEnum): +class cudaMemPoolAttr(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA memory pool attributes """ @@ -3780,11 +3736,10 @@ class cudaMemPoolAttr(IntEnum): #: it was reset. High watermark can only be reset to zero. cudaMemPoolAttrUsedMemHigh = cyruntime.cudaMemPoolAttr.cudaMemPoolAttrUsedMemHigh{{endif}} -_dict_cudaMemPoolAttr = dict(((int(v), v) for k, v in cudaMemPoolAttr.__members__.items())) {{endif}} {{if 'cudaMemLocationType' in found_types}} -class cudaMemLocationType(IntEnum): +class cudaMemLocationType(_FastEnum, metaclass=_FastEnumMetaclass): """ Specifies the type of location """ @@ -3813,11 +3768,10 @@ class cudaMemLocationType(IntEnum): #: id is ignored cudaMemLocationTypeHostNumaCurrent = cyruntime.cudaMemLocationType.cudaMemLocationTypeHostNumaCurrent{{endif}} -_dict_cudaMemLocationType = dict(((int(v), v) for k, v in cudaMemLocationType.__members__.items())) {{endif}} {{if 'cudaMemAccessFlags' in found_types}} -class cudaMemAccessFlags(IntEnum): +class cudaMemAccessFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Specifies the memory protection flags for mapping. """ @@ -3834,11 +3788,10 @@ class cudaMemAccessFlags(IntEnum): #: Make the address range read-write accessible cudaMemAccessFlagsProtReadWrite = cyruntime.cudaMemAccessFlags.cudaMemAccessFlagsProtReadWrite{{endif}} -_dict_cudaMemAccessFlags = dict(((int(v), v) for k, v in cudaMemAccessFlags.__members__.items())) {{endif}} {{if 'cudaMemAllocationType' in found_types}} -class cudaMemAllocationType(IntEnum): +class cudaMemAllocationType(_FastEnum, metaclass=_FastEnumMetaclass): """ Defines the allocation types available """ @@ -3856,11 +3809,10 @@ class cudaMemAllocationType(IntEnum): {{if 'cudaMemAllocationTypeMax' in found_values}} cudaMemAllocationTypeMax = cyruntime.cudaMemAllocationType.cudaMemAllocationTypeMax{{endif}} -_dict_cudaMemAllocationType = dict(((int(v), v) for k, v in cudaMemAllocationType.__members__.items())) {{endif}} {{if 'cudaMemAllocationHandleType' in found_types}} -class cudaMemAllocationHandleType(IntEnum): +class cudaMemAllocationHandleType(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for specifying particular handle types """ @@ -3887,11 +3839,10 @@ class cudaMemAllocationHandleType(IntEnum): #: (cudaMemFabricHandle_t) cudaMemHandleTypeFabric = cyruntime.cudaMemAllocationHandleType.cudaMemHandleTypeFabric{{endif}} -_dict_cudaMemAllocationHandleType = dict(((int(v), v) for k, v in cudaMemAllocationHandleType.__members__.items())) {{endif}} {{if 'cudaGraphMemAttributeType' in found_types}} -class cudaGraphMemAttributeType(IntEnum): +class cudaGraphMemAttributeType(_FastEnum, metaclass=_FastEnumMetaclass): """ Graph memory attributes """ @@ -3918,11 +3869,10 @@ class cudaGraphMemAttributeType(IntEnum): #: allocator. cudaGraphMemAttrReservedMemHigh = cyruntime.cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemHigh{{endif}} -_dict_cudaGraphMemAttributeType = dict(((int(v), v) for k, v in cudaGraphMemAttributeType.__members__.items())) {{endif}} {{if 'cudaMemcpyFlags' in found_types}} -class cudaMemcpyFlags(IntEnum): +class cudaMemcpyFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags to specify for copies within a batch. For more details see :py:obj:`~.cudaMemcpyBatchAsync`. @@ -3935,11 +3885,10 @@ class cudaMemcpyFlags(IntEnum): #: the SMs. cudaMemcpyFlagPreferOverlapWithCompute = cyruntime.cudaMemcpyFlags.cudaMemcpyFlagPreferOverlapWithCompute{{endif}} -_dict_cudaMemcpyFlags = dict(((int(v), v) for k, v in cudaMemcpyFlags.__members__.items())) {{endif}} {{if 'cudaMemcpySrcAccessOrder' in found_types}} -class cudaMemcpySrcAccessOrder(IntEnum): +class cudaMemcpySrcAccessOrder(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -3975,11 +3924,10 @@ class cudaMemcpySrcAccessOrder(IntEnum): {{if 'cudaMemcpySrcAccessOrderMax' in found_values}} cudaMemcpySrcAccessOrderMax = cyruntime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderMax{{endif}} -_dict_cudaMemcpySrcAccessOrder = dict(((int(v), v) for k, v in cudaMemcpySrcAccessOrder.__members__.items())) {{endif}} {{if 'cudaMemcpy3DOperandType' in found_types}} -class cudaMemcpy3DOperandType(IntEnum): +class cudaMemcpy3DOperandType(_FastEnum, metaclass=_FastEnumMetaclass): """ These flags allow applications to convey the operand type for individual copies specified in :py:obj:`~.cudaMemcpy3DBatchAsync`. @@ -3995,11 +3943,10 @@ class cudaMemcpy3DOperandType(IntEnum): {{if 'cudaMemcpyOperandTypeMax' in found_values}} cudaMemcpyOperandTypeMax = cyruntime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypeMax{{endif}} -_dict_cudaMemcpy3DOperandType = dict(((int(v), v) for k, v in cudaMemcpy3DOperandType.__members__.items())) {{endif}} {{if 'cudaDeviceP2PAttr' in found_types}} -class cudaDeviceP2PAttr(IntEnum): +class cudaDeviceP2PAttr(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA device P2P attributes """ @@ -4025,11 +3972,10 @@ class cudaDeviceP2PAttr(IntEnum): #: Only some CUDA-valid atomic operations over the link are supported. cudaDevP2PAttrOnlyPartialNativeAtomicSupported = cyruntime.cudaDeviceP2PAttr.cudaDevP2PAttrOnlyPartialNativeAtomicSupported{{endif}} -_dict_cudaDeviceP2PAttr = dict(((int(v), v) for k, v in cudaDeviceP2PAttr.__members__.items())) {{endif}} {{if 'cudaAtomicOperation' in found_types}} -class cudaAtomicOperation(IntEnum): +class cudaAtomicOperation(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA-valid Atomic Operations """ @@ -4060,11 +4006,10 @@ class cudaAtomicOperation(IntEnum): {{if 'cudaAtomicOperationFloatMax' in found_values}} cudaAtomicOperationFloatMax = cyruntime.cudaAtomicOperation.cudaAtomicOperationFloatMax{{endif}} -_dict_cudaAtomicOperation = dict(((int(v), v) for k, v in cudaAtomicOperation.__members__.items())) {{endif}} {{if 'cudaAtomicOperationCapability' in found_types}} -class cudaAtomicOperationCapability(IntEnum): +class cudaAtomicOperationCapability(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA-valid Atomic Operation capabilities """ @@ -4083,11 +4028,10 @@ class cudaAtomicOperationCapability(IntEnum): {{if 'cudaAtomicCapabilityVector32x4' in found_values}} cudaAtomicCapabilityVector32x4 = cyruntime.cudaAtomicOperationCapability.cudaAtomicCapabilityVector32x4{{endif}} -_dict_cudaAtomicOperationCapability = dict(((int(v), v) for k, v in cudaAtomicOperationCapability.__members__.items())) {{endif}} {{if 'cudaExternalMemoryHandleType' in found_types}} -class cudaExternalMemoryHandleType(IntEnum): +class cudaExternalMemoryHandleType(_FastEnum, metaclass=_FastEnumMetaclass): """ External memory handle types """ @@ -4124,11 +4068,10 @@ class cudaExternalMemoryHandleType(IntEnum): #: Handle is an NvSciBuf object cudaExternalMemoryHandleTypeNvSciBuf = cyruntime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf{{endif}} -_dict_cudaExternalMemoryHandleType = dict(((int(v), v) for k, v in cudaExternalMemoryHandleType.__members__.items())) {{endif}} {{if 'cudaExternalSemaphoreHandleType' in found_types}} -class cudaExternalSemaphoreHandleType(IntEnum): +class cudaExternalSemaphoreHandleType(_FastEnum, metaclass=_FastEnumMetaclass): """ External semaphore handle types """ @@ -4175,11 +4118,10 @@ class cudaExternalSemaphoreHandleType(IntEnum): #: semaphore cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = cyruntime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32{{endif}} -_dict_cudaExternalSemaphoreHandleType = dict(((int(v), v) for k, v in cudaExternalSemaphoreHandleType.__members__.items())) {{endif}} {{if 'cudaDevSmResourceGroup_flags' in found_types}} -class cudaDevSmResourceGroup_flags(IntEnum): +class cudaDevSmResourceGroup_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -4188,11 +4130,10 @@ class cudaDevSmResourceGroup_flags(IntEnum): {{if 'cudaDevSmResourceGroupBackfill' in found_values}} cudaDevSmResourceGroupBackfill = cyruntime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupBackfill{{endif}} -_dict_cudaDevSmResourceGroup_flags = dict(((int(v), v) for k, v in cudaDevSmResourceGroup_flags.__members__.items())) {{endif}} {{if 'cudaDevSmResourceSplitByCount_flags' in found_types}} -class cudaDevSmResourceSplitByCount_flags(IntEnum): +class cudaDevSmResourceSplitByCount_flags(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -4201,11 +4142,10 @@ class cudaDevSmResourceSplitByCount_flags(IntEnum): {{if 'cudaDevSmResourceSplitMaxPotentialClusterSize' in found_values}} cudaDevSmResourceSplitMaxPotentialClusterSize = cyruntime.cudaDevSmResourceSplitByCount_flags.cudaDevSmResourceSplitMaxPotentialClusterSize{{endif}} -_dict_cudaDevSmResourceSplitByCount_flags = dict(((int(v), v) for k, v in cudaDevSmResourceSplitByCount_flags.__members__.items())) {{endif}} {{if 'cudaDevResourceType' in found_types}} -class cudaDevResourceType(IntEnum): +class cudaDevResourceType(_FastEnum, metaclass=_FastEnumMetaclass): """ Type of resource """ @@ -4224,11 +4164,10 @@ class cudaDevResourceType(IntEnum): #: Pre-existing workqueue related information cudaDevResourceTypeWorkqueue = cyruntime.cudaDevResourceType.cudaDevResourceTypeWorkqueue{{endif}} -_dict_cudaDevResourceType = dict(((int(v), v) for k, v in cudaDevResourceType.__members__.items())) {{endif}} {{if 'cudaDevWorkqueueConfigScope' in found_types}} -class cudaDevWorkqueueConfigScope(IntEnum): +class cudaDevWorkqueueConfigScope(_FastEnum, metaclass=_FastEnumMetaclass): """ Sharing scope for workqueues """ @@ -4243,11 +4182,10 @@ class cudaDevWorkqueueConfigScope(IntEnum): #: balanced green contexts. cudaDevWorkqueueConfigScopeGreenCtxBalanced = cyruntime.cudaDevWorkqueueConfigScope.cudaDevWorkqueueConfigScopeGreenCtxBalanced{{endif}} -_dict_cudaDevWorkqueueConfigScope = dict(((int(v), v) for k, v in cudaDevWorkqueueConfigScope.__members__.items())) {{endif}} {{if 'cudaJitOption' in found_types}} -class cudaJitOption(IntEnum): +class cudaJitOption(_FastEnum, metaclass=_FastEnumMetaclass): """ Online compiler and linker options """ @@ -4392,11 +4330,10 @@ class cudaJitOption(IntEnum): #: Applies to: compiler only cudaJitOverrideDirectiveValues = cyruntime.cudaJitOption.cudaJitOverrideDirectiveValues{{endif}} -_dict_cudaJitOption = dict(((int(v), v) for k, v in cudaJitOption.__members__.items())) {{endif}} {{if 'cudaLibraryOption' in found_types}} -class cudaLibraryOption(IntEnum): +class cudaLibraryOption(_FastEnum, metaclass=_FastEnumMetaclass): """ Library options to be specified with :py:obj:`~.cudaLibraryLoadData()` or @@ -4417,11 +4354,10 @@ class cudaLibraryOption(IntEnum): #: :py:obj:`~.cudaErrorInvalidValue`. cudaLibraryBinaryIsPreserved = cyruntime.cudaLibraryOption.cudaLibraryBinaryIsPreserved{{endif}} -_dict_cudaLibraryOption = dict(((int(v), v) for k, v in cudaLibraryOption.__members__.items())) {{endif}} {{if 'cudaJit_CacheMode' in found_types}} -class cudaJit_CacheMode(IntEnum): +class cudaJit_CacheMode(_FastEnum, metaclass=_FastEnumMetaclass): """ Caching modes for dlcm """ @@ -4438,11 +4374,10 @@ class cudaJit_CacheMode(IntEnum): #: Compile with L1 cache enabled cudaJitCacheOptionCA = cyruntime.cudaJit_CacheMode.cudaJitCacheOptionCA{{endif}} -_dict_cudaJit_CacheMode = dict(((int(v), v) for k, v in cudaJit_CacheMode.__members__.items())) {{endif}} {{if 'cudaJit_Fallback' in found_types}} -class cudaJit_Fallback(IntEnum): +class cudaJit_Fallback(_FastEnum, metaclass=_FastEnumMetaclass): """ Cubin matching fallback strategies """ @@ -4456,11 +4391,10 @@ class cudaJit_Fallback(IntEnum): #: found cudaPreferBinary = cyruntime.cudaJit_Fallback.cudaPreferBinary{{endif}} -_dict_cudaJit_Fallback = dict(((int(v), v) for k, v in cudaJit_Fallback.__members__.items())) {{endif}} {{if 'cudaCGScope' in found_types}} -class cudaCGScope(IntEnum): +class cudaCGScope(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA cooperative group scope """ @@ -4477,11 +4411,10 @@ class cudaCGScope(IntEnum): #: Reserved cudaCGScopeReserved = cyruntime.cudaCGScope.cudaCGScopeReserved{{endif}} -_dict_cudaCGScope = dict(((int(v), v) for k, v in cudaCGScope.__members__.items())) {{endif}} {{if 'cudaGraphConditionalHandleFlags' in found_types}} -class cudaGraphConditionalHandleFlags(IntEnum): +class cudaGraphConditionalHandleFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ """ @@ -4490,11 +4423,10 @@ class cudaGraphConditionalHandleFlags(IntEnum): #: Apply default handle value when graph is launched. cudaGraphCondAssignDefault = cyruntime.cudaGraphConditionalHandleFlags.cudaGraphCondAssignDefault{{endif}} -_dict_cudaGraphConditionalHandleFlags = dict(((int(v), v) for k, v in cudaGraphConditionalHandleFlags.__members__.items())) {{endif}} {{if 'cudaGraphConditionalNodeType' in found_types}} -class cudaGraphConditionalNodeType(IntEnum): +class cudaGraphConditionalNodeType(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA conditional node types """ @@ -4516,11 +4448,10 @@ class cudaGraphConditionalNodeType(IntEnum): #: index, no body is launched. cudaGraphCondTypeSwitch = cyruntime.cudaGraphConditionalNodeType.cudaGraphCondTypeSwitch{{endif}} -_dict_cudaGraphConditionalNodeType = dict(((int(v), v) for k, v in cudaGraphConditionalNodeType.__members__.items())) {{endif}} {{if 'cudaGraphNodeType' in found_types}} -class cudaGraphNodeType(IntEnum): +class cudaGraphNodeType(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Graph node types """ @@ -4603,11 +4534,10 @@ class cudaGraphNodeType(IntEnum): {{if 'cudaGraphNodeTypeCount' in found_values}} cudaGraphNodeTypeCount = cyruntime.cudaGraphNodeType.cudaGraphNodeTypeCount{{endif}} -_dict_cudaGraphNodeType = dict(((int(v), v) for k, v in cudaGraphNodeType.__members__.items())) {{endif}} {{if 'cudaGraphChildGraphNodeOwnership' in found_types}} -class cudaGraphChildGraphNodeOwnership(IntEnum): +class cudaGraphChildGraphNodeOwnership(_FastEnum, metaclass=_FastEnumMetaclass): """ Child graph node ownership """ @@ -4630,11 +4560,10 @@ class cudaGraphChildGraphNodeOwnership(IntEnum): #: additional memory allocation or free nodes added. cudaGraphChildGraphOwnershipMove = cyruntime.cudaGraphChildGraphNodeOwnership.cudaGraphChildGraphOwnershipMove{{endif}} -_dict_cudaGraphChildGraphNodeOwnership = dict(((int(v), v) for k, v in cudaGraphChildGraphNodeOwnership.__members__.items())) {{endif}} {{if 'cudaGraphExecUpdateResult' in found_types}} -class cudaGraphExecUpdateResult(IntEnum): +class cudaGraphExecUpdateResult(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Graph Update error types """ @@ -4680,11 +4609,10 @@ class cudaGraphExecUpdateResult(IntEnum): #: is not supported cudaGraphExecUpdateErrorAttributesChanged = cyruntime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorAttributesChanged{{endif}} -_dict_cudaGraphExecUpdateResult = dict(((int(v), v) for k, v in cudaGraphExecUpdateResult.__members__.items())) {{endif}} {{if 'cudaGraphKernelNodeField' in found_types}} -class cudaGraphKernelNodeField(IntEnum): +class cudaGraphKernelNodeField(_FastEnum, metaclass=_FastEnumMetaclass): """ Specifies the field to update when performing multiple node updates from the device @@ -4706,11 +4634,10 @@ class cudaGraphKernelNodeField(IntEnum): #: Node enable/disable cudaGraphKernelNodeFieldEnabled = cyruntime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldEnabled{{endif}} -_dict_cudaGraphKernelNodeField = dict(((int(v), v) for k, v in cudaGraphKernelNodeField.__members__.items())) {{endif}} {{if 'cudaGetDriverEntryPointFlags' in found_types}} -class cudaGetDriverEntryPointFlags(IntEnum): +class cudaGetDriverEntryPointFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags to specify search options to be used with :py:obj:`~.cudaGetDriverEntryPoint` For more details see @@ -4729,11 +4656,10 @@ class cudaGetDriverEntryPointFlags(IntEnum): #: Search for per-thread versions of driver symbols. cudaEnablePerThreadDefaultStream = cyruntime.cudaGetDriverEntryPointFlags.cudaEnablePerThreadDefaultStream{{endif}} -_dict_cudaGetDriverEntryPointFlags = dict(((int(v), v) for k, v in cudaGetDriverEntryPointFlags.__members__.items())) {{endif}} {{if 'cudaDriverEntryPointQueryResult' in found_types}} -class cudaDriverEntryPointQueryResult(IntEnum): +class cudaDriverEntryPointQueryResult(_FastEnum, metaclass=_FastEnumMetaclass): """ Enum for status from obtaining driver entry points, used with :py:obj:`~.cudaApiGetDriverEntryPoint` @@ -4751,11 +4677,10 @@ class cudaDriverEntryPointQueryResult(IntEnum): #: Search for symbol was found but version wasn't great enough cudaDriverEntryPointVersionNotSufficent = cyruntime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointVersionNotSufficent{{endif}} -_dict_cudaDriverEntryPointQueryResult = dict(((int(v), v) for k, v in cudaDriverEntryPointQueryResult.__members__.items())) {{endif}} {{if 'cudaGraphDebugDotFlags' in found_types}} -class cudaGraphDebugDotFlags(IntEnum): +class cudaGraphDebugDotFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Graph debug write options """ @@ -4805,11 +4730,10 @@ class cudaGraphDebugDotFlags(IntEnum): #: Adds :py:obj:`~.cudaConditionalNodeParams` to output cudaGraphDebugDotFlagsConditionalNodeParams = cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsConditionalNodeParams{{endif}} -_dict_cudaGraphDebugDotFlags = dict(((int(v), v) for k, v in cudaGraphDebugDotFlags.__members__.items())) {{endif}} {{if 'cudaGraphInstantiateFlags' in found_types}} -class cudaGraphInstantiateFlags(IntEnum): +class cudaGraphInstantiateFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ Flags for instantiating a graph """ @@ -4839,11 +4763,10 @@ class cudaGraphInstantiateFlags(IntEnum): #: priority of the stream it is launched into. cudaGraphInstantiateFlagUseNodePriority = cyruntime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUseNodePriority{{endif}} -_dict_cudaGraphInstantiateFlags = dict(((int(v), v) for k, v in cudaGraphInstantiateFlags.__members__.items())) {{endif}} {{if 'cudaDeviceNumaConfig' in found_types}} -class cudaDeviceNumaConfig(IntEnum): +class cudaDeviceNumaConfig(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA device NUMA config """ @@ -4856,11 +4779,10 @@ class cudaDeviceNumaConfig(IntEnum): #: The GPU is a NUMA node, cudaDevAttrNumaId contains its NUMA ID cudaDeviceNumaConfigNumaNode = cyruntime.cudaDeviceNumaConfig.cudaDeviceNumaConfigNumaNode{{endif}} -_dict_cudaDeviceNumaConfig = dict(((int(v), v) for k, v in cudaDeviceNumaConfig.__members__.items())) {{endif}} {{if 'cudaSurfaceBoundaryMode' in found_types}} -class cudaSurfaceBoundaryMode(IntEnum): +class cudaSurfaceBoundaryMode(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Surface boundary modes """ @@ -4877,11 +4799,10 @@ class cudaSurfaceBoundaryMode(IntEnum): #: Trap boundary mode cudaBoundaryModeTrap = cyruntime.cudaSurfaceBoundaryMode.cudaBoundaryModeTrap{{endif}} -_dict_cudaSurfaceBoundaryMode = dict(((int(v), v) for k, v in cudaSurfaceBoundaryMode.__members__.items())) {{endif}} {{if 'cudaSurfaceFormatMode' in found_types}} -class cudaSurfaceFormatMode(IntEnum): +class cudaSurfaceFormatMode(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA Surface format modes """ @@ -4894,11 +4815,10 @@ class cudaSurfaceFormatMode(IntEnum): #: Auto format mode cudaFormatModeAuto = cyruntime.cudaSurfaceFormatMode.cudaFormatModeAuto{{endif}} -_dict_cudaSurfaceFormatMode = dict(((int(v), v) for k, v in cudaSurfaceFormatMode.__members__.items())) {{endif}} {{if 'cudaTextureAddressMode' in found_types}} -class cudaTextureAddressMode(IntEnum): +class cudaTextureAddressMode(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA texture address modes """ @@ -4919,11 +4839,10 @@ class cudaTextureAddressMode(IntEnum): #: Border address mode cudaAddressModeBorder = cyruntime.cudaTextureAddressMode.cudaAddressModeBorder{{endif}} -_dict_cudaTextureAddressMode = dict(((int(v), v) for k, v in cudaTextureAddressMode.__members__.items())) {{endif}} {{if 'cudaTextureFilterMode' in found_types}} -class cudaTextureFilterMode(IntEnum): +class cudaTextureFilterMode(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA texture filter modes """ @@ -4936,11 +4855,10 @@ class cudaTextureFilterMode(IntEnum): #: Linear filter mode cudaFilterModeLinear = cyruntime.cudaTextureFilterMode.cudaFilterModeLinear{{endif}} -_dict_cudaTextureFilterMode = dict(((int(v), v) for k, v in cudaTextureFilterMode.__members__.items())) {{endif}} {{if 'cudaTextureReadMode' in found_types}} -class cudaTextureReadMode(IntEnum): +class cudaTextureReadMode(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA texture read modes """ @@ -4953,11 +4871,10 @@ class cudaTextureReadMode(IntEnum): #: Read texture as normalized float cudaReadModeNormalizedFloat = cyruntime.cudaTextureReadMode.cudaReadModeNormalizedFloat{{endif}} -_dict_cudaTextureReadMode = dict(((int(v), v) for k, v in cudaTextureReadMode.__members__.items())) {{endif}} {{if 'cudaRoundMode' in found_types}} -class cudaRoundMode(IntEnum): +class cudaRoundMode(_FastEnum, metaclass=_FastEnumMetaclass): """""" {{if 'cudaRoundNearest' in found_values}} cudaRoundNearest = cyruntime.cudaRoundMode.cudaRoundNearest{{endif}} @@ -4968,11 +4885,10 @@ class cudaRoundMode(IntEnum): {{if 'cudaRoundMinInf' in found_values}} cudaRoundMinInf = cyruntime.cudaRoundMode.cudaRoundMinInf{{endif}} -_dict_cudaRoundMode = dict(((int(v), v) for k, v in cudaRoundMode.__members__.items())) {{endif}} {{if True}} -class cudaGLDeviceList(IntEnum): +class cudaGLDeviceList(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA devices corresponding to the current OpenGL context """ @@ -4991,11 +4907,10 @@ class cudaGLDeviceList(IntEnum): #: context in the next frame cudaGLDeviceListNextFrame = cyruntime.cudaGLDeviceList.cudaGLDeviceListNextFrame{{endif}} -_dict_cudaGLDeviceList = dict(((int(v), v) for k, v in cudaGLDeviceList.__members__.items())) {{endif}} {{if True}} -class cudaGLMapFlags(IntEnum): +class cudaGLMapFlags(_FastEnum, metaclass=_FastEnumMetaclass): """ CUDA GL Map Flags """ @@ -5012,11 +4927,10 @@ class cudaGLMapFlags(IntEnum): #: CUDA kernels will only write to and will not read from this resource cudaGLMapFlagsWriteDiscard = cyruntime.cudaGLMapFlags.cudaGLMapFlagsWriteDiscard{{endif}} -_dict_cudaGLMapFlags = dict(((int(v), v) for k, v in cudaGLMapFlags.__members__.items())) {{endif}} {{if 'cudaLaunchAttributeID' in found_types}} -class cudaStreamAttrID(IntEnum): +class cudaStreamAttrID(_FastEnum, metaclass=_FastEnumMetaclass): """ Launch attributes enum; used as id field of :py:obj:`~.cudaLaunchAttribute` @@ -5226,11 +5140,10 @@ class cudaStreamAttrID(IntEnum): #: 0 (disabled) and 1 (enabled). cudaLaunchAttributeNvlinkUtilCentricScheduling = cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeNvlinkUtilCentricScheduling{{endif}} -_dict_cudaLaunchAttributeID = dict(((int(v), v) for k, v in cudaLaunchAttributeID.__members__.items())) {{endif}} {{if 'cudaLaunchAttributeID' in found_types}} -class cudaKernelNodeAttrID(IntEnum): +class cudaKernelNodeAttrID(_FastEnum, metaclass=_FastEnumMetaclass): """ Launch attributes enum; used as id field of :py:obj:`~.cudaLaunchAttribute` @@ -5440,7 +5353,6 @@ class cudaKernelNodeAttrID(IntEnum): #: 0 (disabled) and 1 (enabled). cudaLaunchAttributeNvlinkUtilCentricScheduling = cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeNvlinkUtilCentricScheduling{{endif}} -_dict_cudaLaunchAttributeID = dict(((int(v), v) for k, v in cudaLaunchAttributeID.__members__.items())) {{endif}} {{if 'cudaDevResourceDesc_t' in found_types}} @@ -6379,9 +6291,7 @@ cdef class cudaChannelFormatDesc: {{if 'cudaChannelFormatDesc.f' in found_struct}} @property def f(self): - if self._pvt_ptr[0].f not in _dict_cudaChannelFormatKind: - return None - return _dict_cudaChannelFormatKind[self._pvt_ptr[0].f] + return cudaChannelFormatKind(self._pvt_ptr[0].f) @f.setter def f(self, f not None : cudaChannelFormatKind): self._pvt_ptr[0].f = int(f) @@ -7167,9 +7077,7 @@ cdef class cudaMemcpy3DParms: {{if 'cudaMemcpy3DParms.kind' in found_struct}} @property def kind(self): - if self._pvt_ptr[0].kind not in _dict_cudaMemcpyKind: - return None - return _dict_cudaMemcpyKind[self._pvt_ptr[0].kind] + return cudaMemcpyKind(self._pvt_ptr[0].kind) @kind.setter def kind(self, kind not None : cudaMemcpyKind): self._pvt_ptr[0].kind = int(kind) @@ -7961,9 +7869,7 @@ cdef class cudaAccessPolicyWindow: {{if 'cudaAccessPolicyWindow.hitProp' in found_struct}} @property def hitProp(self): - if self._pvt_ptr[0].hitProp not in _dict_cudaAccessProperty: - return None - return _dict_cudaAccessProperty[self._pvt_ptr[0].hitProp] + return cudaAccessProperty(self._pvt_ptr[0].hitProp) @hitProp.setter def hitProp(self, hitProp not None : cudaAccessProperty): self._pvt_ptr[0].hitProp = int(hitProp) @@ -7971,9 +7877,7 @@ cdef class cudaAccessPolicyWindow: {{if 'cudaAccessPolicyWindow.missProp' in found_struct}} @property def missProp(self): - if self._pvt_ptr[0].missProp not in _dict_cudaAccessProperty: - return None - return _dict_cudaAccessProperty[self._pvt_ptr[0].missProp] + return cudaAccessProperty(self._pvt_ptr[0].missProp) @missProp.setter def missProp(self, missProp not None : cudaAccessProperty): self._pvt_ptr[0].missProp = int(missProp) @@ -8713,9 +8617,7 @@ cdef class cudaResourceDesc: {{if 'cudaResourceDesc.resType' in found_struct}} @property def resType(self): - if self._pvt_ptr[0].resType not in _dict_cudaResourceType: - return None - return _dict_cudaResourceType[self._pvt_ptr[0].resType] + return cudaResourceType(self._pvt_ptr[0].resType) @resType.setter def resType(self, resType not None : cudaResourceType): self._pvt_ptr[0].resType = int(resType) @@ -8861,9 +8763,7 @@ cdef class cudaResourceViewDesc: {{if 'cudaResourceViewDesc.format' in found_struct}} @property def format(self): - if self._pvt_ptr[0].format not in _dict_cudaResourceViewFormat: - return None - return _dict_cudaResourceViewFormat[self._pvt_ptr[0].format] + return cudaResourceViewFormat(self._pvt_ptr[0].format) @format.setter def format(self, format not None : cudaResourceViewFormat): self._pvt_ptr[0].format = int(format) @@ -9028,9 +8928,7 @@ cdef class cudaPointerAttributes: {{if 'cudaPointerAttributes.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_cudaMemoryType: - return None - return _dict_cudaMemoryType[self._pvt_ptr[0].type] + return cudaMemoryType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : cudaMemoryType): self._pvt_ptr[0].type = int(type) @@ -9502,9 +9400,7 @@ cdef class cudaMemLocation: {{if 'cudaMemLocation.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_cudaMemLocationType: - return None - return _dict_cudaMemLocationType[self._pvt_ptr[0].type] + return cudaMemLocationType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : cudaMemLocationType): self._pvt_ptr[0].type = int(type) @@ -9583,9 +9479,7 @@ cdef class cudaMemAccessDesc: {{if 'cudaMemAccessDesc.flags' in found_struct}} @property def flags(self): - if self._pvt_ptr[0].flags not in _dict_cudaMemAccessFlags: - return None - return _dict_cudaMemAccessFlags[self._pvt_ptr[0].flags] + return cudaMemAccessFlags(self._pvt_ptr[0].flags) @flags.setter def flags(self, flags not None : cudaMemAccessFlags): self._pvt_ptr[0].flags = int(flags) @@ -9704,9 +9598,7 @@ cdef class cudaMemPoolProps: {{if 'cudaMemPoolProps.allocType' in found_struct}} @property def allocType(self): - if self._pvt_ptr[0].allocType not in _dict_cudaMemAllocationType: - return None - return _dict_cudaMemAllocationType[self._pvt_ptr[0].allocType] + return cudaMemAllocationType(self._pvt_ptr[0].allocType) @allocType.setter def allocType(self, allocType not None : cudaMemAllocationType): self._pvt_ptr[0].allocType = int(allocType) @@ -9714,9 +9606,7 @@ cdef class cudaMemPoolProps: {{if 'cudaMemPoolProps.handleTypes' in found_struct}} @property def handleTypes(self): - if self._pvt_ptr[0].handleTypes not in _dict_cudaMemAllocationHandleType: - return None - return _dict_cudaMemAllocationHandleType[self._pvt_ptr[0].handleTypes] + return cudaMemAllocationHandleType(self._pvt_ptr[0].handleTypes) @handleTypes.setter def handleTypes(self, handleTypes not None : cudaMemAllocationHandleType): self._pvt_ptr[0].handleTypes = int(handleTypes) @@ -10253,9 +10143,7 @@ cdef class cudaMemcpyAttributes: {{if 'cudaMemcpyAttributes.srcAccessOrder' in found_struct}} @property def srcAccessOrder(self): - if self._pvt_ptr[0].srcAccessOrder not in _dict_cudaMemcpySrcAccessOrder: - return None - return _dict_cudaMemcpySrcAccessOrder[self._pvt_ptr[0].srcAccessOrder] + return cudaMemcpySrcAccessOrder(self._pvt_ptr[0].srcAccessOrder) @srcAccessOrder.setter def srcAccessOrder(self, srcAccessOrder not None : cudaMemcpySrcAccessOrder): self._pvt_ptr[0].srcAccessOrder = int(srcAccessOrder) @@ -10683,9 +10571,7 @@ cdef class cudaMemcpy3DOperand: {{if 'cudaMemcpy3DOperand.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_cudaMemcpy3DOperandType: - return None - return _dict_cudaMemcpy3DOperandType[self._pvt_ptr[0].type] + return cudaMemcpy3DOperandType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : cudaMemcpy3DOperandType): self._pvt_ptr[0].type = int(type) @@ -10815,9 +10701,7 @@ cdef class cudaMemcpy3DBatchOp: {{if 'cudaMemcpy3DBatchOp.srcAccessOrder' in found_struct}} @property def srcAccessOrder(self): - if self._pvt_ptr[0].srcAccessOrder not in _dict_cudaMemcpySrcAccessOrder: - return None - return _dict_cudaMemcpySrcAccessOrder[self._pvt_ptr[0].srcAccessOrder] + return cudaMemcpySrcAccessOrder(self._pvt_ptr[0].srcAccessOrder) @srcAccessOrder.setter def srcAccessOrder(self, srcAccessOrder not None : cudaMemcpySrcAccessOrder): self._pvt_ptr[0].srcAccessOrder = int(srcAccessOrder) @@ -13042,9 +12926,7 @@ cdef class cudaExternalMemoryHandleDesc: {{if 'cudaExternalMemoryHandleDesc.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_cudaExternalMemoryHandleType: - return None - return _dict_cudaExternalMemoryHandleType[self._pvt_ptr[0].type] + return cudaExternalMemoryHandleType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : cudaExternalMemoryHandleType): self._pvt_ptr[0].type = int(type) @@ -13565,9 +13447,7 @@ cdef class cudaExternalSemaphoreHandleDesc: {{if 'cudaExternalSemaphoreHandleDesc.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_cudaExternalSemaphoreHandleType: - return None - return _dict_cudaExternalSemaphoreHandleType[self._pvt_ptr[0].type] + return cudaExternalSemaphoreHandleType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : cudaExternalSemaphoreHandleType): self._pvt_ptr[0].type = int(type) @@ -14529,9 +14409,7 @@ cdef class cudaDevWorkqueueConfigResource: {{if 'cudaDevWorkqueueConfigResource.sharingScope' in found_struct}} @property def sharingScope(self): - if self._pvt_ptr[0].sharingScope not in _dict_cudaDevWorkqueueConfigScope: - return None - return _dict_cudaDevWorkqueueConfigScope[self._pvt_ptr[0].sharingScope] + return cudaDevWorkqueueConfigScope(self._pvt_ptr[0].sharingScope) @sharingScope.setter def sharingScope(self, sharingScope not None : cudaDevWorkqueueConfigScope): self._pvt_ptr[0].sharingScope = int(sharingScope) @@ -14849,9 +14727,7 @@ cdef class cudaDevResource_st: {{if 'cudaDevResource_st.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_cudaDevResourceType: - return None - return _dict_cudaDevResourceType[self._pvt_ptr[0].type] + return cudaDevResourceType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : cudaDevResourceType): self._pvt_ptr[0].type = int(type) @@ -15983,9 +15859,7 @@ cdef class cudaConditionalNodeParams: {{if 'cudaConditionalNodeParams.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_cudaGraphConditionalNodeType: - return None - return _dict_cudaGraphConditionalNodeType[self._pvt_ptr[0].type] + return cudaGraphConditionalNodeType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : cudaGraphConditionalNodeType): self._pvt_ptr[0].type = int(type) @@ -16100,9 +15974,7 @@ cdef class cudaChildGraphNodeParams: {{if 'cudaChildGraphNodeParams.ownership' in found_struct}} @property def ownership(self): - if self._pvt_ptr[0].ownership not in _dict_cudaGraphChildGraphNodeOwnership: - return None - return _dict_cudaGraphChildGraphNodeOwnership[self._pvt_ptr[0].ownership] + return cudaGraphChildGraphNodeOwnership(self._pvt_ptr[0].ownership) @ownership.setter def ownership(self, ownership not None : cudaGraphChildGraphNodeOwnership): self._pvt_ptr[0].ownership = int(ownership) @@ -16464,9 +16336,7 @@ cdef class cudaGraphNodeParams: {{if 'cudaGraphNodeParams.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_cudaGraphNodeType: - return None - return _dict_cudaGraphNodeType[self._pvt_ptr[0].type] + return cudaGraphNodeType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : cudaGraphNodeType): self._pvt_ptr[0].type = int(type) @@ -16840,9 +16710,7 @@ cdef class cudaGraphInstantiateParams_st: {{if 'cudaGraphInstantiateParams_st.result_out' in found_struct}} @property def result_out(self): - if self._pvt_ptr[0].result_out not in _dict_cudaGraphInstantiateResult: - return None - return _dict_cudaGraphInstantiateResult[self._pvt_ptr[0].result_out] + return cudaGraphInstantiateResult(self._pvt_ptr[0].result_out) @result_out.setter def result_out(self, result_out not None : cudaGraphInstantiateResult): self._pvt_ptr[0].result_out = int(result_out) @@ -16921,9 +16789,7 @@ cdef class cudaGraphExecUpdateResultInfo_st: {{if 'cudaGraphExecUpdateResultInfo_st.result' in found_struct}} @property def result(self): - if self._pvt_ptr[0].result not in _dict_cudaGraphExecUpdateResult: - return None - return _dict_cudaGraphExecUpdateResult[self._pvt_ptr[0].result] + return cudaGraphExecUpdateResult(self._pvt_ptr[0].result) @result.setter def result(self, result not None : cudaGraphExecUpdateResult): self._pvt_ptr[0].result = int(result) @@ -17225,9 +17091,7 @@ cdef class cudaGraphKernelNodeUpdate: {{if 'cudaGraphKernelNodeUpdate.field' in found_struct}} @property def field(self): - if self._pvt_ptr[0].field not in _dict_cudaGraphKernelNodeField: - return None - return _dict_cudaGraphKernelNodeField[self._pvt_ptr[0].field] + return cudaGraphKernelNodeField(self._pvt_ptr[0].field) @field.setter def field(self, field not None : cudaGraphKernelNodeField): self._pvt_ptr[0].field = int(field) @@ -18017,9 +17881,7 @@ cdef class cudaLaunchAttributeValue: {{if 'cudaLaunchAttributeValue.syncPolicy' in found_struct}} @property def syncPolicy(self): - if self._pvt_ptr[0].syncPolicy not in _dict_cudaSynchronizationPolicy: - return None - return _dict_cudaSynchronizationPolicy[self._pvt_ptr[0].syncPolicy] + return cudaSynchronizationPolicy(self._pvt_ptr[0].syncPolicy) @syncPolicy.setter def syncPolicy(self, syncPolicy not None : cudaSynchronizationPolicy): self._pvt_ptr[0].syncPolicy = int(syncPolicy) @@ -18035,9 +17897,7 @@ cdef class cudaLaunchAttributeValue: {{if 'cudaLaunchAttributeValue.clusterSchedulingPolicyPreference' in found_struct}} @property def clusterSchedulingPolicyPreference(self): - if self._pvt_ptr[0].clusterSchedulingPolicyPreference not in _dict_cudaClusterSchedulingPolicy: - return None - return _dict_cudaClusterSchedulingPolicy[self._pvt_ptr[0].clusterSchedulingPolicyPreference] + return cudaClusterSchedulingPolicy(self._pvt_ptr[0].clusterSchedulingPolicyPreference) @clusterSchedulingPolicyPreference.setter def clusterSchedulingPolicyPreference(self, clusterSchedulingPolicyPreference not None : cudaClusterSchedulingPolicy): self._pvt_ptr[0].clusterSchedulingPolicyPreference = int(clusterSchedulingPolicyPreference) @@ -18077,9 +17937,7 @@ cdef class cudaLaunchAttributeValue: {{if 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} @property def memSyncDomain(self): - if self._pvt_ptr[0].memSyncDomain not in _dict_cudaLaunchMemSyncDomain: - return None - return _dict_cudaLaunchMemSyncDomain[self._pvt_ptr[0].memSyncDomain] + return cudaLaunchMemSyncDomain(self._pvt_ptr[0].memSyncDomain) @memSyncDomain.setter def memSyncDomain(self, memSyncDomain not None : cudaLaunchMemSyncDomain): self._pvt_ptr[0].memSyncDomain = int(memSyncDomain) @@ -18182,9 +18040,7 @@ cdef class cudaLaunchAttribute_st: {{if 'cudaLaunchAttribute_st.id' in found_struct}} @property def id(self): - if self._pvt_ptr[0].id not in _dict_cudaLaunchAttributeID: - return None - return _dict_cudaLaunchAttributeID[self._pvt_ptr[0].id] + return cudaLaunchAttributeID(self._pvt_ptr[0].id) @id.setter def id(self, id not None : cudaLaunchAttributeID): self._pvt_ptr[0].id = int(id) @@ -18353,9 +18209,7 @@ cdef class cudaAsyncNotificationInfo: {{if 'cudaAsyncNotificationInfo.type' in found_struct}} @property def type(self): - if self._pvt_ptr[0].type not in _dict_cudaAsyncNotificationType: - return None - return _dict_cudaAsyncNotificationType[self._pvt_ptr[0].type] + return cudaAsyncNotificationType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : cudaAsyncNotificationType): self._pvt_ptr[0].type = int(type) @@ -18533,7 +18387,7 @@ cdef class cudaTextureDesc: {{if 'cudaTextureDesc.addressMode' in found_struct}} @property def addressMode(self): - return [_dict_cudaTextureAddressMode[_x] if _x in _dict_cudaTextureAddressMode else None for _x in list(self._pvt_ptr[0].addressMode)] + return [cudaTextureAddressMode(_x) for _x in list(self._pvt_ptr[0].addressMode)] @addressMode.setter def addressMode(self, addressMode): self._pvt_ptr[0].addressMode = [int(_x) for _x in addressMode] @@ -18541,9 +18395,7 @@ cdef class cudaTextureDesc: {{if 'cudaTextureDesc.filterMode' in found_struct}} @property def filterMode(self): - if self._pvt_ptr[0].filterMode not in _dict_cudaTextureFilterMode: - return None - return _dict_cudaTextureFilterMode[self._pvt_ptr[0].filterMode] + return cudaTextureFilterMode(self._pvt_ptr[0].filterMode) @filterMode.setter def filterMode(self, filterMode not None : cudaTextureFilterMode): self._pvt_ptr[0].filterMode = int(filterMode) @@ -18551,9 +18403,7 @@ cdef class cudaTextureDesc: {{if 'cudaTextureDesc.readMode' in found_struct}} @property def readMode(self): - if self._pvt_ptr[0].readMode not in _dict_cudaTextureReadMode: - return None - return _dict_cudaTextureReadMode[self._pvt_ptr[0].readMode] + return cudaTextureReadMode(self._pvt_ptr[0].readMode) @readMode.setter def readMode(self, readMode not None : cudaTextureReadMode): self._pvt_ptr[0].readMode = int(readMode) @@ -18593,9 +18443,7 @@ cdef class cudaTextureDesc: {{if 'cudaTextureDesc.mipmapFilterMode' in found_struct}} @property def mipmapFilterMode(self): - if self._pvt_ptr[0].mipmapFilterMode not in _dict_cudaTextureFilterMode: - return None - return _dict_cudaTextureFilterMode[self._pvt_ptr[0].mipmapFilterMode] + return cudaTextureFilterMode(self._pvt_ptr[0].mipmapFilterMode) @mipmapFilterMode.setter def mipmapFilterMode(self, mipmapFilterMode not None : cudaTextureFilterMode): self._pvt_ptr[0].mipmapFilterMode = int(mipmapFilterMode) @@ -19006,9 +18854,7 @@ cdef class cudaEglFrame_st: {{if True}} @property def frameType(self): - if self._pvt_ptr[0].frameType not in _dict_cudaEglFrameType: - return None - return _dict_cudaEglFrameType[self._pvt_ptr[0].frameType] + return cudaEglFrameType(self._pvt_ptr[0].frameType) @frameType.setter def frameType(self, frameType not None : cudaEglFrameType): self._pvt_ptr[0].frameType = int(frameType) @@ -19016,9 +18862,7 @@ cdef class cudaEglFrame_st: {{if True}} @property def eglColorFormat(self): - if self._pvt_ptr[0].eglColorFormat not in _dict_cudaEglColorFormat: - return None - return _dict_cudaEglColorFormat[self._pvt_ptr[0].eglColorFormat] + return cudaEglColorFormat(self._pvt_ptr[0].eglColorFormat) @eglColorFormat.setter def eglColorFormat(self, eglColorFormat not None : cudaEglColorFormat): self._pvt_ptr[0].eglColorFormat = int(eglColorFormat) @@ -19382,7 +19226,7 @@ def cudaDeviceReset(): """ with nogil: err = cyruntime.cudaDeviceReset() - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceSynchronize' in found_functions}} @@ -19409,7 +19253,7 @@ def cudaDeviceSynchronize(): """ with nogil: err = cyruntime.cudaDeviceSynchronize() - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceSetLimit' in found_functions}} @@ -19512,7 +19356,7 @@ def cudaDeviceSetLimit(limit not None : cudaLimit, size_t value): cdef cyruntime.cudaLimit cylimit = int(limit) with nogil: err = cyruntime.cudaDeviceSetLimit(cylimit, value) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceGetLimit' in found_functions}} @@ -19571,8 +19415,8 @@ def cudaDeviceGetLimit(limit not None : cudaLimit): with nogil: err = cyruntime.cudaDeviceGetLimit(&pValue, cylimit) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pValue) + return (cudaError_t(err), None) + return (cudaError_t(err), pValue) {{endif}} {{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}} @@ -19609,8 +19453,8 @@ def cudaDeviceGetTexture1DLinearMaxWidth(fmtDesc : Optional[cudaChannelFormatDes with nogil: err = cyruntime.cudaDeviceGetTexture1DLinearMaxWidth(&maxWidthInElements, cyfmtDesc_ptr, device) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], maxWidthInElements) + return (cudaError_t(err), None) + return (cudaError_t(err), maxWidthInElements) {{endif}} {{if 'cudaDeviceGetCacheConfig' in found_functions}} @@ -19659,8 +19503,8 @@ def cudaDeviceGetCacheConfig(): with nogil: err = cyruntime.cudaDeviceGetCacheConfig(&pCacheConfig) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], cudaFuncCache(pCacheConfig)) + return (cudaError_t(err), None) + return (cudaError_t(err), cudaFuncCache(pCacheConfig)) {{endif}} {{if 'cudaDeviceGetStreamPriorityRange' in found_functions}} @@ -19706,8 +19550,8 @@ def cudaDeviceGetStreamPriorityRange(): with nogil: err = cyruntime.cudaDeviceGetStreamPriorityRange(&leastPriority, &greatestPriority) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], leastPriority, greatestPriority) + return (cudaError_t(err), None, None) + return (cudaError_t(err), leastPriority, greatestPriority) {{endif}} {{if 'cudaDeviceSetCacheConfig' in found_functions}} @@ -19765,7 +19609,7 @@ def cudaDeviceSetCacheConfig(cacheConfig not None : cudaFuncCache): cdef cyruntime.cudaFuncCache cycacheConfig = int(cacheConfig) with nogil: err = cyruntime.cudaDeviceSetCacheConfig(cycacheConfig) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceGetByPCIBusId' in found_functions}} @@ -19799,8 +19643,8 @@ def cudaDeviceGetByPCIBusId(char* pciBusId): with nogil: err = cyruntime.cudaDeviceGetByPCIBusId(&device, pciBusId) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], device) + return (cudaError_t(err), None) + return (cudaError_t(err), device) {{endif}} {{if 'cudaDeviceGetPCIBusId' in found_functions}} @@ -19840,8 +19684,8 @@ def cudaDeviceGetPCIBusId(int length, int device): with nogil: err = cyruntime.cudaDeviceGetPCIBusId(pciBusId, length, device) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pypciBusId) + return (cudaError_t(err), None) + return (cudaError_t(err), pypciBusId) {{endif}} {{if 'cudaIpcGetEventHandle' in found_functions}} @@ -19901,8 +19745,8 @@ def cudaIpcGetEventHandle(event): with nogil: err = cyruntime.cudaIpcGetEventHandle(handle._pvt_ptr, cyevent) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], handle) + return (cudaError_t(err), None) + return (cudaError_t(err), handle) {{endif}} {{if 'cudaIpcOpenEventHandle' in found_functions}} @@ -19948,8 +19792,8 @@ def cudaIpcOpenEventHandle(handle not None : cudaIpcEventHandle_t): with nogil: err = cyruntime.cudaIpcOpenEventHandle(event._pvt_ptr, handle._pvt_ptr[0]) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], event) + return (cudaError_t(err), None) + return (cudaError_t(err), event) {{endif}} {{if 'cudaIpcGetMemHandle' in found_functions}} @@ -19998,8 +19842,8 @@ def cudaIpcGetMemHandle(devPtr): with nogil: err = cyruntime.cudaIpcGetMemHandle(handle._pvt_ptr, cydevPtr_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], handle) + return (cudaError_t(err), None) + return (cudaError_t(err), handle) {{endif}} {{if 'cudaIpcOpenMemHandle' in found_functions}} @@ -20071,8 +19915,8 @@ def cudaIpcOpenMemHandle(handle not None : cudaIpcMemHandle_t, unsigned int flag with nogil: err = cyruntime.cudaIpcOpenMemHandle(&devPtr, handle._pvt_ptr[0], flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], devPtr) + return (cudaError_t(err), None) + return (cudaError_t(err), devPtr) {{endif}} {{if 'cudaIpcCloseMemHandle' in found_functions}} @@ -20115,7 +19959,7 @@ def cudaIpcCloseMemHandle(devPtr): cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaIpcCloseMemHandle(cydevPtr_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}} @@ -20158,7 +20002,7 @@ def cudaDeviceFlushGPUDirectRDMAWrites(target not None : cudaFlushGPUDirectRDMAW cdef cyruntime.cudaFlushGPUDirectRDMAWritesScope cyscope = int(scope) with nogil: err = cyruntime.cudaDeviceFlushGPUDirectRDMAWrites(cytarget, cyscope) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceRegisterAsyncNotification' in found_functions}} @@ -20244,8 +20088,8 @@ def cudaDeviceRegisterAsyncNotification(int device, callbackFunc, userData): else: m_global._allocated[int(callback)] = cbData if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], callback) + return (cudaError_t(err), None) + return (cudaError_t(err), callback) {{endif}} {{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}} @@ -20287,7 +20131,7 @@ def cudaDeviceUnregisterAsyncNotification(int device, callback): if err == cyruntime.cudaSuccess: free(m_global._allocated[pcallback]) m_global._allocated.erase(pcallback) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceGetSharedMemConfig' in found_functions}} @@ -20330,8 +20174,8 @@ def cudaDeviceGetSharedMemConfig(): with nogil: err = cyruntime.cudaDeviceGetSharedMemConfig(&pConfig) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], cudaSharedMemConfig(pConfig)) + return (cudaError_t(err), None) + return (cudaError_t(err), cudaSharedMemConfig(pConfig)) {{endif}} {{if 'cudaDeviceSetSharedMemConfig' in found_functions}} @@ -20388,7 +20232,7 @@ def cudaDeviceSetSharedMemConfig(config not None : cudaSharedMemConfig): cdef cyruntime.cudaSharedMemConfig cyconfig = int(config) with nogil: err = cyruntime.cudaDeviceSetSharedMemConfig(cyconfig) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGetLastError' in found_functions}} @@ -20416,7 +20260,7 @@ def cudaGetLastError(): """ with nogil: err = cyruntime.cudaGetLastError() - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaPeekAtLastError' in found_functions}} @@ -20445,7 +20289,7 @@ def cudaPeekAtLastError(): """ with nogil: err = cyruntime.cudaPeekAtLastError() - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGetErrorName' in found_functions}} @@ -20536,8 +20380,8 @@ def cudaGetDeviceCount(): with nogil: err = cyruntime.cudaGetDeviceCount(&count) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], count) + return (cudaError_t(err), None) + return (cudaError_t(err), count) {{endif}} {{if 'cudaGetDeviceProperties' in found_functions}} @@ -20568,8 +20412,8 @@ def cudaGetDeviceProperties(int device): with nogil: err = cyruntime.cudaGetDeviceProperties(prop._pvt_ptr, device) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], prop) + return (cudaError_t(err), None) + return (cudaError_t(err), prop) {{endif}} {{if 'cudaDeviceGetAttribute' in found_functions}} @@ -20604,8 +20448,8 @@ def cudaDeviceGetAttribute(attr not None : cudaDeviceAttr, int device): with nogil: err = cyruntime.cudaDeviceGetAttribute(&value, cyattr, device) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], value) + return (cudaError_t(err), None) + return (cudaError_t(err), value) {{endif}} {{if 'cudaDeviceGetHostAtomicCapabilities' in found_functions}} @@ -20667,8 +20511,8 @@ def cudaDeviceGetHostAtomicCapabilities(operations : Optional[tuple[cudaAtomicOp if cycapabilities is not NULL: free(cycapabilities) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pycapabilities) + return (cudaError_t(err), None) + return (cudaError_t(err), pycapabilities) {{endif}} {{if 'cudaDeviceGetDefaultMemPool' in found_functions}} @@ -20700,8 +20544,8 @@ def cudaDeviceGetDefaultMemPool(int device): with nogil: err = cyruntime.cudaDeviceGetDefaultMemPool(memPool._pvt_ptr, device) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], memPool) + return (cudaError_t(err), None) + return (cudaError_t(err), memPool) {{endif}} {{if 'cudaDeviceSetMemPool' in found_functions}} @@ -20746,7 +20590,7 @@ def cudaDeviceSetMemPool(int device, memPool): cymemPool = pmemPool with nogil: err = cyruntime.cudaDeviceSetMemPool(device, cymemPool) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceGetMemPool' in found_functions}} @@ -20782,8 +20626,8 @@ def cudaDeviceGetMemPool(int device): with nogil: err = cyruntime.cudaDeviceGetMemPool(memPool._pvt_ptr, device) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], memPool) + return (cudaError_t(err), None) + return (cudaError_t(err), memPool) {{endif}} {{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}} @@ -20869,7 +20713,7 @@ def cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, int device, int flags): cdef void* cynvSciSyncAttrList_ptr = cynvSciSyncAttrList.cptr with nogil: err = cyruntime.cudaDeviceGetNvSciSyncAttributes(cynvSciSyncAttrList_ptr, device, flags) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceGetP2PAttribute' in found_functions}} @@ -20933,8 +20777,8 @@ def cudaDeviceGetP2PAttribute(attr not None : cudaDeviceP2PAttr, int srcDevice, with nogil: err = cyruntime.cudaDeviceGetP2PAttribute(&value, cyattr, srcDevice, dstDevice) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], value) + return (cudaError_t(err), None) + return (cudaError_t(err), value) {{endif}} {{if 'cudaDeviceGetP2PAtomicCapabilities' in found_functions}} @@ -21000,8 +20844,8 @@ def cudaDeviceGetP2PAtomicCapabilities(operations : Optional[tuple[cudaAtomicOpe if cycapabilities is not NULL: free(cycapabilities) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pycapabilities) + return (cudaError_t(err), None) + return (cudaError_t(err), pycapabilities) {{endif}} {{if 'cudaChooseDevice' in found_functions}} @@ -21034,8 +20878,8 @@ def cudaChooseDevice(prop : Optional[cudaDeviceProp]): with nogil: err = cyruntime.cudaChooseDevice(&device, cyprop_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], device) + return (cudaError_t(err), None) + return (cudaError_t(err), device) {{endif}} {{if 'cudaInitDevice' in found_functions}} @@ -21078,7 +20922,7 @@ def cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags): """ with nogil: err = cyruntime.cudaInitDevice(device, deviceFlags, flags) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaSetDevice' in found_functions}} @@ -21134,7 +20978,7 @@ def cudaSetDevice(int device): """ with nogil: err = cyruntime.cudaSetDevice(device) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGetDevice' in found_functions}} @@ -21161,8 +21005,8 @@ def cudaGetDevice(): with nogil: err = cyruntime.cudaGetDevice(&device) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], device) + return (cudaError_t(err), None) + return (cudaError_t(err), device) {{endif}} {{if 'cudaSetDeviceFlags' in found_functions}} @@ -21249,7 +21093,7 @@ def cudaSetDeviceFlags(unsigned int flags): """ with nogil: err = cyruntime.cudaSetDeviceFlags(flags) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGetDeviceFlags' in found_functions}} @@ -21298,8 +21142,8 @@ def cudaGetDeviceFlags(): with nogil: err = cyruntime.cudaGetDeviceFlags(&flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], flags) + return (cudaError_t(err), None) + return (cudaError_t(err), flags) {{endif}} {{if 'cudaStreamCreate' in found_functions}} @@ -21328,8 +21172,8 @@ def cudaStreamCreate(): with nogil: err = cyruntime.cudaStreamCreate(pStream._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pStream) + return (cudaError_t(err), None) + return (cudaError_t(err), pStream) {{endif}} {{if 'cudaStreamCreateWithFlags' in found_functions}} @@ -21372,8 +21216,8 @@ def cudaStreamCreateWithFlags(unsigned int flags): with nogil: err = cyruntime.cudaStreamCreateWithFlags(pStream._pvt_ptr, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pStream) + return (cudaError_t(err), None) + return (cudaError_t(err), pStream) {{endif}} {{if 'cudaStreamCreateWithPriority' in found_functions}} @@ -21433,8 +21277,8 @@ def cudaStreamCreateWithPriority(unsigned int flags, int priority): with nogil: err = cyruntime.cudaStreamCreateWithPriority(pStream._pvt_ptr, flags, priority) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pStream) + return (cudaError_t(err), None) + return (cudaError_t(err), pStream) {{endif}} {{if 'cudaStreamGetPriority' in found_functions}} @@ -21479,8 +21323,8 @@ def cudaStreamGetPriority(hStream): with nogil: err = cyruntime.cudaStreamGetPriority(cyhStream, &priority) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], priority) + return (cudaError_t(err), None) + return (cudaError_t(err), priority) {{endif}} {{if 'cudaStreamGetFlags' in found_functions}} @@ -21521,8 +21365,8 @@ def cudaStreamGetFlags(hStream): with nogil: err = cyruntime.cudaStreamGetFlags(cyhStream, &flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], flags) + return (cudaError_t(err), None) + return (cudaError_t(err), flags) {{endif}} {{if 'cudaStreamGetId' in found_functions}} @@ -21577,8 +21421,8 @@ def cudaStreamGetId(hStream): with nogil: err = cyruntime.cudaStreamGetId(cyhStream, &streamId) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], streamId) + return (cudaError_t(err), None) + return (cudaError_t(err), streamId) {{endif}} {{if 'cudaStreamGetDevice' in found_functions}} @@ -21617,8 +21461,8 @@ def cudaStreamGetDevice(hStream): with nogil: err = cyruntime.cudaStreamGetDevice(cyhStream, &device) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], device) + return (cudaError_t(err), None) + return (cudaError_t(err), device) {{endif}} {{if 'cudaCtxResetPersistingL2Cache' in found_functions}} @@ -21641,7 +21485,7 @@ def cudaCtxResetPersistingL2Cache(): """ with nogil: err = cyruntime.cudaCtxResetPersistingL2Cache() - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaStreamCopyAttributes' in found_functions}} @@ -21687,7 +21531,7 @@ def cudaStreamCopyAttributes(dst, src): cydst = pdst with nogil: err = cyruntime.cudaStreamCopyAttributes(cydst, cysrc) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaStreamGetAttribute' in found_functions}} @@ -21730,8 +21574,8 @@ def cudaStreamGetAttribute(hStream, attr not None : cudaStreamAttrID): with nogil: err = cyruntime.cudaStreamGetAttribute(cyhStream, cyattr, value_out._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], value_out) + return (cudaError_t(err), None) + return (cudaError_t(err), value_out) {{endif}} {{if 'cudaStreamSetAttribute' in found_functions}} @@ -21774,7 +21618,7 @@ def cudaStreamSetAttribute(hStream, attr not None : cudaStreamAttrID, value : Op cdef cyruntime.cudaStreamAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cyruntime.cudaStreamSetAttribute(cyhStream, cyattr, cyvalue_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaStreamDestroy' in found_functions}} @@ -21814,7 +21658,7 @@ def cudaStreamDestroy(stream): cystream = pstream with nogil: err = cyruntime.cudaStreamDestroy(cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaStreamWaitEvent' in found_functions}} @@ -21872,7 +21716,7 @@ def cudaStreamWaitEvent(stream, event, unsigned int flags): cystream = pstream with nogil: err = cyruntime.cudaStreamWaitEvent(cystream, cyevent, flags) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaStreamAddCallback' in found_functions}} @@ -21989,7 +21833,7 @@ def cudaStreamAddCallback(stream, callback, userData, unsigned int flags): err = cyruntime.cudaStreamAddCallback(cystream, cudaStreamRtCallbackWrapper, cbData, flags) if err != cyruntime.cudaSuccess: free(cbData) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaStreamSynchronize' in found_functions}} @@ -22027,7 +21871,7 @@ def cudaStreamSynchronize(stream): cystream = pstream with nogil: err = cyruntime.cudaStreamSynchronize(cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaStreamQuery' in found_functions}} @@ -22067,7 +21911,7 @@ def cudaStreamQuery(stream): cystream = pstream with nogil: err = cyruntime.cudaStreamQuery(cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaStreamAttachMemAsync' in found_functions}} @@ -22178,7 +22022,7 @@ def cudaStreamAttachMemAsync(stream, devPtr, size_t length, unsigned int flags): cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaStreamAttachMemAsync(cystream, cydevPtr_ptr, length, flags) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaStreamBeginCapture' in found_functions}} @@ -22235,7 +22079,7 @@ def cudaStreamBeginCapture(stream, mode not None : cudaStreamCaptureMode): cdef cyruntime.cudaStreamCaptureMode cymode = int(mode) with nogil: err = cyruntime.cudaStreamBeginCapture(cystream, cymode) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} @@ -22340,7 +22184,7 @@ def cudaStreamBeginCaptureToGraph(stream, graph, dependencies : Optional[tuple[c free(cydependencies) if len(dependencyData) > 1 and cydependencyData is not NULL: free(cydependencyData) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}} @@ -22413,8 +22257,8 @@ def cudaThreadExchangeStreamCaptureMode(mode not None : cudaStreamCaptureMode): with nogil: err = cyruntime.cudaThreadExchangeStreamCaptureMode(&cymode) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], cudaStreamCaptureMode(cymode)) + return (cudaError_t(err), None) + return (cudaError_t(err), cudaStreamCaptureMode(cymode)) {{endif}} {{if 'cudaStreamEndCapture' in found_functions}} @@ -22461,8 +22305,8 @@ def cudaStreamEndCapture(stream): with nogil: err = cyruntime.cudaStreamEndCapture(cystream, pGraph._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraph) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraph) {{endif}} {{if 'cudaStreamIsCapturing' in found_functions}} @@ -22523,8 +22367,8 @@ def cudaStreamIsCapturing(stream): with nogil: err = cyruntime.cudaStreamIsCapturing(cystream, &pCaptureStatus) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], cudaStreamCaptureStatus(pCaptureStatus)) + return (cudaError_t(err), None) + return (cudaError_t(err), cudaStreamCaptureStatus(pCaptureStatus)) {{endif}} {{if 'cudaStreamGetCaptureInfo' in found_functions}} @@ -22623,8 +22467,8 @@ def cudaStreamGetCaptureInfo(stream): if cudaError_t(err) == cudaError_t(0): pyedgeData_out = [cudaGraphEdgeData(_ptr=&cyedgeData_out[idx]) for idx in range(numDependencies_out)] if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None, None, None, None, None) - return (_dict_cudaError_t[err], cudaStreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, pyedgeData_out, numDependencies_out) + return (cudaError_t(err), None, None, None, None, None, None) + return (cudaError_t(err), cudaStreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, pyedgeData_out, numDependencies_out) {{endif}} {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} @@ -22711,7 +22555,7 @@ def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[tuple[cu free(cydependencies) if len(dependencyData) > 1 and cydependencyData is not NULL: free(cydependencyData) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaEventCreate' in found_functions}} @@ -22738,8 +22582,8 @@ def cudaEventCreate(): with nogil: err = cyruntime.cudaEventCreate(event._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], event) + return (cudaError_t(err), None) + return (cudaError_t(err), event) {{endif}} {{if 'cudaEventCreateWithFlags' in found_functions}} @@ -22790,8 +22634,8 @@ def cudaEventCreateWithFlags(unsigned int flags): with nogil: err = cyruntime.cudaEventCreateWithFlags(event._pvt_ptr, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], event) + return (cudaError_t(err), None) + return (cudaError_t(err), event) {{endif}} {{if 'cudaEventRecord' in found_functions}} @@ -22850,7 +22694,7 @@ def cudaEventRecord(event, stream): cyevent = pevent with nogil: err = cyruntime.cudaEventRecord(cyevent, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaEventRecordWithFlags' in found_functions}} @@ -22918,7 +22762,7 @@ def cudaEventRecordWithFlags(event, stream, unsigned int flags): cyevent = pevent with nogil: err = cyruntime.cudaEventRecordWithFlags(cyevent, cystream, flags) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaEventQuery' in found_functions}} @@ -22963,7 +22807,7 @@ def cudaEventQuery(event): cyevent = pevent with nogil: err = cyruntime.cudaEventQuery(cyevent) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaEventSynchronize' in found_functions}} @@ -23007,7 +22851,7 @@ def cudaEventSynchronize(event): cyevent = pevent with nogil: err = cyruntime.cudaEventSynchronize(cyevent) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaEventDestroy' in found_functions}} @@ -23048,7 +22892,7 @@ def cudaEventDestroy(event): cyevent = pevent with nogil: err = cyruntime.cudaEventDestroy(cyevent) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaEventElapsedTime' in found_functions}} @@ -23120,8 +22964,8 @@ def cudaEventElapsedTime(start, end): with nogil: err = cyruntime.cudaEventElapsedTime(&ms, cystart, cyend) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], ms) + return (cudaError_t(err), None) + return (cudaError_t(err), ms) {{endif}} {{if 'cudaImportExternalMemory' in found_functions}} @@ -23274,8 +23118,8 @@ def cudaImportExternalMemory(memHandleDesc : Optional[cudaExternalMemoryHandleDe with nogil: err = cyruntime.cudaImportExternalMemory(extMem_out._pvt_ptr, cymemHandleDesc_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], extMem_out) + return (cudaError_t(err), None) + return (cudaError_t(err), extMem_out) {{endif}} {{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}} @@ -23342,8 +23186,8 @@ def cudaExternalMemoryGetMappedBuffer(extMem, bufferDesc : Optional[cudaExternal with nogil: err = cyruntime.cudaExternalMemoryGetMappedBuffer(&devPtr, cyextMem, cybufferDesc_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], devPtr) + return (cudaError_t(err), None) + return (cudaError_t(err), devPtr) {{endif}} {{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}} @@ -23414,8 +23258,8 @@ def cudaExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[cuda with nogil: err = cyruntime.cudaExternalMemoryGetMappedMipmappedArray(mipmap._pvt_ptr, cyextMem, cymipmapDesc_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], mipmap) + return (cudaError_t(err), None) + return (cudaError_t(err), mipmap) {{endif}} {{if 'cudaDestroyExternalMemory' in found_functions}} @@ -23453,7 +23297,7 @@ def cudaDestroyExternalMemory(extMem): cyextMem = pextMem with nogil: err = cyruntime.cudaDestroyExternalMemory(cyextMem) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaImportExternalSemaphore' in found_functions}} @@ -23601,8 +23445,8 @@ def cudaImportExternalSemaphore(semHandleDesc : Optional[cudaExternalSemaphoreHa with nogil: err = cyruntime.cudaImportExternalSemaphore(extSem_out._pvt_ptr, cysemHandleDesc_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], extSem_out) + return (cudaError_t(err), None) + return (cudaError_t(err), extSem_out) {{endif}} {{if 'cudaSignalExternalSemaphoresAsync' in found_functions}} @@ -23758,7 +23602,7 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalS free(cyextSemArray) if len(paramsArray) > 1 and cyparamsArray is not NULL: free(cyparamsArray) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaWaitExternalSemaphoresAsync' in found_functions}} @@ -23887,7 +23731,7 @@ def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalSem free(cyextSemArray) if len(paramsArray) > 1 and cyparamsArray is not NULL: free(cyparamsArray) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDestroyExternalSemaphore' in found_functions}} @@ -23924,7 +23768,7 @@ def cudaDestroyExternalSemaphore(extSem): cyextSem = pextSem with nogil: err = cyruntime.cudaDestroyExternalSemaphore(cyextSem) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaFuncSetCacheConfig' in found_functions}} @@ -23991,7 +23835,7 @@ def cudaFuncSetCacheConfig(func, cacheConfig not None : cudaFuncCache): cdef cyruntime.cudaFuncCache cycacheConfig = int(cacheConfig) with nogil: err = cyruntime.cudaFuncSetCacheConfig(cyfunc_ptr, cycacheConfig) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaFuncGetAttributes' in found_functions}} @@ -24034,8 +23878,8 @@ def cudaFuncGetAttributes(func): with nogil: err = cyruntime.cudaFuncGetAttributes(attr._pvt_ptr, cyfunc_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], attr) + return (cudaError_t(err), None) + return (cudaError_t(err), attr) {{endif}} {{if 'cudaFuncSetAttribute' in found_functions}} @@ -24121,7 +23965,7 @@ def cudaFuncSetAttribute(func, attr not None : cudaFuncAttribute, int value): cdef cyruntime.cudaFuncAttribute cyattr = int(attr) with nogil: err = cyruntime.cudaFuncSetAttribute(cyfunc_ptr, cyattr, value) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaLaunchHostFunc' in found_functions}} @@ -24231,7 +24075,7 @@ def cudaLaunchHostFunc(stream, fn, userData): err = cyruntime.cudaLaunchHostFunc(cystream, cudaStreamRtHostCallbackWrapper, cbData) if err != cyruntime.cudaSuccess: free(cbData) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaFuncSetSharedMemConfig' in found_functions}} @@ -24299,7 +24143,7 @@ def cudaFuncSetSharedMemConfig(func, config not None : cudaSharedMemConfig): cdef cyruntime.cudaSharedMemConfig cyconfig = int(config) with nogil: err = cyruntime.cudaFuncSetSharedMemConfig(cyfunc_ptr, cyconfig) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} @@ -24337,8 +24181,8 @@ def cudaOccupancyMaxActiveBlocksPerMultiprocessor(func, int blockSize, size_t dy with nogil: err = cyruntime.cudaOccupancyMaxActiveBlocksPerMultiprocessor(&numBlocks, cyfunc_ptr, blockSize, dynamicSMemSize) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], numBlocks) + return (cudaError_t(err), None) + return (cudaError_t(err), numBlocks) {{endif}} {{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}} @@ -24376,8 +24220,8 @@ def cudaOccupancyAvailableDynamicSMemPerBlock(func, int numBlocks, int blockSize with nogil: err = cyruntime.cudaOccupancyAvailableDynamicSMemPerBlock(&dynamicSmemSize, cyfunc_ptr, numBlocks, blockSize) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], dynamicSmemSize) + return (cudaError_t(err), None) + return (cudaError_t(err), dynamicSmemSize) {{endif}} {{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} @@ -24432,8 +24276,8 @@ def cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(func, int blockSize, with nogil: err = cyruntime.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(&numBlocks, cyfunc_ptr, blockSize, dynamicSMemSize, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], numBlocks) + return (cudaError_t(err), None) + return (cudaError_t(err), numBlocks) {{endif}} {{if 'cudaMallocManaged' in found_functions}} @@ -24566,8 +24410,8 @@ def cudaMallocManaged(size_t size, unsigned int flags): with nogil: err = cyruntime.cudaMallocManaged(&devPtr, size, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], devPtr) + return (cudaError_t(err), None) + return (cudaError_t(err), devPtr) {{endif}} {{if 'cudaMalloc' in found_functions}} @@ -24605,8 +24449,8 @@ def cudaMalloc(size_t size): with nogil: err = cyruntime.cudaMalloc(&devPtr, size) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], devPtr) + return (cudaError_t(err), None) + return (cudaError_t(err), devPtr) {{endif}} {{if 'cudaMallocHost' in found_functions}} @@ -24653,8 +24497,8 @@ def cudaMallocHost(size_t size): with nogil: err = cyruntime.cudaMallocHost(&ptr, size) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], ptr) + return (cudaError_t(err), None) + return (cudaError_t(err), ptr) {{endif}} {{if 'cudaMallocPitch' in found_functions}} @@ -24709,8 +24553,8 @@ def cudaMallocPitch(size_t width, size_t height): with nogil: err = cyruntime.cudaMallocPitch(&devPtr, &pitch, width, height) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], devPtr, pitch) + return (cudaError_t(err), None, None) + return (cudaError_t(err), devPtr, pitch) {{endif}} {{if 'cudaMallocArray' in found_functions}} @@ -24786,8 +24630,8 @@ def cudaMallocArray(desc : Optional[cudaChannelFormatDesc], size_t width, size_t with nogil: err = cyruntime.cudaMallocArray(array._pvt_ptr, cydesc_ptr, width, height, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], array) + return (cudaError_t(err), None) + return (cudaError_t(err), array) {{endif}} {{if 'cudaFree' in found_functions}} @@ -24837,7 +24681,7 @@ def cudaFree(devPtr): cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaFree(cydevPtr_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaFreeHost' in found_functions}} @@ -24868,7 +24712,7 @@ def cudaFreeHost(ptr): cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaFreeHost(cyptr_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaFreeArray' in found_functions}} @@ -24905,7 +24749,7 @@ def cudaFreeArray(array): cyarray = parray with nogil: err = cyruntime.cudaFreeArray(cyarray) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaFreeMipmappedArray' in found_functions}} @@ -24942,7 +24786,7 @@ def cudaFreeMipmappedArray(mipmappedArray): cymipmappedArray = pmipmappedArray with nogil: err = cyruntime.cudaFreeMipmappedArray(cymipmappedArray) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaHostAlloc' in found_functions}} @@ -25026,8 +24870,8 @@ def cudaHostAlloc(size_t size, unsigned int flags): with nogil: err = cyruntime.cudaHostAlloc(&pHost, size, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pHost) + return (cudaError_t(err), None) + return (cudaError_t(err), pHost) {{endif}} {{if 'cudaHostRegister' in found_functions}} @@ -25144,7 +24988,7 @@ def cudaHostRegister(ptr, size_t size, unsigned int flags): cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaHostRegister(cyptr_ptr, size, flags) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaHostUnregister' in found_functions}} @@ -25177,7 +25021,7 @@ def cudaHostUnregister(ptr): cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaHostUnregister(cyptr_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaHostGetDevicePointer' in found_functions}} @@ -25238,8 +25082,8 @@ def cudaHostGetDevicePointer(pHost, unsigned int flags): with nogil: err = cyruntime.cudaHostGetDevicePointer(&pDevice, cypHost_ptr, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pDevice) + return (cudaError_t(err), None) + return (cudaError_t(err), pDevice) {{endif}} {{if 'cudaHostGetFlags' in found_functions}} @@ -25273,8 +25117,8 @@ def cudaHostGetFlags(pHost): with nogil: err = cyruntime.cudaHostGetFlags(&pFlags, cypHost_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pFlags) + return (cudaError_t(err), None) + return (cudaError_t(err), pFlags) {{endif}} {{if 'cudaMalloc3D' in found_functions}} @@ -25322,8 +25166,8 @@ def cudaMalloc3D(extent not None : cudaExtent): with nogil: err = cyruntime.cudaMalloc3D(pitchedDevPtr._pvt_ptr, extent._pvt_ptr[0]) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pitchedDevPtr) + return (cudaError_t(err), None) + return (cudaError_t(err), pitchedDevPtr) {{endif}} {{if 'cudaMalloc3DArray' in found_functions}} @@ -25445,8 +25289,8 @@ def cudaMalloc3DArray(desc : Optional[cudaChannelFormatDesc], extent not None : with nogil: err = cyruntime.cudaMalloc3DArray(array._pvt_ptr, cydesc_ptr, extent._pvt_ptr[0], flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], array) + return (cudaError_t(err), None) + return (cudaError_t(err), array) {{endif}} {{if 'cudaMallocMipmappedArray' in found_functions}} @@ -25571,8 +25415,8 @@ def cudaMallocMipmappedArray(desc : Optional[cudaChannelFormatDesc], extent not with nogil: err = cyruntime.cudaMallocMipmappedArray(mipmappedArray._pvt_ptr, cydesc_ptr, extent._pvt_ptr[0], numLevels, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], mipmappedArray) + return (cudaError_t(err), None) + return (cudaError_t(err), mipmappedArray) {{endif}} {{if 'cudaGetMipmappedArrayLevel' in found_functions}} @@ -25620,8 +25464,8 @@ def cudaGetMipmappedArrayLevel(mipmappedArray, unsigned int level): with nogil: err = cyruntime.cudaGetMipmappedArrayLevel(levelArray._pvt_ptr, cymipmappedArray, level) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], levelArray) + return (cudaError_t(err), None) + return (cudaError_t(err), levelArray) {{endif}} {{if 'cudaMemcpy3D' in found_functions}} @@ -25705,7 +25549,7 @@ def cudaMemcpy3D(p : Optional[cudaMemcpy3DParms]): cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3D(cyp_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpy3DPeer' in found_functions}} @@ -25742,7 +25586,7 @@ def cudaMemcpy3DPeer(p : Optional[cudaMemcpy3DPeerParms]): cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DPeer(cyp_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpy3DAsync' in found_functions}} @@ -25847,7 +25691,7 @@ def cudaMemcpy3DAsync(p : Optional[cudaMemcpy3DParms], stream): cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DAsync(cyp_ptr, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpy3DPeerAsync' in found_functions}} @@ -25887,7 +25731,7 @@ def cudaMemcpy3DPeerAsync(p : Optional[cudaMemcpy3DPeerParms], stream): cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DPeerAsync(cyp_ptr, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemGetInfo' in found_functions}} @@ -25931,8 +25775,8 @@ def cudaMemGetInfo(): with nogil: err = cyruntime.cudaMemGetInfo(&free, &total) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], free, total) + return (cudaError_t(err), None, None) + return (cudaError_t(err), free, total) {{endif}} {{if 'cudaArrayGetInfo' in found_functions}} @@ -25980,8 +25824,8 @@ def cudaArrayGetInfo(array): with nogil: err = cyruntime.cudaArrayGetInfo(desc._pvt_ptr, extent._pvt_ptr, &flags, cyarray) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None, None) - return (_dict_cudaError_t[err], desc, extent, flags) + return (cudaError_t(err), None, None, None) + return (cudaError_t(err), desc, extent, flags) {{endif}} {{if 'cudaArrayGetPlane' in found_functions}} @@ -26036,8 +25880,8 @@ def cudaArrayGetPlane(hArray, unsigned int planeIdx): with nogil: err = cyruntime.cudaArrayGetPlane(pPlaneArray._pvt_ptr, cyhArray, planeIdx) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pPlaneArray) + return (cudaError_t(err), None) + return (cudaError_t(err), pPlaneArray) {{endif}} {{if 'cudaArrayGetMemoryRequirements' in found_functions}} @@ -26086,8 +25930,8 @@ def cudaArrayGetMemoryRequirements(array, int device): with nogil: err = cyruntime.cudaArrayGetMemoryRequirements(memoryRequirements._pvt_ptr, cyarray, device) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], memoryRequirements) + return (cudaError_t(err), None) + return (cudaError_t(err), memoryRequirements) {{endif}} {{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}} @@ -26136,8 +25980,8 @@ def cudaMipmappedArrayGetMemoryRequirements(mipmap, int device): with nogil: err = cyruntime.cudaMipmappedArrayGetMemoryRequirements(memoryRequirements._pvt_ptr, cymipmap, device) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], memoryRequirements) + return (cudaError_t(err), None) + return (cudaError_t(err), memoryRequirements) {{endif}} {{if 'cudaArrayGetSparseProperties' in found_functions}} @@ -26192,8 +26036,8 @@ def cudaArrayGetSparseProperties(array): with nogil: err = cyruntime.cudaArrayGetSparseProperties(sparseProperties._pvt_ptr, cyarray) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], sparseProperties) + return (cudaError_t(err), None) + return (cudaError_t(err), sparseProperties) {{endif}} {{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}} @@ -26248,8 +26092,8 @@ def cudaMipmappedArrayGetSparseProperties(mipmap): with nogil: err = cyruntime.cudaMipmappedArrayGetSparseProperties(sparseProperties._pvt_ptr, cymipmap) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], sparseProperties) + return (cudaError_t(err), None) + return (cudaError_t(err), sparseProperties) {{endif}} {{if 'cudaMemcpy' in found_functions}} @@ -26299,7 +26143,7 @@ def cudaMemcpy(dst, src, size_t count, kind not None : cudaMemcpyKind): cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpy(cydst_ptr, cysrc_ptr, count, cykind) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpyPeer' in found_functions}} @@ -26347,7 +26191,7 @@ def cudaMemcpyPeer(dst, int dstDevice, src, int srcDevice, size_t count): cdef void* cysrc_ptr = cysrc.cptr with nogil: err = cyruntime.cudaMemcpyPeer(cydst_ptr, dstDevice, cysrc_ptr, srcDevice, count) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpy2D' in found_functions}} @@ -26407,7 +26251,7 @@ def cudaMemcpy2D(dst, size_t dpitch, src, size_t spitch, size_t width, size_t he cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpy2D(cydst_ptr, dpitch, cysrc_ptr, spitch, width, height, cykind) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpy2DToArray' in found_functions}} @@ -26474,7 +26318,7 @@ def cudaMemcpy2DToArray(dst, size_t wOffset, size_t hOffset, src, size_t spitch, cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpy2DToArray(cydst, wOffset, hOffset, cysrc_ptr, spitch, width, height, cykind) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpy2DFromArray' in found_functions}} @@ -26541,7 +26385,7 @@ def cudaMemcpy2DFromArray(dst, size_t dpitch, src, size_t wOffset, size_t hOffse cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpy2DFromArray(cydst_ptr, dpitch, cysrc, wOffset, hOffset, width, height, cykind) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpy2DArrayToArray' in found_functions}} @@ -26614,7 +26458,7 @@ def cudaMemcpy2DArrayToArray(dst, size_t wOffsetDst, size_t hOffsetDst, src, siz cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpy2DArrayToArray(cydst, wOffsetDst, hOffsetDst, cysrc, wOffsetSrc, hOffsetSrc, width, height, cykind) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpyAsync' in found_functions}} @@ -26684,7 +26528,7 @@ def cudaMemcpyAsync(dst, src, size_t count, kind not None : cudaMemcpyKind, stre cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpyAsync(cydst_ptr, cysrc_ptr, count, cykind, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpyPeerAsync' in found_functions}} @@ -26740,7 +26584,7 @@ def cudaMemcpyPeerAsync(dst, int dstDevice, src, int srcDevice, size_t count, st cdef void* cysrc_ptr = cysrc.cptr with nogil: err = cyruntime.cudaMemcpyPeerAsync(cydst_ptr, dstDevice, cysrc_ptr, srcDevice, count, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpyBatchAsync' in found_functions}} @@ -26890,7 +26734,7 @@ def cudaMemcpyBatchAsync(dsts : Optional[tuple[Any] | list[Any]], srcs : Optiona err = cyruntime.cudaMemcpyBatchAsync(cydsts_ptr, cysrcs_ptr, cysizes.data(), count, cyattrs, cyattrsIdxs.data(), numAttrs, cystream) if len(attrs) > 1 and cyattrs is not NULL: free(cyattrs) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpy3DBatchAsync' in found_functions}} @@ -27020,7 +26864,7 @@ def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[cudaMemcpy3DBa err = cyruntime.cudaMemcpy3DBatchAsync(numOps, cyopList, flags, cystream) if len(opList) > 1 and cyopList is not NULL: free(cyopList) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpy2DAsync' in found_functions}} @@ -27101,7 +26945,7 @@ def cudaMemcpy2DAsync(dst, size_t dpitch, src, size_t spitch, size_t width, size cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpy2DAsync(cydst_ptr, dpitch, cysrc_ptr, spitch, width, height, cykind, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpy2DToArrayAsync' in found_functions}} @@ -27189,7 +27033,7 @@ def cudaMemcpy2DToArrayAsync(dst, size_t wOffset, size_t hOffset, src, size_t sp cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpy2DToArrayAsync(cydst, wOffset, hOffset, cysrc_ptr, spitch, width, height, cykind, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpy2DFromArrayAsync' in found_functions}} @@ -27276,7 +27120,7 @@ def cudaMemcpy2DFromArrayAsync(dst, size_t dpitch, src, size_t wOffset, size_t h cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpy2DFromArrayAsync(cydst_ptr, dpitch, cysrc, wOffset, hOffset, width, height, cykind, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemset' in found_functions}} @@ -27313,7 +27157,7 @@ def cudaMemset(devPtr, int value, size_t count): cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemset(cydevPtr_ptr, value, count) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemset2D' in found_functions}} @@ -27357,7 +27201,7 @@ def cudaMemset2D(devPtr, size_t pitch, int value, size_t width, size_t height): cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemset2D(cydevPtr_ptr, pitch, value, width, height) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemset3D' in found_functions}} @@ -27411,7 +27255,7 @@ def cudaMemset3D(pitchedDevPtr not None : cudaPitchedPtr, int value, extent not """ with nogil: err = cyruntime.cudaMemset3D(pitchedDevPtr._pvt_ptr[0], value, extent._pvt_ptr[0]) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemsetAsync' in found_functions}} @@ -27464,7 +27308,7 @@ def cudaMemsetAsync(devPtr, int value, size_t count, stream): cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemsetAsync(cydevPtr_ptr, value, count, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemset2DAsync' in found_functions}} @@ -27524,7 +27368,7 @@ def cudaMemset2DAsync(devPtr, size_t pitch, int value, size_t width, size_t heig cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemset2DAsync(cydevPtr_ptr, pitch, value, width, height, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemset3DAsync' in found_functions}} @@ -27594,7 +27438,7 @@ def cudaMemset3DAsync(pitchedDevPtr not None : cudaPitchedPtr, int value, extent cystream = pstream with nogil: err = cyruntime.cudaMemset3DAsync(pitchedDevPtr._pvt_ptr[0], value, extent._pvt_ptr[0], cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemPrefetchAsync' in found_functions}} @@ -27712,7 +27556,7 @@ def cudaMemPrefetchAsync(devPtr, size_t count, location not None : cudaMemLocati cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemPrefetchAsync(cydevPtr_ptr, count, location._pvt_ptr[0], flags, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemPrefetchBatchAsync' in found_functions}} @@ -27821,7 +27665,7 @@ def cudaMemPrefetchBatchAsync(dptrs : Optional[tuple[Any] | list[Any]], sizes : err = cyruntime.cudaMemPrefetchBatchAsync(cydptrs_ptr, cysizes.data(), count, cyprefetchLocs, cyprefetchLocIdxs.data(), numPrefetchLocs, flags, cystream) if len(prefetchLocs) > 1 and cyprefetchLocs is not NULL: free(cyprefetchLocs) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemDiscardBatchAsync' in found_functions}} @@ -27895,7 +27739,7 @@ def cudaMemDiscardBatchAsync(dptrs : Optional[tuple[Any] | list[Any]], sizes : t if count > len(sizes): raise RuntimeError("List is too small: " + str(len(sizes)) + " < " + str(count)) with nogil: err = cyruntime.cudaMemDiscardBatchAsync(cydptrs_ptr, cysizes.data(), count, flags, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemDiscardAndPrefetchBatchAsync' in found_functions}} @@ -28012,7 +27856,7 @@ def cudaMemDiscardAndPrefetchBatchAsync(dptrs : Optional[tuple[Any] | list[Any]] err = cyruntime.cudaMemDiscardAndPrefetchBatchAsync(cydptrs_ptr, cysizes.data(), count, cyprefetchLocs, cyprefetchLocIdxs.data(), numPrefetchLocs, flags, cystream) if len(prefetchLocs) > 1 and cyprefetchLocs is not NULL: free(cyprefetchLocs) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemAdvise' in found_functions}} @@ -28209,7 +28053,7 @@ def cudaMemAdvise(devPtr, size_t count, advice not None : cudaMemoryAdvise, loca cdef cyruntime.cudaMemoryAdvise cyadvice = int(advice) with nogil: err = cyruntime.cudaMemAdvise(cydevPtr_ptr, count, cyadvice, location._pvt_ptr[0]) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemRangeGetAttribute' in found_functions}} @@ -28358,8 +28202,8 @@ def cudaMemRangeGetAttribute(size_t dataSize, attribute not None : cudaMemRangeA with nogil: err = cyruntime.cudaMemRangeGetAttribute(cydata_ptr, dataSize, cyattribute, cydevPtr_ptr, count) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], cydata.pyObj()) + return (cudaError_t(err), None) + return (cudaError_t(err), cydata.pyObj()) {{endif}} {{if 'cudaMemRangeGetAttributes' in found_functions}} @@ -28439,8 +28283,8 @@ def cudaMemRangeGetAttributes(dataSizes : tuple[int] | list[int], attributes : O with nogil: err = cyruntime.cudaMemRangeGetAttributes(cyvoidStarHelper_ptr, cydataSizes.data(), cyattributes.data(), numAttributes, cydevPtr_ptr, count) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], [obj.pyObj() for obj in pylist]) + return (cudaError_t(err), None) + return (cudaError_t(err), [obj.pyObj() for obj in pylist]) {{endif}} {{if 'cudaMemcpyToArray' in found_functions}} @@ -28499,7 +28343,7 @@ def cudaMemcpyToArray(dst, size_t wOffset, size_t hOffset, src, size_t count, ki cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpyToArray(cydst, wOffset, hOffset, cysrc_ptr, count, cykind) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpyFromArray' in found_functions}} @@ -28558,7 +28402,7 @@ def cudaMemcpyFromArray(dst, src, size_t wOffset, size_t hOffset, size_t count, cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpyFromArray(cydst_ptr, cysrc, wOffset, hOffset, count, cykind) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpyArrayToArray' in found_functions}} @@ -28628,7 +28472,7 @@ def cudaMemcpyArrayToArray(dst, size_t wOffsetDst, size_t hOffsetDst, src, size_ cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpyArrayToArray(cydst, wOffsetDst, hOffsetDst, cysrc, wOffsetSrc, hOffsetSrc, count, cykind) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpyToArrayAsync' in found_functions}} @@ -28704,7 +28548,7 @@ def cudaMemcpyToArrayAsync(dst, size_t wOffset, size_t hOffset, src, size_t coun cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpyToArrayAsync(cydst, wOffset, hOffset, cysrc_ptr, count, cykind, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemcpyFromArrayAsync' in found_functions}} @@ -28780,7 +28624,7 @@ def cudaMemcpyFromArrayAsync(dst, src, size_t wOffset, size_t hOffset, size_t co cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaMemcpyFromArrayAsync(cydst_ptr, cysrc, wOffset, hOffset, count, cykind, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMallocAsync' in found_functions}} @@ -28834,8 +28678,8 @@ def cudaMallocAsync(size_t size, hStream): with nogil: err = cyruntime.cudaMallocAsync(&devPtr, size, cyhStream) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], devPtr) + return (cudaError_t(err), None) + return (cudaError_t(err), devPtr) {{endif}} {{if 'cudaFreeAsync' in found_functions}} @@ -28881,7 +28725,7 @@ def cudaFreeAsync(devPtr, hStream): cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaFreeAsync(cydevPtr_ptr, cyhStream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemPoolTrimTo' in found_functions}} @@ -28931,7 +28775,7 @@ def cudaMemPoolTrimTo(memPool, size_t minBytesToKeep): cymemPool = pmemPool with nogil: err = cyruntime.cudaMemPoolTrimTo(cymemPool, minBytesToKeep) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemPoolSetAttribute' in found_functions}} @@ -29007,7 +28851,7 @@ def cudaMemPoolSetAttribute(memPool, attr not None : cudaMemPoolAttr, value): cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cyruntime.cudaMemPoolSetAttribute(cymemPool, cyattr, cyvalue_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemPoolGetAttribute' in found_functions}} @@ -29090,8 +28934,8 @@ def cudaMemPoolGetAttribute(memPool, attr not None : cudaMemPoolAttr): with nogil: err = cyruntime.cudaMemPoolGetAttribute(cymemPool, cyattr, cyvalue_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], cyvalue.pyObj()) + return (cudaError_t(err), None) + return (cudaError_t(err), cyvalue.pyObj()) {{endif}} {{if 'cudaMemPoolSetAccess' in found_functions}} @@ -29144,7 +28988,7 @@ def cudaMemPoolSetAccess(memPool, descList : Optional[tuple[cudaMemAccessDesc] | err = cyruntime.cudaMemPoolSetAccess(cymemPool, cydescList, count) if len(descList) > 1 and cydescList is not NULL: free(cydescList) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemPoolGetAccess' in found_functions}} @@ -29187,8 +29031,8 @@ def cudaMemPoolGetAccess(memPool, location : Optional[cudaMemLocation]): with nogil: err = cyruntime.cudaMemPoolGetAccess(&flags, cymemPool, cylocation_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], cudaMemAccessFlags(flags)) + return (cudaError_t(err), None) + return (cudaError_t(err), cudaMemAccessFlags(flags)) {{endif}} {{if 'cudaMemPoolCreate' in found_functions}} @@ -29287,8 +29131,8 @@ def cudaMemPoolCreate(poolProps : Optional[cudaMemPoolProps]): with nogil: err = cyruntime.cudaMemPoolCreate(memPool._pvt_ptr, cypoolProps_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], memPool) + return (cudaError_t(err), None) + return (cudaError_t(err), memPool) {{endif}} {{if 'cudaMemPoolDestroy' in found_functions}} @@ -29334,7 +29178,7 @@ def cudaMemPoolDestroy(memPool): cymemPool = pmemPool with nogil: err = cyruntime.cudaMemPoolDestroy(cymemPool) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMemGetDefaultMemPool' in found_functions}} @@ -29378,8 +29222,8 @@ def cudaMemGetDefaultMemPool(location : Optional[cudaMemLocation], typename not with nogil: err = cyruntime.cudaMemGetDefaultMemPool(memPool._pvt_ptr, cylocation_ptr, cytypename) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], memPool) + return (cudaError_t(err), None) + return (cudaError_t(err), memPool) {{endif}} {{if 'cudaMemGetMemPool' in found_functions}} @@ -29432,8 +29276,8 @@ def cudaMemGetMemPool(location : Optional[cudaMemLocation], typename not None : with nogil: err = cyruntime.cudaMemGetMemPool(memPool._pvt_ptr, cylocation_ptr, cytypename) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], memPool) + return (cudaError_t(err), None) + return (cudaError_t(err), memPool) {{endif}} {{if 'cudaMemSetMemPool' in found_functions}} @@ -29500,7 +29344,7 @@ def cudaMemSetMemPool(location : Optional[cudaMemLocation], typename not None : cdef cyruntime.cudaMemAllocationType cytypename = int(typename) with nogil: err = cyruntime.cudaMemSetMemPool(cylocation_ptr, cytypename, cymemPool) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaMallocFromPoolAsync' in found_functions}} @@ -29558,8 +29402,8 @@ def cudaMallocFromPoolAsync(size_t size, memPool, stream): with nogil: err = cyruntime.cudaMallocFromPoolAsync(&ptr, size, cymemPool, cystream) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], ptr) + return (cudaError_t(err), None) + return (cudaError_t(err), ptr) {{endif}} {{if 'cudaMemPoolExportToShareableHandle' in found_functions}} @@ -29615,8 +29459,8 @@ def cudaMemPoolExportToShareableHandle(memPool, handleType not None : cudaMemAll with nogil: err = cyruntime.cudaMemPoolExportToShareableHandle(cyshareableHandle_ptr, cymemPool, cyhandleType, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], cyshareableHandle.pyObj()) + return (cudaError_t(err), None) + return (cudaError_t(err), cyshareableHandle.pyObj()) {{endif}} {{if 'cudaMemPoolImportFromShareableHandle' in found_functions}} @@ -29659,8 +29503,8 @@ def cudaMemPoolImportFromShareableHandle(shareableHandle, handleType not None : with nogil: err = cyruntime.cudaMemPoolImportFromShareableHandle(memPool._pvt_ptr, cyshareableHandle_ptr, cyhandleType, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], memPool) + return (cudaError_t(err), None) + return (cudaError_t(err), memPool) {{endif}} {{if 'cudaMemPoolExportPointer' in found_functions}} @@ -29696,8 +29540,8 @@ def cudaMemPoolExportPointer(ptr): with nogil: err = cyruntime.cudaMemPoolExportPointer(exportData._pvt_ptr, cyptr_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], exportData) + return (cudaError_t(err), None) + return (cudaError_t(err), exportData) {{endif}} {{if 'cudaMemPoolImportPointer' in found_functions}} @@ -29749,8 +29593,8 @@ def cudaMemPoolImportPointer(memPool, exportData : Optional[cudaMemPoolPtrExport with nogil: err = cyruntime.cudaMemPoolImportPointer(&ptr, cymemPool, cyexportData_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], ptr) + return (cudaError_t(err), None) + return (cudaError_t(err), ptr) {{endif}} {{if 'cudaPointerGetAttributes' in found_functions}} @@ -29821,8 +29665,8 @@ def cudaPointerGetAttributes(ptr): with nogil: err = cyruntime.cudaPointerGetAttributes(attributes._pvt_ptr, cyptr_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], attributes) + return (cudaError_t(err), None) + return (cudaError_t(err), attributes) {{endif}} {{if 'cudaDeviceCanAccessPeer' in found_functions}} @@ -29860,8 +29704,8 @@ def cudaDeviceCanAccessPeer(int device, int peerDevice): with nogil: err = cyruntime.cudaDeviceCanAccessPeer(&canAccessPeer, device, peerDevice) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], canAccessPeer) + return (cudaError_t(err), None) + return (cudaError_t(err), canAccessPeer) {{endif}} {{if 'cudaDeviceEnablePeerAccess' in found_functions}} @@ -29912,7 +29756,7 @@ def cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags): """ with nogil: err = cyruntime.cudaDeviceEnablePeerAccess(peerDevice, flags) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceDisablePeerAccess' in found_functions}} @@ -29941,7 +29785,7 @@ def cudaDeviceDisablePeerAccess(int peerDevice): """ with nogil: err = cyruntime.cudaDeviceDisablePeerAccess(peerDevice) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphicsUnregisterResource' in found_functions}} @@ -29980,7 +29824,7 @@ def cudaGraphicsUnregisterResource(resource): cyresource = presource with nogil: err = cyruntime.cudaGraphicsUnregisterResource(cyresource) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphicsResourceSetMapFlags' in found_functions}} @@ -30036,7 +29880,7 @@ def cudaGraphicsResourceSetMapFlags(resource, unsigned int flags): cyresource = presource with nogil: err = cyruntime.cudaGraphicsResourceSetMapFlags(cyresource, flags) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphicsMapResources' in found_functions}} @@ -30099,7 +29943,7 @@ def cudaGraphicsMapResources(int count, resources, stream): raise TypeError("Argument 'resources' is not instance of type (expected , found " + str(type(resources))) with nogil: err = cyruntime.cudaGraphicsMapResources(count, cyresources, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphicsUnmapResources' in found_functions}} @@ -30160,7 +30004,7 @@ def cudaGraphicsUnmapResources(int count, resources, stream): raise TypeError("Argument 'resources' is not instance of type (expected , found " + str(type(resources))) with nogil: err = cyruntime.cudaGraphicsUnmapResources(count, cyresources, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}} @@ -30205,8 +30049,8 @@ def cudaGraphicsResourceGetMappedPointer(resource): with nogil: err = cyruntime.cudaGraphicsResourceGetMappedPointer(&devPtr, &size, cyresource) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], devPtr, size) + return (cudaError_t(err), None, None) + return (cudaError_t(err), devPtr, size) {{endif}} {{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}} @@ -30262,8 +30106,8 @@ def cudaGraphicsSubResourceGetMappedArray(resource, unsigned int arrayIndex, uns with nogil: err = cyruntime.cudaGraphicsSubResourceGetMappedArray(array._pvt_ptr, cyresource, arrayIndex, mipLevel) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], array) + return (cudaError_t(err), None) + return (cudaError_t(err), array) {{endif}} {{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}} @@ -30308,8 +30152,8 @@ def cudaGraphicsResourceGetMappedMipmappedArray(resource): with nogil: err = cyruntime.cudaGraphicsResourceGetMappedMipmappedArray(mipmappedArray._pvt_ptr, cyresource) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], mipmappedArray) + return (cudaError_t(err), None) + return (cudaError_t(err), mipmappedArray) {{endif}} {{if 'cudaGetChannelDesc' in found_functions}} @@ -30348,8 +30192,8 @@ def cudaGetChannelDesc(array): with nogil: err = cyruntime.cudaGetChannelDesc(desc._pvt_ptr, cyarray) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], desc) + return (cudaError_t(err), None) + return (cudaError_t(err), desc) {{endif}} {{if 'cudaCreateChannelDesc' in found_functions}} @@ -30642,8 +30486,8 @@ def cudaCreateTextureObject(pResDesc : Optional[cudaResourceDesc], pTexDesc : Op with nogil: err = cyruntime.cudaCreateTextureObject(pTexObject._pvt_ptr, cypResDesc_ptr, cypTexDesc_ptr, cypResViewDesc_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pTexObject) + return (cudaError_t(err), None) + return (cudaError_t(err), pTexObject) {{endif}} {{if 'cudaDestroyTextureObject' in found_functions}} @@ -30678,7 +30522,7 @@ def cudaDestroyTextureObject(texObject): cytexObject = ptexObject with nogil: err = cyruntime.cudaDestroyTextureObject(cytexObject) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGetTextureObjectResourceDesc' in found_functions}} @@ -30718,8 +30562,8 @@ def cudaGetTextureObjectResourceDesc(texObject): with nogil: err = cyruntime.cudaGetTextureObjectResourceDesc(pResDesc._pvt_ptr, cytexObject) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pResDesc) + return (cudaError_t(err), None) + return (cudaError_t(err), pResDesc) {{endif}} {{if 'cudaGetTextureObjectTextureDesc' in found_functions}} @@ -30759,8 +30603,8 @@ def cudaGetTextureObjectTextureDesc(texObject): with nogil: err = cyruntime.cudaGetTextureObjectTextureDesc(pTexDesc._pvt_ptr, cytexObject) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pTexDesc) + return (cudaError_t(err), None) + return (cudaError_t(err), pTexDesc) {{endif}} {{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}} @@ -30801,8 +30645,8 @@ def cudaGetTextureObjectResourceViewDesc(texObject): with nogil: err = cyruntime.cudaGetTextureObjectResourceViewDesc(pResViewDesc._pvt_ptr, cytexObject) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pResViewDesc) + return (cudaError_t(err), None) + return (cudaError_t(err), pResViewDesc) {{endif}} {{if 'cudaCreateSurfaceObject' in found_functions}} @@ -30843,8 +30687,8 @@ def cudaCreateSurfaceObject(pResDesc : Optional[cudaResourceDesc]): with nogil: err = cyruntime.cudaCreateSurfaceObject(pSurfObject._pvt_ptr, cypResDesc_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pSurfObject) + return (cudaError_t(err), None) + return (cudaError_t(err), pSurfObject) {{endif}} {{if 'cudaDestroySurfaceObject' in found_functions}} @@ -30879,7 +30723,7 @@ def cudaDestroySurfaceObject(surfObject): cysurfObject = psurfObject with nogil: err = cyruntime.cudaDestroySurfaceObject(cysurfObject) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}} @@ -30916,8 +30760,8 @@ def cudaGetSurfaceObjectResourceDesc(surfObject): with nogil: err = cyruntime.cudaGetSurfaceObjectResourceDesc(pResDesc._pvt_ptr, cysurfObject) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pResDesc) + return (cudaError_t(err), None) + return (cudaError_t(err), pResDesc) {{endif}} {{if 'cudaDriverGetVersion' in found_functions}} @@ -30949,8 +30793,8 @@ def cudaDriverGetVersion(): with nogil: err = cyruntime.cudaDriverGetVersion(&driverVersion) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], driverVersion) + return (cudaError_t(err), None) + return (cudaError_t(err), driverVersion) {{endif}} {{if 'cudaRuntimeGetVersion' in found_functions}} @@ -30985,8 +30829,8 @@ def cudaRuntimeGetVersion(): with nogil: err = cyruntime.cudaRuntimeGetVersion(&runtimeVersion) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], runtimeVersion) + return (cudaError_t(err), None) + return (cudaError_t(err), runtimeVersion) {{endif}} {{if 'cudaLogsRegisterCallback' in found_functions}} @@ -31025,8 +30869,8 @@ def cudaLogsRegisterCallback(callbackFunc, userData): with nogil: err = cyruntime.cudaLogsRegisterCallback(cycallbackFunc, cyuserData_ptr, callback_out._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], callback_out) + return (cudaError_t(err), None) + return (cudaError_t(err), callback_out) {{endif}} {{if 'cudaLogsUnregisterCallback' in found_functions}} @@ -31055,7 +30899,7 @@ def cudaLogsUnregisterCallback(callback): cycallback = pcallback with nogil: err = cyruntime.cudaLogsUnregisterCallback(cycallback) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaLogsCurrent' in found_functions}} @@ -31080,8 +30924,8 @@ def cudaLogsCurrent(unsigned int flags): with nogil: err = cyruntime.cudaLogsCurrent(iterator_out._pvt_ptr, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], iterator_out) + return (cudaError_t(err), None) + return (cudaError_t(err), iterator_out) {{endif}} {{if 'cudaLogsDumpToFile' in found_functions}} @@ -31124,8 +30968,8 @@ def cudaLogsDumpToFile(iterator : Optional[cudaLogIterator], char* pathToFile, u with nogil: err = cyruntime.cudaLogsDumpToFile(cyiterator, pathToFile, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], iterator) + return (cudaError_t(err), None) + return (cudaError_t(err), iterator) {{endif}} {{if 'cudaLogsDumpToMemory' in found_functions}} @@ -31182,8 +31026,8 @@ def cudaLogsDumpToMemory(iterator : Optional[cudaLogIterator], char* buffer, siz with nogil: err = cyruntime.cudaLogsDumpToMemory(cyiterator, buffer, &size, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], iterator, size) + return (cudaError_t(err), None, None) + return (cudaError_t(err), iterator, size) {{endif}} {{if 'cudaGraphCreate' in found_functions}} @@ -31214,8 +31058,8 @@ def cudaGraphCreate(unsigned int flags): with nogil: err = cyruntime.cudaGraphCreate(pGraph._pvt_ptr, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraph) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraph) {{endif}} {{if 'cudaGraphAddKernelNode' in found_functions}} @@ -31336,8 +31180,8 @@ def cudaGraphAddKernelNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphKernelNodeGetParams' in found_functions}} @@ -31385,8 +31229,8 @@ def cudaGraphKernelNodeGetParams(node): with nogil: err = cyruntime.cudaGraphKernelNodeGetParams(cynode, pNodeParams._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pNodeParams) + return (cudaError_t(err), None) + return (cudaError_t(err), pNodeParams) {{endif}} {{if 'cudaGraphKernelNodeSetParams' in found_functions}} @@ -31424,7 +31268,7 @@ def cudaGraphKernelNodeSetParams(node, pNodeParams : Optional[cudaKernelNodePara cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphKernelNodeSetParams(cynode, cypNodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} @@ -31471,7 +31315,7 @@ def cudaGraphKernelNodeCopyAttributes(hDst, hSrc): cyhDst = phDst with nogil: err = cyruntime.cudaGraphKernelNodeCopyAttributes(cyhDst, cyhSrc) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} @@ -31514,8 +31358,8 @@ def cudaGraphKernelNodeGetAttribute(hNode, attr not None : cudaKernelNodeAttrID) with nogil: err = cyruntime.cudaGraphKernelNodeGetAttribute(cyhNode, cyattr, value_out._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], value_out) + return (cudaError_t(err), None) + return (cudaError_t(err), value_out) {{endif}} {{if 'cudaGraphKernelNodeSetAttribute' in found_functions}} @@ -31557,7 +31401,7 @@ def cudaGraphKernelNodeSetAttribute(hNode, attr not None : cudaKernelNodeAttrID, cdef cyruntime.cudaKernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cyruntime.cudaGraphKernelNodeSetAttribute(cyhNode, cyattr, cyvalue_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphAddMemcpyNode' in found_functions}} @@ -31632,8 +31476,8 @@ def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphAddMemcpyNode1D' in found_functions}} @@ -31727,8 +31571,8 @@ def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[tuple[cudaGraphNode if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphMemcpyNodeGetParams' in found_functions}} @@ -31767,8 +31611,8 @@ def cudaGraphMemcpyNodeGetParams(node): with nogil: err = cyruntime.cudaGraphMemcpyNodeGetParams(cynode, pNodeParams._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pNodeParams) + return (cudaError_t(err), None) + return (cudaError_t(err), pNodeParams) {{endif}} {{if 'cudaGraphMemcpyNodeSetParams' in found_functions}} @@ -31806,7 +31650,7 @@ def cudaGraphMemcpyNodeSetParams(node, pNodeParams : Optional[cudaMemcpy3DParms] cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphMemcpyNodeSetParams(cynode, cypNodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}} @@ -31868,7 +31712,7 @@ def cudaGraphMemcpyNodeSetParams1D(node, dst, src, size_t count, kind not None : cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaGraphMemcpyNodeSetParams1D(cynode, cydst_ptr, cysrc_ptr, count, cykind) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphAddMemsetNode' in found_functions}} @@ -31937,8 +31781,8 @@ def cudaGraphAddMemsetNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphMemsetNodeGetParams' in found_functions}} @@ -31977,8 +31821,8 @@ def cudaGraphMemsetNodeGetParams(node): with nogil: err = cyruntime.cudaGraphMemsetNodeGetParams(cynode, pNodeParams._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pNodeParams) + return (cudaError_t(err), None) + return (cudaError_t(err), pNodeParams) {{endif}} {{if 'cudaGraphMemsetNodeSetParams' in found_functions}} @@ -32016,7 +31860,7 @@ def cudaGraphMemsetNodeSetParams(node, pNodeParams : Optional[cudaMemsetParams]) cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphMemsetNodeSetParams(cynode, cypNodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphAddHostNode' in found_functions}} @@ -32086,8 +31930,8 @@ def cudaGraphAddHostNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphHostNodeGetParams' in found_functions}} @@ -32126,8 +31970,8 @@ def cudaGraphHostNodeGetParams(node): with nogil: err = cyruntime.cudaGraphHostNodeGetParams(cynode, pNodeParams._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pNodeParams) + return (cudaError_t(err), None) + return (cudaError_t(err), pNodeParams) {{endif}} {{if 'cudaGraphHostNodeSetParams' in found_functions}} @@ -32165,7 +32009,7 @@ def cudaGraphHostNodeSetParams(node, pNodeParams : Optional[cudaHostNodeParams]) cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphHostNodeSetParams(cynode, cypNodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphAddChildGraphNode' in found_functions}} @@ -32245,8 +32089,8 @@ def cudaGraphAddChildGraphNode(graph, pDependencies : Optional[tuple[cudaGraphNo if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}} @@ -32290,8 +32134,8 @@ def cudaGraphChildGraphNodeGetGraph(node): with nogil: err = cyruntime.cudaGraphChildGraphNodeGetGraph(cynode, pGraph._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraph) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraph) {{endif}} {{if 'cudaGraphAddEmptyNode' in found_functions}} @@ -32361,8 +32205,8 @@ def cudaGraphAddEmptyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphAddEventRecordNode' in found_functions}} @@ -32441,8 +32285,8 @@ def cudaGraphAddEventRecordNode(graph, pDependencies : Optional[tuple[cudaGraphN if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}} @@ -32481,8 +32325,8 @@ def cudaGraphEventRecordNodeGetEvent(node): with nogil: err = cyruntime.cudaGraphEventRecordNodeGetEvent(cynode, event_out._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], event_out) + return (cudaError_t(err), None) + return (cudaError_t(err), event_out) {{endif}} {{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}} @@ -32527,7 +32371,7 @@ def cudaGraphEventRecordNodeSetEvent(node, event): cynode = pnode with nogil: err = cyruntime.cudaGraphEventRecordNodeSetEvent(cynode, cyevent) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphAddEventWaitNode' in found_functions}} @@ -32609,8 +32453,8 @@ def cudaGraphAddEventWaitNode(graph, pDependencies : Optional[tuple[cudaGraphNod if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}} @@ -32649,8 +32493,8 @@ def cudaGraphEventWaitNodeGetEvent(node): with nogil: err = cyruntime.cudaGraphEventWaitNodeGetEvent(cynode, event_out._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], event_out) + return (cudaError_t(err), None) + return (cudaError_t(err), event_out) {{endif}} {{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}} @@ -32695,7 +32539,7 @@ def cudaGraphEventWaitNodeSetEvent(node, event): cynode = pnode with nogil: err = cyruntime.cudaGraphEventWaitNodeSetEvent(cynode, cyevent) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}} @@ -32766,8 +32610,8 @@ def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[tup if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} @@ -32812,8 +32656,8 @@ def cudaGraphExternalSemaphoresSignalNodeGetParams(hNode): with nogil: err = cyruntime.cudaGraphExternalSemaphoresSignalNodeGetParams(cyhNode, params_out._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], params_out) + return (cudaError_t(err), None) + return (cudaError_t(err), params_out) {{endif}} {{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} @@ -32852,7 +32696,7 @@ def cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[ cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExternalSemaphoresSignalNodeSetParams(cyhNode, cynodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}} @@ -32923,8 +32767,8 @@ def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[tuple if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} @@ -32969,8 +32813,8 @@ def cudaGraphExternalSemaphoresWaitNodeGetParams(hNode): with nogil: err = cyruntime.cudaGraphExternalSemaphoresWaitNodeGetParams(cyhNode, params_out._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], params_out) + return (cudaError_t(err), None) + return (cudaError_t(err), params_out) {{endif}} {{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} @@ -33009,7 +32853,7 @@ def cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[cu cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExternalSemaphoresWaitNodeSetParams(cyhNode, cynodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphAddMemAllocNode' in found_functions}} @@ -33119,8 +32963,8 @@ def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[tuple[cudaGraphNode if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphMemAllocNodeGetParams' in found_functions}} @@ -33162,8 +33006,8 @@ def cudaGraphMemAllocNodeGetParams(node): with nogil: err = cyruntime.cudaGraphMemAllocNodeGetParams(cynode, params_out._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], params_out) + return (cudaError_t(err), None) + return (cudaError_t(err), params_out) {{endif}} {{if 'cudaGraphAddMemFreeNode' in found_functions}} @@ -33252,8 +33096,8 @@ def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[tuple[cudaGraphNode_ if len(pDependencies) > 1 and cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphMemFreeNodeGetParams' in found_functions}} @@ -33293,8 +33137,8 @@ def cudaGraphMemFreeNodeGetParams(node): with nogil: err = cyruntime.cudaGraphMemFreeNodeGetParams(cynode, cydptr_out_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], dptr_out) + return (cudaError_t(err), None) + return (cudaError_t(err), dptr_out) {{endif}} {{if 'cudaDeviceGraphMemTrim' in found_functions}} @@ -33323,7 +33167,7 @@ def cudaDeviceGraphMemTrim(int device): """ with nogil: err = cyruntime.cudaDeviceGraphMemTrim(device) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceGetGraphMemAttribute' in found_functions}} @@ -33373,8 +33217,8 @@ def cudaDeviceGetGraphMemAttribute(int device, attr not None : cudaGraphMemAttri with nogil: err = cyruntime.cudaDeviceGetGraphMemAttribute(device, cyattr, cyvalue_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], cyvalue.pyObj()) + return (cudaError_t(err), None) + return (cudaError_t(err), cyvalue.pyObj()) {{endif}} {{if 'cudaDeviceSetGraphMemAttribute' in found_functions}} @@ -33416,7 +33260,7 @@ def cudaDeviceSetGraphMemAttribute(int device, attr not None : cudaGraphMemAttri cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cyruntime.cudaDeviceSetGraphMemAttribute(device, cyattr, cyvalue_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphClone' in found_functions}} @@ -33465,8 +33309,8 @@ def cudaGraphClone(originalGraph): with nogil: err = cyruntime.cudaGraphClone(pGraphClone._pvt_ptr, cyoriginalGraph) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphClone) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphClone) {{endif}} {{if 'cudaGraphNodeFindInClone' in found_functions}} @@ -33522,8 +33366,8 @@ def cudaGraphNodeFindInClone(originalNode, clonedGraph): with nogil: err = cyruntime.cudaGraphNodeFindInClone(pNode._pvt_ptr, cyoriginalNode, cyclonedGraph) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pNode) {{endif}} {{if 'cudaGraphNodeGetType' in found_functions}} @@ -33562,8 +33406,8 @@ def cudaGraphNodeGetType(node): with nogil: err = cyruntime.cudaGraphNodeGetType(cynode, &pType) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], cudaGraphNodeType(pType)) + return (cudaError_t(err), None) + return (cudaError_t(err), cudaGraphNodeType(pType)) {{endif}} {{if 'cudaGraphNodeGetContainingGraph' in found_functions}} @@ -33603,8 +33447,8 @@ def cudaGraphNodeGetContainingGraph(hNode): with nogil: err = cyruntime.cudaGraphNodeGetContainingGraph(cyhNode, phGraph._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], phGraph) + return (cudaError_t(err), None) + return (cudaError_t(err), phGraph) {{endif}} {{if 'cudaGraphNodeGetLocalId' in found_functions}} @@ -33645,8 +33489,8 @@ def cudaGraphNodeGetLocalId(hNode): with nogil: err = cyruntime.cudaGraphNodeGetLocalId(cyhNode, &nodeId) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], nodeId) + return (cudaError_t(err), None) + return (cudaError_t(err), nodeId) {{endif}} {{if 'cudaGraphNodeGetToolsId' in found_functions}} @@ -33683,8 +33527,8 @@ def cudaGraphNodeGetToolsId(hNode): with nogil: err = cyruntime.cudaGraphNodeGetToolsId(cyhNode, &toolsNodeId) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], toolsNodeId) + return (cudaError_t(err), None) + return (cudaError_t(err), toolsNodeId) {{endif}} {{if 'cudaGraphGetId' in found_functions}} @@ -33724,8 +33568,8 @@ def cudaGraphGetId(hGraph): with nogil: err = cyruntime.cudaGraphGetId(cyhGraph, &graphID) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], graphID) + return (cudaError_t(err), None) + return (cudaError_t(err), graphID) {{endif}} {{if 'cudaGraphExecGetId' in found_functions}} @@ -33765,8 +33609,8 @@ def cudaGraphExecGetId(hGraphExec): with nogil: err = cyruntime.cudaGraphExecGetId(cyhGraphExec, &graphID) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], graphID) + return (cudaError_t(err), None) + return (cudaError_t(err), graphID) {{endif}} {{if 'cudaGraphGetNodes' in found_functions}} @@ -33824,8 +33668,8 @@ def cudaGraphGetNodes(graph, size_t numNodes = 0): if cynodes is not NULL: free(cynodes) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], pynodes, numNodes) + return (cudaError_t(err), None, None) + return (cudaError_t(err), pynodes, numNodes) {{endif}} {{if 'cudaGraphGetRootNodes' in found_functions}} @@ -33883,8 +33727,8 @@ def cudaGraphGetRootNodes(graph, size_t pNumRootNodes = 0): if cypRootNodes is not NULL: free(cypRootNodes) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], pypRootNodes, pNumRootNodes) + return (cudaError_t(err), None, None) + return (cudaError_t(err), pypRootNodes, pNumRootNodes) {{endif}} {{if 'cudaGraphGetEdges' in found_functions}} @@ -33973,8 +33817,8 @@ def cudaGraphGetEdges(graph, size_t numEdges = 0): if cyedgeData is not NULL: free(cyedgeData) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None, None, None) - return (_dict_cudaError_t[err], pyfrom_, pyto, pyedgeData, numEdges) + return (cudaError_t(err), None, None, None, None) + return (cudaError_t(err), pyfrom_, pyto, pyedgeData, numEdges) {{endif}} {{if 'cudaGraphNodeGetDependencies' in found_functions}} @@ -34050,8 +33894,8 @@ def cudaGraphNodeGetDependencies(node, size_t pNumDependencies = 0): if cyedgeData is not NULL: free(cyedgeData) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None, None) - return (_dict_cudaError_t[err], pypDependencies, pyedgeData, pNumDependencies) + return (cudaError_t(err), None, None, None) + return (cudaError_t(err), pypDependencies, pyedgeData, pNumDependencies) {{endif}} {{if 'cudaGraphNodeGetDependentNodes' in found_functions}} @@ -34127,8 +33971,8 @@ def cudaGraphNodeGetDependentNodes(node, size_t pNumDependentNodes = 0): if cyedgeData is not NULL: free(cyedgeData) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None, None) - return (_dict_cudaError_t[err], pypDependentNodes, pyedgeData, pNumDependentNodes) + return (cudaError_t(err), None, None, None) + return (cudaError_t(err), pypDependentNodes, pyedgeData, pNumDependentNodes) {{endif}} {{if 'cudaGraphAddDependencies' in found_functions}} @@ -34221,7 +34065,7 @@ def cudaGraphAddDependencies(graph, from_ : Optional[tuple[cudaGraphNode_t] | li free(cyto) if len(edgeData) > 1 and cyedgeData is not NULL: free(cyedgeData) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphRemoveDependencies' in found_functions}} @@ -34317,7 +34161,7 @@ def cudaGraphRemoveDependencies(graph, from_ : Optional[tuple[cudaGraphNode_t] | free(cyto) if len(edgeData) > 1 and cyedgeData is not NULL: free(cyedgeData) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphDestroyNode' in found_functions}} @@ -34356,7 +34200,7 @@ def cudaGraphDestroyNode(node): cynode = pnode with nogil: err = cyruntime.cudaGraphDestroyNode(cynode) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphInstantiate' in found_functions}} @@ -34459,8 +34303,8 @@ def cudaGraphInstantiate(graph, unsigned long long flags): with nogil: err = cyruntime.cudaGraphInstantiate(pGraphExec._pvt_ptr, cygraph, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphExec) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphExec) {{endif}} {{if 'cudaGraphInstantiateWithFlags' in found_functions}} @@ -34565,8 +34409,8 @@ def cudaGraphInstantiateWithFlags(graph, unsigned long long flags): with nogil: err = cyruntime.cudaGraphInstantiateWithFlags(pGraphExec._pvt_ptr, cygraph, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphExec) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphExec) {{endif}} {{if 'cudaGraphInstantiateWithParams' in found_functions}} @@ -34712,8 +34556,8 @@ def cudaGraphInstantiateWithParams(graph, instantiateParams : Optional[cudaGraph with nogil: err = cyruntime.cudaGraphInstantiateWithParams(pGraphExec._pvt_ptr, cygraph, cyinstantiateParams_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphExec) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphExec) {{endif}} {{if 'cudaGraphExecGetFlags' in found_functions}} @@ -34755,8 +34599,8 @@ def cudaGraphExecGetFlags(graphExec): with nogil: err = cyruntime.cudaGraphExecGetFlags(cygraphExec, &flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], flags) + return (cudaError_t(err), None) + return (cudaError_t(err), flags) {{endif}} {{if 'cudaGraphExecKernelNodeSetParams' in found_functions}} @@ -34838,7 +34682,7 @@ def cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecKernelNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}} @@ -34903,7 +34747,7 @@ def cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecMemcpyNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}} @@ -34976,7 +34820,7 @@ def cudaGraphExecMemcpyNodeSetParams1D(hGraphExec, node, dst, src, size_t count, cdef cyruntime.cudaMemcpyKind cykind = int(kind) with nogil: err = cyruntime.cudaGraphExecMemcpyNodeSetParams1D(cyhGraphExec, cynode, cydst_ptr, cysrc_ptr, count, cykind) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}} @@ -35046,7 +34890,7 @@ def cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecMemsetNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphExecHostNodeSetParams' in found_functions}} @@ -35101,7 +34945,7 @@ def cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams : Optional[cuda cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecHostNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}} @@ -35171,7 +35015,7 @@ def cudaGraphExecChildGraphNodeSetParams(hGraphExec, node, childGraph): cyhGraphExec = phGraphExec with nogil: err = cyruntime.cudaGraphExecChildGraphNodeSetParams(cyhGraphExec, cynode, cychildGraph) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}} @@ -35234,7 +35078,7 @@ def cudaGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event): cyhGraphExec = phGraphExec with nogil: err = cyruntime.cudaGraphExecEventRecordNodeSetEvent(cyhGraphExec, cyhNode, cyevent) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}} @@ -35297,7 +35141,7 @@ def cudaGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event): cyhGraphExec = phGraphExec with nogil: err = cyruntime.cudaGraphExecEventWaitNodeSetEvent(cyhGraphExec, cyhNode, cyevent) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} @@ -35357,7 +35201,7 @@ def cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodePa cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecExternalSemaphoresSignalNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} @@ -35417,7 +35261,7 @@ def cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodePara cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecExternalSemaphoresWaitNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphNodeSetEnabled' in found_functions}} @@ -35480,7 +35324,7 @@ def cudaGraphNodeSetEnabled(hGraphExec, hNode, unsigned int isEnabled): cyhGraphExec = phGraphExec with nogil: err = cyruntime.cudaGraphNodeSetEnabled(cyhGraphExec, cyhNode, isEnabled) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphNodeGetEnabled' in found_functions}} @@ -35538,8 +35382,8 @@ def cudaGraphNodeGetEnabled(hGraphExec, hNode): with nogil: err = cyruntime.cudaGraphNodeGetEnabled(cyhGraphExec, cyhNode, &isEnabled) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], isEnabled) + return (cudaError_t(err), None) + return (cudaError_t(err), isEnabled) {{endif}} {{if 'cudaGraphExecUpdate' in found_functions}} @@ -35714,8 +35558,8 @@ def cudaGraphExecUpdate(hGraphExec, hGraph): with nogil: err = cyruntime.cudaGraphExecUpdate(cyhGraphExec, cyhGraph, resultInfo._pvt_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], resultInfo) + return (cudaError_t(err), None) + return (cudaError_t(err), resultInfo) {{endif}} {{if 'cudaGraphUpload' in found_functions}} @@ -35764,7 +35608,7 @@ def cudaGraphUpload(graphExec, stream): cygraphExec = pgraphExec with nogil: err = cyruntime.cudaGraphUpload(cygraphExec, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphLaunch' in found_functions}} @@ -35818,7 +35662,7 @@ def cudaGraphLaunch(graphExec, stream): cygraphExec = pgraphExec with nogil: err = cyruntime.cudaGraphLaunch(cygraphExec, cystream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphExecDestroy' in found_functions}} @@ -35853,7 +35697,7 @@ def cudaGraphExecDestroy(graphExec): cygraphExec = pgraphExec with nogil: err = cyruntime.cudaGraphExecDestroy(cygraphExec) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphDestroy' in found_functions}} @@ -35888,7 +35732,7 @@ def cudaGraphDestroy(graph): cygraph = pgraph with nogil: err = cyruntime.cudaGraphDestroy(cygraph) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphDebugDotPrint' in found_functions}} @@ -35928,7 +35772,7 @@ def cudaGraphDebugDotPrint(graph, char* path, unsigned int flags): cygraph = pgraph with nogil: err = cyruntime.cudaGraphDebugDotPrint(cygraph, path, flags) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaUserObjectCreate' in found_functions}} @@ -35989,8 +35833,8 @@ def cudaUserObjectCreate(ptr, destroy, unsigned int initialRefcount, unsigned in with nogil: err = cyruntime.cudaUserObjectCreate(object_out._pvt_ptr, cyptr_ptr, cydestroy, initialRefcount, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], object_out) + return (cudaError_t(err), None) + return (cudaError_t(err), object_out) {{endif}} {{if 'cudaUserObjectRetain' in found_functions}} @@ -36032,7 +35876,7 @@ def cudaUserObjectRetain(object, unsigned int count): cyobject = pobject with nogil: err = cyruntime.cudaUserObjectRetain(cyobject, count) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaUserObjectRelease' in found_functions}} @@ -36077,7 +35921,7 @@ def cudaUserObjectRelease(object, unsigned int count): cyobject = pobject with nogil: err = cyruntime.cudaUserObjectRelease(cyobject, count) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphRetainUserObject' in found_functions}} @@ -36133,7 +35977,7 @@ def cudaGraphRetainUserObject(graph, object, unsigned int count, unsigned int fl cygraph = pgraph with nogil: err = cyruntime.cudaGraphRetainUserObject(cygraph, cyobject, count, flags) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphReleaseUserObject' in found_functions}} @@ -36184,7 +36028,7 @@ def cudaGraphReleaseUserObject(graph, object, unsigned int count): cygraph = pgraph with nogil: err = cyruntime.cudaGraphReleaseUserObject(cygraph, cyobject, count) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphAddNode' in found_functions}} @@ -36279,8 +36123,8 @@ def cudaGraphAddNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | li if len(dependencyData) > 1 and cydependencyData is not NULL: free(cydependencyData) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pGraphNode) + return (cudaError_t(err), None) + return (cudaError_t(err), pGraphNode) {{endif}} {{if 'cudaGraphNodeSetParams' in found_functions}} @@ -36324,7 +36168,7 @@ def cudaGraphNodeSetParams(node, nodeParams : Optional[cudaGraphNodeParams]): cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphNodeSetParams(cynode, cynodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphExecNodeSetParams' in found_functions}} @@ -36384,7 +36228,7 @@ def cudaGraphExecNodeSetParams(graphExec, node, nodeParams : Optional[cudaGraphN cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecNodeSetParams(cygraphExec, cynode, cynodeParams_ptr) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaGraphConditionalHandleCreate' in found_functions}} @@ -36435,8 +36279,8 @@ def cudaGraphConditionalHandleCreate(graph, unsigned int defaultLaunchValue, uns with nogil: err = cyruntime.cudaGraphConditionalHandleCreate(pHandle_out._pvt_ptr, cygraph, defaultLaunchValue, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pHandle_out) + return (cudaError_t(err), None) + return (cudaError_t(err), pHandle_out) {{endif}} {{if 'cudaGraphConditionalHandleCreate_v2' in found_functions}} @@ -36498,8 +36342,8 @@ def cudaGraphConditionalHandleCreate_v2(graph, ctx, unsigned int defaultLaunchVa with nogil: err = cyruntime.cudaGraphConditionalHandleCreate_v2(pHandle_out._pvt_ptr, cygraph, cyctx, defaultLaunchValue, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pHandle_out) + return (cudaError_t(err), None) + return (cudaError_t(err), pHandle_out) {{endif}} {{if 'cudaGetDriverEntryPoint' in found_functions}} @@ -36602,8 +36446,8 @@ def cudaGetDriverEntryPoint(char* symbol, unsigned long long flags): with nogil: err = cyruntime.cudaGetDriverEntryPoint(symbol, &funcPtr, flags, &driverStatus) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], funcPtr, cudaDriverEntryPointQueryResult(driverStatus)) + return (cudaError_t(err), None, None) + return (cudaError_t(err), funcPtr, cudaDriverEntryPointQueryResult(driverStatus)) {{endif}} {{if 'cudaGetDriverEntryPointByVersion' in found_functions}} @@ -36710,8 +36554,8 @@ def cudaGetDriverEntryPointByVersion(char* symbol, unsigned int cudaVersion, uns with nogil: err = cyruntime.cudaGetDriverEntryPointByVersion(symbol, &funcPtr, cudaVersion, flags, &driverStatus) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], funcPtr, cudaDriverEntryPointQueryResult(driverStatus)) + return (cudaError_t(err), None, None) + return (cudaError_t(err), funcPtr, cudaDriverEntryPointQueryResult(driverStatus)) {{endif}} {{if 'cudaLibraryLoadData' in found_functions}} @@ -36809,8 +36653,8 @@ def cudaLibraryLoadData(code, jitOptions : Optional[tuple[cudaJitOption] | list[ with nogil: err = cyruntime.cudaLibraryLoadData(library._pvt_ptr, cycode_ptr, cyjitOptions.data(), cyjitOptionsValues_ptr, numJitOptions, cylibraryOptions.data(), cylibraryOptionValues_ptr, numLibraryOptions) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], library) + return (cudaError_t(err), None) + return (cudaError_t(err), library) {{endif}} {{if 'cudaLibraryLoadFromFile' in found_functions}} @@ -36907,8 +36751,8 @@ def cudaLibraryLoadFromFile(char* fileName, jitOptions : Optional[tuple[cudaJitO with nogil: err = cyruntime.cudaLibraryLoadFromFile(library._pvt_ptr, fileName, cyjitOptions.data(), cyjitOptionsValues_ptr, numJitOptions, cylibraryOptions.data(), cylibraryOptionValues_ptr, numLibraryOptions) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], library) + return (cudaError_t(err), None) + return (cudaError_t(err), library) {{endif}} {{if 'cudaLibraryUnload' in found_functions}} @@ -36943,7 +36787,7 @@ def cudaLibraryUnload(library): cylibrary = plibrary with nogil: err = cyruntime.cudaLibraryUnload(cylibrary) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaLibraryGetKernel' in found_functions}} @@ -36986,8 +36830,8 @@ def cudaLibraryGetKernel(library, char* name): with nogil: err = cyruntime.cudaLibraryGetKernel(pKernel._pvt_ptr, cylibrary, name) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pKernel) + return (cudaError_t(err), None) + return (cudaError_t(err), pKernel) {{endif}} {{if 'cudaLibraryGetGlobal' in found_functions}} @@ -37038,8 +36882,8 @@ def cudaLibraryGetGlobal(library, char* name): with nogil: err = cyruntime.cudaLibraryGetGlobal(&dptr, &numbytes, cylibrary, name) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], dptr, numbytes) + return (cudaError_t(err), None, None) + return (cudaError_t(err), dptr, numbytes) {{endif}} {{if 'cudaLibraryGetManaged' in found_functions}} @@ -37092,8 +36936,8 @@ def cudaLibraryGetManaged(library, char* name): with nogil: err = cyruntime.cudaLibraryGetManaged(&dptr, &numbytes, cylibrary, name) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], dptr, numbytes) + return (cudaError_t(err), None, None) + return (cudaError_t(err), dptr, numbytes) {{endif}} {{if 'cudaLibraryGetUnifiedFunction' in found_functions}} @@ -37138,8 +36982,8 @@ def cudaLibraryGetUnifiedFunction(library, char* symbol): with nogil: err = cyruntime.cudaLibraryGetUnifiedFunction(&fptr, cylibrary, symbol) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], fptr) + return (cudaError_t(err), None) + return (cudaError_t(err), fptr) {{endif}} {{if 'cudaLibraryGetKernelCount' in found_functions}} @@ -37178,8 +37022,8 @@ def cudaLibraryGetKernelCount(lib): with nogil: err = cyruntime.cudaLibraryGetKernelCount(&count, cylib) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], count) + return (cudaError_t(err), None) + return (cudaError_t(err), count) {{endif}} {{if 'cudaLibraryEnumerateKernels' in found_functions}} @@ -37231,8 +37075,8 @@ def cudaLibraryEnumerateKernels(unsigned int numKernels, lib): if cykernels is not NULL: free(cykernels) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pykernels) + return (cudaError_t(err), None) + return (cudaError_t(err), pykernels) {{endif}} {{if 'cudaKernelSetAttributeForDevice' in found_functions}} @@ -37338,7 +37182,7 @@ def cudaKernelSetAttributeForDevice(kernel, attr not None : cudaFuncAttribute, i cdef cyruntime.cudaFuncAttribute cyattr = int(attr) with nogil: err = cyruntime.cudaKernelSetAttributeForDevice(cykernel, cyattr, value, device) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceGetDevResource' in found_functions}} @@ -37376,8 +37220,8 @@ def cudaDeviceGetDevResource(int device, typename not None : cudaDevResourceType with nogil: err = cyruntime.cudaDeviceGetDevResource(device, resource._pvt_ptr, cytypename) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], resource) + return (cudaError_t(err), None) + return (cudaError_t(err), resource) {{endif}} {{if 'cudaDevSmResourceSplitByCount' in found_functions}} @@ -37496,8 +37340,8 @@ def cudaDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[cudaD if cyresult is not NULL: free(cyresult) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None, None) - return (_dict_cudaError_t[err], pyresult, cynbGroups, remaining) + return (cudaError_t(err), None, None, None) + return (cudaError_t(err), pyresult, cynbGroups, remaining) {{endif}} {{if 'cudaDevSmResourceSplit' in found_functions}} @@ -37656,8 +37500,8 @@ def cudaDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[cudaDevResou if cyresult is not NULL: free(cyresult) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], pyresult, remainder) + return (cudaError_t(err), None, None) + return (cudaError_t(err), pyresult, remainder) {{endif}} {{if 'cudaDevResourceGenerateDesc' in found_functions}} @@ -37723,8 +37567,8 @@ def cudaDevResourceGenerateDesc(resources : Optional[tuple[cudaDevResource] | li if len(resources) > 1 and cyresources is not NULL: free(cyresources) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], phDesc) + return (cudaError_t(err), None) + return (cudaError_t(err), phDesc) {{endif}} {{if 'cudaGreenCtxCreate' in found_functions}} @@ -37786,8 +37630,8 @@ def cudaGreenCtxCreate(desc, int device, unsigned int flags): with nogil: err = cyruntime.cudaGreenCtxCreate(phCtx._pvt_ptr, cydesc, device, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], phCtx) + return (cudaError_t(err), None) + return (cudaError_t(err), phCtx) {{endif}} {{if 'cudaExecutionCtxDestroy' in found_functions}} @@ -37846,7 +37690,7 @@ def cudaExecutionCtxDestroy(ctx): cyctx = pctx with nogil: err = cyruntime.cudaExecutionCtxDestroy(cyctx) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaExecutionCtxGetDevResource' in found_functions}} @@ -37891,8 +37735,8 @@ def cudaExecutionCtxGetDevResource(ctx, typename not None : cudaDevResourceType) with nogil: err = cyruntime.cudaExecutionCtxGetDevResource(cyctx, resource._pvt_ptr, cytypename) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], resource) + return (cudaError_t(err), None) + return (cudaError_t(err), resource) {{endif}} {{if 'cudaExecutionCtxGetDevice' in found_functions}} @@ -37933,8 +37777,8 @@ def cudaExecutionCtxGetDevice(ctx): with nogil: err = cyruntime.cudaExecutionCtxGetDevice(&device, cyctx) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], device) + return (cudaError_t(err), None) + return (cudaError_t(err), device) {{endif}} {{if 'cudaExecutionCtxGetId' in found_functions}} @@ -37976,8 +37820,8 @@ def cudaExecutionCtxGetId(ctx): with nogil: err = cyruntime.cudaExecutionCtxGetId(cyctx, &ctxId) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], ctxId) + return (cudaError_t(err), None) + return (cudaError_t(err), ctxId) {{endif}} {{if 'cudaExecutionCtxStreamCreate' in found_functions}} @@ -38051,8 +37895,8 @@ def cudaExecutionCtxStreamCreate(ctx, unsigned int flags, int priority): with nogil: err = cyruntime.cudaExecutionCtxStreamCreate(phStream._pvt_ptr, cyctx, flags, priority) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], phStream) + return (cudaError_t(err), None) + return (cudaError_t(err), phStream) {{endif}} {{if 'cudaExecutionCtxSynchronize' in found_functions}} @@ -38094,7 +37938,7 @@ def cudaExecutionCtxSynchronize(ctx): cyctx = pctx with nogil: err = cyruntime.cudaExecutionCtxSynchronize(cyctx) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaStreamGetDevResource' in found_functions}} @@ -38141,8 +37985,8 @@ def cudaStreamGetDevResource(hStream, typename not None : cudaDevResourceType): with nogil: err = cyruntime.cudaStreamGetDevResource(cyhStream, resource._pvt_ptr, cytypename) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], resource) + return (cudaError_t(err), None) + return (cudaError_t(err), resource) {{endif}} {{if 'cudaExecutionCtxRecordEvent' in found_functions}} @@ -38201,7 +38045,7 @@ def cudaExecutionCtxRecordEvent(ctx, event): cyctx = pctx with nogil: err = cyruntime.cudaExecutionCtxRecordEvent(cyctx, cyevent) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaExecutionCtxWaitEvent' in found_functions}} @@ -38259,7 +38103,7 @@ def cudaExecutionCtxWaitEvent(ctx, event): cyctx = pctx with nogil: err = cyruntime.cudaExecutionCtxWaitEvent(cyctx, cyevent) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaDeviceGetExecutionCtx' in found_functions}} @@ -38297,8 +38141,8 @@ def cudaDeviceGetExecutionCtx(int device): with nogil: err = cyruntime.cudaDeviceGetExecutionCtx(ctx._pvt_ptr, device) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], ctx) + return (cudaError_t(err), None) + return (cudaError_t(err), ctx) {{endif}} {{if 'cudaGetExportTable' in found_functions}} @@ -38311,8 +38155,8 @@ def cudaGetExportTable(pExportTableId : Optional[cudaUUID_t]): with nogil: err = cyruntime.cudaGetExportTable(&ppExportTable, cypExportTableId_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], ppExportTable) + return (cudaError_t(err), None) + return (cudaError_t(err), ppExportTable) {{endif}} {{if 'cudaGetKernel' in found_functions}} @@ -38355,8 +38199,8 @@ def cudaGetKernel(entryFuncAddr): with nogil: err = cyruntime.cudaGetKernel(kernelPtr._pvt_ptr, cyentryFuncAddr_ptr) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], kernelPtr) + return (cudaError_t(err), None) + return (cudaError_t(err), kernelPtr) {{endif}} {{if 'make_cudaPitchedPtr' in found_functions}} @@ -38544,8 +38388,8 @@ def cudaGraphicsEGLRegisterImage(image, unsigned int flags): with nogil: err = cyruntime.cudaGraphicsEGLRegisterImage(pCudaResource._pvt_ptr, cyimage, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], pCudaResource) + return (cudaError_t(err), None) + return (cudaError_t(err), pCudaResource) {{endif}} {{if True}} @@ -38587,8 +38431,8 @@ def cudaEGLStreamConsumerConnect(eglStream): with nogil: err = cyruntime.cudaEGLStreamConsumerConnect(conn._pvt_ptr, cyeglStream) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], conn) + return (cudaError_t(err), None) + return (cudaError_t(err), conn) {{endif}} {{if True}} @@ -38634,8 +38478,8 @@ def cudaEGLStreamConsumerConnectWithFlags(eglStream, unsigned int flags): with nogil: err = cyruntime.cudaEGLStreamConsumerConnectWithFlags(conn._pvt_ptr, cyeglStream, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], conn) + return (cudaError_t(err), None) + return (cudaError_t(err), conn) {{endif}} {{if True}} @@ -38672,7 +38516,7 @@ def cudaEGLStreamConsumerDisconnect(conn): raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) with nogil: err = cyruntime.cudaEGLStreamConsumerDisconnect(cyconn) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if True}} @@ -38738,7 +38582,7 @@ def cudaEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, unsigned int raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) with nogil: err = cyruntime.cudaEGLStreamConsumerAcquireFrame(cyconn, cypCudaResource, cypStream, timeout) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if True}} @@ -38798,7 +38642,7 @@ def cudaEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream): raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) with nogil: err = cyruntime.cudaEGLStreamConsumerReleaseFrame(cyconn, cypCudaResource, cypStream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if True}} @@ -38860,8 +38704,8 @@ def cudaEGLStreamProducerConnect(eglStream, width, height): with nogil: err = cyruntime.cudaEGLStreamProducerConnect(conn._pvt_ptr, cyeglStream, cywidth, cyheight) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], conn) + return (cudaError_t(err), None) + return (cudaError_t(err), conn) {{endif}} {{if True}} @@ -38898,7 +38742,7 @@ def cudaEGLStreamProducerDisconnect(conn): raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) with nogil: err = cyruntime.cudaEGLStreamProducerDisconnect(cyconn) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if True}} @@ -38958,7 +38802,7 @@ def cudaEGLStreamProducerPresentFrame(conn, eglframe not None : cudaEglFrame, pS raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) with nogil: err = cyruntime.cudaEGLStreamProducerPresentFrame(cyconn, eglframe._pvt_ptr[0], cypStream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if True}} @@ -39013,7 +38857,7 @@ def cudaEGLStreamProducerReturnFrame(conn, eglframe : Optional[cudaEglFrame], pS cdef cyruntime.cudaEglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe is not None else NULL with nogil: err = cyruntime.cudaEGLStreamProducerReturnFrame(cyconn, cyeglframe_ptr, cypStream) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if True}} @@ -39066,8 +38910,8 @@ def cudaGraphicsResourceGetMappedEglFrame(resource, unsigned int index, unsigned with nogil: err = cyruntime.cudaGraphicsResourceGetMappedEglFrame(eglFrame._pvt_ptr, cyresource, index, mipLevel) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], eglFrame) + return (cudaError_t(err), None) + return (cudaError_t(err), eglFrame) {{endif}} {{if True}} @@ -39122,8 +38966,8 @@ def cudaEventCreateFromEGLSync(eglSync, unsigned int flags): with nogil: err = cyruntime.cudaEventCreateFromEGLSync(phEvent._pvt_ptr, cyeglSync, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], phEvent) + return (cudaError_t(err), None) + return (cudaError_t(err), phEvent) {{endif}} {{if 'cudaProfilerStart' in found_functions}} @@ -39151,7 +38995,7 @@ def cudaProfilerStart(): """ with nogil: err = cyruntime.cudaProfilerStart() - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if 'cudaProfilerStop' in found_functions}} @@ -39179,7 +39023,7 @@ def cudaProfilerStop(): """ with nogil: err = cyruntime.cudaProfilerStop() - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if True}} @@ -39246,8 +39090,8 @@ def cudaGLGetDevices(unsigned int cudaDeviceCount, deviceList not None : cudaGLD if cypCudaDevices is not NULL: free(cypCudaDevices) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None, None) - return (_dict_cudaError_t[err], pCudaDeviceCount, pypCudaDevices) + return (cudaError_t(err), None, None) + return (cudaError_t(err), pCudaDeviceCount, pypCudaDevices) {{endif}} {{if True}} @@ -39346,8 +39190,8 @@ def cudaGraphicsGLRegisterImage(image, target, unsigned int flags): with nogil: err = cyruntime.cudaGraphicsGLRegisterImage(resource._pvt_ptr, cyimage, cytarget, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], resource) + return (cudaError_t(err), None) + return (cudaError_t(err), resource) {{endif}} {{if True}} @@ -39403,8 +39247,8 @@ def cudaGraphicsGLRegisterBuffer(buffer, unsigned int flags): with nogil: err = cyruntime.cudaGraphicsGLRegisterBuffer(resource._pvt_ptr, cybuffer, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], resource) + return (cudaError_t(err), None) + return (cudaError_t(err), resource) {{endif}} {{if True}} @@ -39456,8 +39300,8 @@ def cudaVDPAUGetDevice(vdpDevice, vdpGetProcAddress): with nogil: err = cyruntime.cudaVDPAUGetDevice(&device, cyvdpDevice, cyvdpGetProcAddress) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], device) + return (cudaError_t(err), None) + return (cudaError_t(err), device) {{endif}} {{if True}} @@ -39516,7 +39360,7 @@ def cudaVDPAUSetVDPAUDevice(int device, vdpDevice, vdpGetProcAddress): cyvdpDevice = pvdpDevice with nogil: err = cyruntime.cudaVDPAUSetVDPAUDevice(device, cyvdpDevice, cyvdpGetProcAddress) - return (_dict_cudaError_t[err],) + return (cudaError_t(err),) {{endif}} {{if True}} @@ -39572,8 +39416,8 @@ def cudaGraphicsVDPAURegisterVideoSurface(vdpSurface, unsigned int flags): with nogil: err = cyruntime.cudaGraphicsVDPAURegisterVideoSurface(resource._pvt_ptr, cyvdpSurface, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], resource) + return (cudaError_t(err), None) + return (cudaError_t(err), resource) {{endif}} {{if True}} @@ -39629,8 +39473,8 @@ def cudaGraphicsVDPAURegisterOutputSurface(vdpSurface, unsigned int flags): with nogil: err = cyruntime.cudaGraphicsVDPAURegisterOutputSurface(resource._pvt_ptr, cyvdpSurface, flags) if err != cyruntime.cudaSuccess: - return (_dict_cudaError_t[err], None) - return (_dict_cudaError_t[err], resource) + return (cudaError_t(err), None) + return (cudaError_t(err), resource) {{endif}} diff --git a/cuda_bindings/cuda/bindings/utils/_fast_enum.c b/cuda_bindings/cuda/bindings/utils/_fast_enum.c new file mode 100644 index 0000000000..1459e02b70 --- /dev/null +++ b/cuda_bindings/cuda/bindings/utils/_fast_enum.c @@ -0,0 +1,399 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +#include +#include + +/* + * State for the module, storing references to our heap types. + */ +typedef struct { + PyObject *FastEnum_Type; + PyObject *FastEnumMetaclass_Type; +} fast_enum_state; + +static inline fast_enum_state* +get_fast_enum_state(PyObject *module) +{ + void *state = PyModule_GetState(module); + assert(state != NULL); + return (fast_enum_state *)state; +} + +/* + * =================================================================================== + * _FastEnum Implementation (Inherits from int) + * =================================================================================== + */ + +typedef struct { + PyLongObject long_base; /* Must be first to inherit from int */ + PyObject *name; +} FastEnumObject; + +static PyObject * +FastEnum_get_singletons(PyObject *obj) +{ + return PyObject_GetAttrString(obj, "__singletons__"); +} + +static PyObject * +FastEnum_get_members(PyObject *obj) +{ + return PyObject_GetAttrString(obj, "__members__"); +} + +static void +FastEnum_dealloc(FastEnumObject *self) +{ + Py_CLEAR(self->name); + Py_TYPE(self)->tp_free((PyObject *)self); +} + +// This method is not exposed to Python and is only called from FastEnumMetaclass_init. +// It is used to make the initial singleton instances of each of the values. + +static PyObject * +_FastEnum_new_member(PyTypeObject *type, PyObject *name, PyObject *value) +{ + /* Create the int base */ + PyObject *args_value = PyTuple_Pack(1, value); + if (!args_value) return NULL; + + /* Call super().__new__(cls, value) - technically int.__new__ */ + PyObject *self_obj = PyLong_Type.tp_new(type, args_value, NULL); + Py_DECREF(args_value); + if (!self_obj) return NULL; + + FastEnumObject *self = (FastEnumObject *)self_obj; + Py_INCREF(name); + self->name = name; + + return self_obj; +} + +// This method is exposed to Python as a constructor, and always returns one of +// the singleton instances. + +static PyObject * +FastEnum_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + if (kwds && PyDict_Size(kwds) != 0) { + PyErr_Format(PyExc_TypeError, "%S does not take keyword arguments", type); + return NULL; + } + + if (PyTuple_Size(args) != 1) { + PyErr_Format(PyExc_ValueError, "%S takes exactly one argument", type); + return NULL; + } + + PyObject *val = PyTuple_GET_ITEM(args, 0); + PyObject *singletons = FastEnum_get_singletons((PyObject *)type); + + int contains = PyDict_Contains(singletons, val); + + switch (contains) { + case 1: + PyObject *result = PyDict_GetItem(singletons, val); // borrowed ref + Py_DECREF(singletons); + Py_INCREF(result); + return result; + case 0: + Py_DECREF(singletons); + PyErr_Format(PyExc_ValueError, "Value %S not in %S", val, type); + return NULL; + case -1: + Py_DECREF(singletons); + return NULL; + } +} + +static PyObject * +FastEnum_repr(FastEnumObject *self) +{ + PyObject *result = NULL; + PyObject *type = NULL; + PyObject *type_name = NULL; + long long_val; + + /* Equivalent to: f"<{type(self).__name__}.{self._name}: {int(self)}>" */ + + type = (PyObject *)PyObject_Type((PyObject *)self); + if (type == NULL) goto exit; + + type_name = PyObject_GetAttrString(type, "__name__"); + if (type_name == NULL) goto exit; + + long_val = PyLong_AsLong((PyObject *)self); + + result = PyUnicode_FromFormat("<%U.%U: %ld>", type_name, self->name, long_val); + + exit: + Py_XDECREF(type); + Py_XDECREF(type_name); + + return result; +} + +static PyObject * +FastEnum_get_value(FastEnumObject *self, void *closure) +{ + return Py_NewRef((PyObject *)self); +} + +static PyObject * +FastEnum_get_name(FastEnumObject *self, void *closure) +{ + return Py_NewRef(self->name); +} + +static PyGetSetDef FastEnum_getseters[] = { + {"value", (getter)FastEnum_get_value, NULL, "Enum value", NULL}, + {"name", (getter)FastEnum_get_name, NULL, "Enum name", NULL}, + {NULL} /* Sentinel */ +}; + +static PyType_Slot FastEnum_slots[] = { + {Py_tp_new, FastEnum_new}, + {Py_tp_dealloc, FastEnum_dealloc}, + {Py_tp_repr, FastEnum_repr}, + {Py_tp_getset, FastEnum_getseters}, + {0, NULL}, +}; + +static PyType_Spec FastEnum_spec = { + .name = "_fast_enum._FastEnum", + .basicsize = sizeof(FastEnumObject), + .itemsize = 0, + .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_LONG_SUBCLASS, + .slots = FastEnum_slots, +}; + +/* + * =================================================================================== + * _FastEnumMetaclass Implementation (Inherits from type) + * =================================================================================== + */ + +/* Since it inherits from type, the struct is technically PyHeapTypeObject + but we don't need extra fields based on the python code. */ + +static int +FastEnumMetaclass_init(PyObject *cls, PyObject *args, PyObject *kwds) +{ + PyObject *members = NULL; + PyObject *singletons = NULL; + PyObject *contents = NULL; + PyObject *dunder = NULL; + int result = -1; + + if (PyType_Type.tp_init(cls, args, kwds) < 0) { + return -1; + } + + contents = PyObject_GenericGetDict(cls, NULL); + if (contents == NULL) goto exit; + + members = PyDict_New(); + if (members == NULL) goto exit; + + singletons = PyDict_New(); + if (singletons == NULL) goto exit; + + dunder = PyUnicode_FromString("__"); + if (dunder == NULL) goto exit; + + PyObject *key, *value; + Py_ssize_t pos = 0; + while (PyDict_Next(contents, &pos, &key, &value)) { + // Don't convert __dunder__ members + if ( + PyUnicode_Tailmatch(key, dunder, 0, 2, 0) && + PyUnicode_Tailmatch(key, dunder, 0, 2, -1) + ) { + continue; + } + + // Only convert members with integer values + if (PyLong_Check(value)) { + PyObject *new_entry = _FastEnum_new_member((PyTypeObject *)cls, key, value); + if (new_entry == NULL) goto exit; + if (PyDict_SetItem(members, key, new_entry)) { + Py_DECREF(new_entry); + goto exit; + } + + if (PyDict_SetItem(singletons, value, new_entry)) { + Py_DECREF(new_entry); + goto exit; + } + + Py_DECREF(new_entry); + } + } + + if (PyObject_SetAttrString(cls, "__members__", members)) goto exit; + if (PyObject_SetAttrString(cls, "__singletons__", singletons)) goto exit; + + pos = 0; + while (PyDict_Next(members, &pos, &key, &value)) { + if (PyObject_SetAttr(cls, key, value)) { + goto exit; + } + } + + result = 0; + + exit: + Py_XDECREF(members); + Py_XDECREF(singletons); + Py_XDECREF(contents); + Py_XDECREF(dunder); + return result; +} + +static PyObject * +FastEnumMetaclass_repr(PyObject *self) +{ + PyObject *result = NULL; + PyObject *type_name = NULL; + + /* Equivalent to: f"" */ + + type_name = PyObject_GetAttrString(self, "__name__"); + if (type_name == NULL) return NULL; + + result = PyUnicode_FromFormat("", type_name); + Py_DECREF(type_name); + + return result; +} + +static Py_ssize_t +FastEnumMetaclass_len(PyObject *cls) +{ + PyObject *members = FastEnum_get_members(cls); + if (!members) return -1; + Py_ssize_t len = PyDict_Size(members); + Py_DECREF(members); + return len; +} + +static PyObject * +FastEnumMetaclass_iter(PyObject *cls) +{ + PyObject *members = FastEnum_get_members(cls); + if (!members) return NULL; + + PyObject *values = PyDict_Values(members); + Py_DECREF(members); + if (!values) return NULL; + + PyObject *iter = PyObject_GetIter(values); + Py_DECREF(values); + return iter; +} + +static int +FastEnumMetaclass_sq_contains(PyObject *cls, PyObject *value) +{ + PyObject *singletons = FastEnum_get_singletons(cls); + if (!singletons) return -1; + + int in_keys = PyDict_Contains(singletons, value); + + Py_DECREF(singletons); + return in_keys; +} + +static PyType_Slot FastEnumMetaclass_slots[] = { + {Py_tp_init, FastEnumMetaclass_init}, + {Py_tp_repr, FastEnumMetaclass_repr}, + {Py_sq_length, FastEnumMetaclass_len}, + {Py_tp_iter, FastEnumMetaclass_iter}, + {Py_sq_contains, FastEnumMetaclass_sq_contains}, + {Py_tp_base, NULL}, /* Will be &PyType_Type */ + {0, NULL}, +}; + +static PyType_Spec FastEnumMetaclass_spec = { + .name = "_fast_enum._FastEnumMetaclass", + .basicsize = sizeof(PyHeapTypeObject), /* Metaclasses must use PyHeapTypeObject size */ + .itemsize = sizeof(PyMemberDef), /* Inheriting from type requires itemsize */ + .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_TYPE_SUBCLASS, + .slots = FastEnumMetaclass_slots, +}; + +/* + * =================================================================================== + * Module Initialization (Multi-phase) + * =================================================================================== + */ + +static int +fast_enum_exec(PyObject *module) +{ + fast_enum_state *state = get_fast_enum_state(module); + + /* Initialize _FastEnum (bases: int) */ + state->FastEnum_Type = PyType_FromModuleAndSpec(module, &FastEnum_spec, (PyObject *)&PyLong_Type); + if (state->FastEnum_Type == NULL) { + return -1; + } + if (PyModule_AddObjectRef(module, "_FastEnum", state->FastEnum_Type) < 0) { + Py_DECREF(state->FastEnum_Type); + return -1; + } + + /* Initialize _FastEnumMetaclass (bases: type) */ + state->FastEnumMetaclass_Type = PyType_FromModuleAndSpec(module, &FastEnumMetaclass_spec, (PyObject *)&PyType_Type); + if (state->FastEnumMetaclass_Type == NULL) { + return -1; + } + if (PyModule_AddObjectRef(module, "_FastEnumMetaclass", state->FastEnumMetaclass_Type) < 0) { + Py_DECREF(state->FastEnumMetaclass_Type); + return -1; + } + + return 0; +} + +static int +fast_enum_traverse(PyObject *module, visitproc visit, void *arg) +{ + fast_enum_state *state = get_fast_enum_state(module); + Py_VISIT(state->FastEnum_Type); + Py_VISIT(state->FastEnumMetaclass_Type); + return 0; +} + +static int +fast_enum_clear(PyObject *module) +{ + fast_enum_state *state = get_fast_enum_state(module); + Py_CLEAR(state->FastEnum_Type); + Py_CLEAR(state->FastEnumMetaclass_Type); + return 0; +} + +static PyModuleDef_Slot fast_enum_slots[] = { + {Py_mod_exec, fast_enum_exec}, + {0, NULL} +}; + +static struct PyModuleDef _fast_enum_module = { + PyModuleDef_HEAD_INIT, + .m_name = "_fast_enum", + .m_doc = "Fast Enum C Extension", + .m_size = sizeof(fast_enum_state), + .m_slots = fast_enum_slots, + .m_traverse = fast_enum_traverse, + .m_clear = fast_enum_clear, +}; + +PyMODINIT_FUNC +PyInit__fast_enum(void) +{ + return PyModuleDef_Init(&_fast_enum_module); +} diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index bfa1ae7826..7543ab9107 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE import atexit @@ -298,7 +298,7 @@ def prep_extensions(sources, libraries): libraries = libraries if libraries else [] exts = [] for pyx in files: - mod_name = pyx.replace(".pyx", "").replace(os.sep, ".").replace("/", ".") + mod_name = pyx[: pyx.rfind(".")].replace(os.sep, ".").replace("/", ".") exts.append( Extension( mod_name, @@ -374,6 +374,7 @@ def do_cythonize(extensions): (["cuda/bindings/_bindings/cyruntime_ptds.pyx"], static_runtime_libraries), # utils (["cuda/bindings/utils/*.pyx"], None), + (["cuda/bindings/utils/_fast_enum.c"], None), # public *(([f], None) for f in cuda_bindings_files), # internal files used by generated bindings diff --git a/cuda_bindings/tests/test_basics.py b/cuda_bindings/tests/test_basics.py new file mode 100644 index 0000000000..c6b53ac81d --- /dev/null +++ b/cuda_bindings/tests/test_basics.py @@ -0,0 +1,73 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +import enum + +import pytest +from cuda.bindings.utils import _fast_enum + +# Test both with the FastEnum implementation and the stdlib enum.IntEnum (even +# though we don't use the latter) to make sure that the two APIs are identical + + +class MyFastEnum(_fast_enum._FastEnum, metaclass=_fast_enum._FastEnumMetaclass): + RED = 0 + GREEN = 1 + BLUE = 2 + + +class MyIntEnum(enum.IntEnum): + RED = 0 + GREEN = 1 + BLUE = 2 + + +@pytest.mark.parametrize("MyEnum", [MyFastEnum, MyIntEnum]) +def test_enum(MyEnum): + container = MyEnum + + val = container.GREEN + + assert isinstance(val, MyEnum) + + assert container(1) is val + + with pytest.raises(ValueError): + container(5) + + # Different Python versions raise different error types here from + # stdlib.enum.IntEnum + with pytest.raises((ValueError, TypeError)): + container(1, 2, 3) + + with pytest.raises(TypeError): + container(foo=1) + + assert val == 1 + assert val.value == 1 + assert isinstance(val.value, int) + assert val.name == "GREEN" + assert isinstance(val.name, str) + + assert container.GREEN | container.BLUE == 3 + assert container.GREEN.BLUE is container.BLUE + + assert repr(container) == f"" + assert repr(val) == f"<{container.__name__}.GREEN: 1>" + + assert len(container) == 3 + + for item in container: + assert isinstance(item, container) + assert item in container + assert item.value in container + assert item.name in dir(container) + for item2 in container: + assert hasattr(item, item2.name) + assert item2.name in dir(item) + assert getattr(item, item2.name) is item2 + + for name, val in container.__members__.items(): + assert isinstance(val, container) + assert isinstance(name, str) + assert name == val.name