# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 12.9.0, generator version 0.3.1.dev1630+gadce055ea.d20260422. Do not modify it directly.
{{if 'Windows' == platform.system()}}
import os
cimport cuda.bindings._lib.windll as windll
{{else}}
cimport cuda.bindings._lib.dlfcn as dlfcn
{{endif}}
from libc.stdint cimport intptr_t, uintptr_t
import os
import sys
cimport cuda.bindings._bindings.loader as loader
import threading

cdef object __symbol_lock = threading.Lock()
cdef bint __cuPythonInit = False
{{if 'cuGetErrorString' in found_functions}}cdef void *__cuGetErrorString = NULL{{endif}}
{{if 'cuGetErrorName' in found_functions}}cdef void *__cuGetErrorName = NULL{{endif}}
{{if 'cuInit' in found_functions}}cdef void *__cuInit = NULL{{endif}}
{{if 'cuDriverGetVersion' in found_functions}}cdef void *__cuDriverGetVersion = NULL{{endif}}
{{if 'cuDeviceGet' in found_functions}}cdef void *__cuDeviceGet = NULL{{endif}}
{{if 'cuDeviceGetCount' in found_functions}}cdef void *__cuDeviceGetCount = NULL{{endif}}
{{if 'cuDeviceGetName' in found_functions}}cdef void *__cuDeviceGetName = NULL{{endif}}
{{if 'cuDeviceGetUuid' in found_functions}}cdef void *__cuDeviceGetUuid = NULL{{endif}}
{{if 'cuDeviceGetUuid_v2' in found_functions}}cdef void *__cuDeviceGetUuid_v2 = NULL{{endif}}
{{if 'cuDeviceGetLuid' in found_functions}}cdef void *__cuDeviceGetLuid = NULL{{endif}}
{{if 'cuDeviceTotalMem_v2' in found_functions}}cdef void *__cuDeviceTotalMem_v2 = NULL{{endif}}
{{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}}cdef void *__cuDeviceGetTexture1DLinearMaxWidth = NULL{{endif}}
{{if 'cuDeviceGetAttribute' in found_functions}}cdef void *__cuDeviceGetAttribute = NULL{{endif}}
{{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}}cdef void *__cuDeviceGetNvSciSyncAttributes = NULL{{endif}}
{{if 'cuDeviceSetMemPool' in found_functions}}cdef void *__cuDeviceSetMemPool = NULL{{endif}}
{{if 'cuDeviceGetMemPool' in found_functions}}cdef void *__cuDeviceGetMemPool = NULL{{endif}}
{{if 'cuDeviceGetDefaultMemPool' in found_functions}}cdef void *__cuDeviceGetDefaultMemPool = NULL{{endif}}
{{if 'cuDeviceGetExecAffinitySupport' in found_functions}}cdef void *__cuDeviceGetExecAffinitySupport = NULL{{endif}}
{{if 'cuFlushGPUDirectRDMAWrites' in found_functions}}cdef void *__cuFlushGPUDirectRDMAWrites = NULL{{endif}}
{{if 'cuDeviceGetProperties' in found_functions}}cdef void *__cuDeviceGetProperties = NULL{{endif}}
{{if 'cuDeviceComputeCapability' in found_functions}}cdef void *__cuDeviceComputeCapability = NULL{{endif}}
{{if 'cuDevicePrimaryCtxRetain' in found_functions}}cdef void *__cuDevicePrimaryCtxRetain = NULL{{endif}}
{{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}}cdef void *__cuDevicePrimaryCtxRelease_v2 = NULL{{endif}}
{{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}}cdef void *__cuDevicePrimaryCtxSetFlags_v2 = NULL{{endif}}
{{if 'cuDevicePrimaryCtxGetState' in found_functions}}cdef void *__cuDevicePrimaryCtxGetState = NULL{{endif}}
{{if 'cuDevicePrimaryCtxReset_v2' in found_functions}}cdef void *__cuDevicePrimaryCtxReset_v2 = NULL{{endif}}
{{if 'cuCtxCreate_v2' in found_functions}}cdef void *__cuCtxCreate_v2 = NULL{{endif}}
{{if 'cuCtxCreate_v3' in found_functions}}cdef void *__cuCtxCreate_v3 = NULL{{endif}}
{{if 'cuCtxCreate_v4' in found_functions}}cdef void *__cuCtxCreate_v4 = NULL{{endif}}
{{if 'cuCtxDestroy_v2' in found_functions}}cdef void *__cuCtxDestroy_v2 = NULL{{endif}}
{{if 'cuCtxPushCurrent_v2' in found_functions}}cdef void *__cuCtxPushCurrent_v2 = NULL{{endif}}
{{if 'cuCtxPopCurrent_v2' in found_functions}}cdef void *__cuCtxPopCurrent_v2 = NULL{{endif}}
{{if 'cuCtxSetCurrent' in found_functions}}cdef void *__cuCtxSetCurrent = NULL{{endif}}
{{if 'cuCtxGetCurrent' in found_functions}}cdef void *__cuCtxGetCurrent = NULL{{endif}}
{{if 'cuCtxGetDevice' in found_functions}}cdef void *__cuCtxGetDevice = NULL{{endif}}
{{if 'cuCtxGetFlags' in found_functions}}cdef void *__cuCtxGetFlags = NULL{{endif}}
{{if 'cuCtxSetFlags' in found_functions}}cdef void *__cuCtxSetFlags = NULL{{endif}}
{{if 'cuCtxGetId' in found_functions}}cdef void *__cuCtxGetId = NULL{{endif}}
{{if 'cuCtxSynchronize' in found_functions}}cdef void *__cuCtxSynchronize = NULL{{endif}}
{{if 'cuCtxSetLimit' in found_functions}}cdef void *__cuCtxSetLimit = NULL{{endif}}
{{if 'cuCtxGetLimit' in found_functions}}cdef void *__cuCtxGetLimit = NULL{{endif}}
{{if 'cuCtxGetCacheConfig' in found_functions}}cdef void *__cuCtxGetCacheConfig = NULL{{endif}}
{{if 'cuCtxSetCacheConfig' in found_functions}}cdef void *__cuCtxSetCacheConfig = NULL{{endif}}
{{if 'cuCtxGetApiVersion' in found_functions}}cdef void *__cuCtxGetApiVersion = NULL{{endif}}
{{if 'cuCtxGetStreamPriorityRange' in found_functions}}cdef void *__cuCtxGetStreamPriorityRange = NULL{{endif}}
{{if 'cuCtxResetPersistingL2Cache' in found_functions}}cdef void *__cuCtxResetPersistingL2Cache = NULL{{endif}}
{{if 'cuCtxGetExecAffinity' in found_functions}}cdef void *__cuCtxGetExecAffinity = NULL{{endif}}
{{if 'cuCtxRecordEvent' in found_functions}}cdef void *__cuCtxRecordEvent = NULL{{endif}}
{{if 'cuCtxWaitEvent' in found_functions}}cdef void *__cuCtxWaitEvent = NULL{{endif}}
{{if 'cuCtxAttach' in found_functions}}cdef void *__cuCtxAttach = NULL{{endif}}
{{if 'cuCtxDetach' in found_functions}}cdef void *__cuCtxDetach = NULL{{endif}}
{{if 'cuCtxGetSharedMemConfig' in found_functions}}cdef void *__cuCtxGetSharedMemConfig = NULL{{endif}}
{{if 'cuCtxSetSharedMemConfig' in found_functions}}cdef void *__cuCtxSetSharedMemConfig = NULL{{endif}}
{{if 'cuModuleLoad' in found_functions}}cdef void *__cuModuleLoad = NULL{{endif}}
{{if 'cuModuleLoadData' in found_functions}}cdef void *__cuModuleLoadData = NULL{{endif}}
{{if 'cuModuleLoadDataEx' in found_functions}}cdef void *__cuModuleLoadDataEx = NULL{{endif}}
{{if 'cuModuleLoadFatBinary' in found_functions}}cdef void *__cuModuleLoadFatBinary = NULL{{endif}}
{{if 'cuModuleUnload' in found_functions}}cdef void *__cuModuleUnload = NULL{{endif}}
{{if 'cuModuleGetLoadingMode' in found_functions}}cdef void *__cuModuleGetLoadingMode = NULL{{endif}}
{{if 'cuModuleGetFunction' in found_functions}}cdef void *__cuModuleGetFunction = NULL{{endif}}
{{if 'cuModuleGetFunctionCount' in found_functions}}cdef void *__cuModuleGetFunctionCount = NULL{{endif}}
{{if 'cuModuleEnumerateFunctions' in found_functions}}cdef void *__cuModuleEnumerateFunctions = NULL{{endif}}
{{if 'cuModuleGetGlobal_v2' in found_functions}}cdef void *__cuModuleGetGlobal_v2 = NULL{{endif}}
{{if 'cuLinkCreate_v2' in found_functions}}cdef void *__cuLinkCreate_v2 = NULL{{endif}}
{{if 'cuLinkAddData_v2' in found_functions}}cdef void *__cuLinkAddData_v2 = NULL{{endif}}
{{if 'cuLinkAddFile_v2' in found_functions}}cdef void *__cuLinkAddFile_v2 = NULL{{endif}}
{{if 'cuLinkComplete' in found_functions}}cdef void *__cuLinkComplete = NULL{{endif}}
{{if 'cuLinkDestroy' in found_functions}}cdef void *__cuLinkDestroy = NULL{{endif}}
{{if 'cuModuleGetTexRef' in found_functions}}cdef void *__cuModuleGetTexRef = NULL{{endif}}
{{if 'cuModuleGetSurfRef' in found_functions}}cdef void *__cuModuleGetSurfRef = NULL{{endif}}
{{if 'cuLibraryLoadData' in found_functions}}cdef void *__cuLibraryLoadData = NULL{{endif}}
{{if 'cuLibraryLoadFromFile' in found_functions}}cdef void *__cuLibraryLoadFromFile = NULL{{endif}}
{{if 'cuLibraryUnload' in found_functions}}cdef void *__cuLibraryUnload = NULL{{endif}}
{{if 'cuLibraryGetKernel' in found_functions}}cdef void *__cuLibraryGetKernel = NULL{{endif}}
{{if 'cuLibraryGetKernelCount' in found_functions}}cdef void *__cuLibraryGetKernelCount = NULL{{endif}}
{{if 'cuLibraryEnumerateKernels' in found_functions}}cdef void *__cuLibraryEnumerateKernels = NULL{{endif}}
{{if 'cuLibraryGetModule' in found_functions}}cdef void *__cuLibraryGetModule = NULL{{endif}}
{{if 'cuKernelGetFunction' in found_functions}}cdef void *__cuKernelGetFunction = NULL{{endif}}
{{if 'cuKernelGetLibrary' in found_functions}}cdef void *__cuKernelGetLibrary = NULL{{endif}}
{{if 'cuLibraryGetGlobal' in found_functions}}cdef void *__cuLibraryGetGlobal = NULL{{endif}}
{{if 'cuLibraryGetManaged' in found_functions}}cdef void *__cuLibraryGetManaged = NULL{{endif}}
{{if 'cuLibraryGetUnifiedFunction' in found_functions}}cdef void *__cuLibraryGetUnifiedFunction = NULL{{endif}}
{{if 'cuKernelGetAttribute' in found_functions}}cdef void *__cuKernelGetAttribute = NULL{{endif}}
{{if 'cuKernelSetAttribute' in found_functions}}cdef void *__cuKernelSetAttribute = NULL{{endif}}
{{if 'cuKernelSetCacheConfig' in found_functions}}cdef void *__cuKernelSetCacheConfig = NULL{{endif}}
{{if 'cuKernelGetName' in found_functions}}cdef void *__cuKernelGetName = NULL{{endif}}
{{if 'cuKernelGetParamInfo' in found_functions}}cdef void *__cuKernelGetParamInfo = NULL{{endif}}
{{if 'cuMemGetInfo_v2' in found_functions}}cdef void *__cuMemGetInfo_v2 = NULL{{endif}}
{{if 'cuMemAlloc_v2' in found_functions}}cdef void *__cuMemAlloc_v2 = NULL{{endif}}
{{if 'cuMemAllocPitch_v2' in found_functions}}cdef void *__cuMemAllocPitch_v2 = NULL{{endif}}
{{if 'cuMemFree_v2' in found_functions}}cdef void *__cuMemFree_v2 = NULL{{endif}}
{{if 'cuMemGetAddressRange_v2' in found_functions}}cdef void *__cuMemGetAddressRange_v2 = NULL{{endif}}
{{if 'cuMemAllocHost_v2' in found_functions}}cdef void *__cuMemAllocHost_v2 = NULL{{endif}}
{{if 'cuMemFreeHost' in found_functions}}cdef void *__cuMemFreeHost = NULL{{endif}}
{{if 'cuMemHostAlloc' in found_functions}}cdef void *__cuMemHostAlloc = NULL{{endif}}
{{if 'cuMemHostGetDevicePointer_v2' in found_functions}}cdef void *__cuMemHostGetDevicePointer_v2 = NULL{{endif}}
{{if 'cuMemHostGetFlags' in found_functions}}cdef void *__cuMemHostGetFlags = NULL{{endif}}
{{if 'cuMemAllocManaged' in found_functions}}cdef void *__cuMemAllocManaged = NULL{{endif}}
{{if 'cuDeviceRegisterAsyncNotification' in found_functions}}cdef void *__cuDeviceRegisterAsyncNotification = NULL{{endif}}
{{if 'cuDeviceUnregisterAsyncNotification' in found_functions}}cdef void *__cuDeviceUnregisterAsyncNotification = NULL{{endif}}
{{if 'cuDeviceGetByPCIBusId' in found_functions}}cdef void *__cuDeviceGetByPCIBusId = NULL{{endif}}
{{if 'cuDeviceGetPCIBusId' in found_functions}}cdef void *__cuDeviceGetPCIBusId = NULL{{endif}}
{{if 'cuIpcGetEventHandle' in found_functions}}cdef void *__cuIpcGetEventHandle = NULL{{endif}}
{{if 'cuIpcOpenEventHandle' in found_functions}}cdef void *__cuIpcOpenEventHandle = NULL{{endif}}
{{if 'cuIpcGetMemHandle' in found_functions}}cdef void *__cuIpcGetMemHandle = NULL{{endif}}
{{if 'cuIpcOpenMemHandle_v2' in found_functions}}cdef void *__cuIpcOpenMemHandle_v2 = NULL{{endif}}
{{if 'cuIpcCloseMemHandle' in found_functions}}cdef void *__cuIpcCloseMemHandle = NULL{{endif}}
{{if 'cuMemHostRegister_v2' in found_functions}}cdef void *__cuMemHostRegister_v2 = NULL{{endif}}
{{if 'cuMemHostUnregister' in found_functions}}cdef void *__cuMemHostUnregister = NULL{{endif}}
{{if 'cuMemcpy' in found_functions}}cdef void *__cuMemcpy = NULL{{endif}}
{{if 'cuMemcpyPeer' in found_functions}}cdef void *__cuMemcpyPeer = NULL{{endif}}
{{if 'cuMemcpyHtoD_v2' in found_functions}}cdef void *__cuMemcpyHtoD_v2 = NULL{{endif}}
{{if 'cuMemcpyDtoH_v2' in found_functions}}cdef void *__cuMemcpyDtoH_v2 = NULL{{endif}}
{{if 'cuMemcpyDtoD_v2' in found_functions}}cdef void *__cuMemcpyDtoD_v2 = NULL{{endif}}
{{if 'cuMemcpyDtoA_v2' in found_functions}}cdef void *__cuMemcpyDtoA_v2 = NULL{{endif}}
{{if 'cuMemcpyAtoD_v2' in found_functions}}cdef void *__cuMemcpyAtoD_v2 = NULL{{endif}}
{{if 'cuMemcpyHtoA_v2' in found_functions}}cdef void *__cuMemcpyHtoA_v2 = NULL{{endif}}
{{if 'cuMemcpyAtoH_v2' in found_functions}}cdef void *__cuMemcpyAtoH_v2 = NULL{{endif}}
{{if 'cuMemcpyAtoA_v2' in found_functions}}cdef void *__cuMemcpyAtoA_v2 = NULL{{endif}}
{{if 'cuMemcpy2D_v2' in found_functions}}cdef void *__cuMemcpy2D_v2 = NULL{{endif}}
{{if 'cuMemcpy2DUnaligned_v2' in found_functions}}cdef void *__cuMemcpy2DUnaligned_v2 = NULL{{endif}}
{{if 'cuMemcpy3D_v2' in found_functions}}cdef void *__cuMemcpy3D_v2 = NULL{{endif}}
{{if 'cuMemcpy3DPeer' in found_functions}}cdef void *__cuMemcpy3DPeer = NULL{{endif}}
{{if 'cuMemcpyAsync' in found_functions}}cdef void *__cuMemcpyAsync = NULL{{endif}}
{{if 'cuMemcpyPeerAsync' in found_functions}}cdef void *__cuMemcpyPeerAsync = NULL{{endif}}
{{if 'cuMemcpyHtoDAsync_v2' in found_functions}}cdef void *__cuMemcpyHtoDAsync_v2 = NULL{{endif}}
{{if 'cuMemcpyDtoHAsync_v2' in found_functions}}cdef void *__cuMemcpyDtoHAsync_v2 = NULL{{endif}}
{{if 'cuMemcpyDtoDAsync_v2' in found_functions}}cdef void *__cuMemcpyDtoDAsync_v2 = NULL{{endif}}
{{if 'cuMemcpyHtoAAsync_v2' in found_functions}}cdef void *__cuMemcpyHtoAAsync_v2 = NULL{{endif}}
{{if 'cuMemcpyAtoHAsync_v2' in found_functions}}cdef void *__cuMemcpyAtoHAsync_v2 = NULL{{endif}}
{{if 'cuMemcpy2DAsync_v2' in found_functions}}cdef void *__cuMemcpy2DAsync_v2 = NULL{{endif}}
{{if 'cuMemcpy3DAsync_v2' in found_functions}}cdef void *__cuMemcpy3DAsync_v2 = NULL{{endif}}
{{if 'cuMemcpy3DPeerAsync' in found_functions}}cdef void *__cuMemcpy3DPeerAsync = NULL{{endif}}
{{if 'cuMemcpyBatchAsync' in found_functions}}cdef void *__cuMemcpyBatchAsync = NULL{{endif}}
{{if 'cuMemcpy3DBatchAsync' in found_functions}}cdef void *__cuMemcpy3DBatchAsync = NULL{{endif}}
{{if 'cuMemsetD8_v2' in found_functions}}cdef void *__cuMemsetD8_v2 = NULL{{endif}}
{{if 'cuMemsetD16_v2' in found_functions}}cdef void *__cuMemsetD16_v2 = NULL{{endif}}
{{if 'cuMemsetD32_v2' in found_functions}}cdef void *__cuMemsetD32_v2 = NULL{{endif}}
{{if 'cuMemsetD2D8_v2' in found_functions}}cdef void *__cuMemsetD2D8_v2 = NULL{{endif}}
{{if 'cuMemsetD2D16_v2' in found_functions}}cdef void *__cuMemsetD2D16_v2 = NULL{{endif}}
{{if 'cuMemsetD2D32_v2' in found_functions}}cdef void *__cuMemsetD2D32_v2 = NULL{{endif}}
{{if 'cuMemsetD8Async' in found_functions}}cdef void *__cuMemsetD8Async = NULL{{endif}}
{{if 'cuMemsetD16Async' in found_functions}}cdef void *__cuMemsetD16Async = NULL{{endif}}
{{if 'cuMemsetD32Async' in found_functions}}cdef void *__cuMemsetD32Async = NULL{{endif}}
{{if 'cuMemsetD2D8Async' in found_functions}}cdef void *__cuMemsetD2D8Async = NULL{{endif}}
{{if 'cuMemsetD2D16Async' in found_functions}}cdef void *__cuMemsetD2D16Async = NULL{{endif}}
{{if 'cuMemsetD2D32Async' in found_functions}}cdef void *__cuMemsetD2D32Async = NULL{{endif}}
{{if 'cuArrayCreate_v2' in found_functions}}cdef void *__cuArrayCreate_v2 = NULL{{endif}}
{{if 'cuArrayGetDescriptor_v2' in found_functions}}cdef void *__cuArrayGetDescriptor_v2 = NULL{{endif}}
{{if 'cuArrayGetSparseProperties' in found_functions}}cdef void *__cuArrayGetSparseProperties = NULL{{endif}}
{{if 'cuMipmappedArrayGetSparseProperties' in found_functions}}cdef void *__cuMipmappedArrayGetSparseProperties = NULL{{endif}}
{{if 'cuArrayGetMemoryRequirements' in found_functions}}cdef void *__cuArrayGetMemoryRequirements = NULL{{endif}}
{{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}}cdef void *__cuMipmappedArrayGetMemoryRequirements = NULL{{endif}}
{{if 'cuArrayGetPlane' in found_functions}}cdef void *__cuArrayGetPlane = NULL{{endif}}
{{if 'cuArrayDestroy' in found_functions}}cdef void *__cuArrayDestroy = NULL{{endif}}
{{if 'cuArray3DCreate_v2' in found_functions}}cdef void *__cuArray3DCreate_v2 = NULL{{endif}}
{{if 'cuArray3DGetDescriptor_v2' in found_functions}}cdef void *__cuArray3DGetDescriptor_v2 = NULL{{endif}}
{{if 'cuMipmappedArrayCreate' in found_functions}}cdef void *__cuMipmappedArrayCreate = NULL{{endif}}
{{if 'cuMipmappedArrayGetLevel' in found_functions}}cdef void *__cuMipmappedArrayGetLevel = NULL{{endif}}
{{if 'cuMipmappedArrayDestroy' in found_functions}}cdef void *__cuMipmappedArrayDestroy = NULL{{endif}}
{{if 'cuMemGetHandleForAddressRange' in found_functions}}cdef void *__cuMemGetHandleForAddressRange = NULL{{endif}}
{{if 'cuMemBatchDecompressAsync' in found_functions}}cdef void *__cuMemBatchDecompressAsync = NULL{{endif}}
{{if 'cuMemAddressReserve' in found_functions}}cdef void *__cuMemAddressReserve = NULL{{endif}}
{{if 'cuMemAddressFree' in found_functions}}cdef void *__cuMemAddressFree = NULL{{endif}}
{{if 'cuMemCreate' in found_functions}}cdef void *__cuMemCreate = NULL{{endif}}
{{if 'cuMemRelease' in found_functions}}cdef void *__cuMemRelease = NULL{{endif}}
{{if 'cuMemMap' in found_functions}}cdef void *__cuMemMap = NULL{{endif}}
{{if 'cuMemMapArrayAsync' in found_functions}}cdef void *__cuMemMapArrayAsync = NULL{{endif}}
{{if 'cuMemUnmap' in found_functions}}cdef void *__cuMemUnmap = NULL{{endif}}
{{if 'cuMemSetAccess' in found_functions}}cdef void *__cuMemSetAccess = NULL{{endif}}
{{if 'cuMemGetAccess' in found_functions}}cdef void *__cuMemGetAccess = NULL{{endif}}
{{if 'cuMemExportToShareableHandle' in found_functions}}cdef void *__cuMemExportToShareableHandle = NULL{{endif}}
{{if 'cuMemImportFromShareableHandle' in found_functions}}cdef void *__cuMemImportFromShareableHandle = NULL{{endif}}
{{if 'cuMemGetAllocationGranularity' in found_functions}}cdef void *__cuMemGetAllocationGranularity = NULL{{endif}}
{{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}}cdef void *__cuMemGetAllocationPropertiesFromHandle = NULL{{endif}}
{{if 'cuMemRetainAllocationHandle' in found_functions}}cdef void *__cuMemRetainAllocationHandle = NULL{{endif}}
{{if 'cuMemFreeAsync' in found_functions}}cdef void *__cuMemFreeAsync = NULL{{endif}}
{{if 'cuMemAllocAsync' in found_functions}}cdef void *__cuMemAllocAsync = NULL{{endif}}
{{if 'cuMemPoolTrimTo' in found_functions}}cdef void *__cuMemPoolTrimTo = NULL{{endif}}
{{if 'cuMemPoolSetAttribute' in found_functions}}cdef void *__cuMemPoolSetAttribute = NULL{{endif}}
{{if 'cuMemPoolGetAttribute' in found_functions}}cdef void *__cuMemPoolGetAttribute = NULL{{endif}}
{{if 'cuMemPoolSetAccess' in found_functions}}cdef void *__cuMemPoolSetAccess = NULL{{endif}}
{{if 'cuMemPoolGetAccess' in found_functions}}cdef void *__cuMemPoolGetAccess = NULL{{endif}}
{{if 'cuMemPoolCreate' in found_functions}}cdef void *__cuMemPoolCreate = NULL{{endif}}
{{if 'cuMemPoolDestroy' in found_functions}}cdef void *__cuMemPoolDestroy = NULL{{endif}}
{{if 'cuMemAllocFromPoolAsync' in found_functions}}cdef void *__cuMemAllocFromPoolAsync = NULL{{endif}}
{{if 'cuMemPoolExportToShareableHandle' in found_functions}}cdef void *__cuMemPoolExportToShareableHandle = NULL{{endif}}
{{if 'cuMemPoolImportFromShareableHandle' in found_functions}}cdef void *__cuMemPoolImportFromShareableHandle = NULL{{endif}}
{{if 'cuMemPoolExportPointer' in found_functions}}cdef void *__cuMemPoolExportPointer = NULL{{endif}}
{{if 'cuMemPoolImportPointer' in found_functions}}cdef void *__cuMemPoolImportPointer = NULL{{endif}}
{{if 'cuMulticastCreate' in found_functions}}cdef void *__cuMulticastCreate = NULL{{endif}}
{{if 'cuMulticastAddDevice' in found_functions}}cdef void *__cuMulticastAddDevice = NULL{{endif}}
{{if 'cuMulticastBindMem' in found_functions}}cdef void *__cuMulticastBindMem = NULL{{endif}}
{{if 'cuMulticastBindAddr' in found_functions}}cdef void *__cuMulticastBindAddr = NULL{{endif}}
{{if 'cuMulticastUnbind' in found_functions}}cdef void *__cuMulticastUnbind = NULL{{endif}}
{{if 'cuMulticastGetGranularity' in found_functions}}cdef void *__cuMulticastGetGranularity = NULL{{endif}}
{{if 'cuPointerGetAttribute' in found_functions}}cdef void *__cuPointerGetAttribute = NULL{{endif}}
{{if 'cuMemPrefetchAsync' in found_functions}}cdef void *__cuMemPrefetchAsync = NULL{{endif}}
{{if 'cuMemPrefetchAsync_v2' in found_functions}}cdef void *__cuMemPrefetchAsync_v2 = NULL{{endif}}
{{if 'cuMemAdvise' in found_functions}}cdef void *__cuMemAdvise = NULL{{endif}}
{{if 'cuMemAdvise_v2' in found_functions}}cdef void *__cuMemAdvise_v2 = NULL{{endif}}
{{if 'cuMemRangeGetAttribute' in found_functions}}cdef void *__cuMemRangeGetAttribute = NULL{{endif}}
{{if 'cuMemRangeGetAttributes' in found_functions}}cdef void *__cuMemRangeGetAttributes = NULL{{endif}}
{{if 'cuPointerSetAttribute' in found_functions}}cdef void *__cuPointerSetAttribute = NULL{{endif}}
{{if 'cuPointerGetAttributes' in found_functions}}cdef void *__cuPointerGetAttributes = NULL{{endif}}
{{if 'cuStreamCreate' in found_functions}}cdef void *__cuStreamCreate = NULL{{endif}}
{{if 'cuStreamCreateWithPriority' in found_functions}}cdef void *__cuStreamCreateWithPriority = NULL{{endif}}
{{if 'cuStreamGetPriority' in found_functions}}cdef void *__cuStreamGetPriority = NULL{{endif}}
{{if 'cuStreamGetDevice' in found_functions}}cdef void *__cuStreamGetDevice = NULL{{endif}}
{{if 'cuStreamGetFlags' in found_functions}}cdef void *__cuStreamGetFlags = NULL{{endif}}
{{if 'cuStreamGetId' in found_functions}}cdef void *__cuStreamGetId = NULL{{endif}}
{{if 'cuStreamGetCtx' in found_functions}}cdef void *__cuStreamGetCtx = NULL{{endif}}
{{if 'cuStreamGetCtx_v2' in found_functions}}cdef void *__cuStreamGetCtx_v2 = NULL{{endif}}
{{if 'cuStreamWaitEvent' in found_functions}}cdef void *__cuStreamWaitEvent = NULL{{endif}}
{{if 'cuStreamAddCallback' in found_functions}}cdef void *__cuStreamAddCallback = NULL{{endif}}
{{if 'cuStreamBeginCapture_v2' in found_functions}}cdef void *__cuStreamBeginCapture_v2 = NULL{{endif}}
{{if 'cuStreamBeginCaptureToGraph' in found_functions}}cdef void *__cuStreamBeginCaptureToGraph = NULL{{endif}}
{{if 'cuThreadExchangeStreamCaptureMode' in found_functions}}cdef void *__cuThreadExchangeStreamCaptureMode = NULL{{endif}}
{{if 'cuStreamEndCapture' in found_functions}}cdef void *__cuStreamEndCapture = NULL{{endif}}
{{if 'cuStreamIsCapturing' in found_functions}}cdef void *__cuStreamIsCapturing = NULL{{endif}}
{{if 'cuStreamGetCaptureInfo_v2' in found_functions}}cdef void *__cuStreamGetCaptureInfo_v2 = NULL{{endif}}
{{if 'cuStreamGetCaptureInfo_v3' in found_functions}}cdef void *__cuStreamGetCaptureInfo_v3 = NULL{{endif}}
{{if 'cuStreamUpdateCaptureDependencies' in found_functions}}cdef void *__cuStreamUpdateCaptureDependencies = NULL{{endif}}
{{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}}cdef void *__cuStreamUpdateCaptureDependencies_v2 = NULL{{endif}}
{{if 'cuStreamAttachMemAsync' in found_functions}}cdef void *__cuStreamAttachMemAsync = NULL{{endif}}
{{if 'cuStreamQuery' in found_functions}}cdef void *__cuStreamQuery = NULL{{endif}}
{{if 'cuStreamSynchronize' in found_functions}}cdef void *__cuStreamSynchronize = NULL{{endif}}
{{if 'cuStreamDestroy_v2' in found_functions}}cdef void *__cuStreamDestroy_v2 = NULL{{endif}}
{{if 'cuStreamCopyAttributes' in found_functions}}cdef void *__cuStreamCopyAttributes = NULL{{endif}}
{{if 'cuStreamGetAttribute' in found_functions}}cdef void *__cuStreamGetAttribute = NULL{{endif}}
{{if 'cuStreamSetAttribute' in found_functions}}cdef void *__cuStreamSetAttribute = NULL{{endif}}
{{if 'cuEventCreate' in found_functions}}cdef void *__cuEventCreate = NULL{{endif}}
{{if 'cuEventRecord' in found_functions}}cdef void *__cuEventRecord = NULL{{endif}}
{{if 'cuEventRecordWithFlags' in found_functions}}cdef void *__cuEventRecordWithFlags = NULL{{endif}}
{{if 'cuEventQuery' in found_functions}}cdef void *__cuEventQuery = NULL{{endif}}
{{if 'cuEventSynchronize' in found_functions}}cdef void *__cuEventSynchronize = NULL{{endif}}
{{if 'cuEventDestroy_v2' in found_functions}}cdef void *__cuEventDestroy_v2 = NULL{{endif}}
{{if 'cuEventElapsedTime' in found_functions}}cdef void *__cuEventElapsedTime = NULL{{endif}}
{{if 'cuEventElapsedTime_v2' in found_functions}}cdef void *__cuEventElapsedTime_v2 = NULL{{endif}}
{{if 'cuImportExternalMemory' in found_functions}}cdef void *__cuImportExternalMemory = NULL{{endif}}
{{if 'cuExternalMemoryGetMappedBuffer' in found_functions}}cdef void *__cuExternalMemoryGetMappedBuffer = NULL{{endif}}
{{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}}cdef void *__cuExternalMemoryGetMappedMipmappedArray = NULL{{endif}}
{{if 'cuDestroyExternalMemory' in found_functions}}cdef void *__cuDestroyExternalMemory = NULL{{endif}}
{{if 'cuImportExternalSemaphore' in found_functions}}cdef void *__cuImportExternalSemaphore = NULL{{endif}}
{{if 'cuSignalExternalSemaphoresAsync' in found_functions}}cdef void *__cuSignalExternalSemaphoresAsync = NULL{{endif}}
{{if 'cuWaitExternalSemaphoresAsync' in found_functions}}cdef void *__cuWaitExternalSemaphoresAsync = NULL{{endif}}
{{if 'cuDestroyExternalSemaphore' in found_functions}}cdef void *__cuDestroyExternalSemaphore = NULL{{endif}}
{{if 'cuStreamWaitValue32_v2' in found_functions}}cdef void *__cuStreamWaitValue32_v2 = NULL{{endif}}
{{if 'cuStreamWaitValue64_v2' in found_functions}}cdef void *__cuStreamWaitValue64_v2 = NULL{{endif}}
{{if 'cuStreamWriteValue32_v2' in found_functions}}cdef void *__cuStreamWriteValue32_v2 = NULL{{endif}}
{{if 'cuStreamWriteValue64_v2' in found_functions}}cdef void *__cuStreamWriteValue64_v2 = NULL{{endif}}
{{if 'cuStreamBatchMemOp_v2' in found_functions}}cdef void *__cuStreamBatchMemOp_v2 = NULL{{endif}}
{{if 'cuFuncGetAttribute' in found_functions}}cdef void *__cuFuncGetAttribute = NULL{{endif}}
{{if 'cuFuncSetAttribute' in found_functions}}cdef void *__cuFuncSetAttribute = NULL{{endif}}
{{if 'cuFuncSetCacheConfig' in found_functions}}cdef void *__cuFuncSetCacheConfig = NULL{{endif}}
{{if 'cuFuncGetModule' in found_functions}}cdef void *__cuFuncGetModule = NULL{{endif}}
{{if 'cuFuncGetName' in found_functions}}cdef void *__cuFuncGetName = NULL{{endif}}
{{if 'cuFuncGetParamInfo' in found_functions}}cdef void *__cuFuncGetParamInfo = NULL{{endif}}
{{if 'cuFuncIsLoaded' in found_functions}}cdef void *__cuFuncIsLoaded = NULL{{endif}}
{{if 'cuFuncLoad' in found_functions}}cdef void *__cuFuncLoad = NULL{{endif}}
{{if 'cuLaunchKernel' in found_functions}}cdef void *__cuLaunchKernel = NULL{{endif}}
{{if 'cuLaunchKernelEx' in found_functions}}cdef void *__cuLaunchKernelEx = NULL{{endif}}
{{if 'cuLaunchCooperativeKernel' in found_functions}}cdef void *__cuLaunchCooperativeKernel = NULL{{endif}}
{{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}}cdef void *__cuLaunchCooperativeKernelMultiDevice = NULL{{endif}}
{{if 'cuLaunchHostFunc' in found_functions}}cdef void *__cuLaunchHostFunc = NULL{{endif}}
{{if 'cuFuncSetBlockShape' in found_functions}}cdef void *__cuFuncSetBlockShape = NULL{{endif}}
{{if 'cuFuncSetSharedSize' in found_functions}}cdef void *__cuFuncSetSharedSize = NULL{{endif}}
{{if 'cuParamSetSize' in found_functions}}cdef void *__cuParamSetSize = NULL{{endif}}
{{if 'cuParamSeti' in found_functions}}cdef void *__cuParamSeti = NULL{{endif}}
{{if 'cuParamSetf' in found_functions}}cdef void *__cuParamSetf = NULL{{endif}}
{{if 'cuParamSetv' in found_functions}}cdef void *__cuParamSetv = NULL{{endif}}
{{if 'cuLaunch' in found_functions}}cdef void *__cuLaunch = NULL{{endif}}
{{if 'cuLaunchGrid' in found_functions}}cdef void *__cuLaunchGrid = NULL{{endif}}
{{if 'cuLaunchGridAsync' in found_functions}}cdef void *__cuLaunchGridAsync = NULL{{endif}}
{{if 'cuParamSetTexRef' in found_functions}}cdef void *__cuParamSetTexRef = NULL{{endif}}
{{if 'cuFuncSetSharedMemConfig' in found_functions}}cdef void *__cuFuncSetSharedMemConfig = NULL{{endif}}
{{if 'cuGraphCreate' in found_functions}}cdef void *__cuGraphCreate = NULL{{endif}}
{{if 'cuGraphAddKernelNode_v2' in found_functions}}cdef void *__cuGraphAddKernelNode_v2 = NULL{{endif}}
{{if 'cuGraphKernelNodeGetParams_v2' in found_functions}}cdef void *__cuGraphKernelNodeGetParams_v2 = NULL{{endif}}
{{if 'cuGraphKernelNodeSetParams_v2' in found_functions}}cdef void *__cuGraphKernelNodeSetParams_v2 = NULL{{endif}}
{{if 'cuGraphAddMemcpyNode' in found_functions}}cdef void *__cuGraphAddMemcpyNode = NULL{{endif}}
{{if 'cuGraphMemcpyNodeGetParams' in found_functions}}cdef void *__cuGraphMemcpyNodeGetParams = NULL{{endif}}
{{if 'cuGraphMemcpyNodeSetParams' in found_functions}}cdef void *__cuGraphMemcpyNodeSetParams = NULL{{endif}}
{{if 'cuGraphAddMemsetNode' in found_functions}}cdef void *__cuGraphAddMemsetNode = NULL{{endif}}
{{if 'cuGraphMemsetNodeGetParams' in found_functions}}cdef void *__cuGraphMemsetNodeGetParams = NULL{{endif}}
{{if 'cuGraphMemsetNodeSetParams' in found_functions}}cdef void *__cuGraphMemsetNodeSetParams = NULL{{endif}}
{{if 'cuGraphAddHostNode' in found_functions}}cdef void *__cuGraphAddHostNode = NULL{{endif}}
{{if 'cuGraphHostNodeGetParams' in found_functions}}cdef void *__cuGraphHostNodeGetParams = NULL{{endif}}
{{if 'cuGraphHostNodeSetParams' in found_functions}}cdef void *__cuGraphHostNodeSetParams = NULL{{endif}}
{{if 'cuGraphAddChildGraphNode' in found_functions}}cdef void *__cuGraphAddChildGraphNode = NULL{{endif}}
{{if 'cuGraphChildGraphNodeGetGraph' in found_functions}}cdef void *__cuGraphChildGraphNodeGetGraph = NULL{{endif}}
{{if 'cuGraphAddEmptyNode' in found_functions}}cdef void *__cuGraphAddEmptyNode = NULL{{endif}}
{{if 'cuGraphAddEventRecordNode' in found_functions}}cdef void *__cuGraphAddEventRecordNode = NULL{{endif}}
{{if 'cuGraphEventRecordNodeGetEvent' in found_functions}}cdef void *__cuGraphEventRecordNodeGetEvent = NULL{{endif}}
{{if 'cuGraphEventRecordNodeSetEvent' in found_functions}}cdef void *__cuGraphEventRecordNodeSetEvent = NULL{{endif}}
{{if 'cuGraphAddEventWaitNode' in found_functions}}cdef void *__cuGraphAddEventWaitNode = NULL{{endif}}
{{if 'cuGraphEventWaitNodeGetEvent' in found_functions}}cdef void *__cuGraphEventWaitNodeGetEvent = NULL{{endif}}
{{if 'cuGraphEventWaitNodeSetEvent' in found_functions}}cdef void *__cuGraphEventWaitNodeSetEvent = NULL{{endif}}
{{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}}cdef void *__cuGraphAddExternalSemaphoresSignalNode = NULL{{endif}}
{{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}}cdef void *__cuGraphExternalSemaphoresSignalNodeGetParams = NULL{{endif}}
{{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}}cdef void *__cuGraphExternalSemaphoresSignalNodeSetParams = NULL{{endif}}
{{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}}cdef void *__cuGraphAddExternalSemaphoresWaitNode = NULL{{endif}}
{{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}}cdef void *__cuGraphExternalSemaphoresWaitNodeGetParams = NULL{{endif}}
{{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}}cdef void *__cuGraphExternalSemaphoresWaitNodeSetParams = NULL{{endif}}
{{if 'cuGraphAddBatchMemOpNode' in found_functions}}cdef void *__cuGraphAddBatchMemOpNode = NULL{{endif}}
{{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}}cdef void *__cuGraphBatchMemOpNodeGetParams = NULL{{endif}}
{{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}}cdef void *__cuGraphBatchMemOpNodeSetParams = NULL{{endif}}
{{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}}cdef void *__cuGraphExecBatchMemOpNodeSetParams = NULL{{endif}}
{{if 'cuGraphAddMemAllocNode' in found_functions}}cdef void *__cuGraphAddMemAllocNode = NULL{{endif}}
{{if 'cuGraphMemAllocNodeGetParams' in found_functions}}cdef void *__cuGraphMemAllocNodeGetParams = NULL{{endif}}
{{if 'cuGraphAddMemFreeNode' in found_functions}}cdef void *__cuGraphAddMemFreeNode = NULL{{endif}}
{{if 'cuGraphMemFreeNodeGetParams' in found_functions}}cdef void *__cuGraphMemFreeNodeGetParams = NULL{{endif}}
{{if 'cuDeviceGraphMemTrim' in found_functions}}cdef void *__cuDeviceGraphMemTrim = NULL{{endif}}
{{if 'cuDeviceGetGraphMemAttribute' in found_functions}}cdef void *__cuDeviceGetGraphMemAttribute = NULL{{endif}}
{{if 'cuDeviceSetGraphMemAttribute' in found_functions}}cdef void *__cuDeviceSetGraphMemAttribute = NULL{{endif}}
{{if 'cuGraphClone' in found_functions}}cdef void *__cuGraphClone = NULL{{endif}}
{{if 'cuGraphNodeFindInClone' in found_functions}}cdef void *__cuGraphNodeFindInClone = NULL{{endif}}
{{if 'cuGraphNodeGetType' in found_functions}}cdef void *__cuGraphNodeGetType = NULL{{endif}}
{{if 'cuGraphGetNodes' in found_functions}}cdef void *__cuGraphGetNodes = NULL{{endif}}
{{if 'cuGraphGetRootNodes' in found_functions}}cdef void *__cuGraphGetRootNodes = NULL{{endif}}
{{if 'cuGraphGetEdges' in found_functions}}cdef void *__cuGraphGetEdges = NULL{{endif}}
{{if 'cuGraphGetEdges_v2' in found_functions}}cdef void *__cuGraphGetEdges_v2 = NULL{{endif}}
{{if 'cuGraphNodeGetDependencies' in found_functions}}cdef void *__cuGraphNodeGetDependencies = NULL{{endif}}
{{if 'cuGraphNodeGetDependencies_v2' in found_functions}}cdef void *__cuGraphNodeGetDependencies_v2 = NULL{{endif}}
{{if 'cuGraphNodeGetDependentNodes' in found_functions}}cdef void *__cuGraphNodeGetDependentNodes = NULL{{endif}}
{{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}}cdef void *__cuGraphNodeGetDependentNodes_v2 = NULL{{endif}}
{{if 'cuGraphAddDependencies' in found_functions}}cdef void *__cuGraphAddDependencies = NULL{{endif}}
{{if 'cuGraphAddDependencies_v2' in found_functions}}cdef void *__cuGraphAddDependencies_v2 = NULL{{endif}}
{{if 'cuGraphRemoveDependencies' in found_functions}}cdef void *__cuGraphRemoveDependencies = NULL{{endif}}
{{if 'cuGraphRemoveDependencies_v2' in found_functions}}cdef void *__cuGraphRemoveDependencies_v2 = NULL{{endif}}
{{if 'cuGraphDestroyNode' in found_functions}}cdef void *__cuGraphDestroyNode = NULL{{endif}}
{{if 'cuGraphInstantiateWithFlags' in found_functions}}cdef void *__cuGraphInstantiateWithFlags = NULL{{endif}}
{{if 'cuGraphInstantiateWithParams' in found_functions}}cdef void *__cuGraphInstantiateWithParams = NULL{{endif}}
{{if 'cuGraphExecGetFlags' in found_functions}}cdef void *__cuGraphExecGetFlags = NULL{{endif}}
{{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}}cdef void *__cuGraphExecKernelNodeSetParams_v2 = NULL{{endif}}
{{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}}cdef void *__cuGraphExecMemcpyNodeSetParams = NULL{{endif}}
{{if 'cuGraphExecMemsetNodeSetParams' in found_functions}}cdef void *__cuGraphExecMemsetNodeSetParams = NULL{{endif}}
{{if 'cuGraphExecHostNodeSetParams' in found_functions}}cdef void *__cuGraphExecHostNodeSetParams = NULL{{endif}}
{{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}}cdef void *__cuGraphExecChildGraphNodeSetParams = NULL{{endif}}
{{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}}cdef void *__cuGraphExecEventRecordNodeSetEvent = NULL{{endif}}
{{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}}cdef void *__cuGraphExecEventWaitNodeSetEvent = NULL{{endif}}
{{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}}cdef void *__cuGraphExecExternalSemaphoresSignalNodeSetParams = NULL{{endif}}
{{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}}cdef void *__cuGraphExecExternalSemaphoresWaitNodeSetParams = NULL{{endif}}
{{if 'cuGraphNodeSetEnabled' in found_functions}}cdef void *__cuGraphNodeSetEnabled = NULL{{endif}}
{{if 'cuGraphNodeGetEnabled' in found_functions}}cdef void *__cuGraphNodeGetEnabled = NULL{{endif}}
{{if 'cuGraphUpload' in found_functions}}cdef void *__cuGraphUpload = NULL{{endif}}
{{if 'cuGraphLaunch' in found_functions}}cdef void *__cuGraphLaunch = NULL{{endif}}
{{if 'cuGraphExecDestroy' in found_functions}}cdef void *__cuGraphExecDestroy = NULL{{endif}}
{{if 'cuGraphDestroy' in found_functions}}cdef void *__cuGraphDestroy = NULL{{endif}}
{{if 'cuGraphExecUpdate_v2' in found_functions}}cdef void *__cuGraphExecUpdate_v2 = NULL{{endif}}
{{if 'cuGraphKernelNodeCopyAttributes' in found_functions}}cdef void *__cuGraphKernelNodeCopyAttributes = NULL{{endif}}
{{if 'cuGraphKernelNodeGetAttribute' in found_functions}}cdef void *__cuGraphKernelNodeGetAttribute = NULL{{endif}}
{{if 'cuGraphKernelNodeSetAttribute' in found_functions}}cdef void *__cuGraphKernelNodeSetAttribute = NULL{{endif}}
{{if 'cuGraphDebugDotPrint' in found_functions}}cdef void *__cuGraphDebugDotPrint = NULL{{endif}}
{{if 'cuUserObjectCreate' in found_functions}}cdef void *__cuUserObjectCreate = NULL{{endif}}
{{if 'cuUserObjectRetain' in found_functions}}cdef void *__cuUserObjectRetain = NULL{{endif}}
{{if 'cuUserObjectRelease' in found_functions}}cdef void *__cuUserObjectRelease = NULL{{endif}}
{{if 'cuGraphRetainUserObject' in found_functions}}cdef void *__cuGraphRetainUserObject = NULL{{endif}}
{{if 'cuGraphReleaseUserObject' in found_functions}}cdef void *__cuGraphReleaseUserObject = NULL{{endif}}
{{if 'cuGraphAddNode' in found_functions}}cdef void *__cuGraphAddNode = NULL{{endif}}
{{if 'cuGraphAddNode_v2' in found_functions}}cdef void *__cuGraphAddNode_v2 = NULL{{endif}}
{{if 'cuGraphNodeSetParams' in found_functions}}cdef void *__cuGraphNodeSetParams = NULL{{endif}}
{{if 'cuGraphExecNodeSetParams' in found_functions}}cdef void *__cuGraphExecNodeSetParams = NULL{{endif}}
{{if 'cuGraphConditionalHandleCreate' in found_functions}}cdef void *__cuGraphConditionalHandleCreate = NULL{{endif}}
{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}}cdef void *__cuOccupancyMaxActiveBlocksPerMultiprocessor = NULL{{endif}}
{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}}cdef void *__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = NULL{{endif}}
{{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}}cdef void *__cuOccupancyMaxPotentialBlockSize = NULL{{endif}}
{{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}}cdef void *__cuOccupancyMaxPotentialBlockSizeWithFlags = NULL{{endif}}
{{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}}cdef void *__cuOccupancyAvailableDynamicSMemPerBlock = NULL{{endif}}
{{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}}cdef void *__cuOccupancyMaxPotentialClusterSize = NULL{{endif}}
{{if 'cuOccupancyMaxActiveClusters' in found_functions}}cdef void *__cuOccupancyMaxActiveClusters = NULL{{endif}}
{{if 'cuTexRefSetArray' in found_functions}}cdef void *__cuTexRefSetArray = NULL{{endif}}
{{if 'cuTexRefSetMipmappedArray' in found_functions}}cdef void *__cuTexRefSetMipmappedArray = NULL{{endif}}
{{if 'cuTexRefSetAddress_v2' in found_functions}}cdef void *__cuTexRefSetAddress_v2 = NULL{{endif}}
{{if 'cuTexRefSetAddress2D_v3' in found_functions}}cdef void *__cuTexRefSetAddress2D_v3 = NULL{{endif}}
{{if 'cuTexRefSetFormat' in found_functions}}cdef void *__cuTexRefSetFormat = NULL{{endif}}
{{if 'cuTexRefSetAddressMode' in found_functions}}cdef void *__cuTexRefSetAddressMode = NULL{{endif}}
{{if 'cuTexRefSetFilterMode' in found_functions}}cdef void *__cuTexRefSetFilterMode = NULL{{endif}}
{{if 'cuTexRefSetMipmapFilterMode' in found_functions}}cdef void *__cuTexRefSetMipmapFilterMode = NULL{{endif}}
{{if 'cuTexRefSetMipmapLevelBias' in found_functions}}cdef void *__cuTexRefSetMipmapLevelBias = NULL{{endif}}
{{if 'cuTexRefSetMipmapLevelClamp' in found_functions}}cdef void *__cuTexRefSetMipmapLevelClamp = NULL{{endif}}
{{if 'cuTexRefSetMaxAnisotropy' in found_functions}}cdef void *__cuTexRefSetMaxAnisotropy = NULL{{endif}}
{{if 'cuTexRefSetBorderColor' in found_functions}}cdef void *__cuTexRefSetBorderColor = NULL{{endif}}
{{if 'cuTexRefSetFlags' in found_functions}}cdef void *__cuTexRefSetFlags = NULL{{endif}}
{{if 'cuTexRefGetAddress_v2' in found_functions}}cdef void *__cuTexRefGetAddress_v2 = NULL{{endif}}
{{if 'cuTexRefGetArray' in found_functions}}cdef void *__cuTexRefGetArray = NULL{{endif}}
{{if 'cuTexRefGetMipmappedArray' in found_functions}}cdef void *__cuTexRefGetMipmappedArray = NULL{{endif}}
{{if 'cuTexRefGetAddressMode' in found_functions}}cdef void *__cuTexRefGetAddressMode = NULL{{endif}}
{{if 'cuTexRefGetFilterMode' in found_functions}}cdef void *__cuTexRefGetFilterMode = NULL{{endif}}
{{if 'cuTexRefGetFormat' in found_functions}}cdef void *__cuTexRefGetFormat = NULL{{endif}}
{{if 'cuTexRefGetMipmapFilterMode' in found_functions}}cdef void *__cuTexRefGetMipmapFilterMode = NULL{{endif}}
{{if 'cuTexRefGetMipmapLevelBias' in found_functions}}cdef void *__cuTexRefGetMipmapLevelBias = NULL{{endif}}
{{if 'cuTexRefGetMipmapLevelClamp' in found_functions}}cdef void *__cuTexRefGetMipmapLevelClamp = NULL{{endif}}
{{if 'cuTexRefGetMaxAnisotropy' in found_functions}}cdef void *__cuTexRefGetMaxAnisotropy = NULL{{endif}}
{{if 'cuTexRefGetBorderColor' in found_functions}}cdef void *__cuTexRefGetBorderColor = NULL{{endif}}
{{if 'cuTexRefGetFlags' in found_functions}}cdef void *__cuTexRefGetFlags = NULL{{endif}}
{{if 'cuTexRefCreate' in found_functions}}cdef void *__cuTexRefCreate = NULL{{endif}}
{{if 'cuTexRefDestroy' in found_functions}}cdef void *__cuTexRefDestroy = NULL{{endif}}
{{if 'cuSurfRefSetArray' in found_functions}}cdef void *__cuSurfRefSetArray = NULL{{endif}}
{{if 'cuSurfRefGetArray' in found_functions}}cdef void *__cuSurfRefGetArray = NULL{{endif}}
{{if 'cuTexObjectCreate' in found_functions}}cdef void *__cuTexObjectCreate = NULL{{endif}}
{{if 'cuTexObjectDestroy' in found_functions}}cdef void *__cuTexObjectDestroy = NULL{{endif}}
{{if 'cuTexObjectGetResourceDesc' in found_functions}}cdef void *__cuTexObjectGetResourceDesc = NULL{{endif}}
{{if 'cuTexObjectGetTextureDesc' in found_functions}}cdef void *__cuTexObjectGetTextureDesc = NULL{{endif}}
{{if 'cuTexObjectGetResourceViewDesc' in found_functions}}cdef void *__cuTexObjectGetResourceViewDesc = NULL{{endif}}
{{if 'cuSurfObjectCreate' in found_functions}}cdef void *__cuSurfObjectCreate = NULL{{endif}}
{{if 'cuSurfObjectDestroy' in found_functions}}cdef void *__cuSurfObjectDestroy = NULL{{endif}}
{{if 'cuSurfObjectGetResourceDesc' in found_functions}}cdef void *__cuSurfObjectGetResourceDesc = NULL{{endif}}
{{if 'cuTensorMapEncodeTiled' in found_functions}}cdef void *__cuTensorMapEncodeTiled = NULL{{endif}}
{{if 'cuTensorMapEncodeIm2col' in found_functions}}cdef void *__cuTensorMapEncodeIm2col = NULL{{endif}}
{{if 'cuTensorMapEncodeIm2colWide' in found_functions}}cdef void *__cuTensorMapEncodeIm2colWide = NULL{{endif}}
{{if 'cuTensorMapReplaceAddress' in found_functions}}cdef void *__cuTensorMapReplaceAddress = NULL{{endif}}
{{if 'cuDeviceCanAccessPeer' in found_functions}}cdef void *__cuDeviceCanAccessPeer = NULL{{endif}}
{{if 'cuCtxEnablePeerAccess' in found_functions}}cdef void *__cuCtxEnablePeerAccess = NULL{{endif}}
{{if 'cuCtxDisablePeerAccess' in found_functions}}cdef void *__cuCtxDisablePeerAccess = NULL{{endif}}
{{if 'cuDeviceGetP2PAttribute' in found_functions}}cdef void *__cuDeviceGetP2PAttribute = NULL{{endif}}
{{if 'cuGraphicsUnregisterResource' in found_functions}}cdef void *__cuGraphicsUnregisterResource = NULL{{endif}}
{{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}}cdef void *__cuGraphicsSubResourceGetMappedArray = NULL{{endif}}
{{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}}cdef void *__cuGraphicsResourceGetMappedMipmappedArray = NULL{{endif}}
{{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}}cdef void *__cuGraphicsResourceGetMappedPointer_v2 = NULL{{endif}}
{{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}}cdef void *__cuGraphicsResourceSetMapFlags_v2 = NULL{{endif}}
{{if 'cuGraphicsMapResources' in found_functions}}cdef void *__cuGraphicsMapResources = NULL{{endif}}
{{if 'cuGraphicsUnmapResources' in found_functions}}cdef void *__cuGraphicsUnmapResources = NULL{{endif}}
{{if 'cuGetProcAddress_v2' in found_functions}}cdef void *__cuGetProcAddress_v2 = NULL{{endif}}
{{if 'cuCoredumpGetAttribute' in found_functions}}cdef void *__cuCoredumpGetAttribute = NULL{{endif}}
{{if 'cuCoredumpGetAttributeGlobal' in found_functions}}cdef void *__cuCoredumpGetAttributeGlobal = NULL{{endif}}
{{if 'cuCoredumpSetAttribute' in found_functions}}cdef void *__cuCoredumpSetAttribute = NULL{{endif}}
{{if 'cuCoredumpSetAttributeGlobal' in found_functions}}cdef void *__cuCoredumpSetAttributeGlobal = NULL{{endif}}
{{if 'cuGetExportTable' in found_functions}}cdef void *__cuGetExportTable = NULL{{endif}}
{{if 'cuGreenCtxCreate' in found_functions}}cdef void *__cuGreenCtxCreate = NULL{{endif}}
{{if 'cuGreenCtxDestroy' in found_functions}}cdef void *__cuGreenCtxDestroy = NULL{{endif}}
{{if 'cuCtxFromGreenCtx' in found_functions}}cdef void *__cuCtxFromGreenCtx = NULL{{endif}}
{{if 'cuDeviceGetDevResource' in found_functions}}cdef void *__cuDeviceGetDevResource = NULL{{endif}}
{{if 'cuCtxGetDevResource' in found_functions}}cdef void *__cuCtxGetDevResource = NULL{{endif}}
{{if 'cuGreenCtxGetDevResource' in found_functions}}cdef void *__cuGreenCtxGetDevResource = NULL{{endif}}
{{if 'cuDevSmResourceSplitByCount' in found_functions}}cdef void *__cuDevSmResourceSplitByCount = NULL{{endif}}
{{if 'cuDevResourceGenerateDesc' in found_functions}}cdef void *__cuDevResourceGenerateDesc = NULL{{endif}}
{{if 'cuGreenCtxRecordEvent' in found_functions}}cdef void *__cuGreenCtxRecordEvent = NULL{{endif}}
{{if 'cuGreenCtxWaitEvent' in found_functions}}cdef void *__cuGreenCtxWaitEvent = NULL{{endif}}
{{if 'cuStreamGetGreenCtx' in found_functions}}cdef void *__cuStreamGetGreenCtx = NULL{{endif}}
{{if 'cuGreenCtxStreamCreate' in found_functions}}cdef void *__cuGreenCtxStreamCreate = NULL{{endif}}
{{if 'cuLogsRegisterCallback' in found_functions}}cdef void *__cuLogsRegisterCallback = NULL{{endif}}
{{if 'cuLogsUnregisterCallback' in found_functions}}cdef void *__cuLogsUnregisterCallback = NULL{{endif}}
{{if 'cuLogsCurrent' in found_functions}}cdef void *__cuLogsCurrent = NULL{{endif}}
{{if 'cuLogsDumpToFile' in found_functions}}cdef void *__cuLogsDumpToFile = NULL{{endif}}
{{if 'cuLogsDumpToMemory' in found_functions}}cdef void *__cuLogsDumpToMemory = NULL{{endif}}
{{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}}cdef void *__cuCheckpointProcessGetRestoreThreadId = NULL{{endif}}
{{if 'cuCheckpointProcessGetState' in found_functions}}cdef void *__cuCheckpointProcessGetState = NULL{{endif}}
{{if 'cuCheckpointProcessLock' in found_functions}}cdef void *__cuCheckpointProcessLock = NULL{{endif}}
{{if 'cuCheckpointProcessCheckpoint' in found_functions}}cdef void *__cuCheckpointProcessCheckpoint = NULL{{endif}}
{{if 'cuCheckpointProcessRestore' in found_functions}}cdef void *__cuCheckpointProcessRestore = NULL{{endif}}
{{if 'cuCheckpointProcessUnlock' in found_functions}}cdef void *__cuCheckpointProcessUnlock = NULL{{endif}}
{{if 'cuProfilerStart' in found_functions}}cdef void *__cuProfilerStart = NULL{{endif}}
{{if 'cuProfilerStop' in found_functions}}cdef void *__cuProfilerStop = NULL{{endif}}
{{if True}}cdef void *__cuGraphicsEGLRegisterImage = NULL{{endif}}
{{if True}}cdef void *__cuEGLStreamConsumerConnect = NULL{{endif}}
{{if True}}cdef void *__cuEGLStreamConsumerConnectWithFlags = NULL{{endif}}
{{if True}}cdef void *__cuEGLStreamConsumerDisconnect = NULL{{endif}}
{{if True}}cdef void *__cuEGLStreamConsumerAcquireFrame = NULL{{endif}}
{{if True}}cdef void *__cuEGLStreamConsumerReleaseFrame = NULL{{endif}}
{{if True}}cdef void *__cuEGLStreamProducerConnect = NULL{{endif}}
{{if True}}cdef void *__cuEGLStreamProducerDisconnect = NULL{{endif}}
{{if True}}cdef void *__cuEGLStreamProducerPresentFrame = NULL{{endif}}
{{if True}}cdef void *__cuEGLStreamProducerReturnFrame = NULL{{endif}}
{{if True}}cdef void *__cuGraphicsResourceGetMappedEglFrame = NULL{{endif}}
{{if True}}cdef void *__cuEventCreateFromEGLSync = NULL{{endif}}
{{if True}}cdef void *__cuGraphicsGLRegisterBuffer = NULL{{endif}}
{{if True}}cdef void *__cuGraphicsGLRegisterImage = NULL{{endif}}
{{if True}}cdef void *__cuGLGetDevices_v2 = NULL{{endif}}
{{if True}}cdef void *__cuVDPAUGetDevice = NULL{{endif}}
{{if True}}cdef void *__cuVDPAUCtxCreate_v2 = NULL{{endif}}
{{if True}}cdef void *__cuGraphicsVDPAURegisterVideoSurface = NULL{{endif}}
{{if True}}cdef void *__cuGraphicsVDPAURegisterOutputSurface = NULL{{endif}}

# To make cuPythonInit reentrant
ctypedef CUresult (*__cuGetProcAddress_v2_T)(const char*, void**, int, cuuint64_t, CUdriverProcAddressQueryResult*) except?CUDA_ERROR_NOT_FOUND nogil
cdef __cuGetProcAddress_v2_T _F_cuGetProcAddress_v2 = NULL

cdef int _cuPythonInit() except -1 nogil:
    global __cuPythonInit

    cdef bint usePTDS
    cdef char libPath[260]

    with gil, __symbol_lock:
        usePTDS = bool(int(os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0)))

        # Load library
        libPath[0] = 0
        status = loader.getCUDALibraryPath(libPath, sys.maxsize > 2**32)
        if status == 0 and len(libPath) != 0:
            path = libPath.decode('utf-8')
        else:
            {{if 'Windows' == platform.system()}}
            path = 'nvcuda.dll'
            {{else}}
            path = 'libcuda.so.1'
            {{endif}}

        {{if 'Windows' == platform.system()}}
        handle = windll.LoadLibraryExW(path, NULL, windll.LOAD_LIBRARY_SEARCH_SYSTEM32)
        if handle == 0:
            raise RuntimeError('Failed to LoadLibraryEx ' + path)
        {{else}}
        handle = dlfcn.dlopen(bytes(path, encoding='utf-8'), dlfcn.RTLD_NOW)
        if handle == NULL:
            raise RuntimeError('Failed to dlopen ' + path)
        {{endif}}

        # Get latest __cuGetProcAddress_v2
        global __cuGetProcAddress_v2
        {{if 'Windows' == platform.system()}}
        __cuGetProcAddress_v2 = windll.GetProcAddress(handle, 'cuGetProcAddress_v2')
        {{else}}
        __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2')
        {{endif}}

        # Load using cuGetProcAddress if available
        if __cuGetProcAddress_v2 != NULL:
            _F_cuGetProcAddress_v2 = <__cuGetProcAddress_v2_T>__cuGetProcAddress_v2
            if usePTDS:
                # Get all PTDS version of functions
                pass
                {{if 'cuMemcpy' in found_functions}}
                global __cuMemcpy
                _F_cuGetProcAddress_v2('cuMemcpy', &__cuMemcpy, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyPeer' in found_functions}}
                global __cuMemcpyPeer
                _F_cuGetProcAddress_v2('cuMemcpyPeer', &__cuMemcpyPeer, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyHtoD_v2' in found_functions}}
                global __cuMemcpyHtoD_v2
                _F_cuGetProcAddress_v2('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyDtoH_v2' in found_functions}}
                global __cuMemcpyDtoH_v2
                _F_cuGetProcAddress_v2('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyDtoD_v2' in found_functions}}
                global __cuMemcpyDtoD_v2
                _F_cuGetProcAddress_v2('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyDtoA_v2' in found_functions}}
                global __cuMemcpyDtoA_v2
                _F_cuGetProcAddress_v2('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyAtoD_v2' in found_functions}}
                global __cuMemcpyAtoD_v2
                _F_cuGetProcAddress_v2('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyHtoA_v2' in found_functions}}
                global __cuMemcpyHtoA_v2
                _F_cuGetProcAddress_v2('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyAtoH_v2' in found_functions}}
                global __cuMemcpyAtoH_v2
                _F_cuGetProcAddress_v2('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyAtoA_v2' in found_functions}}
                global __cuMemcpyAtoA_v2
                _F_cuGetProcAddress_v2('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpy2D_v2' in found_functions}}
                global __cuMemcpy2D_v2
                _F_cuGetProcAddress_v2('cuMemcpy2D', &__cuMemcpy2D_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpy2DUnaligned_v2' in found_functions}}
                global __cuMemcpy2DUnaligned_v2
                _F_cuGetProcAddress_v2('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpy3D_v2' in found_functions}}
                global __cuMemcpy3D_v2
                _F_cuGetProcAddress_v2('cuMemcpy3D', &__cuMemcpy3D_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpy3DPeer' in found_functions}}
                global __cuMemcpy3DPeer
                _F_cuGetProcAddress_v2('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyAsync' in found_functions}}
                global __cuMemcpyAsync
                _F_cuGetProcAddress_v2('cuMemcpyAsync', &__cuMemcpyAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyPeerAsync' in found_functions}}
                global __cuMemcpyPeerAsync
                _F_cuGetProcAddress_v2('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyHtoDAsync_v2' in found_functions}}
                global __cuMemcpyHtoDAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyDtoHAsync_v2' in found_functions}}
                global __cuMemcpyDtoHAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyDtoDAsync_v2' in found_functions}}
                global __cuMemcpyDtoDAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyHtoAAsync_v2' in found_functions}}
                global __cuMemcpyHtoAAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyAtoHAsync_v2' in found_functions}}
                global __cuMemcpyAtoHAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpy2DAsync_v2' in found_functions}}
                global __cuMemcpy2DAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpy3DAsync_v2' in found_functions}}
                global __cuMemcpy3DAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpy3DPeerAsync' in found_functions}}
                global __cuMemcpy3DPeerAsync
                _F_cuGetProcAddress_v2('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpyBatchAsync' in found_functions}}
                global __cuMemcpyBatchAsync
                _F_cuGetProcAddress_v2('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemcpy3DBatchAsync' in found_functions}}
                global __cuMemcpy3DBatchAsync
                _F_cuGetProcAddress_v2('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD8_v2' in found_functions}}
                global __cuMemsetD8_v2
                _F_cuGetProcAddress_v2('cuMemsetD8', &__cuMemsetD8_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD16_v2' in found_functions}}
                global __cuMemsetD16_v2
                _F_cuGetProcAddress_v2('cuMemsetD16', &__cuMemsetD16_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD32_v2' in found_functions}}
                global __cuMemsetD32_v2
                _F_cuGetProcAddress_v2('cuMemsetD32', &__cuMemsetD32_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD2D8_v2' in found_functions}}
                global __cuMemsetD2D8_v2
                _F_cuGetProcAddress_v2('cuMemsetD2D8', &__cuMemsetD2D8_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD2D16_v2' in found_functions}}
                global __cuMemsetD2D16_v2
                _F_cuGetProcAddress_v2('cuMemsetD2D16', &__cuMemsetD2D16_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD2D32_v2' in found_functions}}
                global __cuMemsetD2D32_v2
                _F_cuGetProcAddress_v2('cuMemsetD2D32', &__cuMemsetD2D32_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD8Async' in found_functions}}
                global __cuMemsetD8Async
                _F_cuGetProcAddress_v2('cuMemsetD8Async', &__cuMemsetD8Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD16Async' in found_functions}}
                global __cuMemsetD16Async
                _F_cuGetProcAddress_v2('cuMemsetD16Async', &__cuMemsetD16Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD32Async' in found_functions}}
                global __cuMemsetD32Async
                _F_cuGetProcAddress_v2('cuMemsetD32Async', &__cuMemsetD32Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD2D8Async' in found_functions}}
                global __cuMemsetD2D8Async
                _F_cuGetProcAddress_v2('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD2D16Async' in found_functions}}
                global __cuMemsetD2D16Async
                _F_cuGetProcAddress_v2('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemsetD2D32Async' in found_functions}}
                global __cuMemsetD2D32Async
                _F_cuGetProcAddress_v2('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemBatchDecompressAsync' in found_functions}}
                global __cuMemBatchDecompressAsync
                _F_cuGetProcAddress_v2('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemMapArrayAsync' in found_functions}}
                global __cuMemMapArrayAsync
                _F_cuGetProcAddress_v2('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemFreeAsync' in found_functions}}
                global __cuMemFreeAsync
                _F_cuGetProcAddress_v2('cuMemFreeAsync', &__cuMemFreeAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemAllocAsync' in found_functions}}
                global __cuMemAllocAsync
                _F_cuGetProcAddress_v2('cuMemAllocAsync', &__cuMemAllocAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemAllocFromPoolAsync' in found_functions}}
                global __cuMemAllocFromPoolAsync
                _F_cuGetProcAddress_v2('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemPrefetchAsync' in found_functions}}
                global __cuMemPrefetchAsync
                _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync, 8000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuMemPrefetchAsync_v2' in found_functions}}
                global __cuMemPrefetchAsync_v2
                _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamGetPriority' in found_functions}}
                global __cuStreamGetPriority
                _F_cuGetProcAddress_v2('cuStreamGetPriority', &__cuStreamGetPriority, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamGetDevice' in found_functions}}
                global __cuStreamGetDevice
                _F_cuGetProcAddress_v2('cuStreamGetDevice', &__cuStreamGetDevice, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamGetFlags' in found_functions}}
                global __cuStreamGetFlags
                _F_cuGetProcAddress_v2('cuStreamGetFlags', &__cuStreamGetFlags, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamGetId' in found_functions}}
                global __cuStreamGetId
                _F_cuGetProcAddress_v2('cuStreamGetId', &__cuStreamGetId, 12000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamGetCtx' in found_functions}}
                global __cuStreamGetCtx
                _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx, 9020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamGetCtx_v2' in found_functions}}
                global __cuStreamGetCtx_v2
                _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamWaitEvent' in found_functions}}
                global __cuStreamWaitEvent
                _F_cuGetProcAddress_v2('cuStreamWaitEvent', &__cuStreamWaitEvent, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamAddCallback' in found_functions}}
                global __cuStreamAddCallback
                _F_cuGetProcAddress_v2('cuStreamAddCallback', &__cuStreamAddCallback, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamBeginCapture_v2' in found_functions}}
                global __cuStreamBeginCapture_v2
                _F_cuGetProcAddress_v2('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamBeginCaptureToGraph' in found_functions}}
                global __cuStreamBeginCaptureToGraph
                _F_cuGetProcAddress_v2('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamEndCapture' in found_functions}}
                global __cuStreamEndCapture
                _F_cuGetProcAddress_v2('cuStreamEndCapture', &__cuStreamEndCapture, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamIsCapturing' in found_functions}}
                global __cuStreamIsCapturing
                _F_cuGetProcAddress_v2('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamGetCaptureInfo_v2' in found_functions}}
                global __cuStreamGetCaptureInfo_v2
                _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamGetCaptureInfo_v3' in found_functions}}
                global __cuStreamGetCaptureInfo_v3
                _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamUpdateCaptureDependencies' in found_functions}}
                global __cuStreamUpdateCaptureDependencies
                _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies, 11030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}}
                global __cuStreamUpdateCaptureDependencies_v2
                _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamAttachMemAsync' in found_functions}}
                global __cuStreamAttachMemAsync
                _F_cuGetProcAddress_v2('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamQuery' in found_functions}}
                global __cuStreamQuery
                _F_cuGetProcAddress_v2('cuStreamQuery', &__cuStreamQuery, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamSynchronize' in found_functions}}
                global __cuStreamSynchronize
                _F_cuGetProcAddress_v2('cuStreamSynchronize', &__cuStreamSynchronize, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamCopyAttributes' in found_functions}}
                global __cuStreamCopyAttributes
                _F_cuGetProcAddress_v2('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamGetAttribute' in found_functions}}
                global __cuStreamGetAttribute
                _F_cuGetProcAddress_v2('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamSetAttribute' in found_functions}}
                global __cuStreamSetAttribute
                _F_cuGetProcAddress_v2('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuEventRecord' in found_functions}}
                global __cuEventRecord
                _F_cuGetProcAddress_v2('cuEventRecord', &__cuEventRecord, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuEventRecordWithFlags' in found_functions}}
                global __cuEventRecordWithFlags
                _F_cuGetProcAddress_v2('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuSignalExternalSemaphoresAsync' in found_functions}}
                global __cuSignalExternalSemaphoresAsync
                _F_cuGetProcAddress_v2('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuWaitExternalSemaphoresAsync' in found_functions}}
                global __cuWaitExternalSemaphoresAsync
                _F_cuGetProcAddress_v2('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamWaitValue32_v2' in found_functions}}
                global __cuStreamWaitValue32_v2
                _F_cuGetProcAddress_v2('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamWaitValue64_v2' in found_functions}}
                global __cuStreamWaitValue64_v2
                _F_cuGetProcAddress_v2('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamWriteValue32_v2' in found_functions}}
                global __cuStreamWriteValue32_v2
                _F_cuGetProcAddress_v2('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamWriteValue64_v2' in found_functions}}
                global __cuStreamWriteValue64_v2
                _F_cuGetProcAddress_v2('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuStreamBatchMemOp_v2' in found_functions}}
                global __cuStreamBatchMemOp_v2
                _F_cuGetProcAddress_v2('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuLaunchKernel' in found_functions}}
                global __cuLaunchKernel
                _F_cuGetProcAddress_v2('cuLaunchKernel', &__cuLaunchKernel, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuLaunchKernelEx' in found_functions}}
                global __cuLaunchKernelEx
                _F_cuGetProcAddress_v2('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuLaunchCooperativeKernel' in found_functions}}
                global __cuLaunchCooperativeKernel
                _F_cuGetProcAddress_v2('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuLaunchHostFunc' in found_functions}}
                global __cuLaunchHostFunc
                _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuGraphInstantiateWithParams' in found_functions}}
                global __cuGraphInstantiateWithParams
                _F_cuGetProcAddress_v2('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuGraphUpload' in found_functions}}
                global __cuGraphUpload
                _F_cuGetProcAddress_v2('cuGraphUpload', &__cuGraphUpload, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuGraphLaunch' in found_functions}}
                global __cuGraphLaunch
                _F_cuGetProcAddress_v2('cuGraphLaunch', &__cuGraphLaunch, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuGraphicsMapResources' in found_functions}}
                global __cuGraphicsMapResources
                _F_cuGetProcAddress_v2('cuGraphicsMapResources', &__cuGraphicsMapResources, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
                {{if 'cuGraphicsUnmapResources' in found_functions}}
                global __cuGraphicsUnmapResources
                _F_cuGetProcAddress_v2('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL)
                {{endif}}
            else:
                # Else get the regular version
                pass
                {{if 'cuMemcpy' in found_functions}}
                global __cuMemcpy
                _F_cuGetProcAddress_v2('cuMemcpy', &__cuMemcpy, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyPeer' in found_functions}}
                global __cuMemcpyPeer
                _F_cuGetProcAddress_v2('cuMemcpyPeer', &__cuMemcpyPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyHtoD_v2' in found_functions}}
                global __cuMemcpyHtoD_v2
                _F_cuGetProcAddress_v2('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyDtoH_v2' in found_functions}}
                global __cuMemcpyDtoH_v2
                _F_cuGetProcAddress_v2('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyDtoD_v2' in found_functions}}
                global __cuMemcpyDtoD_v2
                _F_cuGetProcAddress_v2('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyDtoA_v2' in found_functions}}
                global __cuMemcpyDtoA_v2
                _F_cuGetProcAddress_v2('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyAtoD_v2' in found_functions}}
                global __cuMemcpyAtoD_v2
                _F_cuGetProcAddress_v2('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyHtoA_v2' in found_functions}}
                global __cuMemcpyHtoA_v2
                _F_cuGetProcAddress_v2('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyAtoH_v2' in found_functions}}
                global __cuMemcpyAtoH_v2
                _F_cuGetProcAddress_v2('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyAtoA_v2' in found_functions}}
                global __cuMemcpyAtoA_v2
                _F_cuGetProcAddress_v2('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpy2D_v2' in found_functions}}
                global __cuMemcpy2D_v2
                _F_cuGetProcAddress_v2('cuMemcpy2D', &__cuMemcpy2D_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpy2DUnaligned_v2' in found_functions}}
                global __cuMemcpy2DUnaligned_v2
                _F_cuGetProcAddress_v2('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpy3D_v2' in found_functions}}
                global __cuMemcpy3D_v2
                _F_cuGetProcAddress_v2('cuMemcpy3D', &__cuMemcpy3D_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpy3DPeer' in found_functions}}
                global __cuMemcpy3DPeer
                _F_cuGetProcAddress_v2('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyAsync' in found_functions}}
                global __cuMemcpyAsync
                _F_cuGetProcAddress_v2('cuMemcpyAsync', &__cuMemcpyAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyPeerAsync' in found_functions}}
                global __cuMemcpyPeerAsync
                _F_cuGetProcAddress_v2('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyHtoDAsync_v2' in found_functions}}
                global __cuMemcpyHtoDAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyDtoHAsync_v2' in found_functions}}
                global __cuMemcpyDtoHAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyDtoDAsync_v2' in found_functions}}
                global __cuMemcpyDtoDAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyHtoAAsync_v2' in found_functions}}
                global __cuMemcpyHtoAAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyAtoHAsync_v2' in found_functions}}
                global __cuMemcpyAtoHAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpy2DAsync_v2' in found_functions}}
                global __cuMemcpy2DAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpy3DAsync_v2' in found_functions}}
                global __cuMemcpy3DAsync_v2
                _F_cuGetProcAddress_v2('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpy3DPeerAsync' in found_functions}}
                global __cuMemcpy3DPeerAsync
                _F_cuGetProcAddress_v2('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpyBatchAsync' in found_functions}}
                global __cuMemcpyBatchAsync
                _F_cuGetProcAddress_v2('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemcpy3DBatchAsync' in found_functions}}
                global __cuMemcpy3DBatchAsync
                _F_cuGetProcAddress_v2('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD8_v2' in found_functions}}
                global __cuMemsetD8_v2
                _F_cuGetProcAddress_v2('cuMemsetD8', &__cuMemsetD8_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD16_v2' in found_functions}}
                global __cuMemsetD16_v2
                _F_cuGetProcAddress_v2('cuMemsetD16', &__cuMemsetD16_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD32_v2' in found_functions}}
                global __cuMemsetD32_v2
                _F_cuGetProcAddress_v2('cuMemsetD32', &__cuMemsetD32_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD2D8_v2' in found_functions}}
                global __cuMemsetD2D8_v2
                _F_cuGetProcAddress_v2('cuMemsetD2D8', &__cuMemsetD2D8_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD2D16_v2' in found_functions}}
                global __cuMemsetD2D16_v2
                _F_cuGetProcAddress_v2('cuMemsetD2D16', &__cuMemsetD2D16_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD2D32_v2' in found_functions}}
                global __cuMemsetD2D32_v2
                _F_cuGetProcAddress_v2('cuMemsetD2D32', &__cuMemsetD2D32_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD8Async' in found_functions}}
                global __cuMemsetD8Async
                _F_cuGetProcAddress_v2('cuMemsetD8Async', &__cuMemsetD8Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD16Async' in found_functions}}
                global __cuMemsetD16Async
                _F_cuGetProcAddress_v2('cuMemsetD16Async', &__cuMemsetD16Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD32Async' in found_functions}}
                global __cuMemsetD32Async
                _F_cuGetProcAddress_v2('cuMemsetD32Async', &__cuMemsetD32Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD2D8Async' in found_functions}}
                global __cuMemsetD2D8Async
                _F_cuGetProcAddress_v2('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD2D16Async' in found_functions}}
                global __cuMemsetD2D16Async
                _F_cuGetProcAddress_v2('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemsetD2D32Async' in found_functions}}
                global __cuMemsetD2D32Async
                _F_cuGetProcAddress_v2('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemBatchDecompressAsync' in found_functions}}
                global __cuMemBatchDecompressAsync
                _F_cuGetProcAddress_v2('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemMapArrayAsync' in found_functions}}
                global __cuMemMapArrayAsync
                _F_cuGetProcAddress_v2('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemFreeAsync' in found_functions}}
                global __cuMemFreeAsync
                _F_cuGetProcAddress_v2('cuMemFreeAsync', &__cuMemFreeAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemAllocAsync' in found_functions}}
                global __cuMemAllocAsync
                _F_cuGetProcAddress_v2('cuMemAllocAsync', &__cuMemAllocAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemAllocFromPoolAsync' in found_functions}}
                global __cuMemAllocFromPoolAsync
                _F_cuGetProcAddress_v2('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemPrefetchAsync' in found_functions}}
                global __cuMemPrefetchAsync
                _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuMemPrefetchAsync_v2' in found_functions}}
                global __cuMemPrefetchAsync_v2
                _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamGetPriority' in found_functions}}
                global __cuStreamGetPriority
                _F_cuGetProcAddress_v2('cuStreamGetPriority', &__cuStreamGetPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamGetDevice' in found_functions}}
                global __cuStreamGetDevice
                _F_cuGetProcAddress_v2('cuStreamGetDevice', &__cuStreamGetDevice, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamGetFlags' in found_functions}}
                global __cuStreamGetFlags
                _F_cuGetProcAddress_v2('cuStreamGetFlags', &__cuStreamGetFlags, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamGetId' in found_functions}}
                global __cuStreamGetId
                _F_cuGetProcAddress_v2('cuStreamGetId', &__cuStreamGetId, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamGetCtx' in found_functions}}
                global __cuStreamGetCtx
                _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx, 9020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamGetCtx_v2' in found_functions}}
                global __cuStreamGetCtx_v2
                _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamWaitEvent' in found_functions}}
                global __cuStreamWaitEvent
                _F_cuGetProcAddress_v2('cuStreamWaitEvent', &__cuStreamWaitEvent, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamAddCallback' in found_functions}}
                global __cuStreamAddCallback
                _F_cuGetProcAddress_v2('cuStreamAddCallback', &__cuStreamAddCallback, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamBeginCapture_v2' in found_functions}}
                global __cuStreamBeginCapture_v2
                _F_cuGetProcAddress_v2('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamBeginCaptureToGraph' in found_functions}}
                global __cuStreamBeginCaptureToGraph
                _F_cuGetProcAddress_v2('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamEndCapture' in found_functions}}
                global __cuStreamEndCapture
                _F_cuGetProcAddress_v2('cuStreamEndCapture', &__cuStreamEndCapture, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamIsCapturing' in found_functions}}
                global __cuStreamIsCapturing
                _F_cuGetProcAddress_v2('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamGetCaptureInfo_v2' in found_functions}}
                global __cuStreamGetCaptureInfo_v2
                _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamGetCaptureInfo_v3' in found_functions}}
                global __cuStreamGetCaptureInfo_v3
                _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamUpdateCaptureDependencies' in found_functions}}
                global __cuStreamUpdateCaptureDependencies
                _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}}
                global __cuStreamUpdateCaptureDependencies_v2
                _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamAttachMemAsync' in found_functions}}
                global __cuStreamAttachMemAsync
                _F_cuGetProcAddress_v2('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamQuery' in found_functions}}
                global __cuStreamQuery
                _F_cuGetProcAddress_v2('cuStreamQuery', &__cuStreamQuery, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamSynchronize' in found_functions}}
                global __cuStreamSynchronize
                _F_cuGetProcAddress_v2('cuStreamSynchronize', &__cuStreamSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamCopyAttributes' in found_functions}}
                global __cuStreamCopyAttributes
                _F_cuGetProcAddress_v2('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamGetAttribute' in found_functions}}
                global __cuStreamGetAttribute
                _F_cuGetProcAddress_v2('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamSetAttribute' in found_functions}}
                global __cuStreamSetAttribute
                _F_cuGetProcAddress_v2('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuEventRecord' in found_functions}}
                global __cuEventRecord
                _F_cuGetProcAddress_v2('cuEventRecord', &__cuEventRecord, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuEventRecordWithFlags' in found_functions}}
                global __cuEventRecordWithFlags
                _F_cuGetProcAddress_v2('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuSignalExternalSemaphoresAsync' in found_functions}}
                global __cuSignalExternalSemaphoresAsync
                _F_cuGetProcAddress_v2('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuWaitExternalSemaphoresAsync' in found_functions}}
                global __cuWaitExternalSemaphoresAsync
                _F_cuGetProcAddress_v2('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamWaitValue32_v2' in found_functions}}
                global __cuStreamWaitValue32_v2
                _F_cuGetProcAddress_v2('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamWaitValue64_v2' in found_functions}}
                global __cuStreamWaitValue64_v2
                _F_cuGetProcAddress_v2('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamWriteValue32_v2' in found_functions}}
                global __cuStreamWriteValue32_v2
                _F_cuGetProcAddress_v2('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamWriteValue64_v2' in found_functions}}
                global __cuStreamWriteValue64_v2
                _F_cuGetProcAddress_v2('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuStreamBatchMemOp_v2' in found_functions}}
                global __cuStreamBatchMemOp_v2
                _F_cuGetProcAddress_v2('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuLaunchKernel' in found_functions}}
                global __cuLaunchKernel
                _F_cuGetProcAddress_v2('cuLaunchKernel', &__cuLaunchKernel, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuLaunchKernelEx' in found_functions}}
                global __cuLaunchKernelEx
                _F_cuGetProcAddress_v2('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuLaunchCooperativeKernel' in found_functions}}
                global __cuLaunchCooperativeKernel
                _F_cuGetProcAddress_v2('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuLaunchHostFunc' in found_functions}}
                global __cuLaunchHostFunc
                _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuGraphInstantiateWithParams' in found_functions}}
                global __cuGraphInstantiateWithParams
                _F_cuGetProcAddress_v2('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuGraphUpload' in found_functions}}
                global __cuGraphUpload
                _F_cuGetProcAddress_v2('cuGraphUpload', &__cuGraphUpload, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuGraphLaunch' in found_functions}}
                global __cuGraphLaunch
                _F_cuGetProcAddress_v2('cuGraphLaunch', &__cuGraphLaunch, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuGraphicsMapResources' in found_functions}}
                global __cuGraphicsMapResources
                _F_cuGetProcAddress_v2('cuGraphicsMapResources', &__cuGraphicsMapResources, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
                {{if 'cuGraphicsUnmapResources' in found_functions}}
                global __cuGraphicsUnmapResources
                _F_cuGetProcAddress_v2('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
                {{endif}}
            # Get remaining functions
            {{if 'cuGetErrorString' in found_functions}}
            global __cuGetErrorString
            _F_cuGetProcAddress_v2('cuGetErrorString', &__cuGetErrorString, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGetErrorName' in found_functions}}
            global __cuGetErrorName
            _F_cuGetProcAddress_v2('cuGetErrorName', &__cuGetErrorName, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuInit' in found_functions}}
            global __cuInit
            _F_cuGetProcAddress_v2('cuInit', &__cuInit, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDriverGetVersion' in found_functions}}
            global __cuDriverGetVersion
            _F_cuGetProcAddress_v2('cuDriverGetVersion', &__cuDriverGetVersion, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGet' in found_functions}}
            global __cuDeviceGet
            _F_cuGetProcAddress_v2('cuDeviceGet', &__cuDeviceGet, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetCount' in found_functions}}
            global __cuDeviceGetCount
            _F_cuGetProcAddress_v2('cuDeviceGetCount', &__cuDeviceGetCount, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetName' in found_functions}}
            global __cuDeviceGetName
            _F_cuGetProcAddress_v2('cuDeviceGetName', &__cuDeviceGetName, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetUuid' in found_functions}}
            global __cuDeviceGetUuid
            _F_cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid, 9020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetUuid_v2' in found_functions}}
            global __cuDeviceGetUuid_v2
            _F_cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetLuid' in found_functions}}
            global __cuDeviceGetLuid
            _F_cuGetProcAddress_v2('cuDeviceGetLuid', &__cuDeviceGetLuid, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceTotalMem_v2' in found_functions}}
            global __cuDeviceTotalMem_v2
            _F_cuGetProcAddress_v2('cuDeviceTotalMem', &__cuDeviceTotalMem_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}}
            global __cuDeviceGetTexture1DLinearMaxWidth
            _F_cuGetProcAddress_v2('cuDeviceGetTexture1DLinearMaxWidth', &__cuDeviceGetTexture1DLinearMaxWidth, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetAttribute' in found_functions}}
            global __cuDeviceGetAttribute
            _F_cuGetProcAddress_v2('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}}
            global __cuDeviceGetNvSciSyncAttributes
            _F_cuGetProcAddress_v2('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceSetMemPool' in found_functions}}
            global __cuDeviceSetMemPool
            _F_cuGetProcAddress_v2('cuDeviceSetMemPool', &__cuDeviceSetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetMemPool' in found_functions}}
            global __cuDeviceGetMemPool
            _F_cuGetProcAddress_v2('cuDeviceGetMemPool', &__cuDeviceGetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetDefaultMemPool' in found_functions}}
            global __cuDeviceGetDefaultMemPool
            _F_cuGetProcAddress_v2('cuDeviceGetDefaultMemPool', &__cuDeviceGetDefaultMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetExecAffinitySupport' in found_functions}}
            global __cuDeviceGetExecAffinitySupport
            _F_cuGetProcAddress_v2('cuDeviceGetExecAffinitySupport', &__cuDeviceGetExecAffinitySupport, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}}
            global __cuFlushGPUDirectRDMAWrites
            _F_cuGetProcAddress_v2('cuFlushGPUDirectRDMAWrites', &__cuFlushGPUDirectRDMAWrites, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetProperties' in found_functions}}
            global __cuDeviceGetProperties
            _F_cuGetProcAddress_v2('cuDeviceGetProperties', &__cuDeviceGetProperties, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceComputeCapability' in found_functions}}
            global __cuDeviceComputeCapability
            _F_cuGetProcAddress_v2('cuDeviceComputeCapability', &__cuDeviceComputeCapability, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDevicePrimaryCtxRetain' in found_functions}}
            global __cuDevicePrimaryCtxRetain
            _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRetain', &__cuDevicePrimaryCtxRetain, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}}
            global __cuDevicePrimaryCtxRelease_v2
            _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRelease', &__cuDevicePrimaryCtxRelease_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}}
            global __cuDevicePrimaryCtxSetFlags_v2
            _F_cuGetProcAddress_v2('cuDevicePrimaryCtxSetFlags', &__cuDevicePrimaryCtxSetFlags_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDevicePrimaryCtxGetState' in found_functions}}
            global __cuDevicePrimaryCtxGetState
            _F_cuGetProcAddress_v2('cuDevicePrimaryCtxGetState', &__cuDevicePrimaryCtxGetState, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}}
            global __cuDevicePrimaryCtxReset_v2
            _F_cuGetProcAddress_v2('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxCreate_v2' in found_functions}}
            global __cuCtxCreate_v2
            _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxCreate_v3' in found_functions}}
            global __cuCtxCreate_v3
            _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v3, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxCreate_v4' in found_functions}}
            global __cuCtxCreate_v4
            _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v4, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxDestroy_v2' in found_functions}}
            global __cuCtxDestroy_v2
            _F_cuGetProcAddress_v2('cuCtxDestroy', &__cuCtxDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxPushCurrent_v2' in found_functions}}
            global __cuCtxPushCurrent_v2
            _F_cuGetProcAddress_v2('cuCtxPushCurrent', &__cuCtxPushCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxPopCurrent_v2' in found_functions}}
            global __cuCtxPopCurrent_v2
            _F_cuGetProcAddress_v2('cuCtxPopCurrent', &__cuCtxPopCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxSetCurrent' in found_functions}}
            global __cuCtxSetCurrent
            _F_cuGetProcAddress_v2('cuCtxSetCurrent', &__cuCtxSetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxGetCurrent' in found_functions}}
            global __cuCtxGetCurrent
            _F_cuGetProcAddress_v2('cuCtxGetCurrent', &__cuCtxGetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxGetDevice' in found_functions}}
            global __cuCtxGetDevice
            _F_cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxGetFlags' in found_functions}}
            global __cuCtxGetFlags
            _F_cuGetProcAddress_v2('cuCtxGetFlags', &__cuCtxGetFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxSetFlags' in found_functions}}
            global __cuCtxSetFlags
            _F_cuGetProcAddress_v2('cuCtxSetFlags', &__cuCtxSetFlags, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxGetId' in found_functions}}
            global __cuCtxGetId
            _F_cuGetProcAddress_v2('cuCtxGetId', &__cuCtxGetId, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxSynchronize' in found_functions}}
            global __cuCtxSynchronize
            _F_cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxSetLimit' in found_functions}}
            global __cuCtxSetLimit
            _F_cuGetProcAddress_v2('cuCtxSetLimit', &__cuCtxSetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxGetLimit' in found_functions}}
            global __cuCtxGetLimit
            _F_cuGetProcAddress_v2('cuCtxGetLimit', &__cuCtxGetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxGetCacheConfig' in found_functions}}
            global __cuCtxGetCacheConfig
            _F_cuGetProcAddress_v2('cuCtxGetCacheConfig', &__cuCtxGetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxSetCacheConfig' in found_functions}}
            global __cuCtxSetCacheConfig
            _F_cuGetProcAddress_v2('cuCtxSetCacheConfig', &__cuCtxSetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxGetApiVersion' in found_functions}}
            global __cuCtxGetApiVersion
            _F_cuGetProcAddress_v2('cuCtxGetApiVersion', &__cuCtxGetApiVersion, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxGetStreamPriorityRange' in found_functions}}
            global __cuCtxGetStreamPriorityRange
            _F_cuGetProcAddress_v2('cuCtxGetStreamPriorityRange', &__cuCtxGetStreamPriorityRange, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxResetPersistingL2Cache' in found_functions}}
            global __cuCtxResetPersistingL2Cache
            _F_cuGetProcAddress_v2('cuCtxResetPersistingL2Cache', &__cuCtxResetPersistingL2Cache, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxGetExecAffinity' in found_functions}}
            global __cuCtxGetExecAffinity
            _F_cuGetProcAddress_v2('cuCtxGetExecAffinity', &__cuCtxGetExecAffinity, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxRecordEvent' in found_functions}}
            global __cuCtxRecordEvent
            _F_cuGetProcAddress_v2('cuCtxRecordEvent', &__cuCtxRecordEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxWaitEvent' in found_functions}}
            global __cuCtxWaitEvent
            _F_cuGetProcAddress_v2('cuCtxWaitEvent', &__cuCtxWaitEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxAttach' in found_functions}}
            global __cuCtxAttach
            _F_cuGetProcAddress_v2('cuCtxAttach', &__cuCtxAttach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxDetach' in found_functions}}
            global __cuCtxDetach
            _F_cuGetProcAddress_v2('cuCtxDetach', &__cuCtxDetach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxGetSharedMemConfig' in found_functions}}
            global __cuCtxGetSharedMemConfig
            _F_cuGetProcAddress_v2('cuCtxGetSharedMemConfig', &__cuCtxGetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxSetSharedMemConfig' in found_functions}}
            global __cuCtxSetSharedMemConfig
            _F_cuGetProcAddress_v2('cuCtxSetSharedMemConfig', &__cuCtxSetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleLoad' in found_functions}}
            global __cuModuleLoad
            _F_cuGetProcAddress_v2('cuModuleLoad', &__cuModuleLoad, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleLoadData' in found_functions}}
            global __cuModuleLoadData
            _F_cuGetProcAddress_v2('cuModuleLoadData', &__cuModuleLoadData, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleLoadDataEx' in found_functions}}
            global __cuModuleLoadDataEx
            _F_cuGetProcAddress_v2('cuModuleLoadDataEx', &__cuModuleLoadDataEx, 2010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleLoadFatBinary' in found_functions}}
            global __cuModuleLoadFatBinary
            _F_cuGetProcAddress_v2('cuModuleLoadFatBinary', &__cuModuleLoadFatBinary, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleUnload' in found_functions}}
            global __cuModuleUnload
            _F_cuGetProcAddress_v2('cuModuleUnload', &__cuModuleUnload, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleGetLoadingMode' in found_functions}}
            global __cuModuleGetLoadingMode
            _F_cuGetProcAddress_v2('cuModuleGetLoadingMode', &__cuModuleGetLoadingMode, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleGetFunction' in found_functions}}
            global __cuModuleGetFunction
            _F_cuGetProcAddress_v2('cuModuleGetFunction', &__cuModuleGetFunction, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleGetFunctionCount' in found_functions}}
            global __cuModuleGetFunctionCount
            _F_cuGetProcAddress_v2('cuModuleGetFunctionCount', &__cuModuleGetFunctionCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleEnumerateFunctions' in found_functions}}
            global __cuModuleEnumerateFunctions
            _F_cuGetProcAddress_v2('cuModuleEnumerateFunctions', &__cuModuleEnumerateFunctions, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleGetGlobal_v2' in found_functions}}
            global __cuModuleGetGlobal_v2
            _F_cuGetProcAddress_v2('cuModuleGetGlobal', &__cuModuleGetGlobal_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLinkCreate_v2' in found_functions}}
            global __cuLinkCreate_v2
            _F_cuGetProcAddress_v2('cuLinkCreate', &__cuLinkCreate_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLinkAddData_v2' in found_functions}}
            global __cuLinkAddData_v2
            _F_cuGetProcAddress_v2('cuLinkAddData', &__cuLinkAddData_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLinkAddFile_v2' in found_functions}}
            global __cuLinkAddFile_v2
            _F_cuGetProcAddress_v2('cuLinkAddFile', &__cuLinkAddFile_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLinkComplete' in found_functions}}
            global __cuLinkComplete
            _F_cuGetProcAddress_v2('cuLinkComplete', &__cuLinkComplete, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLinkDestroy' in found_functions}}
            global __cuLinkDestroy
            _F_cuGetProcAddress_v2('cuLinkDestroy', &__cuLinkDestroy, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleGetTexRef' in found_functions}}
            global __cuModuleGetTexRef
            _F_cuGetProcAddress_v2('cuModuleGetTexRef', &__cuModuleGetTexRef, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuModuleGetSurfRef' in found_functions}}
            global __cuModuleGetSurfRef
            _F_cuGetProcAddress_v2('cuModuleGetSurfRef', &__cuModuleGetSurfRef, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLibraryLoadData' in found_functions}}
            global __cuLibraryLoadData
            _F_cuGetProcAddress_v2('cuLibraryLoadData', &__cuLibraryLoadData, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLibraryLoadFromFile' in found_functions}}
            global __cuLibraryLoadFromFile
            _F_cuGetProcAddress_v2('cuLibraryLoadFromFile', &__cuLibraryLoadFromFile, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLibraryUnload' in found_functions}}
            global __cuLibraryUnload
            _F_cuGetProcAddress_v2('cuLibraryUnload', &__cuLibraryUnload, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLibraryGetKernel' in found_functions}}
            global __cuLibraryGetKernel
            _F_cuGetProcAddress_v2('cuLibraryGetKernel', &__cuLibraryGetKernel, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLibraryGetKernelCount' in found_functions}}
            global __cuLibraryGetKernelCount
            _F_cuGetProcAddress_v2('cuLibraryGetKernelCount', &__cuLibraryGetKernelCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLibraryEnumerateKernels' in found_functions}}
            global __cuLibraryEnumerateKernels
            _F_cuGetProcAddress_v2('cuLibraryEnumerateKernels', &__cuLibraryEnumerateKernels, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLibraryGetModule' in found_functions}}
            global __cuLibraryGetModule
            _F_cuGetProcAddress_v2('cuLibraryGetModule', &__cuLibraryGetModule, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuKernelGetFunction' in found_functions}}
            global __cuKernelGetFunction
            _F_cuGetProcAddress_v2('cuKernelGetFunction', &__cuKernelGetFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuKernelGetLibrary' in found_functions}}
            global __cuKernelGetLibrary
            _F_cuGetProcAddress_v2('cuKernelGetLibrary', &__cuKernelGetLibrary, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLibraryGetGlobal' in found_functions}}
            global __cuLibraryGetGlobal
            _F_cuGetProcAddress_v2('cuLibraryGetGlobal', &__cuLibraryGetGlobal, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLibraryGetManaged' in found_functions}}
            global __cuLibraryGetManaged
            _F_cuGetProcAddress_v2('cuLibraryGetManaged', &__cuLibraryGetManaged, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLibraryGetUnifiedFunction' in found_functions}}
            global __cuLibraryGetUnifiedFunction
            _F_cuGetProcAddress_v2('cuLibraryGetUnifiedFunction', &__cuLibraryGetUnifiedFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuKernelGetAttribute' in found_functions}}
            global __cuKernelGetAttribute
            _F_cuGetProcAddress_v2('cuKernelGetAttribute', &__cuKernelGetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuKernelSetAttribute' in found_functions}}
            global __cuKernelSetAttribute
            _F_cuGetProcAddress_v2('cuKernelSetAttribute', &__cuKernelSetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuKernelSetCacheConfig' in found_functions}}
            global __cuKernelSetCacheConfig
            _F_cuGetProcAddress_v2('cuKernelSetCacheConfig', &__cuKernelSetCacheConfig, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuKernelGetName' in found_functions}}
            global __cuKernelGetName
            _F_cuGetProcAddress_v2('cuKernelGetName', &__cuKernelGetName, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuKernelGetParamInfo' in found_functions}}
            global __cuKernelGetParamInfo
            _F_cuGetProcAddress_v2('cuKernelGetParamInfo', &__cuKernelGetParamInfo, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemGetInfo_v2' in found_functions}}
            global __cuMemGetInfo_v2
            _F_cuGetProcAddress_v2('cuMemGetInfo', &__cuMemGetInfo_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemAlloc_v2' in found_functions}}
            global __cuMemAlloc_v2
            _F_cuGetProcAddress_v2('cuMemAlloc', &__cuMemAlloc_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemAllocPitch_v2' in found_functions}}
            global __cuMemAllocPitch_v2
            _F_cuGetProcAddress_v2('cuMemAllocPitch', &__cuMemAllocPitch_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemFree_v2' in found_functions}}
            global __cuMemFree_v2
            _F_cuGetProcAddress_v2('cuMemFree', &__cuMemFree_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemGetAddressRange_v2' in found_functions}}
            global __cuMemGetAddressRange_v2
            _F_cuGetProcAddress_v2('cuMemGetAddressRange', &__cuMemGetAddressRange_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemAllocHost_v2' in found_functions}}
            global __cuMemAllocHost_v2
            _F_cuGetProcAddress_v2('cuMemAllocHost', &__cuMemAllocHost_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemFreeHost' in found_functions}}
            global __cuMemFreeHost
            _F_cuGetProcAddress_v2('cuMemFreeHost', &__cuMemFreeHost, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemHostAlloc' in found_functions}}
            global __cuMemHostAlloc
            _F_cuGetProcAddress_v2('cuMemHostAlloc', &__cuMemHostAlloc, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemHostGetDevicePointer_v2' in found_functions}}
            global __cuMemHostGetDevicePointer_v2
            _F_cuGetProcAddress_v2('cuMemHostGetDevicePointer', &__cuMemHostGetDevicePointer_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemHostGetFlags' in found_functions}}
            global __cuMemHostGetFlags
            _F_cuGetProcAddress_v2('cuMemHostGetFlags', &__cuMemHostGetFlags, 2030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemAllocManaged' in found_functions}}
            global __cuMemAllocManaged
            _F_cuGetProcAddress_v2('cuMemAllocManaged', &__cuMemAllocManaged, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceRegisterAsyncNotification' in found_functions}}
            global __cuDeviceRegisterAsyncNotification
            _F_cuGetProcAddress_v2('cuDeviceRegisterAsyncNotification', &__cuDeviceRegisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}}
            global __cuDeviceUnregisterAsyncNotification
            _F_cuGetProcAddress_v2('cuDeviceUnregisterAsyncNotification', &__cuDeviceUnregisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetByPCIBusId' in found_functions}}
            global __cuDeviceGetByPCIBusId
            _F_cuGetProcAddress_v2('cuDeviceGetByPCIBusId', &__cuDeviceGetByPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetPCIBusId' in found_functions}}
            global __cuDeviceGetPCIBusId
            _F_cuGetProcAddress_v2('cuDeviceGetPCIBusId', &__cuDeviceGetPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuIpcGetEventHandle' in found_functions}}
            global __cuIpcGetEventHandle
            _F_cuGetProcAddress_v2('cuIpcGetEventHandle', &__cuIpcGetEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuIpcOpenEventHandle' in found_functions}}
            global __cuIpcOpenEventHandle
            _F_cuGetProcAddress_v2('cuIpcOpenEventHandle', &__cuIpcOpenEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuIpcGetMemHandle' in found_functions}}
            global __cuIpcGetMemHandle
            _F_cuGetProcAddress_v2('cuIpcGetMemHandle', &__cuIpcGetMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuIpcOpenMemHandle_v2' in found_functions}}
            global __cuIpcOpenMemHandle_v2
            _F_cuGetProcAddress_v2('cuIpcOpenMemHandle', &__cuIpcOpenMemHandle_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuIpcCloseMemHandle' in found_functions}}
            global __cuIpcCloseMemHandle
            _F_cuGetProcAddress_v2('cuIpcCloseMemHandle', &__cuIpcCloseMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemHostRegister_v2' in found_functions}}
            global __cuMemHostRegister_v2
            _F_cuGetProcAddress_v2('cuMemHostRegister', &__cuMemHostRegister_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemHostUnregister' in found_functions}}
            global __cuMemHostUnregister
            _F_cuGetProcAddress_v2('cuMemHostUnregister', &__cuMemHostUnregister, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuArrayCreate_v2' in found_functions}}
            global __cuArrayCreate_v2
            _F_cuGetProcAddress_v2('cuArrayCreate', &__cuArrayCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuArrayGetDescriptor_v2' in found_functions}}
            global __cuArrayGetDescriptor_v2
            _F_cuGetProcAddress_v2('cuArrayGetDescriptor', &__cuArrayGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuArrayGetSparseProperties' in found_functions}}
            global __cuArrayGetSparseProperties
            _F_cuGetProcAddress_v2('cuArrayGetSparseProperties', &__cuArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}}
            global __cuMipmappedArrayGetSparseProperties
            _F_cuGetProcAddress_v2('cuMipmappedArrayGetSparseProperties', &__cuMipmappedArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuArrayGetMemoryRequirements' in found_functions}}
            global __cuArrayGetMemoryRequirements
            _F_cuGetProcAddress_v2('cuArrayGetMemoryRequirements', &__cuArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}}
            global __cuMipmappedArrayGetMemoryRequirements
            _F_cuGetProcAddress_v2('cuMipmappedArrayGetMemoryRequirements', &__cuMipmappedArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuArrayGetPlane' in found_functions}}
            global __cuArrayGetPlane
            _F_cuGetProcAddress_v2('cuArrayGetPlane', &__cuArrayGetPlane, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuArrayDestroy' in found_functions}}
            global __cuArrayDestroy
            _F_cuGetProcAddress_v2('cuArrayDestroy', &__cuArrayDestroy, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuArray3DCreate_v2' in found_functions}}
            global __cuArray3DCreate_v2
            _F_cuGetProcAddress_v2('cuArray3DCreate', &__cuArray3DCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuArray3DGetDescriptor_v2' in found_functions}}
            global __cuArray3DGetDescriptor_v2
            _F_cuGetProcAddress_v2('cuArray3DGetDescriptor', &__cuArray3DGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMipmappedArrayCreate' in found_functions}}
            global __cuMipmappedArrayCreate
            _F_cuGetProcAddress_v2('cuMipmappedArrayCreate', &__cuMipmappedArrayCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMipmappedArrayGetLevel' in found_functions}}
            global __cuMipmappedArrayGetLevel
            _F_cuGetProcAddress_v2('cuMipmappedArrayGetLevel', &__cuMipmappedArrayGetLevel, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMipmappedArrayDestroy' in found_functions}}
            global __cuMipmappedArrayDestroy
            _F_cuGetProcAddress_v2('cuMipmappedArrayDestroy', &__cuMipmappedArrayDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemGetHandleForAddressRange' in found_functions}}
            global __cuMemGetHandleForAddressRange
            _F_cuGetProcAddress_v2('cuMemGetHandleForAddressRange', &__cuMemGetHandleForAddressRange, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemAddressReserve' in found_functions}}
            global __cuMemAddressReserve
            _F_cuGetProcAddress_v2('cuMemAddressReserve', &__cuMemAddressReserve, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemAddressFree' in found_functions}}
            global __cuMemAddressFree
            _F_cuGetProcAddress_v2('cuMemAddressFree', &__cuMemAddressFree, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemCreate' in found_functions}}
            global __cuMemCreate
            _F_cuGetProcAddress_v2('cuMemCreate', &__cuMemCreate, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemRelease' in found_functions}}
            global __cuMemRelease
            _F_cuGetProcAddress_v2('cuMemRelease', &__cuMemRelease, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemMap' in found_functions}}
            global __cuMemMap
            _F_cuGetProcAddress_v2('cuMemMap', &__cuMemMap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemUnmap' in found_functions}}
            global __cuMemUnmap
            _F_cuGetProcAddress_v2('cuMemUnmap', &__cuMemUnmap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemSetAccess' in found_functions}}
            global __cuMemSetAccess
            _F_cuGetProcAddress_v2('cuMemSetAccess', &__cuMemSetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemGetAccess' in found_functions}}
            global __cuMemGetAccess
            _F_cuGetProcAddress_v2('cuMemGetAccess', &__cuMemGetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemExportToShareableHandle' in found_functions}}
            global __cuMemExportToShareableHandle
            _F_cuGetProcAddress_v2('cuMemExportToShareableHandle', &__cuMemExportToShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemImportFromShareableHandle' in found_functions}}
            global __cuMemImportFromShareableHandle
            _F_cuGetProcAddress_v2('cuMemImportFromShareableHandle', &__cuMemImportFromShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemGetAllocationGranularity' in found_functions}}
            global __cuMemGetAllocationGranularity
            _F_cuGetProcAddress_v2('cuMemGetAllocationGranularity', &__cuMemGetAllocationGranularity, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}}
            global __cuMemGetAllocationPropertiesFromHandle
            _F_cuGetProcAddress_v2('cuMemGetAllocationPropertiesFromHandle', &__cuMemGetAllocationPropertiesFromHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemRetainAllocationHandle' in found_functions}}
            global __cuMemRetainAllocationHandle
            _F_cuGetProcAddress_v2('cuMemRetainAllocationHandle', &__cuMemRetainAllocationHandle, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemPoolTrimTo' in found_functions}}
            global __cuMemPoolTrimTo
            _F_cuGetProcAddress_v2('cuMemPoolTrimTo', &__cuMemPoolTrimTo, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemPoolSetAttribute' in found_functions}}
            global __cuMemPoolSetAttribute
            _F_cuGetProcAddress_v2('cuMemPoolSetAttribute', &__cuMemPoolSetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemPoolGetAttribute' in found_functions}}
            global __cuMemPoolGetAttribute
            _F_cuGetProcAddress_v2('cuMemPoolGetAttribute', &__cuMemPoolGetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemPoolSetAccess' in found_functions}}
            global __cuMemPoolSetAccess
            _F_cuGetProcAddress_v2('cuMemPoolSetAccess', &__cuMemPoolSetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemPoolGetAccess' in found_functions}}
            global __cuMemPoolGetAccess
            _F_cuGetProcAddress_v2('cuMemPoolGetAccess', &__cuMemPoolGetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemPoolCreate' in found_functions}}
            global __cuMemPoolCreate
            _F_cuGetProcAddress_v2('cuMemPoolCreate', &__cuMemPoolCreate, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemPoolDestroy' in found_functions}}
            global __cuMemPoolDestroy
            _F_cuGetProcAddress_v2('cuMemPoolDestroy', &__cuMemPoolDestroy, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemPoolExportToShareableHandle' in found_functions}}
            global __cuMemPoolExportToShareableHandle
            _F_cuGetProcAddress_v2('cuMemPoolExportToShareableHandle', &__cuMemPoolExportToShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemPoolImportFromShareableHandle' in found_functions}}
            global __cuMemPoolImportFromShareableHandle
            _F_cuGetProcAddress_v2('cuMemPoolImportFromShareableHandle', &__cuMemPoolImportFromShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemPoolExportPointer' in found_functions}}
            global __cuMemPoolExportPointer
            _F_cuGetProcAddress_v2('cuMemPoolExportPointer', &__cuMemPoolExportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemPoolImportPointer' in found_functions}}
            global __cuMemPoolImportPointer
            _F_cuGetProcAddress_v2('cuMemPoolImportPointer', &__cuMemPoolImportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMulticastCreate' in found_functions}}
            global __cuMulticastCreate
            _F_cuGetProcAddress_v2('cuMulticastCreate', &__cuMulticastCreate, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMulticastAddDevice' in found_functions}}
            global __cuMulticastAddDevice
            _F_cuGetProcAddress_v2('cuMulticastAddDevice', &__cuMulticastAddDevice, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMulticastBindMem' in found_functions}}
            global __cuMulticastBindMem
            _F_cuGetProcAddress_v2('cuMulticastBindMem', &__cuMulticastBindMem, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMulticastBindAddr' in found_functions}}
            global __cuMulticastBindAddr
            _F_cuGetProcAddress_v2('cuMulticastBindAddr', &__cuMulticastBindAddr, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMulticastUnbind' in found_functions}}
            global __cuMulticastUnbind
            _F_cuGetProcAddress_v2('cuMulticastUnbind', &__cuMulticastUnbind, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMulticastGetGranularity' in found_functions}}
            global __cuMulticastGetGranularity
            _F_cuGetProcAddress_v2('cuMulticastGetGranularity', &__cuMulticastGetGranularity, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuPointerGetAttribute' in found_functions}}
            global __cuPointerGetAttribute
            _F_cuGetProcAddress_v2('cuPointerGetAttribute', &__cuPointerGetAttribute, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemAdvise' in found_functions}}
            global __cuMemAdvise
            _F_cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemAdvise_v2' in found_functions}}
            global __cuMemAdvise_v2
            _F_cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemRangeGetAttribute' in found_functions}}
            global __cuMemRangeGetAttribute
            _F_cuGetProcAddress_v2('cuMemRangeGetAttribute', &__cuMemRangeGetAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuMemRangeGetAttributes' in found_functions}}
            global __cuMemRangeGetAttributes
            _F_cuGetProcAddress_v2('cuMemRangeGetAttributes', &__cuMemRangeGetAttributes, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuPointerSetAttribute' in found_functions}}
            global __cuPointerSetAttribute
            _F_cuGetProcAddress_v2('cuPointerSetAttribute', &__cuPointerSetAttribute, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuPointerGetAttributes' in found_functions}}
            global __cuPointerGetAttributes
            _F_cuGetProcAddress_v2('cuPointerGetAttributes', &__cuPointerGetAttributes, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuStreamCreate' in found_functions}}
            global __cuStreamCreate
            _F_cuGetProcAddress_v2('cuStreamCreate', &__cuStreamCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuStreamCreateWithPriority' in found_functions}}
            global __cuStreamCreateWithPriority
            _F_cuGetProcAddress_v2('cuStreamCreateWithPriority', &__cuStreamCreateWithPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}}
            global __cuThreadExchangeStreamCaptureMode
            _F_cuGetProcAddress_v2('cuThreadExchangeStreamCaptureMode', &__cuThreadExchangeStreamCaptureMode, 10010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuStreamDestroy_v2' in found_functions}}
            global __cuStreamDestroy_v2
            _F_cuGetProcAddress_v2('cuStreamDestroy', &__cuStreamDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuEventCreate' in found_functions}}
            global __cuEventCreate
            _F_cuGetProcAddress_v2('cuEventCreate', &__cuEventCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuEventQuery' in found_functions}}
            global __cuEventQuery
            _F_cuGetProcAddress_v2('cuEventQuery', &__cuEventQuery, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuEventSynchronize' in found_functions}}
            global __cuEventSynchronize
            _F_cuGetProcAddress_v2('cuEventSynchronize', &__cuEventSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuEventDestroy_v2' in found_functions}}
            global __cuEventDestroy_v2
            _F_cuGetProcAddress_v2('cuEventDestroy', &__cuEventDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuEventElapsedTime' in found_functions}}
            global __cuEventElapsedTime
            _F_cuGetProcAddress_v2('cuEventElapsedTime', &__cuEventElapsedTime, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuEventElapsedTime_v2' in found_functions}}
            global __cuEventElapsedTime_v2
            _F_cuGetProcAddress_v2('cuEventElapsedTime', &__cuEventElapsedTime_v2, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuImportExternalMemory' in found_functions}}
            global __cuImportExternalMemory
            _F_cuGetProcAddress_v2('cuImportExternalMemory', &__cuImportExternalMemory, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}}
            global __cuExternalMemoryGetMappedBuffer
            _F_cuGetProcAddress_v2('cuExternalMemoryGetMappedBuffer', &__cuExternalMemoryGetMappedBuffer, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}}
            global __cuExternalMemoryGetMappedMipmappedArray
            _F_cuGetProcAddress_v2('cuExternalMemoryGetMappedMipmappedArray', &__cuExternalMemoryGetMappedMipmappedArray, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDestroyExternalMemory' in found_functions}}
            global __cuDestroyExternalMemory
            _F_cuGetProcAddress_v2('cuDestroyExternalMemory', &__cuDestroyExternalMemory, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuImportExternalSemaphore' in found_functions}}
            global __cuImportExternalSemaphore
            _F_cuGetProcAddress_v2('cuImportExternalSemaphore', &__cuImportExternalSemaphore, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDestroyExternalSemaphore' in found_functions}}
            global __cuDestroyExternalSemaphore
            _F_cuGetProcAddress_v2('cuDestroyExternalSemaphore', &__cuDestroyExternalSemaphore, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFuncGetAttribute' in found_functions}}
            global __cuFuncGetAttribute
            _F_cuGetProcAddress_v2('cuFuncGetAttribute', &__cuFuncGetAttribute, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFuncSetAttribute' in found_functions}}
            global __cuFuncSetAttribute
            _F_cuGetProcAddress_v2('cuFuncSetAttribute', &__cuFuncSetAttribute, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFuncSetCacheConfig' in found_functions}}
            global __cuFuncSetCacheConfig
            _F_cuGetProcAddress_v2('cuFuncSetCacheConfig', &__cuFuncSetCacheConfig, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFuncGetModule' in found_functions}}
            global __cuFuncGetModule
            _F_cuGetProcAddress_v2('cuFuncGetModule', &__cuFuncGetModule, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFuncGetName' in found_functions}}
            global __cuFuncGetName
            _F_cuGetProcAddress_v2('cuFuncGetName', &__cuFuncGetName, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFuncGetParamInfo' in found_functions}}
            global __cuFuncGetParamInfo
            _F_cuGetProcAddress_v2('cuFuncGetParamInfo', &__cuFuncGetParamInfo, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFuncIsLoaded' in found_functions}}
            global __cuFuncIsLoaded
            _F_cuGetProcAddress_v2('cuFuncIsLoaded', &__cuFuncIsLoaded, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFuncLoad' in found_functions}}
            global __cuFuncLoad
            _F_cuGetProcAddress_v2('cuFuncLoad', &__cuFuncLoad, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}}
            global __cuLaunchCooperativeKernelMultiDevice
            _F_cuGetProcAddress_v2('cuLaunchCooperativeKernelMultiDevice', &__cuLaunchCooperativeKernelMultiDevice, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFuncSetBlockShape' in found_functions}}
            global __cuFuncSetBlockShape
            _F_cuGetProcAddress_v2('cuFuncSetBlockShape', &__cuFuncSetBlockShape, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFuncSetSharedSize' in found_functions}}
            global __cuFuncSetSharedSize
            _F_cuGetProcAddress_v2('cuFuncSetSharedSize', &__cuFuncSetSharedSize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuParamSetSize' in found_functions}}
            global __cuParamSetSize
            _F_cuGetProcAddress_v2('cuParamSetSize', &__cuParamSetSize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuParamSeti' in found_functions}}
            global __cuParamSeti
            _F_cuGetProcAddress_v2('cuParamSeti', &__cuParamSeti, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuParamSetf' in found_functions}}
            global __cuParamSetf
            _F_cuGetProcAddress_v2('cuParamSetf', &__cuParamSetf, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuParamSetv' in found_functions}}
            global __cuParamSetv
            _F_cuGetProcAddress_v2('cuParamSetv', &__cuParamSetv, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLaunch' in found_functions}}
            global __cuLaunch
            _F_cuGetProcAddress_v2('cuLaunch', &__cuLaunch, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLaunchGrid' in found_functions}}
            global __cuLaunchGrid
            _F_cuGetProcAddress_v2('cuLaunchGrid', &__cuLaunchGrid, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLaunchGridAsync' in found_functions}}
            global __cuLaunchGridAsync
            _F_cuGetProcAddress_v2('cuLaunchGridAsync', &__cuLaunchGridAsync, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuParamSetTexRef' in found_functions}}
            global __cuParamSetTexRef
            _F_cuGetProcAddress_v2('cuParamSetTexRef', &__cuParamSetTexRef, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuFuncSetSharedMemConfig' in found_functions}}
            global __cuFuncSetSharedMemConfig
            _F_cuGetProcAddress_v2('cuFuncSetSharedMemConfig', &__cuFuncSetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphCreate' in found_functions}}
            global __cuGraphCreate
            _F_cuGetProcAddress_v2('cuGraphCreate', &__cuGraphCreate, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddKernelNode_v2' in found_functions}}
            global __cuGraphAddKernelNode_v2
            _F_cuGetProcAddress_v2('cuGraphAddKernelNode', &__cuGraphAddKernelNode_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}}
            global __cuGraphKernelNodeGetParams_v2
            _F_cuGetProcAddress_v2('cuGraphKernelNodeGetParams', &__cuGraphKernelNodeGetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}}
            global __cuGraphKernelNodeSetParams_v2
            _F_cuGetProcAddress_v2('cuGraphKernelNodeSetParams', &__cuGraphKernelNodeSetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddMemcpyNode' in found_functions}}
            global __cuGraphAddMemcpyNode
            _F_cuGetProcAddress_v2('cuGraphAddMemcpyNode', &__cuGraphAddMemcpyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphMemcpyNodeGetParams' in found_functions}}
            global __cuGraphMemcpyNodeGetParams
            _F_cuGetProcAddress_v2('cuGraphMemcpyNodeGetParams', &__cuGraphMemcpyNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphMemcpyNodeSetParams' in found_functions}}
            global __cuGraphMemcpyNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphMemcpyNodeSetParams', &__cuGraphMemcpyNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddMemsetNode' in found_functions}}
            global __cuGraphAddMemsetNode
            _F_cuGetProcAddress_v2('cuGraphAddMemsetNode', &__cuGraphAddMemsetNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphMemsetNodeGetParams' in found_functions}}
            global __cuGraphMemsetNodeGetParams
            _F_cuGetProcAddress_v2('cuGraphMemsetNodeGetParams', &__cuGraphMemsetNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphMemsetNodeSetParams' in found_functions}}
            global __cuGraphMemsetNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphMemsetNodeSetParams', &__cuGraphMemsetNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddHostNode' in found_functions}}
            global __cuGraphAddHostNode
            _F_cuGetProcAddress_v2('cuGraphAddHostNode', &__cuGraphAddHostNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphHostNodeGetParams' in found_functions}}
            global __cuGraphHostNodeGetParams
            _F_cuGetProcAddress_v2('cuGraphHostNodeGetParams', &__cuGraphHostNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphHostNodeSetParams' in found_functions}}
            global __cuGraphHostNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphHostNodeSetParams', &__cuGraphHostNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddChildGraphNode' in found_functions}}
            global __cuGraphAddChildGraphNode
            _F_cuGetProcAddress_v2('cuGraphAddChildGraphNode', &__cuGraphAddChildGraphNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}}
            global __cuGraphChildGraphNodeGetGraph
            _F_cuGetProcAddress_v2('cuGraphChildGraphNodeGetGraph', &__cuGraphChildGraphNodeGetGraph, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddEmptyNode' in found_functions}}
            global __cuGraphAddEmptyNode
            _F_cuGetProcAddress_v2('cuGraphAddEmptyNode', &__cuGraphAddEmptyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddEventRecordNode' in found_functions}}
            global __cuGraphAddEventRecordNode
            _F_cuGetProcAddress_v2('cuGraphAddEventRecordNode', &__cuGraphAddEventRecordNode, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}}
            global __cuGraphEventRecordNodeGetEvent
            _F_cuGetProcAddress_v2('cuGraphEventRecordNodeGetEvent', &__cuGraphEventRecordNodeGetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}}
            global __cuGraphEventRecordNodeSetEvent
            _F_cuGetProcAddress_v2('cuGraphEventRecordNodeSetEvent', &__cuGraphEventRecordNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddEventWaitNode' in found_functions}}
            global __cuGraphAddEventWaitNode
            _F_cuGetProcAddress_v2('cuGraphAddEventWaitNode', &__cuGraphAddEventWaitNode, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}}
            global __cuGraphEventWaitNodeGetEvent
            _F_cuGetProcAddress_v2('cuGraphEventWaitNodeGetEvent', &__cuGraphEventWaitNodeGetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}}
            global __cuGraphEventWaitNodeSetEvent
            _F_cuGetProcAddress_v2('cuGraphEventWaitNodeSetEvent', &__cuGraphEventWaitNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}}
            global __cuGraphAddExternalSemaphoresSignalNode
            _F_cuGetProcAddress_v2('cuGraphAddExternalSemaphoresSignalNode', &__cuGraphAddExternalSemaphoresSignalNode, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}}
            global __cuGraphExternalSemaphoresSignalNodeGetParams
            _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeGetParams', &__cuGraphExternalSemaphoresSignalNodeGetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}}
            global __cuGraphExternalSemaphoresSignalNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeSetParams', &__cuGraphExternalSemaphoresSignalNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}}
            global __cuGraphAddExternalSemaphoresWaitNode
            _F_cuGetProcAddress_v2('cuGraphAddExternalSemaphoresWaitNode', &__cuGraphAddExternalSemaphoresWaitNode, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}}
            global __cuGraphExternalSemaphoresWaitNodeGetParams
            _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeGetParams', &__cuGraphExternalSemaphoresWaitNodeGetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}}
            global __cuGraphExternalSemaphoresWaitNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeSetParams', &__cuGraphExternalSemaphoresWaitNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddBatchMemOpNode' in found_functions}}
            global __cuGraphAddBatchMemOpNode
            _F_cuGetProcAddress_v2('cuGraphAddBatchMemOpNode', &__cuGraphAddBatchMemOpNode, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}}
            global __cuGraphBatchMemOpNodeGetParams
            _F_cuGetProcAddress_v2('cuGraphBatchMemOpNodeGetParams', &__cuGraphBatchMemOpNodeGetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}}
            global __cuGraphBatchMemOpNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphBatchMemOpNodeSetParams', &__cuGraphBatchMemOpNodeSetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}}
            global __cuGraphExecBatchMemOpNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphExecBatchMemOpNodeSetParams', &__cuGraphExecBatchMemOpNodeSetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddMemAllocNode' in found_functions}}
            global __cuGraphAddMemAllocNode
            _F_cuGetProcAddress_v2('cuGraphAddMemAllocNode', &__cuGraphAddMemAllocNode, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphMemAllocNodeGetParams' in found_functions}}
            global __cuGraphMemAllocNodeGetParams
            _F_cuGetProcAddress_v2('cuGraphMemAllocNodeGetParams', &__cuGraphMemAllocNodeGetParams, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddMemFreeNode' in found_functions}}
            global __cuGraphAddMemFreeNode
            _F_cuGetProcAddress_v2('cuGraphAddMemFreeNode', &__cuGraphAddMemFreeNode, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphMemFreeNodeGetParams' in found_functions}}
            global __cuGraphMemFreeNodeGetParams
            _F_cuGetProcAddress_v2('cuGraphMemFreeNodeGetParams', &__cuGraphMemFreeNodeGetParams, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGraphMemTrim' in found_functions}}
            global __cuDeviceGraphMemTrim
            _F_cuGetProcAddress_v2('cuDeviceGraphMemTrim', &__cuDeviceGraphMemTrim, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetGraphMemAttribute' in found_functions}}
            global __cuDeviceGetGraphMemAttribute
            _F_cuGetProcAddress_v2('cuDeviceGetGraphMemAttribute', &__cuDeviceGetGraphMemAttribute, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceSetGraphMemAttribute' in found_functions}}
            global __cuDeviceSetGraphMemAttribute
            _F_cuGetProcAddress_v2('cuDeviceSetGraphMemAttribute', &__cuDeviceSetGraphMemAttribute, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphClone' in found_functions}}
            global __cuGraphClone
            _F_cuGetProcAddress_v2('cuGraphClone', &__cuGraphClone, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphNodeFindInClone' in found_functions}}
            global __cuGraphNodeFindInClone
            _F_cuGetProcAddress_v2('cuGraphNodeFindInClone', &__cuGraphNodeFindInClone, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphNodeGetType' in found_functions}}
            global __cuGraphNodeGetType
            _F_cuGetProcAddress_v2('cuGraphNodeGetType', &__cuGraphNodeGetType, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphGetNodes' in found_functions}}
            global __cuGraphGetNodes
            _F_cuGetProcAddress_v2('cuGraphGetNodes', &__cuGraphGetNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphGetRootNodes' in found_functions}}
            global __cuGraphGetRootNodes
            _F_cuGetProcAddress_v2('cuGraphGetRootNodes', &__cuGraphGetRootNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphGetEdges' in found_functions}}
            global __cuGraphGetEdges
            _F_cuGetProcAddress_v2('cuGraphGetEdges', &__cuGraphGetEdges, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphGetEdges_v2' in found_functions}}
            global __cuGraphGetEdges_v2
            _F_cuGetProcAddress_v2('cuGraphGetEdges', &__cuGraphGetEdges_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphNodeGetDependencies' in found_functions}}
            global __cuGraphNodeGetDependencies
            _F_cuGetProcAddress_v2('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphNodeGetDependencies_v2' in found_functions}}
            global __cuGraphNodeGetDependencies_v2
            _F_cuGetProcAddress_v2('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphNodeGetDependentNodes' in found_functions}}
            global __cuGraphNodeGetDependentNodes
            _F_cuGetProcAddress_v2('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}}
            global __cuGraphNodeGetDependentNodes_v2
            _F_cuGetProcAddress_v2('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddDependencies' in found_functions}}
            global __cuGraphAddDependencies
            _F_cuGetProcAddress_v2('cuGraphAddDependencies', &__cuGraphAddDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddDependencies_v2' in found_functions}}
            global __cuGraphAddDependencies_v2
            _F_cuGetProcAddress_v2('cuGraphAddDependencies', &__cuGraphAddDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphRemoveDependencies' in found_functions}}
            global __cuGraphRemoveDependencies
            _F_cuGetProcAddress_v2('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphRemoveDependencies_v2' in found_functions}}
            global __cuGraphRemoveDependencies_v2
            _F_cuGetProcAddress_v2('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphDestroyNode' in found_functions}}
            global __cuGraphDestroyNode
            _F_cuGetProcAddress_v2('cuGraphDestroyNode', &__cuGraphDestroyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphInstantiateWithFlags' in found_functions}}
            global __cuGraphInstantiateWithFlags
            _F_cuGetProcAddress_v2('cuGraphInstantiateWithFlags', &__cuGraphInstantiateWithFlags, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecGetFlags' in found_functions}}
            global __cuGraphExecGetFlags
            _F_cuGetProcAddress_v2('cuGraphExecGetFlags', &__cuGraphExecGetFlags, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}}
            global __cuGraphExecKernelNodeSetParams_v2
            _F_cuGetProcAddress_v2('cuGraphExecKernelNodeSetParams', &__cuGraphExecKernelNodeSetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}}
            global __cuGraphExecMemcpyNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphExecMemcpyNodeSetParams', &__cuGraphExecMemcpyNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}}
            global __cuGraphExecMemsetNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphExecMemsetNodeSetParams', &__cuGraphExecMemsetNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecHostNodeSetParams' in found_functions}}
            global __cuGraphExecHostNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphExecHostNodeSetParams', &__cuGraphExecHostNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}}
            global __cuGraphExecChildGraphNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphExecChildGraphNodeSetParams', &__cuGraphExecChildGraphNodeSetParams, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}}
            global __cuGraphExecEventRecordNodeSetEvent
            _F_cuGetProcAddress_v2('cuGraphExecEventRecordNodeSetEvent', &__cuGraphExecEventRecordNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}}
            global __cuGraphExecEventWaitNodeSetEvent
            _F_cuGetProcAddress_v2('cuGraphExecEventWaitNodeSetEvent', &__cuGraphExecEventWaitNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}}
            global __cuGraphExecExternalSemaphoresSignalNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphExecExternalSemaphoresSignalNodeSetParams', &__cuGraphExecExternalSemaphoresSignalNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}}
            global __cuGraphExecExternalSemaphoresWaitNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphExecExternalSemaphoresWaitNodeSetParams', &__cuGraphExecExternalSemaphoresWaitNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphNodeSetEnabled' in found_functions}}
            global __cuGraphNodeSetEnabled
            _F_cuGetProcAddress_v2('cuGraphNodeSetEnabled', &__cuGraphNodeSetEnabled, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphNodeGetEnabled' in found_functions}}
            global __cuGraphNodeGetEnabled
            _F_cuGetProcAddress_v2('cuGraphNodeGetEnabled', &__cuGraphNodeGetEnabled, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecDestroy' in found_functions}}
            global __cuGraphExecDestroy
            _F_cuGetProcAddress_v2('cuGraphExecDestroy', &__cuGraphExecDestroy, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphDestroy' in found_functions}}
            global __cuGraphDestroy
            _F_cuGetProcAddress_v2('cuGraphDestroy', &__cuGraphDestroy, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecUpdate_v2' in found_functions}}
            global __cuGraphExecUpdate_v2
            _F_cuGetProcAddress_v2('cuGraphExecUpdate', &__cuGraphExecUpdate_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}}
            global __cuGraphKernelNodeCopyAttributes
            _F_cuGetProcAddress_v2('cuGraphKernelNodeCopyAttributes', &__cuGraphKernelNodeCopyAttributes, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphKernelNodeGetAttribute' in found_functions}}
            global __cuGraphKernelNodeGetAttribute
            _F_cuGetProcAddress_v2('cuGraphKernelNodeGetAttribute', &__cuGraphKernelNodeGetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphKernelNodeSetAttribute' in found_functions}}
            global __cuGraphKernelNodeSetAttribute
            _F_cuGetProcAddress_v2('cuGraphKernelNodeSetAttribute', &__cuGraphKernelNodeSetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphDebugDotPrint' in found_functions}}
            global __cuGraphDebugDotPrint
            _F_cuGetProcAddress_v2('cuGraphDebugDotPrint', &__cuGraphDebugDotPrint, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuUserObjectCreate' in found_functions}}
            global __cuUserObjectCreate
            _F_cuGetProcAddress_v2('cuUserObjectCreate', &__cuUserObjectCreate, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuUserObjectRetain' in found_functions}}
            global __cuUserObjectRetain
            _F_cuGetProcAddress_v2('cuUserObjectRetain', &__cuUserObjectRetain, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuUserObjectRelease' in found_functions}}
            global __cuUserObjectRelease
            _F_cuGetProcAddress_v2('cuUserObjectRelease', &__cuUserObjectRelease, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphRetainUserObject' in found_functions}}
            global __cuGraphRetainUserObject
            _F_cuGetProcAddress_v2('cuGraphRetainUserObject', &__cuGraphRetainUserObject, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphReleaseUserObject' in found_functions}}
            global __cuGraphReleaseUserObject
            _F_cuGetProcAddress_v2('cuGraphReleaseUserObject', &__cuGraphReleaseUserObject, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddNode' in found_functions}}
            global __cuGraphAddNode
            _F_cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphAddNode_v2' in found_functions}}
            global __cuGraphAddNode_v2
            _F_cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphNodeSetParams' in found_functions}}
            global __cuGraphNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphNodeSetParams', &__cuGraphNodeSetParams, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphExecNodeSetParams' in found_functions}}
            global __cuGraphExecNodeSetParams
            _F_cuGetProcAddress_v2('cuGraphExecNodeSetParams', &__cuGraphExecNodeSetParams, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphConditionalHandleCreate' in found_functions}}
            global __cuGraphConditionalHandleCreate
            _F_cuGetProcAddress_v2('cuGraphConditionalHandleCreate', &__cuGraphConditionalHandleCreate, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}}
            global __cuOccupancyMaxActiveBlocksPerMultiprocessor
            _F_cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessor', &__cuOccupancyMaxActiveBlocksPerMultiprocessor, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}}
            global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
            _F_cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags', &__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}}
            global __cuOccupancyMaxPotentialBlockSize
            _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSize', &__cuOccupancyMaxPotentialBlockSize, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}}
            global __cuOccupancyMaxPotentialBlockSizeWithFlags
            _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSizeWithFlags', &__cuOccupancyMaxPotentialBlockSizeWithFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}}
            global __cuOccupancyAvailableDynamicSMemPerBlock
            _F_cuGetProcAddress_v2('cuOccupancyAvailableDynamicSMemPerBlock', &__cuOccupancyAvailableDynamicSMemPerBlock, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}}
            global __cuOccupancyMaxPotentialClusterSize
            _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialClusterSize', &__cuOccupancyMaxPotentialClusterSize, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuOccupancyMaxActiveClusters' in found_functions}}
            global __cuOccupancyMaxActiveClusters
            _F_cuGetProcAddress_v2('cuOccupancyMaxActiveClusters', &__cuOccupancyMaxActiveClusters, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetArray' in found_functions}}
            global __cuTexRefSetArray
            _F_cuGetProcAddress_v2('cuTexRefSetArray', &__cuTexRefSetArray, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetMipmappedArray' in found_functions}}
            global __cuTexRefSetMipmappedArray
            _F_cuGetProcAddress_v2('cuTexRefSetMipmappedArray', &__cuTexRefSetMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetAddress_v2' in found_functions}}
            global __cuTexRefSetAddress_v2
            _F_cuGetProcAddress_v2('cuTexRefSetAddress', &__cuTexRefSetAddress_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetAddress2D_v3' in found_functions}}
            global __cuTexRefSetAddress2D_v3
            _F_cuGetProcAddress_v2('cuTexRefSetAddress2D', &__cuTexRefSetAddress2D_v3, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetFormat' in found_functions}}
            global __cuTexRefSetFormat
            _F_cuGetProcAddress_v2('cuTexRefSetFormat', &__cuTexRefSetFormat, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetAddressMode' in found_functions}}
            global __cuTexRefSetAddressMode
            _F_cuGetProcAddress_v2('cuTexRefSetAddressMode', &__cuTexRefSetAddressMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetFilterMode' in found_functions}}
            global __cuTexRefSetFilterMode
            _F_cuGetProcAddress_v2('cuTexRefSetFilterMode', &__cuTexRefSetFilterMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetMipmapFilterMode' in found_functions}}
            global __cuTexRefSetMipmapFilterMode
            _F_cuGetProcAddress_v2('cuTexRefSetMipmapFilterMode', &__cuTexRefSetMipmapFilterMode, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetMipmapLevelBias' in found_functions}}
            global __cuTexRefSetMipmapLevelBias
            _F_cuGetProcAddress_v2('cuTexRefSetMipmapLevelBias', &__cuTexRefSetMipmapLevelBias, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}}
            global __cuTexRefSetMipmapLevelClamp
            _F_cuGetProcAddress_v2('cuTexRefSetMipmapLevelClamp', &__cuTexRefSetMipmapLevelClamp, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetMaxAnisotropy' in found_functions}}
            global __cuTexRefSetMaxAnisotropy
            _F_cuGetProcAddress_v2('cuTexRefSetMaxAnisotropy', &__cuTexRefSetMaxAnisotropy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetBorderColor' in found_functions}}
            global __cuTexRefSetBorderColor
            _F_cuGetProcAddress_v2('cuTexRefSetBorderColor', &__cuTexRefSetBorderColor, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefSetFlags' in found_functions}}
            global __cuTexRefSetFlags
            _F_cuGetProcAddress_v2('cuTexRefSetFlags', &__cuTexRefSetFlags, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetAddress_v2' in found_functions}}
            global __cuTexRefGetAddress_v2
            _F_cuGetProcAddress_v2('cuTexRefGetAddress', &__cuTexRefGetAddress_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetArray' in found_functions}}
            global __cuTexRefGetArray
            _F_cuGetProcAddress_v2('cuTexRefGetArray', &__cuTexRefGetArray, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetMipmappedArray' in found_functions}}
            global __cuTexRefGetMipmappedArray
            _F_cuGetProcAddress_v2('cuTexRefGetMipmappedArray', &__cuTexRefGetMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetAddressMode' in found_functions}}
            global __cuTexRefGetAddressMode
            _F_cuGetProcAddress_v2('cuTexRefGetAddressMode', &__cuTexRefGetAddressMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetFilterMode' in found_functions}}
            global __cuTexRefGetFilterMode
            _F_cuGetProcAddress_v2('cuTexRefGetFilterMode', &__cuTexRefGetFilterMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetFormat' in found_functions}}
            global __cuTexRefGetFormat
            _F_cuGetProcAddress_v2('cuTexRefGetFormat', &__cuTexRefGetFormat, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetMipmapFilterMode' in found_functions}}
            global __cuTexRefGetMipmapFilterMode
            _F_cuGetProcAddress_v2('cuTexRefGetMipmapFilterMode', &__cuTexRefGetMipmapFilterMode, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetMipmapLevelBias' in found_functions}}
            global __cuTexRefGetMipmapLevelBias
            _F_cuGetProcAddress_v2('cuTexRefGetMipmapLevelBias', &__cuTexRefGetMipmapLevelBias, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}}
            global __cuTexRefGetMipmapLevelClamp
            _F_cuGetProcAddress_v2('cuTexRefGetMipmapLevelClamp', &__cuTexRefGetMipmapLevelClamp, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetMaxAnisotropy' in found_functions}}
            global __cuTexRefGetMaxAnisotropy
            _F_cuGetProcAddress_v2('cuTexRefGetMaxAnisotropy', &__cuTexRefGetMaxAnisotropy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetBorderColor' in found_functions}}
            global __cuTexRefGetBorderColor
            _F_cuGetProcAddress_v2('cuTexRefGetBorderColor', &__cuTexRefGetBorderColor, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefGetFlags' in found_functions}}
            global __cuTexRefGetFlags
            _F_cuGetProcAddress_v2('cuTexRefGetFlags', &__cuTexRefGetFlags, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefCreate' in found_functions}}
            global __cuTexRefCreate
            _F_cuGetProcAddress_v2('cuTexRefCreate', &__cuTexRefCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexRefDestroy' in found_functions}}
            global __cuTexRefDestroy
            _F_cuGetProcAddress_v2('cuTexRefDestroy', &__cuTexRefDestroy, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuSurfRefSetArray' in found_functions}}
            global __cuSurfRefSetArray
            _F_cuGetProcAddress_v2('cuSurfRefSetArray', &__cuSurfRefSetArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuSurfRefGetArray' in found_functions}}
            global __cuSurfRefGetArray
            _F_cuGetProcAddress_v2('cuSurfRefGetArray', &__cuSurfRefGetArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexObjectCreate' in found_functions}}
            global __cuTexObjectCreate
            _F_cuGetProcAddress_v2('cuTexObjectCreate', &__cuTexObjectCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexObjectDestroy' in found_functions}}
            global __cuTexObjectDestroy
            _F_cuGetProcAddress_v2('cuTexObjectDestroy', &__cuTexObjectDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexObjectGetResourceDesc' in found_functions}}
            global __cuTexObjectGetResourceDesc
            _F_cuGetProcAddress_v2('cuTexObjectGetResourceDesc', &__cuTexObjectGetResourceDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexObjectGetTextureDesc' in found_functions}}
            global __cuTexObjectGetTextureDesc
            _F_cuGetProcAddress_v2('cuTexObjectGetTextureDesc', &__cuTexObjectGetTextureDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTexObjectGetResourceViewDesc' in found_functions}}
            global __cuTexObjectGetResourceViewDesc
            _F_cuGetProcAddress_v2('cuTexObjectGetResourceViewDesc', &__cuTexObjectGetResourceViewDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuSurfObjectCreate' in found_functions}}
            global __cuSurfObjectCreate
            _F_cuGetProcAddress_v2('cuSurfObjectCreate', &__cuSurfObjectCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuSurfObjectDestroy' in found_functions}}
            global __cuSurfObjectDestroy
            _F_cuGetProcAddress_v2('cuSurfObjectDestroy', &__cuSurfObjectDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuSurfObjectGetResourceDesc' in found_functions}}
            global __cuSurfObjectGetResourceDesc
            _F_cuGetProcAddress_v2('cuSurfObjectGetResourceDesc', &__cuSurfObjectGetResourceDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTensorMapEncodeTiled' in found_functions}}
            global __cuTensorMapEncodeTiled
            _F_cuGetProcAddress_v2('cuTensorMapEncodeTiled', &__cuTensorMapEncodeTiled, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTensorMapEncodeIm2col' in found_functions}}
            global __cuTensorMapEncodeIm2col
            _F_cuGetProcAddress_v2('cuTensorMapEncodeIm2col', &__cuTensorMapEncodeIm2col, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTensorMapEncodeIm2colWide' in found_functions}}
            global __cuTensorMapEncodeIm2colWide
            _F_cuGetProcAddress_v2('cuTensorMapEncodeIm2colWide', &__cuTensorMapEncodeIm2colWide, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuTensorMapReplaceAddress' in found_functions}}
            global __cuTensorMapReplaceAddress
            _F_cuGetProcAddress_v2('cuTensorMapReplaceAddress', &__cuTensorMapReplaceAddress, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceCanAccessPeer' in found_functions}}
            global __cuDeviceCanAccessPeer
            _F_cuGetProcAddress_v2('cuDeviceCanAccessPeer', &__cuDeviceCanAccessPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxEnablePeerAccess' in found_functions}}
            global __cuCtxEnablePeerAccess
            _F_cuGetProcAddress_v2('cuCtxEnablePeerAccess', &__cuCtxEnablePeerAccess, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxDisablePeerAccess' in found_functions}}
            global __cuCtxDisablePeerAccess
            _F_cuGetProcAddress_v2('cuCtxDisablePeerAccess', &__cuCtxDisablePeerAccess, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetP2PAttribute' in found_functions}}
            global __cuDeviceGetP2PAttribute
            _F_cuGetProcAddress_v2('cuDeviceGetP2PAttribute', &__cuDeviceGetP2PAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphicsUnregisterResource' in found_functions}}
            global __cuGraphicsUnregisterResource
            _F_cuGetProcAddress_v2('cuGraphicsUnregisterResource', &__cuGraphicsUnregisterResource, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}}
            global __cuGraphicsSubResourceGetMappedArray
            _F_cuGetProcAddress_v2('cuGraphicsSubResourceGetMappedArray', &__cuGraphicsSubResourceGetMappedArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}}
            global __cuGraphicsResourceGetMappedMipmappedArray
            _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedMipmappedArray', &__cuGraphicsResourceGetMappedMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}}
            global __cuGraphicsResourceGetMappedPointer_v2
            _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedPointer', &__cuGraphicsResourceGetMappedPointer_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}}
            global __cuGraphicsResourceSetMapFlags_v2
            _F_cuGetProcAddress_v2('cuGraphicsResourceSetMapFlags', &__cuGraphicsResourceSetMapFlags_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGetProcAddress_v2' in found_functions}}
            global __cuGetProcAddress_v2
            _F_cuGetProcAddress_v2('cuGetProcAddress', &__cuGetProcAddress_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCoredumpGetAttribute' in found_functions}}
            global __cuCoredumpGetAttribute
            _F_cuGetProcAddress_v2('cuCoredumpGetAttribute', &__cuCoredumpGetAttribute, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCoredumpGetAttributeGlobal' in found_functions}}
            global __cuCoredumpGetAttributeGlobal
            _F_cuGetProcAddress_v2('cuCoredumpGetAttributeGlobal', &__cuCoredumpGetAttributeGlobal, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCoredumpSetAttribute' in found_functions}}
            global __cuCoredumpSetAttribute
            _F_cuGetProcAddress_v2('cuCoredumpSetAttribute', &__cuCoredumpSetAttribute, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCoredumpSetAttributeGlobal' in found_functions}}
            global __cuCoredumpSetAttributeGlobal
            _F_cuGetProcAddress_v2('cuCoredumpSetAttributeGlobal', &__cuCoredumpSetAttributeGlobal, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGetExportTable' in found_functions}}
            global __cuGetExportTable
            _F_cuGetProcAddress_v2('cuGetExportTable', &__cuGetExportTable, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGreenCtxCreate' in found_functions}}
            global __cuGreenCtxCreate
            _F_cuGetProcAddress_v2('cuGreenCtxCreate', &__cuGreenCtxCreate, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGreenCtxDestroy' in found_functions}}
            global __cuGreenCtxDestroy
            _F_cuGetProcAddress_v2('cuGreenCtxDestroy', &__cuGreenCtxDestroy, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxFromGreenCtx' in found_functions}}
            global __cuCtxFromGreenCtx
            _F_cuGetProcAddress_v2('cuCtxFromGreenCtx', &__cuCtxFromGreenCtx, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDeviceGetDevResource' in found_functions}}
            global __cuDeviceGetDevResource
            _F_cuGetProcAddress_v2('cuDeviceGetDevResource', &__cuDeviceGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCtxGetDevResource' in found_functions}}
            global __cuCtxGetDevResource
            _F_cuGetProcAddress_v2('cuCtxGetDevResource', &__cuCtxGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGreenCtxGetDevResource' in found_functions}}
            global __cuGreenCtxGetDevResource
            _F_cuGetProcAddress_v2('cuGreenCtxGetDevResource', &__cuGreenCtxGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDevSmResourceSplitByCount' in found_functions}}
            global __cuDevSmResourceSplitByCount
            _F_cuGetProcAddress_v2('cuDevSmResourceSplitByCount', &__cuDevSmResourceSplitByCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuDevResourceGenerateDesc' in found_functions}}
            global __cuDevResourceGenerateDesc
            _F_cuGetProcAddress_v2('cuDevResourceGenerateDesc', &__cuDevResourceGenerateDesc, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGreenCtxRecordEvent' in found_functions}}
            global __cuGreenCtxRecordEvent
            _F_cuGetProcAddress_v2('cuGreenCtxRecordEvent', &__cuGreenCtxRecordEvent, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGreenCtxWaitEvent' in found_functions}}
            global __cuGreenCtxWaitEvent
            _F_cuGetProcAddress_v2('cuGreenCtxWaitEvent', &__cuGreenCtxWaitEvent, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuStreamGetGreenCtx' in found_functions}}
            global __cuStreamGetGreenCtx
            _F_cuGetProcAddress_v2('cuStreamGetGreenCtx', &__cuStreamGetGreenCtx, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuGreenCtxStreamCreate' in found_functions}}
            global __cuGreenCtxStreamCreate
            _F_cuGetProcAddress_v2('cuGreenCtxStreamCreate', &__cuGreenCtxStreamCreate, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLogsRegisterCallback' in found_functions}}
            global __cuLogsRegisterCallback
            _F_cuGetProcAddress_v2('cuLogsRegisterCallback', &__cuLogsRegisterCallback, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLogsUnregisterCallback' in found_functions}}
            global __cuLogsUnregisterCallback
            _F_cuGetProcAddress_v2('cuLogsUnregisterCallback', &__cuLogsUnregisterCallback, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLogsCurrent' in found_functions}}
            global __cuLogsCurrent
            _F_cuGetProcAddress_v2('cuLogsCurrent', &__cuLogsCurrent, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLogsDumpToFile' in found_functions}}
            global __cuLogsDumpToFile
            _F_cuGetProcAddress_v2('cuLogsDumpToFile', &__cuLogsDumpToFile, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuLogsDumpToMemory' in found_functions}}
            global __cuLogsDumpToMemory
            _F_cuGetProcAddress_v2('cuLogsDumpToMemory', &__cuLogsDumpToMemory, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}}
            global __cuCheckpointProcessGetRestoreThreadId
            _F_cuGetProcAddress_v2('cuCheckpointProcessGetRestoreThreadId', &__cuCheckpointProcessGetRestoreThreadId, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCheckpointProcessGetState' in found_functions}}
            global __cuCheckpointProcessGetState
            _F_cuGetProcAddress_v2('cuCheckpointProcessGetState', &__cuCheckpointProcessGetState, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCheckpointProcessLock' in found_functions}}
            global __cuCheckpointProcessLock
            _F_cuGetProcAddress_v2('cuCheckpointProcessLock', &__cuCheckpointProcessLock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCheckpointProcessCheckpoint' in found_functions}}
            global __cuCheckpointProcessCheckpoint
            _F_cuGetProcAddress_v2('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCheckpointProcessRestore' in found_functions}}
            global __cuCheckpointProcessRestore
            _F_cuGetProcAddress_v2('cuCheckpointProcessRestore', &__cuCheckpointProcessRestore, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuCheckpointProcessUnlock' in found_functions}}
            global __cuCheckpointProcessUnlock
            _F_cuGetProcAddress_v2('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuProfilerStart' in found_functions}}
            global __cuProfilerStart
            _F_cuGetProcAddress_v2('cuProfilerStart', &__cuProfilerStart, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if 'cuProfilerStop' in found_functions}}
            global __cuProfilerStop
            _F_cuGetProcAddress_v2('cuProfilerStop', &__cuProfilerStop, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuGraphicsEGLRegisterImage
            _F_cuGetProcAddress_v2('cuGraphicsEGLRegisterImage', &__cuGraphicsEGLRegisterImage, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuEGLStreamConsumerConnect
            _F_cuGetProcAddress_v2('cuEGLStreamConsumerConnect', &__cuEGLStreamConsumerConnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuEGLStreamConsumerConnectWithFlags
            _F_cuGetProcAddress_v2('cuEGLStreamConsumerConnectWithFlags', &__cuEGLStreamConsumerConnectWithFlags, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuEGLStreamConsumerDisconnect
            _F_cuGetProcAddress_v2('cuEGLStreamConsumerDisconnect', &__cuEGLStreamConsumerDisconnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuEGLStreamConsumerAcquireFrame
            _F_cuGetProcAddress_v2('cuEGLStreamConsumerAcquireFrame', &__cuEGLStreamConsumerAcquireFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuEGLStreamConsumerReleaseFrame
            _F_cuGetProcAddress_v2('cuEGLStreamConsumerReleaseFrame', &__cuEGLStreamConsumerReleaseFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuEGLStreamProducerConnect
            _F_cuGetProcAddress_v2('cuEGLStreamProducerConnect', &__cuEGLStreamProducerConnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuEGLStreamProducerDisconnect
            _F_cuGetProcAddress_v2('cuEGLStreamProducerDisconnect', &__cuEGLStreamProducerDisconnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuEGLStreamProducerPresentFrame
            _F_cuGetProcAddress_v2('cuEGLStreamProducerPresentFrame', &__cuEGLStreamProducerPresentFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuEGLStreamProducerReturnFrame
            _F_cuGetProcAddress_v2('cuEGLStreamProducerReturnFrame', &__cuEGLStreamProducerReturnFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuGraphicsResourceGetMappedEglFrame
            _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedEglFrame', &__cuGraphicsResourceGetMappedEglFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuEventCreateFromEGLSync
            _F_cuGetProcAddress_v2('cuEventCreateFromEGLSync', &__cuEventCreateFromEGLSync, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuGraphicsGLRegisterBuffer
            _F_cuGetProcAddress_v2('cuGraphicsGLRegisterBuffer', &__cuGraphicsGLRegisterBuffer, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuGraphicsGLRegisterImage
            _F_cuGetProcAddress_v2('cuGraphicsGLRegisterImage', &__cuGraphicsGLRegisterImage, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuGLGetDevices_v2
            _F_cuGetProcAddress_v2('cuGLGetDevices', &__cuGLGetDevices_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuVDPAUGetDevice
            _F_cuGetProcAddress_v2('cuVDPAUGetDevice', &__cuVDPAUGetDevice, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuVDPAUCtxCreate_v2
            _F_cuGetProcAddress_v2('cuVDPAUCtxCreate', &__cuVDPAUCtxCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuGraphicsVDPAURegisterVideoSurface
            _F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterVideoSurface', &__cuGraphicsVDPAURegisterVideoSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            {{if True}}
            global __cuGraphicsVDPAURegisterOutputSurface
            _F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterOutputSurface', &__cuGraphicsVDPAURegisterOutputSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
            {{endif}}
            __cuPythonInit = True
            return 0

        {{if 'Windows' == platform.system()}}
        # Load using win32GetAddr
        if usePTDS:
            # Get all PTDS version of functions
            pass
            {{if 'cuMemcpy' in found_functions}}
            global __cuMemcpy
            __cuMemcpy = windll.GetProcAddress(handle, 'cuMemcpy_ptds')
            {{endif}}
            {{if 'cuMemcpyPeer' in found_functions}}
            global __cuMemcpyPeer
            __cuMemcpyPeer = windll.GetProcAddress(handle, 'cuMemcpyPeer_ptds')
            {{endif}}
            {{if 'cuMemcpyHtoD_v2' in found_functions}}
            global __cuMemcpyHtoD_v2
            __cuMemcpyHtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoD_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyDtoH_v2' in found_functions}}
            global __cuMemcpyDtoH_v2
            __cuMemcpyDtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoH_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyDtoD_v2' in found_functions}}
            global __cuMemcpyDtoD_v2
            __cuMemcpyDtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoD_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyDtoA_v2' in found_functions}}
            global __cuMemcpyDtoA_v2
            __cuMemcpyDtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoA_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyAtoD_v2' in found_functions}}
            global __cuMemcpyAtoD_v2
            __cuMemcpyAtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoD_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyHtoA_v2' in found_functions}}
            global __cuMemcpyHtoA_v2
            __cuMemcpyHtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoA_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyAtoH_v2' in found_functions}}
            global __cuMemcpyAtoH_v2
            __cuMemcpyAtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoH_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyAtoA_v2' in found_functions}}
            global __cuMemcpyAtoA_v2
            __cuMemcpyAtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoA_v2_ptds')
            {{endif}}
            {{if 'cuMemcpy2D_v2' in found_functions}}
            global __cuMemcpy2D_v2
            __cuMemcpy2D_v2 = windll.GetProcAddress(handle, 'cuMemcpy2D_v2_ptds')
            {{endif}}
            {{if 'cuMemcpy2DUnaligned_v2' in found_functions}}
            global __cuMemcpy2DUnaligned_v2
            __cuMemcpy2DUnaligned_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2_ptds')
            {{endif}}
            {{if 'cuMemcpy3D_v2' in found_functions}}
            global __cuMemcpy3D_v2
            __cuMemcpy3D_v2 = windll.GetProcAddress(handle, 'cuMemcpy3D_v2_ptds')
            {{endif}}
            {{if 'cuMemcpy3DPeer' in found_functions}}
            global __cuMemcpy3DPeer
            __cuMemcpy3DPeer = windll.GetProcAddress(handle, 'cuMemcpy3DPeer_ptds')
            {{endif}}
            {{if 'cuMemcpyAsync' in found_functions}}
            global __cuMemcpyAsync
            __cuMemcpyAsync = windll.GetProcAddress(handle, 'cuMemcpyAsync_ptsz')
            {{endif}}
            {{if 'cuMemcpyPeerAsync' in found_functions}}
            global __cuMemcpyPeerAsync
            __cuMemcpyPeerAsync = windll.GetProcAddress(handle, 'cuMemcpyPeerAsync_ptsz')
            {{endif}}
            {{if 'cuMemcpyHtoDAsync_v2' in found_functions}}
            global __cuMemcpyHtoDAsync_v2
            __cuMemcpyHtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpyDtoHAsync_v2' in found_functions}}
            global __cuMemcpyDtoHAsync_v2
            __cuMemcpyDtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpyDtoDAsync_v2' in found_functions}}
            global __cuMemcpyDtoDAsync_v2
            __cuMemcpyDtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpyHtoAAsync_v2' in found_functions}}
            global __cuMemcpyHtoAAsync_v2
            __cuMemcpyHtoAAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpyAtoHAsync_v2' in found_functions}}
            global __cuMemcpyAtoHAsync_v2
            __cuMemcpyAtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpy2DAsync_v2' in found_functions}}
            global __cuMemcpy2DAsync_v2
            __cuMemcpy2DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpy3DAsync_v2' in found_functions}}
            global __cuMemcpy3DAsync_v2
            __cuMemcpy3DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpy3DPeerAsync' in found_functions}}
            global __cuMemcpy3DPeerAsync
            __cuMemcpy3DPeerAsync = windll.GetProcAddress(handle, 'cuMemcpy3DPeerAsync_ptsz')
            {{endif}}
            {{if 'cuMemcpyBatchAsync' in found_functions}}
            global __cuMemcpyBatchAsync
            __cuMemcpyBatchAsync = windll.GetProcAddress(handle, 'cuMemcpyBatchAsync_ptsz')
            {{endif}}
            {{if 'cuMemcpy3DBatchAsync' in found_functions}}
            global __cuMemcpy3DBatchAsync
            __cuMemcpy3DBatchAsync = windll.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_ptsz')
            {{endif}}
            {{if 'cuMemsetD8_v2' in found_functions}}
            global __cuMemsetD8_v2
            __cuMemsetD8_v2 = windll.GetProcAddress(handle, 'cuMemsetD8_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD16_v2' in found_functions}}
            global __cuMemsetD16_v2
            __cuMemsetD16_v2 = windll.GetProcAddress(handle, 'cuMemsetD16_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD32_v2' in found_functions}}
            global __cuMemsetD32_v2
            __cuMemsetD32_v2 = windll.GetProcAddress(handle, 'cuMemsetD32_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD2D8_v2' in found_functions}}
            global __cuMemsetD2D8_v2
            __cuMemsetD2D8_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D8_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD2D16_v2' in found_functions}}
            global __cuMemsetD2D16_v2
            __cuMemsetD2D16_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D16_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD2D32_v2' in found_functions}}
            global __cuMemsetD2D32_v2
            __cuMemsetD2D32_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D32_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD8Async' in found_functions}}
            global __cuMemsetD8Async
            __cuMemsetD8Async = windll.GetProcAddress(handle, 'cuMemsetD8Async_ptsz')
            {{endif}}
            {{if 'cuMemsetD16Async' in found_functions}}
            global __cuMemsetD16Async
            __cuMemsetD16Async = windll.GetProcAddress(handle, 'cuMemsetD16Async_ptsz')
            {{endif}}
            {{if 'cuMemsetD32Async' in found_functions}}
            global __cuMemsetD32Async
            __cuMemsetD32Async = windll.GetProcAddress(handle, 'cuMemsetD32Async_ptsz')
            {{endif}}
            {{if 'cuMemsetD2D8Async' in found_functions}}
            global __cuMemsetD2D8Async
            __cuMemsetD2D8Async = windll.GetProcAddress(handle, 'cuMemsetD2D8Async_ptsz')
            {{endif}}
            {{if 'cuMemsetD2D16Async' in found_functions}}
            global __cuMemsetD2D16Async
            __cuMemsetD2D16Async = windll.GetProcAddress(handle, 'cuMemsetD2D16Async_ptsz')
            {{endif}}
            {{if 'cuMemsetD2D32Async' in found_functions}}
            global __cuMemsetD2D32Async
            __cuMemsetD2D32Async = windll.GetProcAddress(handle, 'cuMemsetD2D32Async_ptsz')
            {{endif}}
            {{if 'cuMemBatchDecompressAsync' in found_functions}}
            global __cuMemBatchDecompressAsync
            __cuMemBatchDecompressAsync = windll.GetProcAddress(handle, 'cuMemBatchDecompressAsync_ptsz')
            {{endif}}
            {{if 'cuMemMapArrayAsync' in found_functions}}
            global __cuMemMapArrayAsync
            __cuMemMapArrayAsync = windll.GetProcAddress(handle, 'cuMemMapArrayAsync_ptsz')
            {{endif}}
            {{if 'cuMemFreeAsync' in found_functions}}
            global __cuMemFreeAsync
            __cuMemFreeAsync = windll.GetProcAddress(handle, 'cuMemFreeAsync_ptsz')
            {{endif}}
            {{if 'cuMemAllocAsync' in found_functions}}
            global __cuMemAllocAsync
            __cuMemAllocAsync = windll.GetProcAddress(handle, 'cuMemAllocAsync_ptsz')
            {{endif}}
            {{if 'cuMemAllocFromPoolAsync' in found_functions}}
            global __cuMemAllocFromPoolAsync
            __cuMemAllocFromPoolAsync = windll.GetProcAddress(handle, 'cuMemAllocFromPoolAsync_ptsz')
            {{endif}}
            {{if 'cuMemPrefetchAsync' in found_functions}}
            global __cuMemPrefetchAsync
            __cuMemPrefetchAsync = windll.GetProcAddress(handle, 'cuMemPrefetchAsync_ptsz')
            {{endif}}
            {{if 'cuMemPrefetchAsync_v2' in found_functions}}
            global __cuMemPrefetchAsync_v2
            __cuMemPrefetchAsync_v2 = windll.GetProcAddress(handle, 'cuMemPrefetchAsync_v2_ptsz')
            {{endif}}
            {{if 'cuStreamGetPriority' in found_functions}}
            global __cuStreamGetPriority
            __cuStreamGetPriority = windll.GetProcAddress(handle, 'cuStreamGetPriority_ptsz')
            {{endif}}
            {{if 'cuStreamGetDevice' in found_functions}}
            global __cuStreamGetDevice
            __cuStreamGetDevice = windll.GetProcAddress(handle, 'cuStreamGetDevice_ptsz')
            {{endif}}
            {{if 'cuStreamGetFlags' in found_functions}}
            global __cuStreamGetFlags
            __cuStreamGetFlags = windll.GetProcAddress(handle, 'cuStreamGetFlags_ptsz')
            {{endif}}
            {{if 'cuStreamGetId' in found_functions}}
            global __cuStreamGetId
            __cuStreamGetId = windll.GetProcAddress(handle, 'cuStreamGetId_ptsz')
            {{endif}}
            {{if 'cuStreamGetCtx' in found_functions}}
            global __cuStreamGetCtx
            __cuStreamGetCtx = windll.GetProcAddress(handle, 'cuStreamGetCtx_ptsz')
            {{endif}}
            {{if 'cuStreamGetCtx_v2' in found_functions}}
            global __cuStreamGetCtx_v2
            __cuStreamGetCtx_v2 = windll.GetProcAddress(handle, 'cuStreamGetCtx_v2_ptsz')
            {{endif}}
            {{if 'cuStreamWaitEvent' in found_functions}}
            global __cuStreamWaitEvent
            __cuStreamWaitEvent = windll.GetProcAddress(handle, 'cuStreamWaitEvent_ptsz')
            {{endif}}
            {{if 'cuStreamAddCallback' in found_functions}}
            global __cuStreamAddCallback
            __cuStreamAddCallback = windll.GetProcAddress(handle, 'cuStreamAddCallback_ptsz')
            {{endif}}
            {{if 'cuStreamBeginCapture_v2' in found_functions}}
            global __cuStreamBeginCapture_v2
            __cuStreamBeginCapture_v2 = windll.GetProcAddress(handle, 'cuStreamBeginCapture_v2_ptsz')
            {{endif}}
            {{if 'cuStreamBeginCaptureToGraph' in found_functions}}
            global __cuStreamBeginCaptureToGraph
            __cuStreamBeginCaptureToGraph = windll.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph_ptsz')
            {{endif}}
            {{if 'cuStreamEndCapture' in found_functions}}
            global __cuStreamEndCapture
            __cuStreamEndCapture = windll.GetProcAddress(handle, 'cuStreamEndCapture_ptsz')
            {{endif}}
            {{if 'cuStreamIsCapturing' in found_functions}}
            global __cuStreamIsCapturing
            __cuStreamIsCapturing = windll.GetProcAddress(handle, 'cuStreamIsCapturing_ptsz')
            {{endif}}
            {{if 'cuStreamGetCaptureInfo_v2' in found_functions}}
            global __cuStreamGetCaptureInfo_v2
            __cuStreamGetCaptureInfo_v2 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v2_ptsz')
            {{endif}}
            {{if 'cuStreamGetCaptureInfo_v3' in found_functions}}
            global __cuStreamGetCaptureInfo_v3
            __cuStreamGetCaptureInfo_v3 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3_ptsz')
            {{endif}}
            {{if 'cuStreamUpdateCaptureDependencies' in found_functions}}
            global __cuStreamUpdateCaptureDependencies
            __cuStreamUpdateCaptureDependencies = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_ptsz')
            {{endif}}
            {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}}
            global __cuStreamUpdateCaptureDependencies_v2
            __cuStreamUpdateCaptureDependencies_v2 = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz')
            {{endif}}
            {{if 'cuStreamAttachMemAsync' in found_functions}}
            global __cuStreamAttachMemAsync
            __cuStreamAttachMemAsync = windll.GetProcAddress(handle, 'cuStreamAttachMemAsync_ptsz')
            {{endif}}
            {{if 'cuStreamQuery' in found_functions}}
            global __cuStreamQuery
            __cuStreamQuery = windll.GetProcAddress(handle, 'cuStreamQuery_ptsz')
            {{endif}}
            {{if 'cuStreamSynchronize' in found_functions}}
            global __cuStreamSynchronize
            __cuStreamSynchronize = windll.GetProcAddress(handle, 'cuStreamSynchronize_ptsz')
            {{endif}}
            {{if 'cuStreamCopyAttributes' in found_functions}}
            global __cuStreamCopyAttributes
            __cuStreamCopyAttributes = windll.GetProcAddress(handle, 'cuStreamCopyAttributes_ptsz')
            {{endif}}
            {{if 'cuStreamGetAttribute' in found_functions}}
            global __cuStreamGetAttribute
            __cuStreamGetAttribute = windll.GetProcAddress(handle, 'cuStreamGetAttribute_ptsz')
            {{endif}}
            {{if 'cuStreamSetAttribute' in found_functions}}
            global __cuStreamSetAttribute
            __cuStreamSetAttribute = windll.GetProcAddress(handle, 'cuStreamSetAttribute_ptsz')
            {{endif}}
            {{if 'cuEventRecord' in found_functions}}
            global __cuEventRecord
            __cuEventRecord = windll.GetProcAddress(handle, 'cuEventRecord_ptsz')
            {{endif}}
            {{if 'cuEventRecordWithFlags' in found_functions}}
            global __cuEventRecordWithFlags
            __cuEventRecordWithFlags = windll.GetProcAddress(handle, 'cuEventRecordWithFlags_ptsz')
            {{endif}}
            {{if 'cuSignalExternalSemaphoresAsync' in found_functions}}
            global __cuSignalExternalSemaphoresAsync
            __cuSignalExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync_ptsz')
            {{endif}}
            {{if 'cuWaitExternalSemaphoresAsync' in found_functions}}
            global __cuWaitExternalSemaphoresAsync
            __cuWaitExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync_ptsz')
            {{endif}}
            {{if 'cuStreamWaitValue32_v2' in found_functions}}
            global __cuStreamWaitValue32_v2
            __cuStreamWaitValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue32_v2_ptsz')
            {{endif}}
            {{if 'cuStreamWaitValue64_v2' in found_functions}}
            global __cuStreamWaitValue64_v2
            __cuStreamWaitValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue64_v2_ptsz')
            {{endif}}
            {{if 'cuStreamWriteValue32_v2' in found_functions}}
            global __cuStreamWriteValue32_v2
            __cuStreamWriteValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue32_v2_ptsz')
            {{endif}}
            {{if 'cuStreamWriteValue64_v2' in found_functions}}
            global __cuStreamWriteValue64_v2
            __cuStreamWriteValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue64_v2_ptsz')
            {{endif}}
            {{if 'cuStreamBatchMemOp_v2' in found_functions}}
            global __cuStreamBatchMemOp_v2
            __cuStreamBatchMemOp_v2 = windll.GetProcAddress(handle, 'cuStreamBatchMemOp_v2_ptsz')
            {{endif}}
            {{if 'cuLaunchKernel' in found_functions}}
            global __cuLaunchKernel
            __cuLaunchKernel = windll.GetProcAddress(handle, 'cuLaunchKernel_ptsz')
            {{endif}}
            {{if 'cuLaunchKernelEx' in found_functions}}
            global __cuLaunchKernelEx
            __cuLaunchKernelEx = windll.GetProcAddress(handle, 'cuLaunchKernelEx_ptsz')
            {{endif}}
            {{if 'cuLaunchCooperativeKernel' in found_functions}}
            global __cuLaunchCooperativeKernel
            __cuLaunchCooperativeKernel = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernel_ptsz')
            {{endif}}
            {{if 'cuLaunchHostFunc' in found_functions}}
            global __cuLaunchHostFunc
            __cuLaunchHostFunc = windll.GetProcAddress(handle, 'cuLaunchHostFunc_ptsz')
            {{endif}}
            {{if 'cuGraphInstantiateWithParams' in found_functions}}
            global __cuGraphInstantiateWithParams
            __cuGraphInstantiateWithParams = windll.GetProcAddress(handle, 'cuGraphInstantiateWithParams_ptsz')
            {{endif}}
            {{if 'cuGraphUpload' in found_functions}}
            global __cuGraphUpload
            __cuGraphUpload = windll.GetProcAddress(handle, 'cuGraphUpload_ptsz')
            {{endif}}
            {{if 'cuGraphLaunch' in found_functions}}
            global __cuGraphLaunch
            __cuGraphLaunch = windll.GetProcAddress(handle, 'cuGraphLaunch_ptsz')
            {{endif}}
            {{if 'cuGraphicsMapResources' in found_functions}}
            global __cuGraphicsMapResources
            __cuGraphicsMapResources = windll.GetProcAddress(handle, 'cuGraphicsMapResources_ptsz')
            {{endif}}
            {{if 'cuGraphicsUnmapResources' in found_functions}}
            global __cuGraphicsUnmapResources
            __cuGraphicsUnmapResources = windll.GetProcAddress(handle, 'cuGraphicsUnmapResources_ptsz')
            {{endif}}
        else:
            # Else get the regular version
            pass
            {{if 'cuMemcpy' in found_functions}}
            global __cuMemcpy
            __cuMemcpy = windll.GetProcAddress(handle, 'cuMemcpy')
            {{endif}}
            {{if 'cuMemcpyPeer' in found_functions}}
            global __cuMemcpyPeer
            __cuMemcpyPeer = windll.GetProcAddress(handle, 'cuMemcpyPeer')
            {{endif}}
            {{if 'cuMemcpyHtoD_v2' in found_functions}}
            global __cuMemcpyHtoD_v2
            __cuMemcpyHtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoD_v2')
            {{endif}}
            {{if 'cuMemcpyDtoH_v2' in found_functions}}
            global __cuMemcpyDtoH_v2
            __cuMemcpyDtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoH_v2')
            {{endif}}
            {{if 'cuMemcpyDtoD_v2' in found_functions}}
            global __cuMemcpyDtoD_v2
            __cuMemcpyDtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoD_v2')
            {{endif}}
            {{if 'cuMemcpyDtoA_v2' in found_functions}}
            global __cuMemcpyDtoA_v2
            __cuMemcpyDtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoA_v2')
            {{endif}}
            {{if 'cuMemcpyAtoD_v2' in found_functions}}
            global __cuMemcpyAtoD_v2
            __cuMemcpyAtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoD_v2')
            {{endif}}
            {{if 'cuMemcpyHtoA_v2' in found_functions}}
            global __cuMemcpyHtoA_v2
            __cuMemcpyHtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoA_v2')
            {{endif}}
            {{if 'cuMemcpyAtoH_v2' in found_functions}}
            global __cuMemcpyAtoH_v2
            __cuMemcpyAtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoH_v2')
            {{endif}}
            {{if 'cuMemcpyAtoA_v2' in found_functions}}
            global __cuMemcpyAtoA_v2
            __cuMemcpyAtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoA_v2')
            {{endif}}
            {{if 'cuMemcpy2D_v2' in found_functions}}
            global __cuMemcpy2D_v2
            __cuMemcpy2D_v2 = windll.GetProcAddress(handle, 'cuMemcpy2D_v2')
            {{endif}}
            {{if 'cuMemcpy2DUnaligned_v2' in found_functions}}
            global __cuMemcpy2DUnaligned_v2
            __cuMemcpy2DUnaligned_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2')
            {{endif}}
            {{if 'cuMemcpy3D_v2' in found_functions}}
            global __cuMemcpy3D_v2
            __cuMemcpy3D_v2 = windll.GetProcAddress(handle, 'cuMemcpy3D_v2')
            {{endif}}
            {{if 'cuMemcpy3DPeer' in found_functions}}
            global __cuMemcpy3DPeer
            __cuMemcpy3DPeer = windll.GetProcAddress(handle, 'cuMemcpy3DPeer')
            {{endif}}
            {{if 'cuMemcpyAsync' in found_functions}}
            global __cuMemcpyAsync
            __cuMemcpyAsync = windll.GetProcAddress(handle, 'cuMemcpyAsync')
            {{endif}}
            {{if 'cuMemcpyPeerAsync' in found_functions}}
            global __cuMemcpyPeerAsync
            __cuMemcpyPeerAsync = windll.GetProcAddress(handle, 'cuMemcpyPeerAsync')
            {{endif}}
            {{if 'cuMemcpyHtoDAsync_v2' in found_functions}}
            global __cuMemcpyHtoDAsync_v2
            __cuMemcpyHtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2')
            {{endif}}
            {{if 'cuMemcpyDtoHAsync_v2' in found_functions}}
            global __cuMemcpyDtoHAsync_v2
            __cuMemcpyDtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2')
            {{endif}}
            {{if 'cuMemcpyDtoDAsync_v2' in found_functions}}
            global __cuMemcpyDtoDAsync_v2
            __cuMemcpyDtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2')
            {{endif}}
            {{if 'cuMemcpyHtoAAsync_v2' in found_functions}}
            global __cuMemcpyHtoAAsync_v2
            __cuMemcpyHtoAAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2')
            {{endif}}
            {{if 'cuMemcpyAtoHAsync_v2' in found_functions}}
            global __cuMemcpyAtoHAsync_v2
            __cuMemcpyAtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2')
            {{endif}}
            {{if 'cuMemcpy2DAsync_v2' in found_functions}}
            global __cuMemcpy2DAsync_v2
            __cuMemcpy2DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DAsync_v2')
            {{endif}}
            {{if 'cuMemcpy3DAsync_v2' in found_functions}}
            global __cuMemcpy3DAsync_v2
            __cuMemcpy3DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DAsync_v2')
            {{endif}}
            {{if 'cuMemcpy3DPeerAsync' in found_functions}}
            global __cuMemcpy3DPeerAsync
            __cuMemcpy3DPeerAsync = windll.GetProcAddress(handle, 'cuMemcpy3DPeerAsync')
            {{endif}}
            {{if 'cuMemcpyBatchAsync' in found_functions}}
            global __cuMemcpyBatchAsync
            __cuMemcpyBatchAsync = windll.GetProcAddress(handle, 'cuMemcpyBatchAsync')
            {{endif}}
            {{if 'cuMemcpy3DBatchAsync' in found_functions}}
            global __cuMemcpy3DBatchAsync
            __cuMemcpy3DBatchAsync = windll.GetProcAddress(handle, 'cuMemcpy3DBatchAsync')
            {{endif}}
            {{if 'cuMemsetD8_v2' in found_functions}}
            global __cuMemsetD8_v2
            __cuMemsetD8_v2 = windll.GetProcAddress(handle, 'cuMemsetD8_v2')
            {{endif}}
            {{if 'cuMemsetD16_v2' in found_functions}}
            global __cuMemsetD16_v2
            __cuMemsetD16_v2 = windll.GetProcAddress(handle, 'cuMemsetD16_v2')
            {{endif}}
            {{if 'cuMemsetD32_v2' in found_functions}}
            global __cuMemsetD32_v2
            __cuMemsetD32_v2 = windll.GetProcAddress(handle, 'cuMemsetD32_v2')
            {{endif}}
            {{if 'cuMemsetD2D8_v2' in found_functions}}
            global __cuMemsetD2D8_v2
            __cuMemsetD2D8_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D8_v2')
            {{endif}}
            {{if 'cuMemsetD2D16_v2' in found_functions}}
            global __cuMemsetD2D16_v2
            __cuMemsetD2D16_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D16_v2')
            {{endif}}
            {{if 'cuMemsetD2D32_v2' in found_functions}}
            global __cuMemsetD2D32_v2
            __cuMemsetD2D32_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D32_v2')
            {{endif}}
            {{if 'cuMemsetD8Async' in found_functions}}
            global __cuMemsetD8Async
            __cuMemsetD8Async = windll.GetProcAddress(handle, 'cuMemsetD8Async')
            {{endif}}
            {{if 'cuMemsetD16Async' in found_functions}}
            global __cuMemsetD16Async
            __cuMemsetD16Async = windll.GetProcAddress(handle, 'cuMemsetD16Async')
            {{endif}}
            {{if 'cuMemsetD32Async' in found_functions}}
            global __cuMemsetD32Async
            __cuMemsetD32Async = windll.GetProcAddress(handle, 'cuMemsetD32Async')
            {{endif}}
            {{if 'cuMemsetD2D8Async' in found_functions}}
            global __cuMemsetD2D8Async
            __cuMemsetD2D8Async = windll.GetProcAddress(handle, 'cuMemsetD2D8Async')
            {{endif}}
            {{if 'cuMemsetD2D16Async' in found_functions}}
            global __cuMemsetD2D16Async
            __cuMemsetD2D16Async = windll.GetProcAddress(handle, 'cuMemsetD2D16Async')
            {{endif}}
            {{if 'cuMemsetD2D32Async' in found_functions}}
            global __cuMemsetD2D32Async
            __cuMemsetD2D32Async = windll.GetProcAddress(handle, 'cuMemsetD2D32Async')
            {{endif}}
            {{if 'cuMemBatchDecompressAsync' in found_functions}}
            global __cuMemBatchDecompressAsync
            __cuMemBatchDecompressAsync = windll.GetProcAddress(handle, 'cuMemBatchDecompressAsync')
            {{endif}}
            {{if 'cuMemMapArrayAsync' in found_functions}}
            global __cuMemMapArrayAsync
            __cuMemMapArrayAsync = windll.GetProcAddress(handle, 'cuMemMapArrayAsync')
            {{endif}}
            {{if 'cuMemFreeAsync' in found_functions}}
            global __cuMemFreeAsync
            __cuMemFreeAsync = windll.GetProcAddress(handle, 'cuMemFreeAsync')
            {{endif}}
            {{if 'cuMemAllocAsync' in found_functions}}
            global __cuMemAllocAsync
            __cuMemAllocAsync = windll.GetProcAddress(handle, 'cuMemAllocAsync')
            {{endif}}
            {{if 'cuMemAllocFromPoolAsync' in found_functions}}
            global __cuMemAllocFromPoolAsync
            __cuMemAllocFromPoolAsync = windll.GetProcAddress(handle, 'cuMemAllocFromPoolAsync')
            {{endif}}
            {{if 'cuMemPrefetchAsync' in found_functions}}
            global __cuMemPrefetchAsync
            __cuMemPrefetchAsync = windll.GetProcAddress(handle, 'cuMemPrefetchAsync')
            {{endif}}
            {{if 'cuMemPrefetchAsync_v2' in found_functions}}
            global __cuMemPrefetchAsync_v2
            __cuMemPrefetchAsync_v2 = windll.GetProcAddress(handle, 'cuMemPrefetchAsync_v2')
            {{endif}}
            {{if 'cuStreamGetPriority' in found_functions}}
            global __cuStreamGetPriority
            __cuStreamGetPriority = windll.GetProcAddress(handle, 'cuStreamGetPriority')
            {{endif}}
            {{if 'cuStreamGetDevice' in found_functions}}
            global __cuStreamGetDevice
            __cuStreamGetDevice = windll.GetProcAddress(handle, 'cuStreamGetDevice')
            {{endif}}
            {{if 'cuStreamGetFlags' in found_functions}}
            global __cuStreamGetFlags
            __cuStreamGetFlags = windll.GetProcAddress(handle, 'cuStreamGetFlags')
            {{endif}}
            {{if 'cuStreamGetId' in found_functions}}
            global __cuStreamGetId
            __cuStreamGetId = windll.GetProcAddress(handle, 'cuStreamGetId')
            {{endif}}
            {{if 'cuStreamGetCtx' in found_functions}}
            global __cuStreamGetCtx
            __cuStreamGetCtx = windll.GetProcAddress(handle, 'cuStreamGetCtx')
            {{endif}}
            {{if 'cuStreamGetCtx_v2' in found_functions}}
            global __cuStreamGetCtx_v2
            __cuStreamGetCtx_v2 = windll.GetProcAddress(handle, 'cuStreamGetCtx_v2')
            {{endif}}
            {{if 'cuStreamWaitEvent' in found_functions}}
            global __cuStreamWaitEvent
            __cuStreamWaitEvent = windll.GetProcAddress(handle, 'cuStreamWaitEvent')
            {{endif}}
            {{if 'cuStreamAddCallback' in found_functions}}
            global __cuStreamAddCallback
            __cuStreamAddCallback = windll.GetProcAddress(handle, 'cuStreamAddCallback')
            {{endif}}
            {{if 'cuStreamBeginCapture_v2' in found_functions}}
            global __cuStreamBeginCapture_v2
            __cuStreamBeginCapture_v2 = windll.GetProcAddress(handle, 'cuStreamBeginCapture_v2')
            {{endif}}
            {{if 'cuStreamBeginCaptureToGraph' in found_functions}}
            global __cuStreamBeginCaptureToGraph
            __cuStreamBeginCaptureToGraph = windll.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph')
            {{endif}}
            {{if 'cuStreamEndCapture' in found_functions}}
            global __cuStreamEndCapture
            __cuStreamEndCapture = windll.GetProcAddress(handle, 'cuStreamEndCapture')
            {{endif}}
            {{if 'cuStreamIsCapturing' in found_functions}}
            global __cuStreamIsCapturing
            __cuStreamIsCapturing = windll.GetProcAddress(handle, 'cuStreamIsCapturing')
            {{endif}}
            {{if 'cuStreamGetCaptureInfo_v2' in found_functions}}
            global __cuStreamGetCaptureInfo_v2
            __cuStreamGetCaptureInfo_v2 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v2')
            {{endif}}
            {{if 'cuStreamGetCaptureInfo_v3' in found_functions}}
            global __cuStreamGetCaptureInfo_v3
            __cuStreamGetCaptureInfo_v3 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3')
            {{endif}}
            {{if 'cuStreamUpdateCaptureDependencies' in found_functions}}
            global __cuStreamUpdateCaptureDependencies
            __cuStreamUpdateCaptureDependencies = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies')
            {{endif}}
            {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}}
            global __cuStreamUpdateCaptureDependencies_v2
            __cuStreamUpdateCaptureDependencies_v2 = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2')
            {{endif}}
            {{if 'cuStreamAttachMemAsync' in found_functions}}
            global __cuStreamAttachMemAsync
            __cuStreamAttachMemAsync = windll.GetProcAddress(handle, 'cuStreamAttachMemAsync')
            {{endif}}
            {{if 'cuStreamQuery' in found_functions}}
            global __cuStreamQuery
            __cuStreamQuery = windll.GetProcAddress(handle, 'cuStreamQuery')
            {{endif}}
            {{if 'cuStreamSynchronize' in found_functions}}
            global __cuStreamSynchronize
            __cuStreamSynchronize = windll.GetProcAddress(handle, 'cuStreamSynchronize')
            {{endif}}
            {{if 'cuStreamCopyAttributes' in found_functions}}
            global __cuStreamCopyAttributes
            __cuStreamCopyAttributes = windll.GetProcAddress(handle, 'cuStreamCopyAttributes')
            {{endif}}
            {{if 'cuStreamGetAttribute' in found_functions}}
            global __cuStreamGetAttribute
            __cuStreamGetAttribute = windll.GetProcAddress(handle, 'cuStreamGetAttribute')
            {{endif}}
            {{if 'cuStreamSetAttribute' in found_functions}}
            global __cuStreamSetAttribute
            __cuStreamSetAttribute = windll.GetProcAddress(handle, 'cuStreamSetAttribute')
            {{endif}}
            {{if 'cuEventRecord' in found_functions}}
            global __cuEventRecord
            __cuEventRecord = windll.GetProcAddress(handle, 'cuEventRecord')
            {{endif}}
            {{if 'cuEventRecordWithFlags' in found_functions}}
            global __cuEventRecordWithFlags
            __cuEventRecordWithFlags = windll.GetProcAddress(handle, 'cuEventRecordWithFlags')
            {{endif}}
            {{if 'cuSignalExternalSemaphoresAsync' in found_functions}}
            global __cuSignalExternalSemaphoresAsync
            __cuSignalExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync')
            {{endif}}
            {{if 'cuWaitExternalSemaphoresAsync' in found_functions}}
            global __cuWaitExternalSemaphoresAsync
            __cuWaitExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync')
            {{endif}}
            {{if 'cuStreamWaitValue32_v2' in found_functions}}
            global __cuStreamWaitValue32_v2
            __cuStreamWaitValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue32_v2')
            {{endif}}
            {{if 'cuStreamWaitValue64_v2' in found_functions}}
            global __cuStreamWaitValue64_v2
            __cuStreamWaitValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue64_v2')
            {{endif}}
            {{if 'cuStreamWriteValue32_v2' in found_functions}}
            global __cuStreamWriteValue32_v2
            __cuStreamWriteValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue32_v2')
            {{endif}}
            {{if 'cuStreamWriteValue64_v2' in found_functions}}
            global __cuStreamWriteValue64_v2
            __cuStreamWriteValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue64_v2')
            {{endif}}
            {{if 'cuStreamBatchMemOp_v2' in found_functions}}
            global __cuStreamBatchMemOp_v2
            __cuStreamBatchMemOp_v2 = windll.GetProcAddress(handle, 'cuStreamBatchMemOp_v2')
            {{endif}}
            {{if 'cuLaunchKernel' in found_functions}}
            global __cuLaunchKernel
            __cuLaunchKernel = windll.GetProcAddress(handle, 'cuLaunchKernel')
            {{endif}}
            {{if 'cuLaunchKernelEx' in found_functions}}
            global __cuLaunchKernelEx
            __cuLaunchKernelEx = windll.GetProcAddress(handle, 'cuLaunchKernelEx')
            {{endif}}
            {{if 'cuLaunchCooperativeKernel' in found_functions}}
            global __cuLaunchCooperativeKernel
            __cuLaunchCooperativeKernel = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernel')
            {{endif}}
            {{if 'cuLaunchHostFunc' in found_functions}}
            global __cuLaunchHostFunc
            __cuLaunchHostFunc = windll.GetProcAddress(handle, 'cuLaunchHostFunc')
            {{endif}}
            {{if 'cuGraphInstantiateWithParams' in found_functions}}
            global __cuGraphInstantiateWithParams
            __cuGraphInstantiateWithParams = windll.GetProcAddress(handle, 'cuGraphInstantiateWithParams')
            {{endif}}
            {{if 'cuGraphUpload' in found_functions}}
            global __cuGraphUpload
            __cuGraphUpload = windll.GetProcAddress(handle, 'cuGraphUpload')
            {{endif}}
            {{if 'cuGraphLaunch' in found_functions}}
            global __cuGraphLaunch
            __cuGraphLaunch = windll.GetProcAddress(handle, 'cuGraphLaunch')
            {{endif}}
            {{if 'cuGraphicsMapResources' in found_functions}}
            global __cuGraphicsMapResources
            __cuGraphicsMapResources = windll.GetProcAddress(handle, 'cuGraphicsMapResources')
            {{endif}}
            {{if 'cuGraphicsUnmapResources' in found_functions}}
            global __cuGraphicsUnmapResources
            __cuGraphicsUnmapResources = windll.GetProcAddress(handle, 'cuGraphicsUnmapResources')
            {{endif}}
        # Get remaining functions
        {{if 'cuGetErrorString' in found_functions}}
        global __cuGetErrorString
        __cuGetErrorString = windll.GetProcAddress(handle, 'cuGetErrorString')
        {{endif}}
        {{if 'cuGetErrorName' in found_functions}}
        global __cuGetErrorName
        __cuGetErrorName = windll.GetProcAddress(handle, 'cuGetErrorName')
        {{endif}}
        {{if 'cuInit' in found_functions}}
        global __cuInit
        __cuInit = windll.GetProcAddress(handle, 'cuInit')
        {{endif}}
        {{if 'cuDriverGetVersion' in found_functions}}
        global __cuDriverGetVersion
        __cuDriverGetVersion = windll.GetProcAddress(handle, 'cuDriverGetVersion')
        {{endif}}
        {{if 'cuDeviceGet' in found_functions}}
        global __cuDeviceGet
        __cuDeviceGet = windll.GetProcAddress(handle, 'cuDeviceGet')
        {{endif}}
        {{if 'cuDeviceGetCount' in found_functions}}
        global __cuDeviceGetCount
        __cuDeviceGetCount = windll.GetProcAddress(handle, 'cuDeviceGetCount')
        {{endif}}
        {{if 'cuDeviceGetName' in found_functions}}
        global __cuDeviceGetName
        __cuDeviceGetName = windll.GetProcAddress(handle, 'cuDeviceGetName')
        {{endif}}
        {{if 'cuDeviceGetUuid' in found_functions}}
        global __cuDeviceGetUuid
        __cuDeviceGetUuid = windll.GetProcAddress(handle, 'cuDeviceGetUuid')
        {{endif}}
        {{if 'cuDeviceGetUuid_v2' in found_functions}}
        global __cuDeviceGetUuid_v2
        __cuDeviceGetUuid_v2 = windll.GetProcAddress(handle, 'cuDeviceGetUuid_v2')
        {{endif}}
        {{if 'cuDeviceGetLuid' in found_functions}}
        global __cuDeviceGetLuid
        __cuDeviceGetLuid = windll.GetProcAddress(handle, 'cuDeviceGetLuid')
        {{endif}}
        {{if 'cuDeviceTotalMem_v2' in found_functions}}
        global __cuDeviceTotalMem_v2
        __cuDeviceTotalMem_v2 = windll.GetProcAddress(handle, 'cuDeviceTotalMem_v2')
        {{endif}}
        {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}}
        global __cuDeviceGetTexture1DLinearMaxWidth
        __cuDeviceGetTexture1DLinearMaxWidth = windll.GetProcAddress(handle, 'cuDeviceGetTexture1DLinearMaxWidth')
        {{endif}}
        {{if 'cuDeviceGetAttribute' in found_functions}}
        global __cuDeviceGetAttribute
        __cuDeviceGetAttribute = windll.GetProcAddress(handle, 'cuDeviceGetAttribute')
        {{endif}}
        {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}}
        global __cuDeviceGetNvSciSyncAttributes
        __cuDeviceGetNvSciSyncAttributes = windll.GetProcAddress(handle, 'cuDeviceGetNvSciSyncAttributes')
        {{endif}}
        {{if 'cuDeviceSetMemPool' in found_functions}}
        global __cuDeviceSetMemPool
        __cuDeviceSetMemPool = windll.GetProcAddress(handle, 'cuDeviceSetMemPool')
        {{endif}}
        {{if 'cuDeviceGetMemPool' in found_functions}}
        global __cuDeviceGetMemPool
        __cuDeviceGetMemPool = windll.GetProcAddress(handle, 'cuDeviceGetMemPool')
        {{endif}}
        {{if 'cuDeviceGetDefaultMemPool' in found_functions}}
        global __cuDeviceGetDefaultMemPool
        __cuDeviceGetDefaultMemPool = windll.GetProcAddress(handle, 'cuDeviceGetDefaultMemPool')
        {{endif}}
        {{if 'cuDeviceGetExecAffinitySupport' in found_functions}}
        global __cuDeviceGetExecAffinitySupport
        __cuDeviceGetExecAffinitySupport = windll.GetProcAddress(handle, 'cuDeviceGetExecAffinitySupport')
        {{endif}}
        {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}}
        global __cuFlushGPUDirectRDMAWrites
        __cuFlushGPUDirectRDMAWrites = windll.GetProcAddress(handle, 'cuFlushGPUDirectRDMAWrites')
        {{endif}}
        {{if 'cuDeviceGetProperties' in found_functions}}
        global __cuDeviceGetProperties
        __cuDeviceGetProperties = windll.GetProcAddress(handle, 'cuDeviceGetProperties')
        {{endif}}
        {{if 'cuDeviceComputeCapability' in found_functions}}
        global __cuDeviceComputeCapability
        __cuDeviceComputeCapability = windll.GetProcAddress(handle, 'cuDeviceComputeCapability')
        {{endif}}
        {{if 'cuDevicePrimaryCtxRetain' in found_functions}}
        global __cuDevicePrimaryCtxRetain
        __cuDevicePrimaryCtxRetain = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxRetain')
        {{endif}}
        {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}}
        global __cuDevicePrimaryCtxRelease_v2
        __cuDevicePrimaryCtxRelease_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxRelease_v2')
        {{endif}}
        {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}}
        global __cuDevicePrimaryCtxSetFlags_v2
        __cuDevicePrimaryCtxSetFlags_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxSetFlags_v2')
        {{endif}}
        {{if 'cuDevicePrimaryCtxGetState' in found_functions}}
        global __cuDevicePrimaryCtxGetState
        __cuDevicePrimaryCtxGetState = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxGetState')
        {{endif}}
        {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}}
        global __cuDevicePrimaryCtxReset_v2
        __cuDevicePrimaryCtxReset_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxReset_v2')
        {{endif}}
        {{if 'cuCtxCreate_v2' in found_functions}}
        global __cuCtxCreate_v2
        __cuCtxCreate_v2 = windll.GetProcAddress(handle, 'cuCtxCreate_v2')
        {{endif}}
        {{if 'cuCtxCreate_v3' in found_functions}}
        global __cuCtxCreate_v3
        __cuCtxCreate_v3 = windll.GetProcAddress(handle, 'cuCtxCreate_v3')
        {{endif}}
        {{if 'cuCtxCreate_v4' in found_functions}}
        global __cuCtxCreate_v4
        __cuCtxCreate_v4 = windll.GetProcAddress(handle, 'cuCtxCreate_v4')
        {{endif}}
        {{if 'cuCtxDestroy_v2' in found_functions}}
        global __cuCtxDestroy_v2
        __cuCtxDestroy_v2 = windll.GetProcAddress(handle, 'cuCtxDestroy_v2')
        {{endif}}
        {{if 'cuCtxPushCurrent_v2' in found_functions}}
        global __cuCtxPushCurrent_v2
        __cuCtxPushCurrent_v2 = windll.GetProcAddress(handle, 'cuCtxPushCurrent_v2')
        {{endif}}
        {{if 'cuCtxPopCurrent_v2' in found_functions}}
        global __cuCtxPopCurrent_v2
        __cuCtxPopCurrent_v2 = windll.GetProcAddress(handle, 'cuCtxPopCurrent_v2')
        {{endif}}
        {{if 'cuCtxSetCurrent' in found_functions}}
        global __cuCtxSetCurrent
        __cuCtxSetCurrent = windll.GetProcAddress(handle, 'cuCtxSetCurrent')
        {{endif}}
        {{if 'cuCtxGetCurrent' in found_functions}}
        global __cuCtxGetCurrent
        __cuCtxGetCurrent = windll.GetProcAddress(handle, 'cuCtxGetCurrent')
        {{endif}}
        {{if 'cuCtxGetDevice' in found_functions}}
        global __cuCtxGetDevice
        __cuCtxGetDevice = windll.GetProcAddress(handle, 'cuCtxGetDevice')
        {{endif}}
        {{if 'cuCtxGetFlags' in found_functions}}
        global __cuCtxGetFlags
        __cuCtxGetFlags = windll.GetProcAddress(handle, 'cuCtxGetFlags')
        {{endif}}
        {{if 'cuCtxSetFlags' in found_functions}}
        global __cuCtxSetFlags
        __cuCtxSetFlags = windll.GetProcAddress(handle, 'cuCtxSetFlags')
        {{endif}}
        {{if 'cuCtxGetId' in found_functions}}
        global __cuCtxGetId
        __cuCtxGetId = windll.GetProcAddress(handle, 'cuCtxGetId')
        {{endif}}
        {{if 'cuCtxSynchronize' in found_functions}}
        global __cuCtxSynchronize
        __cuCtxSynchronize = windll.GetProcAddress(handle, 'cuCtxSynchronize')
        {{endif}}
        {{if 'cuCtxSetLimit' in found_functions}}
        global __cuCtxSetLimit
        __cuCtxSetLimit = windll.GetProcAddress(handle, 'cuCtxSetLimit')
        {{endif}}
        {{if 'cuCtxGetLimit' in found_functions}}
        global __cuCtxGetLimit
        __cuCtxGetLimit = windll.GetProcAddress(handle, 'cuCtxGetLimit')
        {{endif}}
        {{if 'cuCtxGetCacheConfig' in found_functions}}
        global __cuCtxGetCacheConfig
        __cuCtxGetCacheConfig = windll.GetProcAddress(handle, 'cuCtxGetCacheConfig')
        {{endif}}
        {{if 'cuCtxSetCacheConfig' in found_functions}}
        global __cuCtxSetCacheConfig
        __cuCtxSetCacheConfig = windll.GetProcAddress(handle, 'cuCtxSetCacheConfig')
        {{endif}}
        {{if 'cuCtxGetApiVersion' in found_functions}}
        global __cuCtxGetApiVersion
        __cuCtxGetApiVersion = windll.GetProcAddress(handle, 'cuCtxGetApiVersion')
        {{endif}}
        {{if 'cuCtxGetStreamPriorityRange' in found_functions}}
        global __cuCtxGetStreamPriorityRange
        __cuCtxGetStreamPriorityRange = windll.GetProcAddress(handle, 'cuCtxGetStreamPriorityRange')
        {{endif}}
        {{if 'cuCtxResetPersistingL2Cache' in found_functions}}
        global __cuCtxResetPersistingL2Cache
        __cuCtxResetPersistingL2Cache = windll.GetProcAddress(handle, 'cuCtxResetPersistingL2Cache')
        {{endif}}
        {{if 'cuCtxGetExecAffinity' in found_functions}}
        global __cuCtxGetExecAffinity
        __cuCtxGetExecAffinity = windll.GetProcAddress(handle, 'cuCtxGetExecAffinity')
        {{endif}}
        {{if 'cuCtxRecordEvent' in found_functions}}
        global __cuCtxRecordEvent
        __cuCtxRecordEvent = windll.GetProcAddress(handle, 'cuCtxRecordEvent')
        {{endif}}
        {{if 'cuCtxWaitEvent' in found_functions}}
        global __cuCtxWaitEvent
        __cuCtxWaitEvent = windll.GetProcAddress(handle, 'cuCtxWaitEvent')
        {{endif}}
        {{if 'cuCtxAttach' in found_functions}}
        global __cuCtxAttach
        __cuCtxAttach = windll.GetProcAddress(handle, 'cuCtxAttach')
        {{endif}}
        {{if 'cuCtxDetach' in found_functions}}
        global __cuCtxDetach
        __cuCtxDetach = windll.GetProcAddress(handle, 'cuCtxDetach')
        {{endif}}
        {{if 'cuCtxGetSharedMemConfig' in found_functions}}
        global __cuCtxGetSharedMemConfig
        __cuCtxGetSharedMemConfig = windll.GetProcAddress(handle, 'cuCtxGetSharedMemConfig')
        {{endif}}
        {{if 'cuCtxSetSharedMemConfig' in found_functions}}
        global __cuCtxSetSharedMemConfig
        __cuCtxSetSharedMemConfig = windll.GetProcAddress(handle, 'cuCtxSetSharedMemConfig')
        {{endif}}
        {{if 'cuModuleLoad' in found_functions}}
        global __cuModuleLoad
        __cuModuleLoad = windll.GetProcAddress(handle, 'cuModuleLoad')
        {{endif}}
        {{if 'cuModuleLoadData' in found_functions}}
        global __cuModuleLoadData
        __cuModuleLoadData = windll.GetProcAddress(handle, 'cuModuleLoadData')
        {{endif}}
        {{if 'cuModuleLoadDataEx' in found_functions}}
        global __cuModuleLoadDataEx
        __cuModuleLoadDataEx = windll.GetProcAddress(handle, 'cuModuleLoadDataEx')
        {{endif}}
        {{if 'cuModuleLoadFatBinary' in found_functions}}
        global __cuModuleLoadFatBinary
        __cuModuleLoadFatBinary = windll.GetProcAddress(handle, 'cuModuleLoadFatBinary')
        {{endif}}
        {{if 'cuModuleUnload' in found_functions}}
        global __cuModuleUnload
        __cuModuleUnload = windll.GetProcAddress(handle, 'cuModuleUnload')
        {{endif}}
        {{if 'cuModuleGetLoadingMode' in found_functions}}
        global __cuModuleGetLoadingMode
        __cuModuleGetLoadingMode = windll.GetProcAddress(handle, 'cuModuleGetLoadingMode')
        {{endif}}
        {{if 'cuModuleGetFunction' in found_functions}}
        global __cuModuleGetFunction
        __cuModuleGetFunction = windll.GetProcAddress(handle, 'cuModuleGetFunction')
        {{endif}}
        {{if 'cuModuleGetFunctionCount' in found_functions}}
        global __cuModuleGetFunctionCount
        __cuModuleGetFunctionCount = windll.GetProcAddress(handle, 'cuModuleGetFunctionCount')
        {{endif}}
        {{if 'cuModuleEnumerateFunctions' in found_functions}}
        global __cuModuleEnumerateFunctions
        __cuModuleEnumerateFunctions = windll.GetProcAddress(handle, 'cuModuleEnumerateFunctions')
        {{endif}}
        {{if 'cuModuleGetGlobal_v2' in found_functions}}
        global __cuModuleGetGlobal_v2
        __cuModuleGetGlobal_v2 = windll.GetProcAddress(handle, 'cuModuleGetGlobal_v2')
        {{endif}}
        {{if 'cuLinkCreate_v2' in found_functions}}
        global __cuLinkCreate_v2
        __cuLinkCreate_v2 = windll.GetProcAddress(handle, 'cuLinkCreate_v2')
        {{endif}}
        {{if 'cuLinkAddData_v2' in found_functions}}
        global __cuLinkAddData_v2
        __cuLinkAddData_v2 = windll.GetProcAddress(handle, 'cuLinkAddData_v2')
        {{endif}}
        {{if 'cuLinkAddFile_v2' in found_functions}}
        global __cuLinkAddFile_v2
        __cuLinkAddFile_v2 = windll.GetProcAddress(handle, 'cuLinkAddFile_v2')
        {{endif}}
        {{if 'cuLinkComplete' in found_functions}}
        global __cuLinkComplete
        __cuLinkComplete = windll.GetProcAddress(handle, 'cuLinkComplete')
        {{endif}}
        {{if 'cuLinkDestroy' in found_functions}}
        global __cuLinkDestroy
        __cuLinkDestroy = windll.GetProcAddress(handle, 'cuLinkDestroy')
        {{endif}}
        {{if 'cuModuleGetTexRef' in found_functions}}
        global __cuModuleGetTexRef
        __cuModuleGetTexRef = windll.GetProcAddress(handle, 'cuModuleGetTexRef')
        {{endif}}
        {{if 'cuModuleGetSurfRef' in found_functions}}
        global __cuModuleGetSurfRef
        __cuModuleGetSurfRef = windll.GetProcAddress(handle, 'cuModuleGetSurfRef')
        {{endif}}
        {{if 'cuLibraryLoadData' in found_functions}}
        global __cuLibraryLoadData
        __cuLibraryLoadData = windll.GetProcAddress(handle, 'cuLibraryLoadData')
        {{endif}}
        {{if 'cuLibraryLoadFromFile' in found_functions}}
        global __cuLibraryLoadFromFile
        __cuLibraryLoadFromFile = windll.GetProcAddress(handle, 'cuLibraryLoadFromFile')
        {{endif}}
        {{if 'cuLibraryUnload' in found_functions}}
        global __cuLibraryUnload
        __cuLibraryUnload = windll.GetProcAddress(handle, 'cuLibraryUnload')
        {{endif}}
        {{if 'cuLibraryGetKernel' in found_functions}}
        global __cuLibraryGetKernel
        __cuLibraryGetKernel = windll.GetProcAddress(handle, 'cuLibraryGetKernel')
        {{endif}}
        {{if 'cuLibraryGetKernelCount' in found_functions}}
        global __cuLibraryGetKernelCount
        __cuLibraryGetKernelCount = windll.GetProcAddress(handle, 'cuLibraryGetKernelCount')
        {{endif}}
        {{if 'cuLibraryEnumerateKernels' in found_functions}}
        global __cuLibraryEnumerateKernels
        __cuLibraryEnumerateKernels = windll.GetProcAddress(handle, 'cuLibraryEnumerateKernels')
        {{endif}}
        {{if 'cuLibraryGetModule' in found_functions}}
        global __cuLibraryGetModule
        __cuLibraryGetModule = windll.GetProcAddress(handle, 'cuLibraryGetModule')
        {{endif}}
        {{if 'cuKernelGetFunction' in found_functions}}
        global __cuKernelGetFunction
        __cuKernelGetFunction = windll.GetProcAddress(handle, 'cuKernelGetFunction')
        {{endif}}
        {{if 'cuKernelGetLibrary' in found_functions}}
        global __cuKernelGetLibrary
        __cuKernelGetLibrary = windll.GetProcAddress(handle, 'cuKernelGetLibrary')
        {{endif}}
        {{if 'cuLibraryGetGlobal' in found_functions}}
        global __cuLibraryGetGlobal
        __cuLibraryGetGlobal = windll.GetProcAddress(handle, 'cuLibraryGetGlobal')
        {{endif}}
        {{if 'cuLibraryGetManaged' in found_functions}}
        global __cuLibraryGetManaged
        __cuLibraryGetManaged = windll.GetProcAddress(handle, 'cuLibraryGetManaged')
        {{endif}}
        {{if 'cuLibraryGetUnifiedFunction' in found_functions}}
        global __cuLibraryGetUnifiedFunction
        __cuLibraryGetUnifiedFunction = windll.GetProcAddress(handle, 'cuLibraryGetUnifiedFunction')
        {{endif}}
        {{if 'cuKernelGetAttribute' in found_functions}}
        global __cuKernelGetAttribute
        __cuKernelGetAttribute = windll.GetProcAddress(handle, 'cuKernelGetAttribute')
        {{endif}}
        {{if 'cuKernelSetAttribute' in found_functions}}
        global __cuKernelSetAttribute
        __cuKernelSetAttribute = windll.GetProcAddress(handle, 'cuKernelSetAttribute')
        {{endif}}
        {{if 'cuKernelSetCacheConfig' in found_functions}}
        global __cuKernelSetCacheConfig
        __cuKernelSetCacheConfig = windll.GetProcAddress(handle, 'cuKernelSetCacheConfig')
        {{endif}}
        {{if 'cuKernelGetName' in found_functions}}
        global __cuKernelGetName
        __cuKernelGetName = windll.GetProcAddress(handle, 'cuKernelGetName')
        {{endif}}
        {{if 'cuKernelGetParamInfo' in found_functions}}
        global __cuKernelGetParamInfo
        __cuKernelGetParamInfo = windll.GetProcAddress(handle, 'cuKernelGetParamInfo')
        {{endif}}
        {{if 'cuMemGetInfo_v2' in found_functions}}
        global __cuMemGetInfo_v2
        __cuMemGetInfo_v2 = windll.GetProcAddress(handle, 'cuMemGetInfo_v2')
        {{endif}}
        {{if 'cuMemAlloc_v2' in found_functions}}
        global __cuMemAlloc_v2
        __cuMemAlloc_v2 = windll.GetProcAddress(handle, 'cuMemAlloc_v2')
        {{endif}}
        {{if 'cuMemAllocPitch_v2' in found_functions}}
        global __cuMemAllocPitch_v2
        __cuMemAllocPitch_v2 = windll.GetProcAddress(handle, 'cuMemAllocPitch_v2')
        {{endif}}
        {{if 'cuMemFree_v2' in found_functions}}
        global __cuMemFree_v2
        __cuMemFree_v2 = windll.GetProcAddress(handle, 'cuMemFree_v2')
        {{endif}}
        {{if 'cuMemGetAddressRange_v2' in found_functions}}
        global __cuMemGetAddressRange_v2
        __cuMemGetAddressRange_v2 = windll.GetProcAddress(handle, 'cuMemGetAddressRange_v2')
        {{endif}}
        {{if 'cuMemAllocHost_v2' in found_functions}}
        global __cuMemAllocHost_v2
        __cuMemAllocHost_v2 = windll.GetProcAddress(handle, 'cuMemAllocHost_v2')
        {{endif}}
        {{if 'cuMemFreeHost' in found_functions}}
        global __cuMemFreeHost
        __cuMemFreeHost = windll.GetProcAddress(handle, 'cuMemFreeHost')
        {{endif}}
        {{if 'cuMemHostAlloc' in found_functions}}
        global __cuMemHostAlloc
        __cuMemHostAlloc = windll.GetProcAddress(handle, 'cuMemHostAlloc')
        {{endif}}
        {{if 'cuMemHostGetDevicePointer_v2' in found_functions}}
        global __cuMemHostGetDevicePointer_v2
        __cuMemHostGetDevicePointer_v2 = windll.GetProcAddress(handle, 'cuMemHostGetDevicePointer_v2')
        {{endif}}
        {{if 'cuMemHostGetFlags' in found_functions}}
        global __cuMemHostGetFlags
        __cuMemHostGetFlags = windll.GetProcAddress(handle, 'cuMemHostGetFlags')
        {{endif}}
        {{if 'cuMemAllocManaged' in found_functions}}
        global __cuMemAllocManaged
        __cuMemAllocManaged = windll.GetProcAddress(handle, 'cuMemAllocManaged')
        {{endif}}
        {{if 'cuDeviceRegisterAsyncNotification' in found_functions}}
        global __cuDeviceRegisterAsyncNotification
        __cuDeviceRegisterAsyncNotification = windll.GetProcAddress(handle, 'cuDeviceRegisterAsyncNotification')
        {{endif}}
        {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}}
        global __cuDeviceUnregisterAsyncNotification
        __cuDeviceUnregisterAsyncNotification = windll.GetProcAddress(handle, 'cuDeviceUnregisterAsyncNotification')
        {{endif}}
        {{if 'cuDeviceGetByPCIBusId' in found_functions}}
        global __cuDeviceGetByPCIBusId
        __cuDeviceGetByPCIBusId = windll.GetProcAddress(handle, 'cuDeviceGetByPCIBusId')
        {{endif}}
        {{if 'cuDeviceGetPCIBusId' in found_functions}}
        global __cuDeviceGetPCIBusId
        __cuDeviceGetPCIBusId = windll.GetProcAddress(handle, 'cuDeviceGetPCIBusId')
        {{endif}}
        {{if 'cuIpcGetEventHandle' in found_functions}}
        global __cuIpcGetEventHandle
        __cuIpcGetEventHandle = windll.GetProcAddress(handle, 'cuIpcGetEventHandle')
        {{endif}}
        {{if 'cuIpcOpenEventHandle' in found_functions}}
        global __cuIpcOpenEventHandle
        __cuIpcOpenEventHandle = windll.GetProcAddress(handle, 'cuIpcOpenEventHandle')
        {{endif}}
        {{if 'cuIpcGetMemHandle' in found_functions}}
        global __cuIpcGetMemHandle
        __cuIpcGetMemHandle = windll.GetProcAddress(handle, 'cuIpcGetMemHandle')
        {{endif}}
        {{if 'cuIpcOpenMemHandle_v2' in found_functions}}
        global __cuIpcOpenMemHandle_v2
        __cuIpcOpenMemHandle_v2 = windll.GetProcAddress(handle, 'cuIpcOpenMemHandle_v2')
        {{endif}}
        {{if 'cuIpcCloseMemHandle' in found_functions}}
        global __cuIpcCloseMemHandle
        __cuIpcCloseMemHandle = windll.GetProcAddress(handle, 'cuIpcCloseMemHandle')
        {{endif}}
        {{if 'cuMemHostRegister_v2' in found_functions}}
        global __cuMemHostRegister_v2
        __cuMemHostRegister_v2 = windll.GetProcAddress(handle, 'cuMemHostRegister_v2')
        {{endif}}
        {{if 'cuMemHostUnregister' in found_functions}}
        global __cuMemHostUnregister
        __cuMemHostUnregister = windll.GetProcAddress(handle, 'cuMemHostUnregister')
        {{endif}}
        {{if 'cuArrayCreate_v2' in found_functions}}
        global __cuArrayCreate_v2
        __cuArrayCreate_v2 = windll.GetProcAddress(handle, 'cuArrayCreate_v2')
        {{endif}}
        {{if 'cuArrayGetDescriptor_v2' in found_functions}}
        global __cuArrayGetDescriptor_v2
        __cuArrayGetDescriptor_v2 = windll.GetProcAddress(handle, 'cuArrayGetDescriptor_v2')
        {{endif}}
        {{if 'cuArrayGetSparseProperties' in found_functions}}
        global __cuArrayGetSparseProperties
        __cuArrayGetSparseProperties = windll.GetProcAddress(handle, 'cuArrayGetSparseProperties')
        {{endif}}
        {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}}
        global __cuMipmappedArrayGetSparseProperties
        __cuMipmappedArrayGetSparseProperties = windll.GetProcAddress(handle, 'cuMipmappedArrayGetSparseProperties')
        {{endif}}
        {{if 'cuArrayGetMemoryRequirements' in found_functions}}
        global __cuArrayGetMemoryRequirements
        __cuArrayGetMemoryRequirements = windll.GetProcAddress(handle, 'cuArrayGetMemoryRequirements')
        {{endif}}
        {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}}
        global __cuMipmappedArrayGetMemoryRequirements
        __cuMipmappedArrayGetMemoryRequirements = windll.GetProcAddress(handle, 'cuMipmappedArrayGetMemoryRequirements')
        {{endif}}
        {{if 'cuArrayGetPlane' in found_functions}}
        global __cuArrayGetPlane
        __cuArrayGetPlane = windll.GetProcAddress(handle, 'cuArrayGetPlane')
        {{endif}}
        {{if 'cuArrayDestroy' in found_functions}}
        global __cuArrayDestroy
        __cuArrayDestroy = windll.GetProcAddress(handle, 'cuArrayDestroy')
        {{endif}}
        {{if 'cuArray3DCreate_v2' in found_functions}}
        global __cuArray3DCreate_v2
        __cuArray3DCreate_v2 = windll.GetProcAddress(handle, 'cuArray3DCreate_v2')
        {{endif}}
        {{if 'cuArray3DGetDescriptor_v2' in found_functions}}
        global __cuArray3DGetDescriptor_v2
        __cuArray3DGetDescriptor_v2 = windll.GetProcAddress(handle, 'cuArray3DGetDescriptor_v2')
        {{endif}}
        {{if 'cuMipmappedArrayCreate' in found_functions}}
        global __cuMipmappedArrayCreate
        __cuMipmappedArrayCreate = windll.GetProcAddress(handle, 'cuMipmappedArrayCreate')
        {{endif}}
        {{if 'cuMipmappedArrayGetLevel' in found_functions}}
        global __cuMipmappedArrayGetLevel
        __cuMipmappedArrayGetLevel = windll.GetProcAddress(handle, 'cuMipmappedArrayGetLevel')
        {{endif}}
        {{if 'cuMipmappedArrayDestroy' in found_functions}}
        global __cuMipmappedArrayDestroy
        __cuMipmappedArrayDestroy = windll.GetProcAddress(handle, 'cuMipmappedArrayDestroy')
        {{endif}}
        {{if 'cuMemGetHandleForAddressRange' in found_functions}}
        global __cuMemGetHandleForAddressRange
        __cuMemGetHandleForAddressRange = windll.GetProcAddress(handle, 'cuMemGetHandleForAddressRange')
        {{endif}}
        {{if 'cuMemAddressReserve' in found_functions}}
        global __cuMemAddressReserve
        __cuMemAddressReserve = windll.GetProcAddress(handle, 'cuMemAddressReserve')
        {{endif}}
        {{if 'cuMemAddressFree' in found_functions}}
        global __cuMemAddressFree
        __cuMemAddressFree = windll.GetProcAddress(handle, 'cuMemAddressFree')
        {{endif}}
        {{if 'cuMemCreate' in found_functions}}
        global __cuMemCreate
        __cuMemCreate = windll.GetProcAddress(handle, 'cuMemCreate')
        {{endif}}
        {{if 'cuMemRelease' in found_functions}}
        global __cuMemRelease
        __cuMemRelease = windll.GetProcAddress(handle, 'cuMemRelease')
        {{endif}}
        {{if 'cuMemMap' in found_functions}}
        global __cuMemMap
        __cuMemMap = windll.GetProcAddress(handle, 'cuMemMap')
        {{endif}}
        {{if 'cuMemUnmap' in found_functions}}
        global __cuMemUnmap
        __cuMemUnmap = windll.GetProcAddress(handle, 'cuMemUnmap')
        {{endif}}
        {{if 'cuMemSetAccess' in found_functions}}
        global __cuMemSetAccess
        __cuMemSetAccess = windll.GetProcAddress(handle, 'cuMemSetAccess')
        {{endif}}
        {{if 'cuMemGetAccess' in found_functions}}
        global __cuMemGetAccess
        __cuMemGetAccess = windll.GetProcAddress(handle, 'cuMemGetAccess')
        {{endif}}
        {{if 'cuMemExportToShareableHandle' in found_functions}}
        global __cuMemExportToShareableHandle
        __cuMemExportToShareableHandle = windll.GetProcAddress(handle, 'cuMemExportToShareableHandle')
        {{endif}}
        {{if 'cuMemImportFromShareableHandle' in found_functions}}
        global __cuMemImportFromShareableHandle
        __cuMemImportFromShareableHandle = windll.GetProcAddress(handle, 'cuMemImportFromShareableHandle')
        {{endif}}
        {{if 'cuMemGetAllocationGranularity' in found_functions}}
        global __cuMemGetAllocationGranularity
        __cuMemGetAllocationGranularity = windll.GetProcAddress(handle, 'cuMemGetAllocationGranularity')
        {{endif}}
        {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}}
        global __cuMemGetAllocationPropertiesFromHandle
        __cuMemGetAllocationPropertiesFromHandle = windll.GetProcAddress(handle, 'cuMemGetAllocationPropertiesFromHandle')
        {{endif}}
        {{if 'cuMemRetainAllocationHandle' in found_functions}}
        global __cuMemRetainAllocationHandle
        __cuMemRetainAllocationHandle = windll.GetProcAddress(handle, 'cuMemRetainAllocationHandle')
        {{endif}}
        {{if 'cuMemPoolTrimTo' in found_functions}}
        global __cuMemPoolTrimTo
        __cuMemPoolTrimTo = windll.GetProcAddress(handle, 'cuMemPoolTrimTo')
        {{endif}}
        {{if 'cuMemPoolSetAttribute' in found_functions}}
        global __cuMemPoolSetAttribute
        __cuMemPoolSetAttribute = windll.GetProcAddress(handle, 'cuMemPoolSetAttribute')
        {{endif}}
        {{if 'cuMemPoolGetAttribute' in found_functions}}
        global __cuMemPoolGetAttribute
        __cuMemPoolGetAttribute = windll.GetProcAddress(handle, 'cuMemPoolGetAttribute')
        {{endif}}
        {{if 'cuMemPoolSetAccess' in found_functions}}
        global __cuMemPoolSetAccess
        __cuMemPoolSetAccess = windll.GetProcAddress(handle, 'cuMemPoolSetAccess')
        {{endif}}
        {{if 'cuMemPoolGetAccess' in found_functions}}
        global __cuMemPoolGetAccess
        __cuMemPoolGetAccess = windll.GetProcAddress(handle, 'cuMemPoolGetAccess')
        {{endif}}
        {{if 'cuMemPoolCreate' in found_functions}}
        global __cuMemPoolCreate
        __cuMemPoolCreate = windll.GetProcAddress(handle, 'cuMemPoolCreate')
        {{endif}}
        {{if 'cuMemPoolDestroy' in found_functions}}
        global __cuMemPoolDestroy
        __cuMemPoolDestroy = windll.GetProcAddress(handle, 'cuMemPoolDestroy')
        {{endif}}
        {{if 'cuMemPoolExportToShareableHandle' in found_functions}}
        global __cuMemPoolExportToShareableHandle
        __cuMemPoolExportToShareableHandle = windll.GetProcAddress(handle, 'cuMemPoolExportToShareableHandle')
        {{endif}}
        {{if 'cuMemPoolImportFromShareableHandle' in found_functions}}
        global __cuMemPoolImportFromShareableHandle
        __cuMemPoolImportFromShareableHandle = windll.GetProcAddress(handle, 'cuMemPoolImportFromShareableHandle')
        {{endif}}
        {{if 'cuMemPoolExportPointer' in found_functions}}
        global __cuMemPoolExportPointer
        __cuMemPoolExportPointer = windll.GetProcAddress(handle, 'cuMemPoolExportPointer')
        {{endif}}
        {{if 'cuMemPoolImportPointer' in found_functions}}
        global __cuMemPoolImportPointer
        __cuMemPoolImportPointer = windll.GetProcAddress(handle, 'cuMemPoolImportPointer')
        {{endif}}
        {{if 'cuMulticastCreate' in found_functions}}
        global __cuMulticastCreate
        __cuMulticastCreate = windll.GetProcAddress(handle, 'cuMulticastCreate')
        {{endif}}
        {{if 'cuMulticastAddDevice' in found_functions}}
        global __cuMulticastAddDevice
        __cuMulticastAddDevice = windll.GetProcAddress(handle, 'cuMulticastAddDevice')
        {{endif}}
        {{if 'cuMulticastBindMem' in found_functions}}
        global __cuMulticastBindMem
        __cuMulticastBindMem = windll.GetProcAddress(handle, 'cuMulticastBindMem')
        {{endif}}
        {{if 'cuMulticastBindAddr' in found_functions}}
        global __cuMulticastBindAddr
        __cuMulticastBindAddr = windll.GetProcAddress(handle, 'cuMulticastBindAddr')
        {{endif}}
        {{if 'cuMulticastUnbind' in found_functions}}
        global __cuMulticastUnbind
        __cuMulticastUnbind = windll.GetProcAddress(handle, 'cuMulticastUnbind')
        {{endif}}
        {{if 'cuMulticastGetGranularity' in found_functions}}
        global __cuMulticastGetGranularity
        __cuMulticastGetGranularity = windll.GetProcAddress(handle, 'cuMulticastGetGranularity')
        {{endif}}
        {{if 'cuPointerGetAttribute' in found_functions}}
        global __cuPointerGetAttribute
        __cuPointerGetAttribute = windll.GetProcAddress(handle, 'cuPointerGetAttribute')
        {{endif}}
        {{if 'cuMemAdvise' in found_functions}}
        global __cuMemAdvise
        __cuMemAdvise = windll.GetProcAddress(handle, 'cuMemAdvise')
        {{endif}}
        {{if 'cuMemAdvise_v2' in found_functions}}
        global __cuMemAdvise_v2
        __cuMemAdvise_v2 = windll.GetProcAddress(handle, 'cuMemAdvise_v2')
        {{endif}}
        {{if 'cuMemRangeGetAttribute' in found_functions}}
        global __cuMemRangeGetAttribute
        __cuMemRangeGetAttribute = windll.GetProcAddress(handle, 'cuMemRangeGetAttribute')
        {{endif}}
        {{if 'cuMemRangeGetAttributes' in found_functions}}
        global __cuMemRangeGetAttributes
        __cuMemRangeGetAttributes = windll.GetProcAddress(handle, 'cuMemRangeGetAttributes')
        {{endif}}
        {{if 'cuPointerSetAttribute' in found_functions}}
        global __cuPointerSetAttribute
        __cuPointerSetAttribute = windll.GetProcAddress(handle, 'cuPointerSetAttribute')
        {{endif}}
        {{if 'cuPointerGetAttributes' in found_functions}}
        global __cuPointerGetAttributes
        __cuPointerGetAttributes = windll.GetProcAddress(handle, 'cuPointerGetAttributes')
        {{endif}}
        {{if 'cuStreamCreate' in found_functions}}
        global __cuStreamCreate
        __cuStreamCreate = windll.GetProcAddress(handle, 'cuStreamCreate')
        {{endif}}
        {{if 'cuStreamCreateWithPriority' in found_functions}}
        global __cuStreamCreateWithPriority
        __cuStreamCreateWithPriority = windll.GetProcAddress(handle, 'cuStreamCreateWithPriority')
        {{endif}}
        {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}}
        global __cuThreadExchangeStreamCaptureMode
        __cuThreadExchangeStreamCaptureMode = windll.GetProcAddress(handle, 'cuThreadExchangeStreamCaptureMode')
        {{endif}}
        {{if 'cuStreamDestroy_v2' in found_functions}}
        global __cuStreamDestroy_v2
        __cuStreamDestroy_v2 = windll.GetProcAddress(handle, 'cuStreamDestroy_v2')
        {{endif}}
        {{if 'cuEventCreate' in found_functions}}
        global __cuEventCreate
        __cuEventCreate = windll.GetProcAddress(handle, 'cuEventCreate')
        {{endif}}
        {{if 'cuEventQuery' in found_functions}}
        global __cuEventQuery
        __cuEventQuery = windll.GetProcAddress(handle, 'cuEventQuery')
        {{endif}}
        {{if 'cuEventSynchronize' in found_functions}}
        global __cuEventSynchronize
        __cuEventSynchronize = windll.GetProcAddress(handle, 'cuEventSynchronize')
        {{endif}}
        {{if 'cuEventDestroy_v2' in found_functions}}
        global __cuEventDestroy_v2
        __cuEventDestroy_v2 = windll.GetProcAddress(handle, 'cuEventDestroy_v2')
        {{endif}}
        {{if 'cuEventElapsedTime' in found_functions}}
        global __cuEventElapsedTime
        __cuEventElapsedTime = windll.GetProcAddress(handle, 'cuEventElapsedTime')
        {{endif}}
        {{if 'cuEventElapsedTime_v2' in found_functions}}
        global __cuEventElapsedTime_v2
        __cuEventElapsedTime_v2 = windll.GetProcAddress(handle, 'cuEventElapsedTime_v2')
        {{endif}}
        {{if 'cuImportExternalMemory' in found_functions}}
        global __cuImportExternalMemory
        __cuImportExternalMemory = windll.GetProcAddress(handle, 'cuImportExternalMemory')
        {{endif}}
        {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}}
        global __cuExternalMemoryGetMappedBuffer
        __cuExternalMemoryGetMappedBuffer = windll.GetProcAddress(handle, 'cuExternalMemoryGetMappedBuffer')
        {{endif}}
        {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}}
        global __cuExternalMemoryGetMappedMipmappedArray
        __cuExternalMemoryGetMappedMipmappedArray = windll.GetProcAddress(handle, 'cuExternalMemoryGetMappedMipmappedArray')
        {{endif}}
        {{if 'cuDestroyExternalMemory' in found_functions}}
        global __cuDestroyExternalMemory
        __cuDestroyExternalMemory = windll.GetProcAddress(handle, 'cuDestroyExternalMemory')
        {{endif}}
        {{if 'cuImportExternalSemaphore' in found_functions}}
        global __cuImportExternalSemaphore
        __cuImportExternalSemaphore = windll.GetProcAddress(handle, 'cuImportExternalSemaphore')
        {{endif}}
        {{if 'cuDestroyExternalSemaphore' in found_functions}}
        global __cuDestroyExternalSemaphore
        __cuDestroyExternalSemaphore = windll.GetProcAddress(handle, 'cuDestroyExternalSemaphore')
        {{endif}}
        {{if 'cuFuncGetAttribute' in found_functions}}
        global __cuFuncGetAttribute
        __cuFuncGetAttribute = windll.GetProcAddress(handle, 'cuFuncGetAttribute')
        {{endif}}
        {{if 'cuFuncSetAttribute' in found_functions}}
        global __cuFuncSetAttribute
        __cuFuncSetAttribute = windll.GetProcAddress(handle, 'cuFuncSetAttribute')
        {{endif}}
        {{if 'cuFuncSetCacheConfig' in found_functions}}
        global __cuFuncSetCacheConfig
        __cuFuncSetCacheConfig = windll.GetProcAddress(handle, 'cuFuncSetCacheConfig')
        {{endif}}
        {{if 'cuFuncGetModule' in found_functions}}
        global __cuFuncGetModule
        __cuFuncGetModule = windll.GetProcAddress(handle, 'cuFuncGetModule')
        {{endif}}
        {{if 'cuFuncGetName' in found_functions}}
        global __cuFuncGetName
        __cuFuncGetName = windll.GetProcAddress(handle, 'cuFuncGetName')
        {{endif}}
        {{if 'cuFuncGetParamInfo' in found_functions}}
        global __cuFuncGetParamInfo
        __cuFuncGetParamInfo = windll.GetProcAddress(handle, 'cuFuncGetParamInfo')
        {{endif}}
        {{if 'cuFuncIsLoaded' in found_functions}}
        global __cuFuncIsLoaded
        __cuFuncIsLoaded = windll.GetProcAddress(handle, 'cuFuncIsLoaded')
        {{endif}}
        {{if 'cuFuncLoad' in found_functions}}
        global __cuFuncLoad
        __cuFuncLoad = windll.GetProcAddress(handle, 'cuFuncLoad')
        {{endif}}
        {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}}
        global __cuLaunchCooperativeKernelMultiDevice
        __cuLaunchCooperativeKernelMultiDevice = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernelMultiDevice')
        {{endif}}
        {{if 'cuFuncSetBlockShape' in found_functions}}
        global __cuFuncSetBlockShape
        __cuFuncSetBlockShape = windll.GetProcAddress(handle, 'cuFuncSetBlockShape')
        {{endif}}
        {{if 'cuFuncSetSharedSize' in found_functions}}
        global __cuFuncSetSharedSize
        __cuFuncSetSharedSize = windll.GetProcAddress(handle, 'cuFuncSetSharedSize')
        {{endif}}
        {{if 'cuParamSetSize' in found_functions}}
        global __cuParamSetSize
        __cuParamSetSize = windll.GetProcAddress(handle, 'cuParamSetSize')
        {{endif}}
        {{if 'cuParamSeti' in found_functions}}
        global __cuParamSeti
        __cuParamSeti = windll.GetProcAddress(handle, 'cuParamSeti')
        {{endif}}
        {{if 'cuParamSetf' in found_functions}}
        global __cuParamSetf
        __cuParamSetf = windll.GetProcAddress(handle, 'cuParamSetf')
        {{endif}}
        {{if 'cuParamSetv' in found_functions}}
        global __cuParamSetv
        __cuParamSetv = windll.GetProcAddress(handle, 'cuParamSetv')
        {{endif}}
        {{if 'cuLaunch' in found_functions}}
        global __cuLaunch
        __cuLaunch = windll.GetProcAddress(handle, 'cuLaunch')
        {{endif}}
        {{if 'cuLaunchGrid' in found_functions}}
        global __cuLaunchGrid
        __cuLaunchGrid = windll.GetProcAddress(handle, 'cuLaunchGrid')
        {{endif}}
        {{if 'cuLaunchGridAsync' in found_functions}}
        global __cuLaunchGridAsync
        __cuLaunchGridAsync = windll.GetProcAddress(handle, 'cuLaunchGridAsync')
        {{endif}}
        {{if 'cuParamSetTexRef' in found_functions}}
        global __cuParamSetTexRef
        __cuParamSetTexRef = windll.GetProcAddress(handle, 'cuParamSetTexRef')
        {{endif}}
        {{if 'cuFuncSetSharedMemConfig' in found_functions}}
        global __cuFuncSetSharedMemConfig
        __cuFuncSetSharedMemConfig = windll.GetProcAddress(handle, 'cuFuncSetSharedMemConfig')
        {{endif}}
        {{if 'cuGraphCreate' in found_functions}}
        global __cuGraphCreate
        __cuGraphCreate = windll.GetProcAddress(handle, 'cuGraphCreate')
        {{endif}}
        {{if 'cuGraphAddKernelNode_v2' in found_functions}}
        global __cuGraphAddKernelNode_v2
        __cuGraphAddKernelNode_v2 = windll.GetProcAddress(handle, 'cuGraphAddKernelNode_v2')
        {{endif}}
        {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}}
        global __cuGraphKernelNodeGetParams_v2
        __cuGraphKernelNodeGetParams_v2 = windll.GetProcAddress(handle, 'cuGraphKernelNodeGetParams_v2')
        {{endif}}
        {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}}
        global __cuGraphKernelNodeSetParams_v2
        __cuGraphKernelNodeSetParams_v2 = windll.GetProcAddress(handle, 'cuGraphKernelNodeSetParams_v2')
        {{endif}}
        {{if 'cuGraphAddMemcpyNode' in found_functions}}
        global __cuGraphAddMemcpyNode
        __cuGraphAddMemcpyNode = windll.GetProcAddress(handle, 'cuGraphAddMemcpyNode')
        {{endif}}
        {{if 'cuGraphMemcpyNodeGetParams' in found_functions}}
        global __cuGraphMemcpyNodeGetParams
        __cuGraphMemcpyNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemcpyNodeGetParams')
        {{endif}}
        {{if 'cuGraphMemcpyNodeSetParams' in found_functions}}
        global __cuGraphMemcpyNodeSetParams
        __cuGraphMemcpyNodeSetParams = windll.GetProcAddress(handle, 'cuGraphMemcpyNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddMemsetNode' in found_functions}}
        global __cuGraphAddMemsetNode
        __cuGraphAddMemsetNode = windll.GetProcAddress(handle, 'cuGraphAddMemsetNode')
        {{endif}}
        {{if 'cuGraphMemsetNodeGetParams' in found_functions}}
        global __cuGraphMemsetNodeGetParams
        __cuGraphMemsetNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemsetNodeGetParams')
        {{endif}}
        {{if 'cuGraphMemsetNodeSetParams' in found_functions}}
        global __cuGraphMemsetNodeSetParams
        __cuGraphMemsetNodeSetParams = windll.GetProcAddress(handle, 'cuGraphMemsetNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddHostNode' in found_functions}}
        global __cuGraphAddHostNode
        __cuGraphAddHostNode = windll.GetProcAddress(handle, 'cuGraphAddHostNode')
        {{endif}}
        {{if 'cuGraphHostNodeGetParams' in found_functions}}
        global __cuGraphHostNodeGetParams
        __cuGraphHostNodeGetParams = windll.GetProcAddress(handle, 'cuGraphHostNodeGetParams')
        {{endif}}
        {{if 'cuGraphHostNodeSetParams' in found_functions}}
        global __cuGraphHostNodeSetParams
        __cuGraphHostNodeSetParams = windll.GetProcAddress(handle, 'cuGraphHostNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddChildGraphNode' in found_functions}}
        global __cuGraphAddChildGraphNode
        __cuGraphAddChildGraphNode = windll.GetProcAddress(handle, 'cuGraphAddChildGraphNode')
        {{endif}}
        {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}}
        global __cuGraphChildGraphNodeGetGraph
        __cuGraphChildGraphNodeGetGraph = windll.GetProcAddress(handle, 'cuGraphChildGraphNodeGetGraph')
        {{endif}}
        {{if 'cuGraphAddEmptyNode' in found_functions}}
        global __cuGraphAddEmptyNode
        __cuGraphAddEmptyNode = windll.GetProcAddress(handle, 'cuGraphAddEmptyNode')
        {{endif}}
        {{if 'cuGraphAddEventRecordNode' in found_functions}}
        global __cuGraphAddEventRecordNode
        __cuGraphAddEventRecordNode = windll.GetProcAddress(handle, 'cuGraphAddEventRecordNode')
        {{endif}}
        {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}}
        global __cuGraphEventRecordNodeGetEvent
        __cuGraphEventRecordNodeGetEvent = windll.GetProcAddress(handle, 'cuGraphEventRecordNodeGetEvent')
        {{endif}}
        {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}}
        global __cuGraphEventRecordNodeSetEvent
        __cuGraphEventRecordNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphEventRecordNodeSetEvent')
        {{endif}}
        {{if 'cuGraphAddEventWaitNode' in found_functions}}
        global __cuGraphAddEventWaitNode
        __cuGraphAddEventWaitNode = windll.GetProcAddress(handle, 'cuGraphAddEventWaitNode')
        {{endif}}
        {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}}
        global __cuGraphEventWaitNodeGetEvent
        __cuGraphEventWaitNodeGetEvent = windll.GetProcAddress(handle, 'cuGraphEventWaitNodeGetEvent')
        {{endif}}
        {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}}
        global __cuGraphEventWaitNodeSetEvent
        __cuGraphEventWaitNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphEventWaitNodeSetEvent')
        {{endif}}
        {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}}
        global __cuGraphAddExternalSemaphoresSignalNode
        __cuGraphAddExternalSemaphoresSignalNode = windll.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresSignalNode')
        {{endif}}
        {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}}
        global __cuGraphExternalSemaphoresSignalNodeGetParams
        __cuGraphExternalSemaphoresSignalNodeGetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams')
        {{endif}}
        {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}}
        global __cuGraphExternalSemaphoresSignalNodeSetParams
        __cuGraphExternalSemaphoresSignalNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}}
        global __cuGraphAddExternalSemaphoresWaitNode
        __cuGraphAddExternalSemaphoresWaitNode = windll.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresWaitNode')
        {{endif}}
        {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}}
        global __cuGraphExternalSemaphoresWaitNodeGetParams
        __cuGraphExternalSemaphoresWaitNodeGetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams')
        {{endif}}
        {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}}
        global __cuGraphExternalSemaphoresWaitNodeSetParams
        __cuGraphExternalSemaphoresWaitNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddBatchMemOpNode' in found_functions}}
        global __cuGraphAddBatchMemOpNode
        __cuGraphAddBatchMemOpNode = windll.GetProcAddress(handle, 'cuGraphAddBatchMemOpNode')
        {{endif}}
        {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}}
        global __cuGraphBatchMemOpNodeGetParams
        __cuGraphBatchMemOpNodeGetParams = windll.GetProcAddress(handle, 'cuGraphBatchMemOpNodeGetParams')
        {{endif}}
        {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}}
        global __cuGraphBatchMemOpNodeSetParams
        __cuGraphBatchMemOpNodeSetParams = windll.GetProcAddress(handle, 'cuGraphBatchMemOpNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}}
        global __cuGraphExecBatchMemOpNodeSetParams
        __cuGraphExecBatchMemOpNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecBatchMemOpNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddMemAllocNode' in found_functions}}
        global __cuGraphAddMemAllocNode
        __cuGraphAddMemAllocNode = windll.GetProcAddress(handle, 'cuGraphAddMemAllocNode')
        {{endif}}
        {{if 'cuGraphMemAllocNodeGetParams' in found_functions}}
        global __cuGraphMemAllocNodeGetParams
        __cuGraphMemAllocNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemAllocNodeGetParams')
        {{endif}}
        {{if 'cuGraphAddMemFreeNode' in found_functions}}
        global __cuGraphAddMemFreeNode
        __cuGraphAddMemFreeNode = windll.GetProcAddress(handle, 'cuGraphAddMemFreeNode')
        {{endif}}
        {{if 'cuGraphMemFreeNodeGetParams' in found_functions}}
        global __cuGraphMemFreeNodeGetParams
        __cuGraphMemFreeNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemFreeNodeGetParams')
        {{endif}}
        {{if 'cuDeviceGraphMemTrim' in found_functions}}
        global __cuDeviceGraphMemTrim
        __cuDeviceGraphMemTrim = windll.GetProcAddress(handle, 'cuDeviceGraphMemTrim')
        {{endif}}
        {{if 'cuDeviceGetGraphMemAttribute' in found_functions}}
        global __cuDeviceGetGraphMemAttribute
        __cuDeviceGetGraphMemAttribute = windll.GetProcAddress(handle, 'cuDeviceGetGraphMemAttribute')
        {{endif}}
        {{if 'cuDeviceSetGraphMemAttribute' in found_functions}}
        global __cuDeviceSetGraphMemAttribute
        __cuDeviceSetGraphMemAttribute = windll.GetProcAddress(handle, 'cuDeviceSetGraphMemAttribute')
        {{endif}}
        {{if 'cuGraphClone' in found_functions}}
        global __cuGraphClone
        __cuGraphClone = windll.GetProcAddress(handle, 'cuGraphClone')
        {{endif}}
        {{if 'cuGraphNodeFindInClone' in found_functions}}
        global __cuGraphNodeFindInClone
        __cuGraphNodeFindInClone = windll.GetProcAddress(handle, 'cuGraphNodeFindInClone')
        {{endif}}
        {{if 'cuGraphNodeGetType' in found_functions}}
        global __cuGraphNodeGetType
        __cuGraphNodeGetType = windll.GetProcAddress(handle, 'cuGraphNodeGetType')
        {{endif}}
        {{if 'cuGraphGetNodes' in found_functions}}
        global __cuGraphGetNodes
        __cuGraphGetNodes = windll.GetProcAddress(handle, 'cuGraphGetNodes')
        {{endif}}
        {{if 'cuGraphGetRootNodes' in found_functions}}
        global __cuGraphGetRootNodes
        __cuGraphGetRootNodes = windll.GetProcAddress(handle, 'cuGraphGetRootNodes')
        {{endif}}
        {{if 'cuGraphGetEdges' in found_functions}}
        global __cuGraphGetEdges
        __cuGraphGetEdges = windll.GetProcAddress(handle, 'cuGraphGetEdges')
        {{endif}}
        {{if 'cuGraphGetEdges_v2' in found_functions}}
        global __cuGraphGetEdges_v2
        __cuGraphGetEdges_v2 = windll.GetProcAddress(handle, 'cuGraphGetEdges_v2')
        {{endif}}
        {{if 'cuGraphNodeGetDependencies' in found_functions}}
        global __cuGraphNodeGetDependencies
        __cuGraphNodeGetDependencies = windll.GetProcAddress(handle, 'cuGraphNodeGetDependencies')
        {{endif}}
        {{if 'cuGraphNodeGetDependencies_v2' in found_functions}}
        global __cuGraphNodeGetDependencies_v2
        __cuGraphNodeGetDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphNodeGetDependencies_v2')
        {{endif}}
        {{if 'cuGraphNodeGetDependentNodes' in found_functions}}
        global __cuGraphNodeGetDependentNodes
        __cuGraphNodeGetDependentNodes = windll.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes')
        {{endif}}
        {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}}
        global __cuGraphNodeGetDependentNodes_v2
        __cuGraphNodeGetDependentNodes_v2 = windll.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes_v2')
        {{endif}}
        {{if 'cuGraphAddDependencies' in found_functions}}
        global __cuGraphAddDependencies
        __cuGraphAddDependencies = windll.GetProcAddress(handle, 'cuGraphAddDependencies')
        {{endif}}
        {{if 'cuGraphAddDependencies_v2' in found_functions}}
        global __cuGraphAddDependencies_v2
        __cuGraphAddDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphAddDependencies_v2')
        {{endif}}
        {{if 'cuGraphRemoveDependencies' in found_functions}}
        global __cuGraphRemoveDependencies
        __cuGraphRemoveDependencies = windll.GetProcAddress(handle, 'cuGraphRemoveDependencies')
        {{endif}}
        {{if 'cuGraphRemoveDependencies_v2' in found_functions}}
        global __cuGraphRemoveDependencies_v2
        __cuGraphRemoveDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphRemoveDependencies_v2')
        {{endif}}
        {{if 'cuGraphDestroyNode' in found_functions}}
        global __cuGraphDestroyNode
        __cuGraphDestroyNode = windll.GetProcAddress(handle, 'cuGraphDestroyNode')
        {{endif}}
        {{if 'cuGraphInstantiateWithFlags' in found_functions}}
        global __cuGraphInstantiateWithFlags
        __cuGraphInstantiateWithFlags = windll.GetProcAddress(handle, 'cuGraphInstantiateWithFlags')
        {{endif}}
        {{if 'cuGraphExecGetFlags' in found_functions}}
        global __cuGraphExecGetFlags
        __cuGraphExecGetFlags = windll.GetProcAddress(handle, 'cuGraphExecGetFlags')
        {{endif}}
        {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}}
        global __cuGraphExecKernelNodeSetParams_v2
        __cuGraphExecKernelNodeSetParams_v2 = windll.GetProcAddress(handle, 'cuGraphExecKernelNodeSetParams_v2')
        {{endif}}
        {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}}
        global __cuGraphExecMemcpyNodeSetParams
        __cuGraphExecMemcpyNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecMemcpyNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}}
        global __cuGraphExecMemsetNodeSetParams
        __cuGraphExecMemsetNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecMemsetNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecHostNodeSetParams' in found_functions}}
        global __cuGraphExecHostNodeSetParams
        __cuGraphExecHostNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecHostNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}}
        global __cuGraphExecChildGraphNodeSetParams
        __cuGraphExecChildGraphNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecChildGraphNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}}
        global __cuGraphExecEventRecordNodeSetEvent
        __cuGraphExecEventRecordNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphExecEventRecordNodeSetEvent')
        {{endif}}
        {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}}
        global __cuGraphExecEventWaitNodeSetEvent
        __cuGraphExecEventWaitNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphExecEventWaitNodeSetEvent')
        {{endif}}
        {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}}
        global __cuGraphExecExternalSemaphoresSignalNodeSetParams
        __cuGraphExecExternalSemaphoresSignalNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}}
        global __cuGraphExecExternalSemaphoresWaitNodeSetParams
        __cuGraphExecExternalSemaphoresWaitNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams')
        {{endif}}
        {{if 'cuGraphNodeSetEnabled' in found_functions}}
        global __cuGraphNodeSetEnabled
        __cuGraphNodeSetEnabled = windll.GetProcAddress(handle, 'cuGraphNodeSetEnabled')
        {{endif}}
        {{if 'cuGraphNodeGetEnabled' in found_functions}}
        global __cuGraphNodeGetEnabled
        __cuGraphNodeGetEnabled = windll.GetProcAddress(handle, 'cuGraphNodeGetEnabled')
        {{endif}}
        {{if 'cuGraphExecDestroy' in found_functions}}
        global __cuGraphExecDestroy
        __cuGraphExecDestroy = windll.GetProcAddress(handle, 'cuGraphExecDestroy')
        {{endif}}
        {{if 'cuGraphDestroy' in found_functions}}
        global __cuGraphDestroy
        __cuGraphDestroy = windll.GetProcAddress(handle, 'cuGraphDestroy')
        {{endif}}
        {{if 'cuGraphExecUpdate_v2' in found_functions}}
        global __cuGraphExecUpdate_v2
        __cuGraphExecUpdate_v2 = windll.GetProcAddress(handle, 'cuGraphExecUpdate_v2')
        {{endif}}
        {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}}
        global __cuGraphKernelNodeCopyAttributes
        __cuGraphKernelNodeCopyAttributes = windll.GetProcAddress(handle, 'cuGraphKernelNodeCopyAttributes')
        {{endif}}
        {{if 'cuGraphKernelNodeGetAttribute' in found_functions}}
        global __cuGraphKernelNodeGetAttribute
        __cuGraphKernelNodeGetAttribute = windll.GetProcAddress(handle, 'cuGraphKernelNodeGetAttribute')
        {{endif}}
        {{if 'cuGraphKernelNodeSetAttribute' in found_functions}}
        global __cuGraphKernelNodeSetAttribute
        __cuGraphKernelNodeSetAttribute = windll.GetProcAddress(handle, 'cuGraphKernelNodeSetAttribute')
        {{endif}}
        {{if 'cuGraphDebugDotPrint' in found_functions}}
        global __cuGraphDebugDotPrint
        __cuGraphDebugDotPrint = windll.GetProcAddress(handle, 'cuGraphDebugDotPrint')
        {{endif}}
        {{if 'cuUserObjectCreate' in found_functions}}
        global __cuUserObjectCreate
        __cuUserObjectCreate = windll.GetProcAddress(handle, 'cuUserObjectCreate')
        {{endif}}
        {{if 'cuUserObjectRetain' in found_functions}}
        global __cuUserObjectRetain
        __cuUserObjectRetain = windll.GetProcAddress(handle, 'cuUserObjectRetain')
        {{endif}}
        {{if 'cuUserObjectRelease' in found_functions}}
        global __cuUserObjectRelease
        __cuUserObjectRelease = windll.GetProcAddress(handle, 'cuUserObjectRelease')
        {{endif}}
        {{if 'cuGraphRetainUserObject' in found_functions}}
        global __cuGraphRetainUserObject
        __cuGraphRetainUserObject = windll.GetProcAddress(handle, 'cuGraphRetainUserObject')
        {{endif}}
        {{if 'cuGraphReleaseUserObject' in found_functions}}
        global __cuGraphReleaseUserObject
        __cuGraphReleaseUserObject = windll.GetProcAddress(handle, 'cuGraphReleaseUserObject')
        {{endif}}
        {{if 'cuGraphAddNode' in found_functions}}
        global __cuGraphAddNode
        __cuGraphAddNode = windll.GetProcAddress(handle, 'cuGraphAddNode')
        {{endif}}
        {{if 'cuGraphAddNode_v2' in found_functions}}
        global __cuGraphAddNode_v2
        __cuGraphAddNode_v2 = windll.GetProcAddress(handle, 'cuGraphAddNode_v2')
        {{endif}}
        {{if 'cuGraphNodeSetParams' in found_functions}}
        global __cuGraphNodeSetParams
        __cuGraphNodeSetParams = windll.GetProcAddress(handle, 'cuGraphNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecNodeSetParams' in found_functions}}
        global __cuGraphExecNodeSetParams
        __cuGraphExecNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecNodeSetParams')
        {{endif}}
        {{if 'cuGraphConditionalHandleCreate' in found_functions}}
        global __cuGraphConditionalHandleCreate
        __cuGraphConditionalHandleCreate = windll.GetProcAddress(handle, 'cuGraphConditionalHandleCreate')
        {{endif}}
        {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}}
        global __cuOccupancyMaxActiveBlocksPerMultiprocessor
        __cuOccupancyMaxActiveBlocksPerMultiprocessor = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor')
        {{endif}}
        {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}}
        global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
        __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags')
        {{endif}}
        {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}}
        global __cuOccupancyMaxPotentialBlockSize
        __cuOccupancyMaxPotentialBlockSize = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSize')
        {{endif}}
        {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}}
        global __cuOccupancyMaxPotentialBlockSizeWithFlags
        __cuOccupancyMaxPotentialBlockSizeWithFlags = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags')
        {{endif}}
        {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}}
        global __cuOccupancyAvailableDynamicSMemPerBlock
        __cuOccupancyAvailableDynamicSMemPerBlock = windll.GetProcAddress(handle, 'cuOccupancyAvailableDynamicSMemPerBlock')
        {{endif}}
        {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}}
        global __cuOccupancyMaxPotentialClusterSize
        __cuOccupancyMaxPotentialClusterSize = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialClusterSize')
        {{endif}}
        {{if 'cuOccupancyMaxActiveClusters' in found_functions}}
        global __cuOccupancyMaxActiveClusters
        __cuOccupancyMaxActiveClusters = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveClusters')
        {{endif}}
        {{if 'cuTexRefSetArray' in found_functions}}
        global __cuTexRefSetArray
        __cuTexRefSetArray = windll.GetProcAddress(handle, 'cuTexRefSetArray')
        {{endif}}
        {{if 'cuTexRefSetMipmappedArray' in found_functions}}
        global __cuTexRefSetMipmappedArray
        __cuTexRefSetMipmappedArray = windll.GetProcAddress(handle, 'cuTexRefSetMipmappedArray')
        {{endif}}
        {{if 'cuTexRefSetAddress_v2' in found_functions}}
        global __cuTexRefSetAddress_v2
        __cuTexRefSetAddress_v2 = windll.GetProcAddress(handle, 'cuTexRefSetAddress_v2')
        {{endif}}
        {{if 'cuTexRefSetAddress2D_v3' in found_functions}}
        global __cuTexRefSetAddress2D_v3
        __cuTexRefSetAddress2D_v3 = windll.GetProcAddress(handle, 'cuTexRefSetAddress2D_v3')
        {{endif}}
        {{if 'cuTexRefSetFormat' in found_functions}}
        global __cuTexRefSetFormat
        __cuTexRefSetFormat = windll.GetProcAddress(handle, 'cuTexRefSetFormat')
        {{endif}}
        {{if 'cuTexRefSetAddressMode' in found_functions}}
        global __cuTexRefSetAddressMode
        __cuTexRefSetAddressMode = windll.GetProcAddress(handle, 'cuTexRefSetAddressMode')
        {{endif}}
        {{if 'cuTexRefSetFilterMode' in found_functions}}
        global __cuTexRefSetFilterMode
        __cuTexRefSetFilterMode = windll.GetProcAddress(handle, 'cuTexRefSetFilterMode')
        {{endif}}
        {{if 'cuTexRefSetMipmapFilterMode' in found_functions}}
        global __cuTexRefSetMipmapFilterMode
        __cuTexRefSetMipmapFilterMode = windll.GetProcAddress(handle, 'cuTexRefSetMipmapFilterMode')
        {{endif}}
        {{if 'cuTexRefSetMipmapLevelBias' in found_functions}}
        global __cuTexRefSetMipmapLevelBias
        __cuTexRefSetMipmapLevelBias = windll.GetProcAddress(handle, 'cuTexRefSetMipmapLevelBias')
        {{endif}}
        {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}}
        global __cuTexRefSetMipmapLevelClamp
        __cuTexRefSetMipmapLevelClamp = windll.GetProcAddress(handle, 'cuTexRefSetMipmapLevelClamp')
        {{endif}}
        {{if 'cuTexRefSetMaxAnisotropy' in found_functions}}
        global __cuTexRefSetMaxAnisotropy
        __cuTexRefSetMaxAnisotropy = windll.GetProcAddress(handle, 'cuTexRefSetMaxAnisotropy')
        {{endif}}
        {{if 'cuTexRefSetBorderColor' in found_functions}}
        global __cuTexRefSetBorderColor
        __cuTexRefSetBorderColor = windll.GetProcAddress(handle, 'cuTexRefSetBorderColor')
        {{endif}}
        {{if 'cuTexRefSetFlags' in found_functions}}
        global __cuTexRefSetFlags
        __cuTexRefSetFlags = windll.GetProcAddress(handle, 'cuTexRefSetFlags')
        {{endif}}
        {{if 'cuTexRefGetAddress_v2' in found_functions}}
        global __cuTexRefGetAddress_v2
        __cuTexRefGetAddress_v2 = windll.GetProcAddress(handle, 'cuTexRefGetAddress_v2')
        {{endif}}
        {{if 'cuTexRefGetArray' in found_functions}}
        global __cuTexRefGetArray
        __cuTexRefGetArray = windll.GetProcAddress(handle, 'cuTexRefGetArray')
        {{endif}}
        {{if 'cuTexRefGetMipmappedArray' in found_functions}}
        global __cuTexRefGetMipmappedArray
        __cuTexRefGetMipmappedArray = windll.GetProcAddress(handle, 'cuTexRefGetMipmappedArray')
        {{endif}}
        {{if 'cuTexRefGetAddressMode' in found_functions}}
        global __cuTexRefGetAddressMode
        __cuTexRefGetAddressMode = windll.GetProcAddress(handle, 'cuTexRefGetAddressMode')
        {{endif}}
        {{if 'cuTexRefGetFilterMode' in found_functions}}
        global __cuTexRefGetFilterMode
        __cuTexRefGetFilterMode = windll.GetProcAddress(handle, 'cuTexRefGetFilterMode')
        {{endif}}
        {{if 'cuTexRefGetFormat' in found_functions}}
        global __cuTexRefGetFormat
        __cuTexRefGetFormat = windll.GetProcAddress(handle, 'cuTexRefGetFormat')
        {{endif}}
        {{if 'cuTexRefGetMipmapFilterMode' in found_functions}}
        global __cuTexRefGetMipmapFilterMode
        __cuTexRefGetMipmapFilterMode = windll.GetProcAddress(handle, 'cuTexRefGetMipmapFilterMode')
        {{endif}}
        {{if 'cuTexRefGetMipmapLevelBias' in found_functions}}
        global __cuTexRefGetMipmapLevelBias
        __cuTexRefGetMipmapLevelBias = windll.GetProcAddress(handle, 'cuTexRefGetMipmapLevelBias')
        {{endif}}
        {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}}
        global __cuTexRefGetMipmapLevelClamp
        __cuTexRefGetMipmapLevelClamp = windll.GetProcAddress(handle, 'cuTexRefGetMipmapLevelClamp')
        {{endif}}
        {{if 'cuTexRefGetMaxAnisotropy' in found_functions}}
        global __cuTexRefGetMaxAnisotropy
        __cuTexRefGetMaxAnisotropy = windll.GetProcAddress(handle, 'cuTexRefGetMaxAnisotropy')
        {{endif}}
        {{if 'cuTexRefGetBorderColor' in found_functions}}
        global __cuTexRefGetBorderColor
        __cuTexRefGetBorderColor = windll.GetProcAddress(handle, 'cuTexRefGetBorderColor')
        {{endif}}
        {{if 'cuTexRefGetFlags' in found_functions}}
        global __cuTexRefGetFlags
        __cuTexRefGetFlags = windll.GetProcAddress(handle, 'cuTexRefGetFlags')
        {{endif}}
        {{if 'cuTexRefCreate' in found_functions}}
        global __cuTexRefCreate
        __cuTexRefCreate = windll.GetProcAddress(handle, 'cuTexRefCreate')
        {{endif}}
        {{if 'cuTexRefDestroy' in found_functions}}
        global __cuTexRefDestroy
        __cuTexRefDestroy = windll.GetProcAddress(handle, 'cuTexRefDestroy')
        {{endif}}
        {{if 'cuSurfRefSetArray' in found_functions}}
        global __cuSurfRefSetArray
        __cuSurfRefSetArray = windll.GetProcAddress(handle, 'cuSurfRefSetArray')
        {{endif}}
        {{if 'cuSurfRefGetArray' in found_functions}}
        global __cuSurfRefGetArray
        __cuSurfRefGetArray = windll.GetProcAddress(handle, 'cuSurfRefGetArray')
        {{endif}}
        {{if 'cuTexObjectCreate' in found_functions}}
        global __cuTexObjectCreate
        __cuTexObjectCreate = windll.GetProcAddress(handle, 'cuTexObjectCreate')
        {{endif}}
        {{if 'cuTexObjectDestroy' in found_functions}}
        global __cuTexObjectDestroy
        __cuTexObjectDestroy = windll.GetProcAddress(handle, 'cuTexObjectDestroy')
        {{endif}}
        {{if 'cuTexObjectGetResourceDesc' in found_functions}}
        global __cuTexObjectGetResourceDesc
        __cuTexObjectGetResourceDesc = windll.GetProcAddress(handle, 'cuTexObjectGetResourceDesc')
        {{endif}}
        {{if 'cuTexObjectGetTextureDesc' in found_functions}}
        global __cuTexObjectGetTextureDesc
        __cuTexObjectGetTextureDesc = windll.GetProcAddress(handle, 'cuTexObjectGetTextureDesc')
        {{endif}}
        {{if 'cuTexObjectGetResourceViewDesc' in found_functions}}
        global __cuTexObjectGetResourceViewDesc
        __cuTexObjectGetResourceViewDesc = windll.GetProcAddress(handle, 'cuTexObjectGetResourceViewDesc')
        {{endif}}
        {{if 'cuSurfObjectCreate' in found_functions}}
        global __cuSurfObjectCreate
        __cuSurfObjectCreate = windll.GetProcAddress(handle, 'cuSurfObjectCreate')
        {{endif}}
        {{if 'cuSurfObjectDestroy' in found_functions}}
        global __cuSurfObjectDestroy
        __cuSurfObjectDestroy = windll.GetProcAddress(handle, 'cuSurfObjectDestroy')
        {{endif}}
        {{if 'cuSurfObjectGetResourceDesc' in found_functions}}
        global __cuSurfObjectGetResourceDesc
        __cuSurfObjectGetResourceDesc = windll.GetProcAddress(handle, 'cuSurfObjectGetResourceDesc')
        {{endif}}
        {{if 'cuTensorMapEncodeTiled' in found_functions}}
        global __cuTensorMapEncodeTiled
        __cuTensorMapEncodeTiled = windll.GetProcAddress(handle, 'cuTensorMapEncodeTiled')
        {{endif}}
        {{if 'cuTensorMapEncodeIm2col' in found_functions}}
        global __cuTensorMapEncodeIm2col
        __cuTensorMapEncodeIm2col = windll.GetProcAddress(handle, 'cuTensorMapEncodeIm2col')
        {{endif}}
        {{if 'cuTensorMapEncodeIm2colWide' in found_functions}}
        global __cuTensorMapEncodeIm2colWide
        __cuTensorMapEncodeIm2colWide = windll.GetProcAddress(handle, 'cuTensorMapEncodeIm2colWide')
        {{endif}}
        {{if 'cuTensorMapReplaceAddress' in found_functions}}
        global __cuTensorMapReplaceAddress
        __cuTensorMapReplaceAddress = windll.GetProcAddress(handle, 'cuTensorMapReplaceAddress')
        {{endif}}
        {{if 'cuDeviceCanAccessPeer' in found_functions}}
        global __cuDeviceCanAccessPeer
        __cuDeviceCanAccessPeer = windll.GetProcAddress(handle, 'cuDeviceCanAccessPeer')
        {{endif}}
        {{if 'cuCtxEnablePeerAccess' in found_functions}}
        global __cuCtxEnablePeerAccess
        __cuCtxEnablePeerAccess = windll.GetProcAddress(handle, 'cuCtxEnablePeerAccess')
        {{endif}}
        {{if 'cuCtxDisablePeerAccess' in found_functions}}
        global __cuCtxDisablePeerAccess
        __cuCtxDisablePeerAccess = windll.GetProcAddress(handle, 'cuCtxDisablePeerAccess')
        {{endif}}
        {{if 'cuDeviceGetP2PAttribute' in found_functions}}
        global __cuDeviceGetP2PAttribute
        __cuDeviceGetP2PAttribute = windll.GetProcAddress(handle, 'cuDeviceGetP2PAttribute')
        {{endif}}
        {{if 'cuGraphicsUnregisterResource' in found_functions}}
        global __cuGraphicsUnregisterResource
        __cuGraphicsUnregisterResource = windll.GetProcAddress(handle, 'cuGraphicsUnregisterResource')
        {{endif}}
        {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}}
        global __cuGraphicsSubResourceGetMappedArray
        __cuGraphicsSubResourceGetMappedArray = windll.GetProcAddress(handle, 'cuGraphicsSubResourceGetMappedArray')
        {{endif}}
        {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}}
        global __cuGraphicsResourceGetMappedMipmappedArray
        __cuGraphicsResourceGetMappedMipmappedArray = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedMipmappedArray')
        {{endif}}
        {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}}
        global __cuGraphicsResourceGetMappedPointer_v2
        __cuGraphicsResourceGetMappedPointer_v2 = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedPointer_v2')
        {{endif}}
        {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}}
        global __cuGraphicsResourceSetMapFlags_v2
        __cuGraphicsResourceSetMapFlags_v2 = windll.GetProcAddress(handle, 'cuGraphicsResourceSetMapFlags_v2')
        {{endif}}
        {{if 'cuGetProcAddress_v2' in found_functions}}
        global __cuGetProcAddress_v2
        __cuGetProcAddress_v2 = windll.GetProcAddress(handle, 'cuGetProcAddress_v2')
        {{endif}}
        {{if 'cuCoredumpGetAttribute' in found_functions}}
        global __cuCoredumpGetAttribute
        __cuCoredumpGetAttribute = windll.GetProcAddress(handle, 'cuCoredumpGetAttribute')
        {{endif}}
        {{if 'cuCoredumpGetAttributeGlobal' in found_functions}}
        global __cuCoredumpGetAttributeGlobal
        __cuCoredumpGetAttributeGlobal = windll.GetProcAddress(handle, 'cuCoredumpGetAttributeGlobal')
        {{endif}}
        {{if 'cuCoredumpSetAttribute' in found_functions}}
        global __cuCoredumpSetAttribute
        __cuCoredumpSetAttribute = windll.GetProcAddress(handle, 'cuCoredumpSetAttribute')
        {{endif}}
        {{if 'cuCoredumpSetAttributeGlobal' in found_functions}}
        global __cuCoredumpSetAttributeGlobal
        __cuCoredumpSetAttributeGlobal = windll.GetProcAddress(handle, 'cuCoredumpSetAttributeGlobal')
        {{endif}}
        {{if 'cuGetExportTable' in found_functions}}
        global __cuGetExportTable
        __cuGetExportTable = windll.GetProcAddress(handle, 'cuGetExportTable')
        {{endif}}
        {{if 'cuGreenCtxCreate' in found_functions}}
        global __cuGreenCtxCreate
        __cuGreenCtxCreate = windll.GetProcAddress(handle, 'cuGreenCtxCreate')
        {{endif}}
        {{if 'cuGreenCtxDestroy' in found_functions}}
        global __cuGreenCtxDestroy
        __cuGreenCtxDestroy = windll.GetProcAddress(handle, 'cuGreenCtxDestroy')
        {{endif}}
        {{if 'cuCtxFromGreenCtx' in found_functions}}
        global __cuCtxFromGreenCtx
        __cuCtxFromGreenCtx = windll.GetProcAddress(handle, 'cuCtxFromGreenCtx')
        {{endif}}
        {{if 'cuDeviceGetDevResource' in found_functions}}
        global __cuDeviceGetDevResource
        __cuDeviceGetDevResource = windll.GetProcAddress(handle, 'cuDeviceGetDevResource')
        {{endif}}
        {{if 'cuCtxGetDevResource' in found_functions}}
        global __cuCtxGetDevResource
        __cuCtxGetDevResource = windll.GetProcAddress(handle, 'cuCtxGetDevResource')
        {{endif}}
        {{if 'cuGreenCtxGetDevResource' in found_functions}}
        global __cuGreenCtxGetDevResource
        __cuGreenCtxGetDevResource = windll.GetProcAddress(handle, 'cuGreenCtxGetDevResource')
        {{endif}}
        {{if 'cuDevSmResourceSplitByCount' in found_functions}}
        global __cuDevSmResourceSplitByCount
        __cuDevSmResourceSplitByCount = windll.GetProcAddress(handle, 'cuDevSmResourceSplitByCount')
        {{endif}}
        {{if 'cuDevResourceGenerateDesc' in found_functions}}
        global __cuDevResourceGenerateDesc
        __cuDevResourceGenerateDesc = windll.GetProcAddress(handle, 'cuDevResourceGenerateDesc')
        {{endif}}
        {{if 'cuGreenCtxRecordEvent' in found_functions}}
        global __cuGreenCtxRecordEvent
        __cuGreenCtxRecordEvent = windll.GetProcAddress(handle, 'cuGreenCtxRecordEvent')
        {{endif}}
        {{if 'cuGreenCtxWaitEvent' in found_functions}}
        global __cuGreenCtxWaitEvent
        __cuGreenCtxWaitEvent = windll.GetProcAddress(handle, 'cuGreenCtxWaitEvent')
        {{endif}}
        {{if 'cuStreamGetGreenCtx' in found_functions}}
        global __cuStreamGetGreenCtx
        __cuStreamGetGreenCtx = windll.GetProcAddress(handle, 'cuStreamGetGreenCtx')
        {{endif}}
        {{if 'cuGreenCtxStreamCreate' in found_functions}}
        global __cuGreenCtxStreamCreate
        __cuGreenCtxStreamCreate = windll.GetProcAddress(handle, 'cuGreenCtxStreamCreate')
        {{endif}}
        {{if 'cuLogsRegisterCallback' in found_functions}}
        global __cuLogsRegisterCallback
        __cuLogsRegisterCallback = windll.GetProcAddress(handle, 'cuLogsRegisterCallback')
        {{endif}}
        {{if 'cuLogsUnregisterCallback' in found_functions}}
        global __cuLogsUnregisterCallback
        __cuLogsUnregisterCallback = windll.GetProcAddress(handle, 'cuLogsUnregisterCallback')
        {{endif}}
        {{if 'cuLogsCurrent' in found_functions}}
        global __cuLogsCurrent
        __cuLogsCurrent = windll.GetProcAddress(handle, 'cuLogsCurrent')
        {{endif}}
        {{if 'cuLogsDumpToFile' in found_functions}}
        global __cuLogsDumpToFile
        __cuLogsDumpToFile = windll.GetProcAddress(handle, 'cuLogsDumpToFile')
        {{endif}}
        {{if 'cuLogsDumpToMemory' in found_functions}}
        global __cuLogsDumpToMemory
        __cuLogsDumpToMemory = windll.GetProcAddress(handle, 'cuLogsDumpToMemory')
        {{endif}}
        {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}}
        global __cuCheckpointProcessGetRestoreThreadId
        __cuCheckpointProcessGetRestoreThreadId = windll.GetProcAddress(handle, 'cuCheckpointProcessGetRestoreThreadId')
        {{endif}}
        {{if 'cuCheckpointProcessGetState' in found_functions}}
        global __cuCheckpointProcessGetState
        __cuCheckpointProcessGetState = windll.GetProcAddress(handle, 'cuCheckpointProcessGetState')
        {{endif}}
        {{if 'cuCheckpointProcessLock' in found_functions}}
        global __cuCheckpointProcessLock
        __cuCheckpointProcessLock = windll.GetProcAddress(handle, 'cuCheckpointProcessLock')
        {{endif}}
        {{if 'cuCheckpointProcessCheckpoint' in found_functions}}
        global __cuCheckpointProcessCheckpoint
        __cuCheckpointProcessCheckpoint = windll.GetProcAddress(handle, 'cuCheckpointProcessCheckpoint')
        {{endif}}
        {{if 'cuCheckpointProcessRestore' in found_functions}}
        global __cuCheckpointProcessRestore
        __cuCheckpointProcessRestore = windll.GetProcAddress(handle, 'cuCheckpointProcessRestore')
        {{endif}}
        {{if 'cuCheckpointProcessUnlock' in found_functions}}
        global __cuCheckpointProcessUnlock
        __cuCheckpointProcessUnlock = windll.GetProcAddress(handle, 'cuCheckpointProcessUnlock')
        {{endif}}
        {{if 'cuProfilerStart' in found_functions}}
        global __cuProfilerStart
        __cuProfilerStart = windll.GetProcAddress(handle, 'cuProfilerStart')
        {{endif}}
        {{if 'cuProfilerStop' in found_functions}}
        global __cuProfilerStop
        __cuProfilerStop = windll.GetProcAddress(handle, 'cuProfilerStop')
        {{endif}}
        {{if True}}
        global __cuGraphicsEGLRegisterImage
        __cuGraphicsEGLRegisterImage = windll.GetProcAddress(handle, 'cuGraphicsEGLRegisterImage')
        {{endif}}
        {{if True}}
        global __cuEGLStreamConsumerConnect
        __cuEGLStreamConsumerConnect = windll.GetProcAddress(handle, 'cuEGLStreamConsumerConnect')
        {{endif}}
        {{if True}}
        global __cuEGLStreamConsumerConnectWithFlags
        __cuEGLStreamConsumerConnectWithFlags = windll.GetProcAddress(handle, 'cuEGLStreamConsumerConnectWithFlags')
        {{endif}}
        {{if True}}
        global __cuEGLStreamConsumerDisconnect
        __cuEGLStreamConsumerDisconnect = windll.GetProcAddress(handle, 'cuEGLStreamConsumerDisconnect')
        {{endif}}
        {{if True}}
        global __cuEGLStreamConsumerAcquireFrame
        __cuEGLStreamConsumerAcquireFrame = windll.GetProcAddress(handle, 'cuEGLStreamConsumerAcquireFrame')
        {{endif}}
        {{if True}}
        global __cuEGLStreamConsumerReleaseFrame
        __cuEGLStreamConsumerReleaseFrame = windll.GetProcAddress(handle, 'cuEGLStreamConsumerReleaseFrame')
        {{endif}}
        {{if True}}
        global __cuEGLStreamProducerConnect
        __cuEGLStreamProducerConnect = windll.GetProcAddress(handle, 'cuEGLStreamProducerConnect')
        {{endif}}
        {{if True}}
        global __cuEGLStreamProducerDisconnect
        __cuEGLStreamProducerDisconnect = windll.GetProcAddress(handle, 'cuEGLStreamProducerDisconnect')
        {{endif}}
        {{if True}}
        global __cuEGLStreamProducerPresentFrame
        __cuEGLStreamProducerPresentFrame = windll.GetProcAddress(handle, 'cuEGLStreamProducerPresentFrame')
        {{endif}}
        {{if True}}
        global __cuEGLStreamProducerReturnFrame
        __cuEGLStreamProducerReturnFrame = windll.GetProcAddress(handle, 'cuEGLStreamProducerReturnFrame')
        {{endif}}
        {{if True}}
        global __cuGraphicsResourceGetMappedEglFrame
        __cuGraphicsResourceGetMappedEglFrame = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedEglFrame')
        {{endif}}
        {{if True}}
        global __cuEventCreateFromEGLSync
        __cuEventCreateFromEGLSync = windll.GetProcAddress(handle, 'cuEventCreateFromEGLSync')
        {{endif}}
        {{if True}}
        global __cuGraphicsGLRegisterBuffer
        __cuGraphicsGLRegisterBuffer = windll.GetProcAddress(handle, 'cuGraphicsGLRegisterBuffer')
        {{endif}}
        {{if True}}
        global __cuGraphicsGLRegisterImage
        __cuGraphicsGLRegisterImage = windll.GetProcAddress(handle, 'cuGraphicsGLRegisterImage')
        {{endif}}
        {{if True}}
        global __cuGLGetDevices_v2
        __cuGLGetDevices_v2 = windll.GetProcAddress(handle, 'cuGLGetDevices_v2')
        {{endif}}
        {{if True}}
        global __cuVDPAUGetDevice
        __cuVDPAUGetDevice = windll.GetProcAddress(handle, 'cuVDPAUGetDevice')
        {{endif}}
        {{if True}}
        global __cuVDPAUCtxCreate_v2
        __cuVDPAUCtxCreate_v2 = windll.GetProcAddress(handle, 'cuVDPAUCtxCreate_v2')
        {{endif}}
        {{if True}}
        global __cuGraphicsVDPAURegisterVideoSurface
        __cuGraphicsVDPAURegisterVideoSurface = windll.GetProcAddress(handle, 'cuGraphicsVDPAURegisterVideoSurface')
        {{endif}}
        {{if True}}
        global __cuGraphicsVDPAURegisterOutputSurface
        __cuGraphicsVDPAURegisterOutputSurface = windll.GetProcAddress(handle, 'cuGraphicsVDPAURegisterOutputSurface')
        {{endif}}
        {{else}}
        # Load using dlsym
        if usePTDS:
            # Get all PTDS version of functions
            pass
            {{if 'cuMemcpy' in found_functions}}
            global __cuMemcpy
            __cuMemcpy = dlfcn.dlsym(handle, 'cuMemcpy_ptds')
            {{endif}}
            {{if 'cuMemcpyPeer' in found_functions}}
            global __cuMemcpyPeer
            __cuMemcpyPeer = dlfcn.dlsym(handle, 'cuMemcpyPeer_ptds')
            {{endif}}
            {{if 'cuMemcpyHtoD_v2' in found_functions}}
            global __cuMemcpyHtoD_v2
            __cuMemcpyHtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoD_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyDtoH_v2' in found_functions}}
            global __cuMemcpyDtoH_v2
            __cuMemcpyDtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoH_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyDtoD_v2' in found_functions}}
            global __cuMemcpyDtoD_v2
            __cuMemcpyDtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoD_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyDtoA_v2' in found_functions}}
            global __cuMemcpyDtoA_v2
            __cuMemcpyDtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoA_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyAtoD_v2' in found_functions}}
            global __cuMemcpyAtoD_v2
            __cuMemcpyAtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoD_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyHtoA_v2' in found_functions}}
            global __cuMemcpyHtoA_v2
            __cuMemcpyHtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoA_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyAtoH_v2' in found_functions}}
            global __cuMemcpyAtoH_v2
            __cuMemcpyAtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoH_v2_ptds')
            {{endif}}
            {{if 'cuMemcpyAtoA_v2' in found_functions}}
            global __cuMemcpyAtoA_v2
            __cuMemcpyAtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoA_v2_ptds')
            {{endif}}
            {{if 'cuMemcpy2D_v2' in found_functions}}
            global __cuMemcpy2D_v2
            __cuMemcpy2D_v2 = dlfcn.dlsym(handle, 'cuMemcpy2D_v2_ptds')
            {{endif}}
            {{if 'cuMemcpy2DUnaligned_v2' in found_functions}}
            global __cuMemcpy2DUnaligned_v2
            __cuMemcpy2DUnaligned_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DUnaligned_v2_ptds')
            {{endif}}
            {{if 'cuMemcpy3D_v2' in found_functions}}
            global __cuMemcpy3D_v2
            __cuMemcpy3D_v2 = dlfcn.dlsym(handle, 'cuMemcpy3D_v2_ptds')
            {{endif}}
            {{if 'cuMemcpy3DPeer' in found_functions}}
            global __cuMemcpy3DPeer
            __cuMemcpy3DPeer = dlfcn.dlsym(handle, 'cuMemcpy3DPeer_ptds')
            {{endif}}
            {{if 'cuMemcpyAsync' in found_functions}}
            global __cuMemcpyAsync
            __cuMemcpyAsync = dlfcn.dlsym(handle, 'cuMemcpyAsync_ptsz')
            {{endif}}
            {{if 'cuMemcpyPeerAsync' in found_functions}}
            global __cuMemcpyPeerAsync
            __cuMemcpyPeerAsync = dlfcn.dlsym(handle, 'cuMemcpyPeerAsync_ptsz')
            {{endif}}
            {{if 'cuMemcpyHtoDAsync_v2' in found_functions}}
            global __cuMemcpyHtoDAsync_v2
            __cuMemcpyHtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoDAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpyDtoHAsync_v2' in found_functions}}
            global __cuMemcpyDtoHAsync_v2
            __cuMemcpyDtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoHAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpyDtoDAsync_v2' in found_functions}}
            global __cuMemcpyDtoDAsync_v2
            __cuMemcpyDtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoDAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpyHtoAAsync_v2' in found_functions}}
            global __cuMemcpyHtoAAsync_v2
            __cuMemcpyHtoAAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoAAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpyAtoHAsync_v2' in found_functions}}
            global __cuMemcpyAtoHAsync_v2
            __cuMemcpyAtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoHAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpy2DAsync_v2' in found_functions}}
            global __cuMemcpy2DAsync_v2
            __cuMemcpy2DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpy3DAsync_v2' in found_functions}}
            global __cuMemcpy3DAsync_v2
            __cuMemcpy3DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DAsync_v2_ptsz')
            {{endif}}
            {{if 'cuMemcpy3DPeerAsync' in found_functions}}
            global __cuMemcpy3DPeerAsync
            __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync_ptsz')
            {{endif}}
            {{if 'cuMemcpyBatchAsync' in found_functions}}
            global __cuMemcpyBatchAsync
            __cuMemcpyBatchAsync = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync_ptsz')
            {{endif}}
            {{if 'cuMemcpy3DBatchAsync' in found_functions}}
            global __cuMemcpy3DBatchAsync
            __cuMemcpy3DBatchAsync = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync_ptsz')
            {{endif}}
            {{if 'cuMemsetD8_v2' in found_functions}}
            global __cuMemsetD8_v2
            __cuMemsetD8_v2 = dlfcn.dlsym(handle, 'cuMemsetD8_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD16_v2' in found_functions}}
            global __cuMemsetD16_v2
            __cuMemsetD16_v2 = dlfcn.dlsym(handle, 'cuMemsetD16_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD32_v2' in found_functions}}
            global __cuMemsetD32_v2
            __cuMemsetD32_v2 = dlfcn.dlsym(handle, 'cuMemsetD32_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD2D8_v2' in found_functions}}
            global __cuMemsetD2D8_v2
            __cuMemsetD2D8_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D8_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD2D16_v2' in found_functions}}
            global __cuMemsetD2D16_v2
            __cuMemsetD2D16_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D16_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD2D32_v2' in found_functions}}
            global __cuMemsetD2D32_v2
            __cuMemsetD2D32_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D32_v2_ptds')
            {{endif}}
            {{if 'cuMemsetD8Async' in found_functions}}
            global __cuMemsetD8Async
            __cuMemsetD8Async = dlfcn.dlsym(handle, 'cuMemsetD8Async_ptsz')
            {{endif}}
            {{if 'cuMemsetD16Async' in found_functions}}
            global __cuMemsetD16Async
            __cuMemsetD16Async = dlfcn.dlsym(handle, 'cuMemsetD16Async_ptsz')
            {{endif}}
            {{if 'cuMemsetD32Async' in found_functions}}
            global __cuMemsetD32Async
            __cuMemsetD32Async = dlfcn.dlsym(handle, 'cuMemsetD32Async_ptsz')
            {{endif}}
            {{if 'cuMemsetD2D8Async' in found_functions}}
            global __cuMemsetD2D8Async
            __cuMemsetD2D8Async = dlfcn.dlsym(handle, 'cuMemsetD2D8Async_ptsz')
            {{endif}}
            {{if 'cuMemsetD2D16Async' in found_functions}}
            global __cuMemsetD2D16Async
            __cuMemsetD2D16Async = dlfcn.dlsym(handle, 'cuMemsetD2D16Async_ptsz')
            {{endif}}
            {{if 'cuMemsetD2D32Async' in found_functions}}
            global __cuMemsetD2D32Async
            __cuMemsetD2D32Async = dlfcn.dlsym(handle, 'cuMemsetD2D32Async_ptsz')
            {{endif}}
            {{if 'cuMemBatchDecompressAsync' in found_functions}}
            global __cuMemBatchDecompressAsync
            __cuMemBatchDecompressAsync = dlfcn.dlsym(handle, 'cuMemBatchDecompressAsync_ptsz')
            {{endif}}
            {{if 'cuMemMapArrayAsync' in found_functions}}
            global __cuMemMapArrayAsync
            __cuMemMapArrayAsync = dlfcn.dlsym(handle, 'cuMemMapArrayAsync_ptsz')
            {{endif}}
            {{if 'cuMemFreeAsync' in found_functions}}
            global __cuMemFreeAsync
            __cuMemFreeAsync = dlfcn.dlsym(handle, 'cuMemFreeAsync_ptsz')
            {{endif}}
            {{if 'cuMemAllocAsync' in found_functions}}
            global __cuMemAllocAsync
            __cuMemAllocAsync = dlfcn.dlsym(handle, 'cuMemAllocAsync_ptsz')
            {{endif}}
            {{if 'cuMemAllocFromPoolAsync' in found_functions}}
            global __cuMemAllocFromPoolAsync
            __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync_ptsz')
            {{endif}}
            {{if 'cuMemPrefetchAsync' in found_functions}}
            global __cuMemPrefetchAsync
            __cuMemPrefetchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_ptsz')
            {{endif}}
            {{if 'cuMemPrefetchAsync_v2' in found_functions}}
            global __cuMemPrefetchAsync_v2
            __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2_ptsz')
            {{endif}}
            {{if 'cuStreamGetPriority' in found_functions}}
            global __cuStreamGetPriority
            __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority_ptsz')
            {{endif}}
            {{if 'cuStreamGetDevice' in found_functions}}
            global __cuStreamGetDevice
            __cuStreamGetDevice = dlfcn.dlsym(handle, 'cuStreamGetDevice_ptsz')
            {{endif}}
            {{if 'cuStreamGetFlags' in found_functions}}
            global __cuStreamGetFlags
            __cuStreamGetFlags = dlfcn.dlsym(handle, 'cuStreamGetFlags_ptsz')
            {{endif}}
            {{if 'cuStreamGetId' in found_functions}}
            global __cuStreamGetId
            __cuStreamGetId = dlfcn.dlsym(handle, 'cuStreamGetId_ptsz')
            {{endif}}
            {{if 'cuStreamGetCtx' in found_functions}}
            global __cuStreamGetCtx
            __cuStreamGetCtx = dlfcn.dlsym(handle, 'cuStreamGetCtx_ptsz')
            {{endif}}
            {{if 'cuStreamGetCtx_v2' in found_functions}}
            global __cuStreamGetCtx_v2
            __cuStreamGetCtx_v2 = dlfcn.dlsym(handle, 'cuStreamGetCtx_v2_ptsz')
            {{endif}}
            {{if 'cuStreamWaitEvent' in found_functions}}
            global __cuStreamWaitEvent
            __cuStreamWaitEvent = dlfcn.dlsym(handle, 'cuStreamWaitEvent_ptsz')
            {{endif}}
            {{if 'cuStreamAddCallback' in found_functions}}
            global __cuStreamAddCallback
            __cuStreamAddCallback = dlfcn.dlsym(handle, 'cuStreamAddCallback_ptsz')
            {{endif}}
            {{if 'cuStreamBeginCapture_v2' in found_functions}}
            global __cuStreamBeginCapture_v2
            __cuStreamBeginCapture_v2 = dlfcn.dlsym(handle, 'cuStreamBeginCapture_v2_ptsz')
            {{endif}}
            {{if 'cuStreamBeginCaptureToGraph' in found_functions}}
            global __cuStreamBeginCaptureToGraph
            __cuStreamBeginCaptureToGraph = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToGraph_ptsz')
            {{endif}}
            {{if 'cuStreamEndCapture' in found_functions}}
            global __cuStreamEndCapture
            __cuStreamEndCapture = dlfcn.dlsym(handle, 'cuStreamEndCapture_ptsz')
            {{endif}}
            {{if 'cuStreamIsCapturing' in found_functions}}
            global __cuStreamIsCapturing
            __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing_ptsz')
            {{endif}}
            {{if 'cuStreamGetCaptureInfo_v2' in found_functions}}
            global __cuStreamGetCaptureInfo_v2
            __cuStreamGetCaptureInfo_v2 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v2_ptsz')
            {{endif}}
            {{if 'cuStreamGetCaptureInfo_v3' in found_functions}}
            global __cuStreamGetCaptureInfo_v3
            __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3_ptsz')
            {{endif}}
            {{if 'cuStreamUpdateCaptureDependencies' in found_functions}}
            global __cuStreamUpdateCaptureDependencies
            __cuStreamUpdateCaptureDependencies = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_ptsz')
            {{endif}}
            {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}}
            global __cuStreamUpdateCaptureDependencies_v2
            __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz')
            {{endif}}
            {{if 'cuStreamAttachMemAsync' in found_functions}}
            global __cuStreamAttachMemAsync
            __cuStreamAttachMemAsync = dlfcn.dlsym(handle, 'cuStreamAttachMemAsync_ptsz')
            {{endif}}
            {{if 'cuStreamQuery' in found_functions}}
            global __cuStreamQuery
            __cuStreamQuery = dlfcn.dlsym(handle, 'cuStreamQuery_ptsz')
            {{endif}}
            {{if 'cuStreamSynchronize' in found_functions}}
            global __cuStreamSynchronize
            __cuStreamSynchronize = dlfcn.dlsym(handle, 'cuStreamSynchronize_ptsz')
            {{endif}}
            {{if 'cuStreamCopyAttributes' in found_functions}}
            global __cuStreamCopyAttributes
            __cuStreamCopyAttributes = dlfcn.dlsym(handle, 'cuStreamCopyAttributes_ptsz')
            {{endif}}
            {{if 'cuStreamGetAttribute' in found_functions}}
            global __cuStreamGetAttribute
            __cuStreamGetAttribute = dlfcn.dlsym(handle, 'cuStreamGetAttribute_ptsz')
            {{endif}}
            {{if 'cuStreamSetAttribute' in found_functions}}
            global __cuStreamSetAttribute
            __cuStreamSetAttribute = dlfcn.dlsym(handle, 'cuStreamSetAttribute_ptsz')
            {{endif}}
            {{if 'cuEventRecord' in found_functions}}
            global __cuEventRecord
            __cuEventRecord = dlfcn.dlsym(handle, 'cuEventRecord_ptsz')
            {{endif}}
            {{if 'cuEventRecordWithFlags' in found_functions}}
            global __cuEventRecordWithFlags
            __cuEventRecordWithFlags = dlfcn.dlsym(handle, 'cuEventRecordWithFlags_ptsz')
            {{endif}}
            {{if 'cuSignalExternalSemaphoresAsync' in found_functions}}
            global __cuSignalExternalSemaphoresAsync
            __cuSignalExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuSignalExternalSemaphoresAsync_ptsz')
            {{endif}}
            {{if 'cuWaitExternalSemaphoresAsync' in found_functions}}
            global __cuWaitExternalSemaphoresAsync
            __cuWaitExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuWaitExternalSemaphoresAsync_ptsz')
            {{endif}}
            {{if 'cuStreamWaitValue32_v2' in found_functions}}
            global __cuStreamWaitValue32_v2
            __cuStreamWaitValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue32_v2_ptsz')
            {{endif}}
            {{if 'cuStreamWaitValue64_v2' in found_functions}}
            global __cuStreamWaitValue64_v2
            __cuStreamWaitValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue64_v2_ptsz')
            {{endif}}
            {{if 'cuStreamWriteValue32_v2' in found_functions}}
            global __cuStreamWriteValue32_v2
            __cuStreamWriteValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue32_v2_ptsz')
            {{endif}}
            {{if 'cuStreamWriteValue64_v2' in found_functions}}
            global __cuStreamWriteValue64_v2
            __cuStreamWriteValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue64_v2_ptsz')
            {{endif}}
            {{if 'cuStreamBatchMemOp_v2' in found_functions}}
            global __cuStreamBatchMemOp_v2
            __cuStreamBatchMemOp_v2 = dlfcn.dlsym(handle, 'cuStreamBatchMemOp_v2_ptsz')
            {{endif}}
            {{if 'cuLaunchKernel' in found_functions}}
            global __cuLaunchKernel
            __cuLaunchKernel = dlfcn.dlsym(handle, 'cuLaunchKernel_ptsz')
            {{endif}}
            {{if 'cuLaunchKernelEx' in found_functions}}
            global __cuLaunchKernelEx
            __cuLaunchKernelEx = dlfcn.dlsym(handle, 'cuLaunchKernelEx_ptsz')
            {{endif}}
            {{if 'cuLaunchCooperativeKernel' in found_functions}}
            global __cuLaunchCooperativeKernel
            __cuLaunchCooperativeKernel = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernel_ptsz')
            {{endif}}
            {{if 'cuLaunchHostFunc' in found_functions}}
            global __cuLaunchHostFunc
            __cuLaunchHostFunc = dlfcn.dlsym(handle, 'cuLaunchHostFunc_ptsz')
            {{endif}}
            {{if 'cuGraphInstantiateWithParams' in found_functions}}
            global __cuGraphInstantiateWithParams
            __cuGraphInstantiateWithParams = dlfcn.dlsym(handle, 'cuGraphInstantiateWithParams_ptsz')
            {{endif}}
            {{if 'cuGraphUpload' in found_functions}}
            global __cuGraphUpload
            __cuGraphUpload = dlfcn.dlsym(handle, 'cuGraphUpload_ptsz')
            {{endif}}
            {{if 'cuGraphLaunch' in found_functions}}
            global __cuGraphLaunch
            __cuGraphLaunch = dlfcn.dlsym(handle, 'cuGraphLaunch_ptsz')
            {{endif}}
            {{if 'cuGraphicsMapResources' in found_functions}}
            global __cuGraphicsMapResources
            __cuGraphicsMapResources = dlfcn.dlsym(handle, 'cuGraphicsMapResources_ptsz')
            {{endif}}
            {{if 'cuGraphicsUnmapResources' in found_functions}}
            global __cuGraphicsUnmapResources
            __cuGraphicsUnmapResources = dlfcn.dlsym(handle, 'cuGraphicsUnmapResources_ptsz')
            {{endif}}
        else:
            # Else get the regular version
            pass
            {{if 'cuMemcpy' in found_functions}}
            global __cuMemcpy
            __cuMemcpy = dlfcn.dlsym(handle, 'cuMemcpy')
            {{endif}}
            {{if 'cuMemcpyPeer' in found_functions}}
            global __cuMemcpyPeer
            __cuMemcpyPeer = dlfcn.dlsym(handle, 'cuMemcpyPeer')
            {{endif}}
            {{if 'cuMemcpyHtoD_v2' in found_functions}}
            global __cuMemcpyHtoD_v2
            __cuMemcpyHtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoD_v2')
            {{endif}}
            {{if 'cuMemcpyDtoH_v2' in found_functions}}
            global __cuMemcpyDtoH_v2
            __cuMemcpyDtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoH_v2')
            {{endif}}
            {{if 'cuMemcpyDtoD_v2' in found_functions}}
            global __cuMemcpyDtoD_v2
            __cuMemcpyDtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoD_v2')
            {{endif}}
            {{if 'cuMemcpyDtoA_v2' in found_functions}}
            global __cuMemcpyDtoA_v2
            __cuMemcpyDtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoA_v2')
            {{endif}}
            {{if 'cuMemcpyAtoD_v2' in found_functions}}
            global __cuMemcpyAtoD_v2
            __cuMemcpyAtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoD_v2')
            {{endif}}
            {{if 'cuMemcpyHtoA_v2' in found_functions}}
            global __cuMemcpyHtoA_v2
            __cuMemcpyHtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoA_v2')
            {{endif}}
            {{if 'cuMemcpyAtoH_v2' in found_functions}}
            global __cuMemcpyAtoH_v2
            __cuMemcpyAtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoH_v2')
            {{endif}}
            {{if 'cuMemcpyAtoA_v2' in found_functions}}
            global __cuMemcpyAtoA_v2
            __cuMemcpyAtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoA_v2')
            {{endif}}
            {{if 'cuMemcpy2D_v2' in found_functions}}
            global __cuMemcpy2D_v2
            __cuMemcpy2D_v2 = dlfcn.dlsym(handle, 'cuMemcpy2D_v2')
            {{endif}}
            {{if 'cuMemcpy2DUnaligned_v2' in found_functions}}
            global __cuMemcpy2DUnaligned_v2
            __cuMemcpy2DUnaligned_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DUnaligned_v2')
            {{endif}}
            {{if 'cuMemcpy3D_v2' in found_functions}}
            global __cuMemcpy3D_v2
            __cuMemcpy3D_v2 = dlfcn.dlsym(handle, 'cuMemcpy3D_v2')
            {{endif}}
            {{if 'cuMemcpy3DPeer' in found_functions}}
            global __cuMemcpy3DPeer
            __cuMemcpy3DPeer = dlfcn.dlsym(handle, 'cuMemcpy3DPeer')
            {{endif}}
            {{if 'cuMemcpyAsync' in found_functions}}
            global __cuMemcpyAsync
            __cuMemcpyAsync = dlfcn.dlsym(handle, 'cuMemcpyAsync')
            {{endif}}
            {{if 'cuMemcpyPeerAsync' in found_functions}}
            global __cuMemcpyPeerAsync
            __cuMemcpyPeerAsync = dlfcn.dlsym(handle, 'cuMemcpyPeerAsync')
            {{endif}}
            {{if 'cuMemcpyHtoDAsync_v2' in found_functions}}
            global __cuMemcpyHtoDAsync_v2
            __cuMemcpyHtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoDAsync_v2')
            {{endif}}
            {{if 'cuMemcpyDtoHAsync_v2' in found_functions}}
            global __cuMemcpyDtoHAsync_v2
            __cuMemcpyDtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoHAsync_v2')
            {{endif}}
            {{if 'cuMemcpyDtoDAsync_v2' in found_functions}}
            global __cuMemcpyDtoDAsync_v2
            __cuMemcpyDtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoDAsync_v2')
            {{endif}}
            {{if 'cuMemcpyHtoAAsync_v2' in found_functions}}
            global __cuMemcpyHtoAAsync_v2
            __cuMemcpyHtoAAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoAAsync_v2')
            {{endif}}
            {{if 'cuMemcpyAtoHAsync_v2' in found_functions}}
            global __cuMemcpyAtoHAsync_v2
            __cuMemcpyAtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoHAsync_v2')
            {{endif}}
            {{if 'cuMemcpy2DAsync_v2' in found_functions}}
            global __cuMemcpy2DAsync_v2
            __cuMemcpy2DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DAsync_v2')
            {{endif}}
            {{if 'cuMemcpy3DAsync_v2' in found_functions}}
            global __cuMemcpy3DAsync_v2
            __cuMemcpy3DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DAsync_v2')
            {{endif}}
            {{if 'cuMemcpy3DPeerAsync' in found_functions}}
            global __cuMemcpy3DPeerAsync
            __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync')
            {{endif}}
            {{if 'cuMemcpyBatchAsync' in found_functions}}
            global __cuMemcpyBatchAsync
            __cuMemcpyBatchAsync = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync')
            {{endif}}
            {{if 'cuMemcpy3DBatchAsync' in found_functions}}
            global __cuMemcpy3DBatchAsync
            __cuMemcpy3DBatchAsync = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync')
            {{endif}}
            {{if 'cuMemsetD8_v2' in found_functions}}
            global __cuMemsetD8_v2
            __cuMemsetD8_v2 = dlfcn.dlsym(handle, 'cuMemsetD8_v2')
            {{endif}}
            {{if 'cuMemsetD16_v2' in found_functions}}
            global __cuMemsetD16_v2
            __cuMemsetD16_v2 = dlfcn.dlsym(handle, 'cuMemsetD16_v2')
            {{endif}}
            {{if 'cuMemsetD32_v2' in found_functions}}
            global __cuMemsetD32_v2
            __cuMemsetD32_v2 = dlfcn.dlsym(handle, 'cuMemsetD32_v2')
            {{endif}}
            {{if 'cuMemsetD2D8_v2' in found_functions}}
            global __cuMemsetD2D8_v2
            __cuMemsetD2D8_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D8_v2')
            {{endif}}
            {{if 'cuMemsetD2D16_v2' in found_functions}}
            global __cuMemsetD2D16_v2
            __cuMemsetD2D16_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D16_v2')
            {{endif}}
            {{if 'cuMemsetD2D32_v2' in found_functions}}
            global __cuMemsetD2D32_v2
            __cuMemsetD2D32_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D32_v2')
            {{endif}}
            {{if 'cuMemsetD8Async' in found_functions}}
            global __cuMemsetD8Async
            __cuMemsetD8Async = dlfcn.dlsym(handle, 'cuMemsetD8Async')
            {{endif}}
            {{if 'cuMemsetD16Async' in found_functions}}
            global __cuMemsetD16Async
            __cuMemsetD16Async = dlfcn.dlsym(handle, 'cuMemsetD16Async')
            {{endif}}
            {{if 'cuMemsetD32Async' in found_functions}}
            global __cuMemsetD32Async
            __cuMemsetD32Async = dlfcn.dlsym(handle, 'cuMemsetD32Async')
            {{endif}}
            {{if 'cuMemsetD2D8Async' in found_functions}}
            global __cuMemsetD2D8Async
            __cuMemsetD2D8Async = dlfcn.dlsym(handle, 'cuMemsetD2D8Async')
            {{endif}}
            {{if 'cuMemsetD2D16Async' in found_functions}}
            global __cuMemsetD2D16Async
            __cuMemsetD2D16Async = dlfcn.dlsym(handle, 'cuMemsetD2D16Async')
            {{endif}}
            {{if 'cuMemsetD2D32Async' in found_functions}}
            global __cuMemsetD2D32Async
            __cuMemsetD2D32Async = dlfcn.dlsym(handle, 'cuMemsetD2D32Async')
            {{endif}}
            {{if 'cuMemBatchDecompressAsync' in found_functions}}
            global __cuMemBatchDecompressAsync
            __cuMemBatchDecompressAsync = dlfcn.dlsym(handle, 'cuMemBatchDecompressAsync')
            {{endif}}
            {{if 'cuMemMapArrayAsync' in found_functions}}
            global __cuMemMapArrayAsync
            __cuMemMapArrayAsync = dlfcn.dlsym(handle, 'cuMemMapArrayAsync')
            {{endif}}
            {{if 'cuMemFreeAsync' in found_functions}}
            global __cuMemFreeAsync
            __cuMemFreeAsync = dlfcn.dlsym(handle, 'cuMemFreeAsync')
            {{endif}}
            {{if 'cuMemAllocAsync' in found_functions}}
            global __cuMemAllocAsync
            __cuMemAllocAsync = dlfcn.dlsym(handle, 'cuMemAllocAsync')
            {{endif}}
            {{if 'cuMemAllocFromPoolAsync' in found_functions}}
            global __cuMemAllocFromPoolAsync
            __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync')
            {{endif}}
            {{if 'cuMemPrefetchAsync' in found_functions}}
            global __cuMemPrefetchAsync
            __cuMemPrefetchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchAsync')
            {{endif}}
            {{if 'cuMemPrefetchAsync_v2' in found_functions}}
            global __cuMemPrefetchAsync_v2
            __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2')
            {{endif}}
            {{if 'cuStreamGetPriority' in found_functions}}
            global __cuStreamGetPriority
            __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority')
            {{endif}}
            {{if 'cuStreamGetDevice' in found_functions}}
            global __cuStreamGetDevice
            __cuStreamGetDevice = dlfcn.dlsym(handle, 'cuStreamGetDevice')
            {{endif}}
            {{if 'cuStreamGetFlags' in found_functions}}
            global __cuStreamGetFlags
            __cuStreamGetFlags = dlfcn.dlsym(handle, 'cuStreamGetFlags')
            {{endif}}
            {{if 'cuStreamGetId' in found_functions}}
            global __cuStreamGetId
            __cuStreamGetId = dlfcn.dlsym(handle, 'cuStreamGetId')
            {{endif}}
            {{if 'cuStreamGetCtx' in found_functions}}
            global __cuStreamGetCtx
            __cuStreamGetCtx = dlfcn.dlsym(handle, 'cuStreamGetCtx')
            {{endif}}
            {{if 'cuStreamGetCtx_v2' in found_functions}}
            global __cuStreamGetCtx_v2
            __cuStreamGetCtx_v2 = dlfcn.dlsym(handle, 'cuStreamGetCtx_v2')
            {{endif}}
            {{if 'cuStreamWaitEvent' in found_functions}}
            global __cuStreamWaitEvent
            __cuStreamWaitEvent = dlfcn.dlsym(handle, 'cuStreamWaitEvent')
            {{endif}}
            {{if 'cuStreamAddCallback' in found_functions}}
            global __cuStreamAddCallback
            __cuStreamAddCallback = dlfcn.dlsym(handle, 'cuStreamAddCallback')
            {{endif}}
            {{if 'cuStreamBeginCapture_v2' in found_functions}}
            global __cuStreamBeginCapture_v2
            __cuStreamBeginCapture_v2 = dlfcn.dlsym(handle, 'cuStreamBeginCapture_v2')
            {{endif}}
            {{if 'cuStreamBeginCaptureToGraph' in found_functions}}
            global __cuStreamBeginCaptureToGraph
            __cuStreamBeginCaptureToGraph = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToGraph')
            {{endif}}
            {{if 'cuStreamEndCapture' in found_functions}}
            global __cuStreamEndCapture
            __cuStreamEndCapture = dlfcn.dlsym(handle, 'cuStreamEndCapture')
            {{endif}}
            {{if 'cuStreamIsCapturing' in found_functions}}
            global __cuStreamIsCapturing
            __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing')
            {{endif}}
            {{if 'cuStreamGetCaptureInfo_v2' in found_functions}}
            global __cuStreamGetCaptureInfo_v2
            __cuStreamGetCaptureInfo_v2 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v2')
            {{endif}}
            {{if 'cuStreamGetCaptureInfo_v3' in found_functions}}
            global __cuStreamGetCaptureInfo_v3
            __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3')
            {{endif}}
            {{if 'cuStreamUpdateCaptureDependencies' in found_functions}}
            global __cuStreamUpdateCaptureDependencies
            __cuStreamUpdateCaptureDependencies = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies')
            {{endif}}
            {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}}
            global __cuStreamUpdateCaptureDependencies_v2
            __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2')
            {{endif}}
            {{if 'cuStreamAttachMemAsync' in found_functions}}
            global __cuStreamAttachMemAsync
            __cuStreamAttachMemAsync = dlfcn.dlsym(handle, 'cuStreamAttachMemAsync')
            {{endif}}
            {{if 'cuStreamQuery' in found_functions}}
            global __cuStreamQuery
            __cuStreamQuery = dlfcn.dlsym(handle, 'cuStreamQuery')
            {{endif}}
            {{if 'cuStreamSynchronize' in found_functions}}
            global __cuStreamSynchronize
            __cuStreamSynchronize = dlfcn.dlsym(handle, 'cuStreamSynchronize')
            {{endif}}
            {{if 'cuStreamCopyAttributes' in found_functions}}
            global __cuStreamCopyAttributes
            __cuStreamCopyAttributes = dlfcn.dlsym(handle, 'cuStreamCopyAttributes')
            {{endif}}
            {{if 'cuStreamGetAttribute' in found_functions}}
            global __cuStreamGetAttribute
            __cuStreamGetAttribute = dlfcn.dlsym(handle, 'cuStreamGetAttribute')
            {{endif}}
            {{if 'cuStreamSetAttribute' in found_functions}}
            global __cuStreamSetAttribute
            __cuStreamSetAttribute = dlfcn.dlsym(handle, 'cuStreamSetAttribute')
            {{endif}}
            {{if 'cuEventRecord' in found_functions}}
            global __cuEventRecord
            __cuEventRecord = dlfcn.dlsym(handle, 'cuEventRecord')
            {{endif}}
            {{if 'cuEventRecordWithFlags' in found_functions}}
            global __cuEventRecordWithFlags
            __cuEventRecordWithFlags = dlfcn.dlsym(handle, 'cuEventRecordWithFlags')
            {{endif}}
            {{if 'cuSignalExternalSemaphoresAsync' in found_functions}}
            global __cuSignalExternalSemaphoresAsync
            __cuSignalExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuSignalExternalSemaphoresAsync')
            {{endif}}
            {{if 'cuWaitExternalSemaphoresAsync' in found_functions}}
            global __cuWaitExternalSemaphoresAsync
            __cuWaitExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuWaitExternalSemaphoresAsync')
            {{endif}}
            {{if 'cuStreamWaitValue32_v2' in found_functions}}
            global __cuStreamWaitValue32_v2
            __cuStreamWaitValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue32_v2')
            {{endif}}
            {{if 'cuStreamWaitValue64_v2' in found_functions}}
            global __cuStreamWaitValue64_v2
            __cuStreamWaitValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue64_v2')
            {{endif}}
            {{if 'cuStreamWriteValue32_v2' in found_functions}}
            global __cuStreamWriteValue32_v2
            __cuStreamWriteValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue32_v2')
            {{endif}}
            {{if 'cuStreamWriteValue64_v2' in found_functions}}
            global __cuStreamWriteValue64_v2
            __cuStreamWriteValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue64_v2')
            {{endif}}
            {{if 'cuStreamBatchMemOp_v2' in found_functions}}
            global __cuStreamBatchMemOp_v2
            __cuStreamBatchMemOp_v2 = dlfcn.dlsym(handle, 'cuStreamBatchMemOp_v2')
            {{endif}}
            {{if 'cuLaunchKernel' in found_functions}}
            global __cuLaunchKernel
            __cuLaunchKernel = dlfcn.dlsym(handle, 'cuLaunchKernel')
            {{endif}}
            {{if 'cuLaunchKernelEx' in found_functions}}
            global __cuLaunchKernelEx
            __cuLaunchKernelEx = dlfcn.dlsym(handle, 'cuLaunchKernelEx')
            {{endif}}
            {{if 'cuLaunchCooperativeKernel' in found_functions}}
            global __cuLaunchCooperativeKernel
            __cuLaunchCooperativeKernel = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernel')
            {{endif}}
            {{if 'cuLaunchHostFunc' in found_functions}}
            global __cuLaunchHostFunc
            __cuLaunchHostFunc = dlfcn.dlsym(handle, 'cuLaunchHostFunc')
            {{endif}}
            {{if 'cuGraphInstantiateWithParams' in found_functions}}
            global __cuGraphInstantiateWithParams
            __cuGraphInstantiateWithParams = dlfcn.dlsym(handle, 'cuGraphInstantiateWithParams')
            {{endif}}
            {{if 'cuGraphUpload' in found_functions}}
            global __cuGraphUpload
            __cuGraphUpload = dlfcn.dlsym(handle, 'cuGraphUpload')
            {{endif}}
            {{if 'cuGraphLaunch' in found_functions}}
            global __cuGraphLaunch
            __cuGraphLaunch = dlfcn.dlsym(handle, 'cuGraphLaunch')
            {{endif}}
            {{if 'cuGraphicsMapResources' in found_functions}}
            global __cuGraphicsMapResources
            __cuGraphicsMapResources = dlfcn.dlsym(handle, 'cuGraphicsMapResources')
            {{endif}}
            {{if 'cuGraphicsUnmapResources' in found_functions}}
            global __cuGraphicsUnmapResources
            __cuGraphicsUnmapResources = dlfcn.dlsym(handle, 'cuGraphicsUnmapResources')
            {{endif}}
        # Get remaining functions
        {{if 'cuGetErrorString' in found_functions}}
        global __cuGetErrorString
        __cuGetErrorString = dlfcn.dlsym(handle, 'cuGetErrorString')
        {{endif}}
        {{if 'cuGetErrorName' in found_functions}}
        global __cuGetErrorName
        __cuGetErrorName = dlfcn.dlsym(handle, 'cuGetErrorName')
        {{endif}}
        {{if 'cuInit' in found_functions}}
        global __cuInit
        __cuInit = dlfcn.dlsym(handle, 'cuInit')
        {{endif}}
        {{if 'cuDriverGetVersion' in found_functions}}
        global __cuDriverGetVersion
        __cuDriverGetVersion = dlfcn.dlsym(handle, 'cuDriverGetVersion')
        {{endif}}
        {{if 'cuDeviceGet' in found_functions}}
        global __cuDeviceGet
        __cuDeviceGet = dlfcn.dlsym(handle, 'cuDeviceGet')
        {{endif}}
        {{if 'cuDeviceGetCount' in found_functions}}
        global __cuDeviceGetCount
        __cuDeviceGetCount = dlfcn.dlsym(handle, 'cuDeviceGetCount')
        {{endif}}
        {{if 'cuDeviceGetName' in found_functions}}
        global __cuDeviceGetName
        __cuDeviceGetName = dlfcn.dlsym(handle, 'cuDeviceGetName')
        {{endif}}
        {{if 'cuDeviceGetUuid' in found_functions}}
        global __cuDeviceGetUuid
        __cuDeviceGetUuid = dlfcn.dlsym(handle, 'cuDeviceGetUuid')
        {{endif}}
        {{if 'cuDeviceGetUuid_v2' in found_functions}}
        global __cuDeviceGetUuid_v2
        __cuDeviceGetUuid_v2 = dlfcn.dlsym(handle, 'cuDeviceGetUuid_v2')
        {{endif}}
        {{if 'cuDeviceGetLuid' in found_functions}}
        global __cuDeviceGetLuid
        __cuDeviceGetLuid = dlfcn.dlsym(handle, 'cuDeviceGetLuid')
        {{endif}}
        {{if 'cuDeviceTotalMem_v2' in found_functions}}
        global __cuDeviceTotalMem_v2
        __cuDeviceTotalMem_v2 = dlfcn.dlsym(handle, 'cuDeviceTotalMem_v2')
        {{endif}}
        {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}}
        global __cuDeviceGetTexture1DLinearMaxWidth
        __cuDeviceGetTexture1DLinearMaxWidth = dlfcn.dlsym(handle, 'cuDeviceGetTexture1DLinearMaxWidth')
        {{endif}}
        {{if 'cuDeviceGetAttribute' in found_functions}}
        global __cuDeviceGetAttribute
        __cuDeviceGetAttribute = dlfcn.dlsym(handle, 'cuDeviceGetAttribute')
        {{endif}}
        {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}}
        global __cuDeviceGetNvSciSyncAttributes
        __cuDeviceGetNvSciSyncAttributes = dlfcn.dlsym(handle, 'cuDeviceGetNvSciSyncAttributes')
        {{endif}}
        {{if 'cuDeviceSetMemPool' in found_functions}}
        global __cuDeviceSetMemPool
        __cuDeviceSetMemPool = dlfcn.dlsym(handle, 'cuDeviceSetMemPool')
        {{endif}}
        {{if 'cuDeviceGetMemPool' in found_functions}}
        global __cuDeviceGetMemPool
        __cuDeviceGetMemPool = dlfcn.dlsym(handle, 'cuDeviceGetMemPool')
        {{endif}}
        {{if 'cuDeviceGetDefaultMemPool' in found_functions}}
        global __cuDeviceGetDefaultMemPool
        __cuDeviceGetDefaultMemPool = dlfcn.dlsym(handle, 'cuDeviceGetDefaultMemPool')
        {{endif}}
        {{if 'cuDeviceGetExecAffinitySupport' in found_functions}}
        global __cuDeviceGetExecAffinitySupport
        __cuDeviceGetExecAffinitySupport = dlfcn.dlsym(handle, 'cuDeviceGetExecAffinitySupport')
        {{endif}}
        {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}}
        global __cuFlushGPUDirectRDMAWrites
        __cuFlushGPUDirectRDMAWrites = dlfcn.dlsym(handle, 'cuFlushGPUDirectRDMAWrites')
        {{endif}}
        {{if 'cuDeviceGetProperties' in found_functions}}
        global __cuDeviceGetProperties
        __cuDeviceGetProperties = dlfcn.dlsym(handle, 'cuDeviceGetProperties')
        {{endif}}
        {{if 'cuDeviceComputeCapability' in found_functions}}
        global __cuDeviceComputeCapability
        __cuDeviceComputeCapability = dlfcn.dlsym(handle, 'cuDeviceComputeCapability')
        {{endif}}
        {{if 'cuDevicePrimaryCtxRetain' in found_functions}}
        global __cuDevicePrimaryCtxRetain
        __cuDevicePrimaryCtxRetain = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxRetain')
        {{endif}}
        {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}}
        global __cuDevicePrimaryCtxRelease_v2
        __cuDevicePrimaryCtxRelease_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxRelease_v2')
        {{endif}}
        {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}}
        global __cuDevicePrimaryCtxSetFlags_v2
        __cuDevicePrimaryCtxSetFlags_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxSetFlags_v2')
        {{endif}}
        {{if 'cuDevicePrimaryCtxGetState' in found_functions}}
        global __cuDevicePrimaryCtxGetState
        __cuDevicePrimaryCtxGetState = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxGetState')
        {{endif}}
        {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}}
        global __cuDevicePrimaryCtxReset_v2
        __cuDevicePrimaryCtxReset_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxReset_v2')
        {{endif}}
        {{if 'cuCtxCreate_v2' in found_functions}}
        global __cuCtxCreate_v2
        __cuCtxCreate_v2 = dlfcn.dlsym(handle, 'cuCtxCreate_v2')
        {{endif}}
        {{if 'cuCtxCreate_v3' in found_functions}}
        global __cuCtxCreate_v3
        __cuCtxCreate_v3 = dlfcn.dlsym(handle, 'cuCtxCreate_v3')
        {{endif}}
        {{if 'cuCtxCreate_v4' in found_functions}}
        global __cuCtxCreate_v4
        __cuCtxCreate_v4 = dlfcn.dlsym(handle, 'cuCtxCreate_v4')
        {{endif}}
        {{if 'cuCtxDestroy_v2' in found_functions}}
        global __cuCtxDestroy_v2
        __cuCtxDestroy_v2 = dlfcn.dlsym(handle, 'cuCtxDestroy_v2')
        {{endif}}
        {{if 'cuCtxPushCurrent_v2' in found_functions}}
        global __cuCtxPushCurrent_v2
        __cuCtxPushCurrent_v2 = dlfcn.dlsym(handle, 'cuCtxPushCurrent_v2')
        {{endif}}
        {{if 'cuCtxPopCurrent_v2' in found_functions}}
        global __cuCtxPopCurrent_v2
        __cuCtxPopCurrent_v2 = dlfcn.dlsym(handle, 'cuCtxPopCurrent_v2')
        {{endif}}
        {{if 'cuCtxSetCurrent' in found_functions}}
        global __cuCtxSetCurrent
        __cuCtxSetCurrent = dlfcn.dlsym(handle, 'cuCtxSetCurrent')
        {{endif}}
        {{if 'cuCtxGetCurrent' in found_functions}}
        global __cuCtxGetCurrent
        __cuCtxGetCurrent = dlfcn.dlsym(handle, 'cuCtxGetCurrent')
        {{endif}}
        {{if 'cuCtxGetDevice' in found_functions}}
        global __cuCtxGetDevice
        __cuCtxGetDevice = dlfcn.dlsym(handle, 'cuCtxGetDevice')
        {{endif}}
        {{if 'cuCtxGetFlags' in found_functions}}
        global __cuCtxGetFlags
        __cuCtxGetFlags = dlfcn.dlsym(handle, 'cuCtxGetFlags')
        {{endif}}
        {{if 'cuCtxSetFlags' in found_functions}}
        global __cuCtxSetFlags
        __cuCtxSetFlags = dlfcn.dlsym(handle, 'cuCtxSetFlags')
        {{endif}}
        {{if 'cuCtxGetId' in found_functions}}
        global __cuCtxGetId
        __cuCtxGetId = dlfcn.dlsym(handle, 'cuCtxGetId')
        {{endif}}
        {{if 'cuCtxSynchronize' in found_functions}}
        global __cuCtxSynchronize
        __cuCtxSynchronize = dlfcn.dlsym(handle, 'cuCtxSynchronize')
        {{endif}}
        {{if 'cuCtxSetLimit' in found_functions}}
        global __cuCtxSetLimit
        __cuCtxSetLimit = dlfcn.dlsym(handle, 'cuCtxSetLimit')
        {{endif}}
        {{if 'cuCtxGetLimit' in found_functions}}
        global __cuCtxGetLimit
        __cuCtxGetLimit = dlfcn.dlsym(handle, 'cuCtxGetLimit')
        {{endif}}
        {{if 'cuCtxGetCacheConfig' in found_functions}}
        global __cuCtxGetCacheConfig
        __cuCtxGetCacheConfig = dlfcn.dlsym(handle, 'cuCtxGetCacheConfig')
        {{endif}}
        {{if 'cuCtxSetCacheConfig' in found_functions}}
        global __cuCtxSetCacheConfig
        __cuCtxSetCacheConfig = dlfcn.dlsym(handle, 'cuCtxSetCacheConfig')
        {{endif}}
        {{if 'cuCtxGetApiVersion' in found_functions}}
        global __cuCtxGetApiVersion
        __cuCtxGetApiVersion = dlfcn.dlsym(handle, 'cuCtxGetApiVersion')
        {{endif}}
        {{if 'cuCtxGetStreamPriorityRange' in found_functions}}
        global __cuCtxGetStreamPriorityRange
        __cuCtxGetStreamPriorityRange = dlfcn.dlsym(handle, 'cuCtxGetStreamPriorityRange')
        {{endif}}
        {{if 'cuCtxResetPersistingL2Cache' in found_functions}}
        global __cuCtxResetPersistingL2Cache
        __cuCtxResetPersistingL2Cache = dlfcn.dlsym(handle, 'cuCtxResetPersistingL2Cache')
        {{endif}}
        {{if 'cuCtxGetExecAffinity' in found_functions}}
        global __cuCtxGetExecAffinity
        __cuCtxGetExecAffinity = dlfcn.dlsym(handle, 'cuCtxGetExecAffinity')
        {{endif}}
        {{if 'cuCtxRecordEvent' in found_functions}}
        global __cuCtxRecordEvent
        __cuCtxRecordEvent = dlfcn.dlsym(handle, 'cuCtxRecordEvent')
        {{endif}}
        {{if 'cuCtxWaitEvent' in found_functions}}
        global __cuCtxWaitEvent
        __cuCtxWaitEvent = dlfcn.dlsym(handle, 'cuCtxWaitEvent')
        {{endif}}
        {{if 'cuCtxAttach' in found_functions}}
        global __cuCtxAttach
        __cuCtxAttach = dlfcn.dlsym(handle, 'cuCtxAttach')
        {{endif}}
        {{if 'cuCtxDetach' in found_functions}}
        global __cuCtxDetach
        __cuCtxDetach = dlfcn.dlsym(handle, 'cuCtxDetach')
        {{endif}}
        {{if 'cuCtxGetSharedMemConfig' in found_functions}}
        global __cuCtxGetSharedMemConfig
        __cuCtxGetSharedMemConfig = dlfcn.dlsym(handle, 'cuCtxGetSharedMemConfig')
        {{endif}}
        {{if 'cuCtxSetSharedMemConfig' in found_functions}}
        global __cuCtxSetSharedMemConfig
        __cuCtxSetSharedMemConfig = dlfcn.dlsym(handle, 'cuCtxSetSharedMemConfig')
        {{endif}}
        {{if 'cuModuleLoad' in found_functions}}
        global __cuModuleLoad
        __cuModuleLoad = dlfcn.dlsym(handle, 'cuModuleLoad')
        {{endif}}
        {{if 'cuModuleLoadData' in found_functions}}
        global __cuModuleLoadData
        __cuModuleLoadData = dlfcn.dlsym(handle, 'cuModuleLoadData')
        {{endif}}
        {{if 'cuModuleLoadDataEx' in found_functions}}
        global __cuModuleLoadDataEx
        __cuModuleLoadDataEx = dlfcn.dlsym(handle, 'cuModuleLoadDataEx')
        {{endif}}
        {{if 'cuModuleLoadFatBinary' in found_functions}}
        global __cuModuleLoadFatBinary
        __cuModuleLoadFatBinary = dlfcn.dlsym(handle, 'cuModuleLoadFatBinary')
        {{endif}}
        {{if 'cuModuleUnload' in found_functions}}
        global __cuModuleUnload
        __cuModuleUnload = dlfcn.dlsym(handle, 'cuModuleUnload')
        {{endif}}
        {{if 'cuModuleGetLoadingMode' in found_functions}}
        global __cuModuleGetLoadingMode
        __cuModuleGetLoadingMode = dlfcn.dlsym(handle, 'cuModuleGetLoadingMode')
        {{endif}}
        {{if 'cuModuleGetFunction' in found_functions}}
        global __cuModuleGetFunction
        __cuModuleGetFunction = dlfcn.dlsym(handle, 'cuModuleGetFunction')
        {{endif}}
        {{if 'cuModuleGetFunctionCount' in found_functions}}
        global __cuModuleGetFunctionCount
        __cuModuleGetFunctionCount = dlfcn.dlsym(handle, 'cuModuleGetFunctionCount')
        {{endif}}
        {{if 'cuModuleEnumerateFunctions' in found_functions}}
        global __cuModuleEnumerateFunctions
        __cuModuleEnumerateFunctions = dlfcn.dlsym(handle, 'cuModuleEnumerateFunctions')
        {{endif}}
        {{if 'cuModuleGetGlobal_v2' in found_functions}}
        global __cuModuleGetGlobal_v2
        __cuModuleGetGlobal_v2 = dlfcn.dlsym(handle, 'cuModuleGetGlobal_v2')
        {{endif}}
        {{if 'cuLinkCreate_v2' in found_functions}}
        global __cuLinkCreate_v2
        __cuLinkCreate_v2 = dlfcn.dlsym(handle, 'cuLinkCreate_v2')
        {{endif}}
        {{if 'cuLinkAddData_v2' in found_functions}}
        global __cuLinkAddData_v2
        __cuLinkAddData_v2 = dlfcn.dlsym(handle, 'cuLinkAddData_v2')
        {{endif}}
        {{if 'cuLinkAddFile_v2' in found_functions}}
        global __cuLinkAddFile_v2
        __cuLinkAddFile_v2 = dlfcn.dlsym(handle, 'cuLinkAddFile_v2')
        {{endif}}
        {{if 'cuLinkComplete' in found_functions}}
        global __cuLinkComplete
        __cuLinkComplete = dlfcn.dlsym(handle, 'cuLinkComplete')
        {{endif}}
        {{if 'cuLinkDestroy' in found_functions}}
        global __cuLinkDestroy
        __cuLinkDestroy = dlfcn.dlsym(handle, 'cuLinkDestroy')
        {{endif}}
        {{if 'cuModuleGetTexRef' in found_functions}}
        global __cuModuleGetTexRef
        __cuModuleGetTexRef = dlfcn.dlsym(handle, 'cuModuleGetTexRef')
        {{endif}}
        {{if 'cuModuleGetSurfRef' in found_functions}}
        global __cuModuleGetSurfRef
        __cuModuleGetSurfRef = dlfcn.dlsym(handle, 'cuModuleGetSurfRef')
        {{endif}}
        {{if 'cuLibraryLoadData' in found_functions}}
        global __cuLibraryLoadData
        __cuLibraryLoadData = dlfcn.dlsym(handle, 'cuLibraryLoadData')
        {{endif}}
        {{if 'cuLibraryLoadFromFile' in found_functions}}
        global __cuLibraryLoadFromFile
        __cuLibraryLoadFromFile = dlfcn.dlsym(handle, 'cuLibraryLoadFromFile')
        {{endif}}
        {{if 'cuLibraryUnload' in found_functions}}
        global __cuLibraryUnload
        __cuLibraryUnload = dlfcn.dlsym(handle, 'cuLibraryUnload')
        {{endif}}
        {{if 'cuLibraryGetKernel' in found_functions}}
        global __cuLibraryGetKernel
        __cuLibraryGetKernel = dlfcn.dlsym(handle, 'cuLibraryGetKernel')
        {{endif}}
        {{if 'cuLibraryGetKernelCount' in found_functions}}
        global __cuLibraryGetKernelCount
        __cuLibraryGetKernelCount = dlfcn.dlsym(handle, 'cuLibraryGetKernelCount')
        {{endif}}
        {{if 'cuLibraryEnumerateKernels' in found_functions}}
        global __cuLibraryEnumerateKernels
        __cuLibraryEnumerateKernels = dlfcn.dlsym(handle, 'cuLibraryEnumerateKernels')
        {{endif}}
        {{if 'cuLibraryGetModule' in found_functions}}
        global __cuLibraryGetModule
        __cuLibraryGetModule = dlfcn.dlsym(handle, 'cuLibraryGetModule')
        {{endif}}
        {{if 'cuKernelGetFunction' in found_functions}}
        global __cuKernelGetFunction
        __cuKernelGetFunction = dlfcn.dlsym(handle, 'cuKernelGetFunction')
        {{endif}}
        {{if 'cuKernelGetLibrary' in found_functions}}
        global __cuKernelGetLibrary
        __cuKernelGetLibrary = dlfcn.dlsym(handle, 'cuKernelGetLibrary')
        {{endif}}
        {{if 'cuLibraryGetGlobal' in found_functions}}
        global __cuLibraryGetGlobal
        __cuLibraryGetGlobal = dlfcn.dlsym(handle, 'cuLibraryGetGlobal')
        {{endif}}
        {{if 'cuLibraryGetManaged' in found_functions}}
        global __cuLibraryGetManaged
        __cuLibraryGetManaged = dlfcn.dlsym(handle, 'cuLibraryGetManaged')
        {{endif}}
        {{if 'cuLibraryGetUnifiedFunction' in found_functions}}
        global __cuLibraryGetUnifiedFunction
        __cuLibraryGetUnifiedFunction = dlfcn.dlsym(handle, 'cuLibraryGetUnifiedFunction')
        {{endif}}
        {{if 'cuKernelGetAttribute' in found_functions}}
        global __cuKernelGetAttribute
        __cuKernelGetAttribute = dlfcn.dlsym(handle, 'cuKernelGetAttribute')
        {{endif}}
        {{if 'cuKernelSetAttribute' in found_functions}}
        global __cuKernelSetAttribute
        __cuKernelSetAttribute = dlfcn.dlsym(handle, 'cuKernelSetAttribute')
        {{endif}}
        {{if 'cuKernelSetCacheConfig' in found_functions}}
        global __cuKernelSetCacheConfig
        __cuKernelSetCacheConfig = dlfcn.dlsym(handle, 'cuKernelSetCacheConfig')
        {{endif}}
        {{if 'cuKernelGetName' in found_functions}}
        global __cuKernelGetName
        __cuKernelGetName = dlfcn.dlsym(handle, 'cuKernelGetName')
        {{endif}}
        {{if 'cuKernelGetParamInfo' in found_functions}}
        global __cuKernelGetParamInfo
        __cuKernelGetParamInfo = dlfcn.dlsym(handle, 'cuKernelGetParamInfo')
        {{endif}}
        {{if 'cuMemGetInfo_v2' in found_functions}}
        global __cuMemGetInfo_v2
        __cuMemGetInfo_v2 = dlfcn.dlsym(handle, 'cuMemGetInfo_v2')
        {{endif}}
        {{if 'cuMemAlloc_v2' in found_functions}}
        global __cuMemAlloc_v2
        __cuMemAlloc_v2 = dlfcn.dlsym(handle, 'cuMemAlloc_v2')
        {{endif}}
        {{if 'cuMemAllocPitch_v2' in found_functions}}
        global __cuMemAllocPitch_v2
        __cuMemAllocPitch_v2 = dlfcn.dlsym(handle, 'cuMemAllocPitch_v2')
        {{endif}}
        {{if 'cuMemFree_v2' in found_functions}}
        global __cuMemFree_v2
        __cuMemFree_v2 = dlfcn.dlsym(handle, 'cuMemFree_v2')
        {{endif}}
        {{if 'cuMemGetAddressRange_v2' in found_functions}}
        global __cuMemGetAddressRange_v2
        __cuMemGetAddressRange_v2 = dlfcn.dlsym(handle, 'cuMemGetAddressRange_v2')
        {{endif}}
        {{if 'cuMemAllocHost_v2' in found_functions}}
        global __cuMemAllocHost_v2
        __cuMemAllocHost_v2 = dlfcn.dlsym(handle, 'cuMemAllocHost_v2')
        {{endif}}
        {{if 'cuMemFreeHost' in found_functions}}
        global __cuMemFreeHost
        __cuMemFreeHost = dlfcn.dlsym(handle, 'cuMemFreeHost')
        {{endif}}
        {{if 'cuMemHostAlloc' in found_functions}}
        global __cuMemHostAlloc
        __cuMemHostAlloc = dlfcn.dlsym(handle, 'cuMemHostAlloc')
        {{endif}}
        {{if 'cuMemHostGetDevicePointer_v2' in found_functions}}
        global __cuMemHostGetDevicePointer_v2
        __cuMemHostGetDevicePointer_v2 = dlfcn.dlsym(handle, 'cuMemHostGetDevicePointer_v2')
        {{endif}}
        {{if 'cuMemHostGetFlags' in found_functions}}
        global __cuMemHostGetFlags
        __cuMemHostGetFlags = dlfcn.dlsym(handle, 'cuMemHostGetFlags')
        {{endif}}
        {{if 'cuMemAllocManaged' in found_functions}}
        global __cuMemAllocManaged
        __cuMemAllocManaged = dlfcn.dlsym(handle, 'cuMemAllocManaged')
        {{endif}}
        {{if 'cuDeviceRegisterAsyncNotification' in found_functions}}
        global __cuDeviceRegisterAsyncNotification
        __cuDeviceRegisterAsyncNotification = dlfcn.dlsym(handle, 'cuDeviceRegisterAsyncNotification')
        {{endif}}
        {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}}
        global __cuDeviceUnregisterAsyncNotification
        __cuDeviceUnregisterAsyncNotification = dlfcn.dlsym(handle, 'cuDeviceUnregisterAsyncNotification')
        {{endif}}
        {{if 'cuDeviceGetByPCIBusId' in found_functions}}
        global __cuDeviceGetByPCIBusId
        __cuDeviceGetByPCIBusId = dlfcn.dlsym(handle, 'cuDeviceGetByPCIBusId')
        {{endif}}
        {{if 'cuDeviceGetPCIBusId' in found_functions}}
        global __cuDeviceGetPCIBusId
        __cuDeviceGetPCIBusId = dlfcn.dlsym(handle, 'cuDeviceGetPCIBusId')
        {{endif}}
        {{if 'cuIpcGetEventHandle' in found_functions}}
        global __cuIpcGetEventHandle
        __cuIpcGetEventHandle = dlfcn.dlsym(handle, 'cuIpcGetEventHandle')
        {{endif}}
        {{if 'cuIpcOpenEventHandle' in found_functions}}
        global __cuIpcOpenEventHandle
        __cuIpcOpenEventHandle = dlfcn.dlsym(handle, 'cuIpcOpenEventHandle')
        {{endif}}
        {{if 'cuIpcGetMemHandle' in found_functions}}
        global __cuIpcGetMemHandle
        __cuIpcGetMemHandle = dlfcn.dlsym(handle, 'cuIpcGetMemHandle')
        {{endif}}
        {{if 'cuIpcOpenMemHandle_v2' in found_functions}}
        global __cuIpcOpenMemHandle_v2
        __cuIpcOpenMemHandle_v2 = dlfcn.dlsym(handle, 'cuIpcOpenMemHandle_v2')
        {{endif}}
        {{if 'cuIpcCloseMemHandle' in found_functions}}
        global __cuIpcCloseMemHandle
        __cuIpcCloseMemHandle = dlfcn.dlsym(handle, 'cuIpcCloseMemHandle')
        {{endif}}
        {{if 'cuMemHostRegister_v2' in found_functions}}
        global __cuMemHostRegister_v2
        __cuMemHostRegister_v2 = dlfcn.dlsym(handle, 'cuMemHostRegister_v2')
        {{endif}}
        {{if 'cuMemHostUnregister' in found_functions}}
        global __cuMemHostUnregister
        __cuMemHostUnregister = dlfcn.dlsym(handle, 'cuMemHostUnregister')
        {{endif}}
        {{if 'cuArrayCreate_v2' in found_functions}}
        global __cuArrayCreate_v2
        __cuArrayCreate_v2 = dlfcn.dlsym(handle, 'cuArrayCreate_v2')
        {{endif}}
        {{if 'cuArrayGetDescriptor_v2' in found_functions}}
        global __cuArrayGetDescriptor_v2
        __cuArrayGetDescriptor_v2 = dlfcn.dlsym(handle, 'cuArrayGetDescriptor_v2')
        {{endif}}
        {{if 'cuArrayGetSparseProperties' in found_functions}}
        global __cuArrayGetSparseProperties
        __cuArrayGetSparseProperties = dlfcn.dlsym(handle, 'cuArrayGetSparseProperties')
        {{endif}}
        {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}}
        global __cuMipmappedArrayGetSparseProperties
        __cuMipmappedArrayGetSparseProperties = dlfcn.dlsym(handle, 'cuMipmappedArrayGetSparseProperties')
        {{endif}}
        {{if 'cuArrayGetMemoryRequirements' in found_functions}}
        global __cuArrayGetMemoryRequirements
        __cuArrayGetMemoryRequirements = dlfcn.dlsym(handle, 'cuArrayGetMemoryRequirements')
        {{endif}}
        {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}}
        global __cuMipmappedArrayGetMemoryRequirements
        __cuMipmappedArrayGetMemoryRequirements = dlfcn.dlsym(handle, 'cuMipmappedArrayGetMemoryRequirements')
        {{endif}}
        {{if 'cuArrayGetPlane' in found_functions}}
        global __cuArrayGetPlane
        __cuArrayGetPlane = dlfcn.dlsym(handle, 'cuArrayGetPlane')
        {{endif}}
        {{if 'cuArrayDestroy' in found_functions}}
        global __cuArrayDestroy
        __cuArrayDestroy = dlfcn.dlsym(handle, 'cuArrayDestroy')
        {{endif}}
        {{if 'cuArray3DCreate_v2' in found_functions}}
        global __cuArray3DCreate_v2
        __cuArray3DCreate_v2 = dlfcn.dlsym(handle, 'cuArray3DCreate_v2')
        {{endif}}
        {{if 'cuArray3DGetDescriptor_v2' in found_functions}}
        global __cuArray3DGetDescriptor_v2
        __cuArray3DGetDescriptor_v2 = dlfcn.dlsym(handle, 'cuArray3DGetDescriptor_v2')
        {{endif}}
        {{if 'cuMipmappedArrayCreate' in found_functions}}
        global __cuMipmappedArrayCreate
        __cuMipmappedArrayCreate = dlfcn.dlsym(handle, 'cuMipmappedArrayCreate')
        {{endif}}
        {{if 'cuMipmappedArrayGetLevel' in found_functions}}
        global __cuMipmappedArrayGetLevel
        __cuMipmappedArrayGetLevel = dlfcn.dlsym(handle, 'cuMipmappedArrayGetLevel')
        {{endif}}
        {{if 'cuMipmappedArrayDestroy' in found_functions}}
        global __cuMipmappedArrayDestroy
        __cuMipmappedArrayDestroy = dlfcn.dlsym(handle, 'cuMipmappedArrayDestroy')
        {{endif}}
        {{if 'cuMemGetHandleForAddressRange' in found_functions}}
        global __cuMemGetHandleForAddressRange
        __cuMemGetHandleForAddressRange = dlfcn.dlsym(handle, 'cuMemGetHandleForAddressRange')
        {{endif}}
        {{if 'cuMemAddressReserve' in found_functions}}
        global __cuMemAddressReserve
        __cuMemAddressReserve = dlfcn.dlsym(handle, 'cuMemAddressReserve')
        {{endif}}
        {{if 'cuMemAddressFree' in found_functions}}
        global __cuMemAddressFree
        __cuMemAddressFree = dlfcn.dlsym(handle, 'cuMemAddressFree')
        {{endif}}
        {{if 'cuMemCreate' in found_functions}}
        global __cuMemCreate
        __cuMemCreate = dlfcn.dlsym(handle, 'cuMemCreate')
        {{endif}}
        {{if 'cuMemRelease' in found_functions}}
        global __cuMemRelease
        __cuMemRelease = dlfcn.dlsym(handle, 'cuMemRelease')
        {{endif}}
        {{if 'cuMemMap' in found_functions}}
        global __cuMemMap
        __cuMemMap = dlfcn.dlsym(handle, 'cuMemMap')
        {{endif}}
        {{if 'cuMemUnmap' in found_functions}}
        global __cuMemUnmap
        __cuMemUnmap = dlfcn.dlsym(handle, 'cuMemUnmap')
        {{endif}}
        {{if 'cuMemSetAccess' in found_functions}}
        global __cuMemSetAccess
        __cuMemSetAccess = dlfcn.dlsym(handle, 'cuMemSetAccess')
        {{endif}}
        {{if 'cuMemGetAccess' in found_functions}}
        global __cuMemGetAccess
        __cuMemGetAccess = dlfcn.dlsym(handle, 'cuMemGetAccess')
        {{endif}}
        {{if 'cuMemExportToShareableHandle' in found_functions}}
        global __cuMemExportToShareableHandle
        __cuMemExportToShareableHandle = dlfcn.dlsym(handle, 'cuMemExportToShareableHandle')
        {{endif}}
        {{if 'cuMemImportFromShareableHandle' in found_functions}}
        global __cuMemImportFromShareableHandle
        __cuMemImportFromShareableHandle = dlfcn.dlsym(handle, 'cuMemImportFromShareableHandle')
        {{endif}}
        {{if 'cuMemGetAllocationGranularity' in found_functions}}
        global __cuMemGetAllocationGranularity
        __cuMemGetAllocationGranularity = dlfcn.dlsym(handle, 'cuMemGetAllocationGranularity')
        {{endif}}
        {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}}
        global __cuMemGetAllocationPropertiesFromHandle
        __cuMemGetAllocationPropertiesFromHandle = dlfcn.dlsym(handle, 'cuMemGetAllocationPropertiesFromHandle')
        {{endif}}
        {{if 'cuMemRetainAllocationHandle' in found_functions}}
        global __cuMemRetainAllocationHandle
        __cuMemRetainAllocationHandle = dlfcn.dlsym(handle, 'cuMemRetainAllocationHandle')
        {{endif}}
        {{if 'cuMemPoolTrimTo' in found_functions}}
        global __cuMemPoolTrimTo
        __cuMemPoolTrimTo = dlfcn.dlsym(handle, 'cuMemPoolTrimTo')
        {{endif}}
        {{if 'cuMemPoolSetAttribute' in found_functions}}
        global __cuMemPoolSetAttribute
        __cuMemPoolSetAttribute = dlfcn.dlsym(handle, 'cuMemPoolSetAttribute')
        {{endif}}
        {{if 'cuMemPoolGetAttribute' in found_functions}}
        global __cuMemPoolGetAttribute
        __cuMemPoolGetAttribute = dlfcn.dlsym(handle, 'cuMemPoolGetAttribute')
        {{endif}}
        {{if 'cuMemPoolSetAccess' in found_functions}}
        global __cuMemPoolSetAccess
        __cuMemPoolSetAccess = dlfcn.dlsym(handle, 'cuMemPoolSetAccess')
        {{endif}}
        {{if 'cuMemPoolGetAccess' in found_functions}}
        global __cuMemPoolGetAccess
        __cuMemPoolGetAccess = dlfcn.dlsym(handle, 'cuMemPoolGetAccess')
        {{endif}}
        {{if 'cuMemPoolCreate' in found_functions}}
        global __cuMemPoolCreate
        __cuMemPoolCreate = dlfcn.dlsym(handle, 'cuMemPoolCreate')
        {{endif}}
        {{if 'cuMemPoolDestroy' in found_functions}}
        global __cuMemPoolDestroy
        __cuMemPoolDestroy = dlfcn.dlsym(handle, 'cuMemPoolDestroy')
        {{endif}}
        {{if 'cuMemPoolExportToShareableHandle' in found_functions}}
        global __cuMemPoolExportToShareableHandle
        __cuMemPoolExportToShareableHandle = dlfcn.dlsym(handle, 'cuMemPoolExportToShareableHandle')
        {{endif}}
        {{if 'cuMemPoolImportFromShareableHandle' in found_functions}}
        global __cuMemPoolImportFromShareableHandle
        __cuMemPoolImportFromShareableHandle = dlfcn.dlsym(handle, 'cuMemPoolImportFromShareableHandle')
        {{endif}}
        {{if 'cuMemPoolExportPointer' in found_functions}}
        global __cuMemPoolExportPointer
        __cuMemPoolExportPointer = dlfcn.dlsym(handle, 'cuMemPoolExportPointer')
        {{endif}}
        {{if 'cuMemPoolImportPointer' in found_functions}}
        global __cuMemPoolImportPointer
        __cuMemPoolImportPointer = dlfcn.dlsym(handle, 'cuMemPoolImportPointer')
        {{endif}}
        {{if 'cuMulticastCreate' in found_functions}}
        global __cuMulticastCreate
        __cuMulticastCreate = dlfcn.dlsym(handle, 'cuMulticastCreate')
        {{endif}}
        {{if 'cuMulticastAddDevice' in found_functions}}
        global __cuMulticastAddDevice
        __cuMulticastAddDevice = dlfcn.dlsym(handle, 'cuMulticastAddDevice')
        {{endif}}
        {{if 'cuMulticastBindMem' in found_functions}}
        global __cuMulticastBindMem
        __cuMulticastBindMem = dlfcn.dlsym(handle, 'cuMulticastBindMem')
        {{endif}}
        {{if 'cuMulticastBindAddr' in found_functions}}
        global __cuMulticastBindAddr
        __cuMulticastBindAddr = dlfcn.dlsym(handle, 'cuMulticastBindAddr')
        {{endif}}
        {{if 'cuMulticastUnbind' in found_functions}}
        global __cuMulticastUnbind
        __cuMulticastUnbind = dlfcn.dlsym(handle, 'cuMulticastUnbind')
        {{endif}}
        {{if 'cuMulticastGetGranularity' in found_functions}}
        global __cuMulticastGetGranularity
        __cuMulticastGetGranularity = dlfcn.dlsym(handle, 'cuMulticastGetGranularity')
        {{endif}}
        {{if 'cuPointerGetAttribute' in found_functions}}
        global __cuPointerGetAttribute
        __cuPointerGetAttribute = dlfcn.dlsym(handle, 'cuPointerGetAttribute')
        {{endif}}
        {{if 'cuMemAdvise' in found_functions}}
        global __cuMemAdvise
        __cuMemAdvise = dlfcn.dlsym(handle, 'cuMemAdvise')
        {{endif}}
        {{if 'cuMemAdvise_v2' in found_functions}}
        global __cuMemAdvise_v2
        __cuMemAdvise_v2 = dlfcn.dlsym(handle, 'cuMemAdvise_v2')
        {{endif}}
        {{if 'cuMemRangeGetAttribute' in found_functions}}
        global __cuMemRangeGetAttribute
        __cuMemRangeGetAttribute = dlfcn.dlsym(handle, 'cuMemRangeGetAttribute')
        {{endif}}
        {{if 'cuMemRangeGetAttributes' in found_functions}}
        global __cuMemRangeGetAttributes
        __cuMemRangeGetAttributes = dlfcn.dlsym(handle, 'cuMemRangeGetAttributes')
        {{endif}}
        {{if 'cuPointerSetAttribute' in found_functions}}
        global __cuPointerSetAttribute
        __cuPointerSetAttribute = dlfcn.dlsym(handle, 'cuPointerSetAttribute')
        {{endif}}
        {{if 'cuPointerGetAttributes' in found_functions}}
        global __cuPointerGetAttributes
        __cuPointerGetAttributes = dlfcn.dlsym(handle, 'cuPointerGetAttributes')
        {{endif}}
        {{if 'cuStreamCreate' in found_functions}}
        global __cuStreamCreate
        __cuStreamCreate = dlfcn.dlsym(handle, 'cuStreamCreate')
        {{endif}}
        {{if 'cuStreamCreateWithPriority' in found_functions}}
        global __cuStreamCreateWithPriority
        __cuStreamCreateWithPriority = dlfcn.dlsym(handle, 'cuStreamCreateWithPriority')
        {{endif}}
        {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}}
        global __cuThreadExchangeStreamCaptureMode
        __cuThreadExchangeStreamCaptureMode = dlfcn.dlsym(handle, 'cuThreadExchangeStreamCaptureMode')
        {{endif}}
        {{if 'cuStreamDestroy_v2' in found_functions}}
        global __cuStreamDestroy_v2
        __cuStreamDestroy_v2 = dlfcn.dlsym(handle, 'cuStreamDestroy_v2')
        {{endif}}
        {{if 'cuEventCreate' in found_functions}}
        global __cuEventCreate
        __cuEventCreate = dlfcn.dlsym(handle, 'cuEventCreate')
        {{endif}}
        {{if 'cuEventQuery' in found_functions}}
        global __cuEventQuery
        __cuEventQuery = dlfcn.dlsym(handle, 'cuEventQuery')
        {{endif}}
        {{if 'cuEventSynchronize' in found_functions}}
        global __cuEventSynchronize
        __cuEventSynchronize = dlfcn.dlsym(handle, 'cuEventSynchronize')
        {{endif}}
        {{if 'cuEventDestroy_v2' in found_functions}}
        global __cuEventDestroy_v2
        __cuEventDestroy_v2 = dlfcn.dlsym(handle, 'cuEventDestroy_v2')
        {{endif}}
        {{if 'cuEventElapsedTime' in found_functions}}
        global __cuEventElapsedTime
        __cuEventElapsedTime = dlfcn.dlsym(handle, 'cuEventElapsedTime')
        {{endif}}
        {{if 'cuEventElapsedTime_v2' in found_functions}}
        global __cuEventElapsedTime_v2
        __cuEventElapsedTime_v2 = dlfcn.dlsym(handle, 'cuEventElapsedTime_v2')
        {{endif}}
        {{if 'cuImportExternalMemory' in found_functions}}
        global __cuImportExternalMemory
        __cuImportExternalMemory = dlfcn.dlsym(handle, 'cuImportExternalMemory')
        {{endif}}
        {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}}
        global __cuExternalMemoryGetMappedBuffer
        __cuExternalMemoryGetMappedBuffer = dlfcn.dlsym(handle, 'cuExternalMemoryGetMappedBuffer')
        {{endif}}
        {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}}
        global __cuExternalMemoryGetMappedMipmappedArray
        __cuExternalMemoryGetMappedMipmappedArray = dlfcn.dlsym(handle, 'cuExternalMemoryGetMappedMipmappedArray')
        {{endif}}
        {{if 'cuDestroyExternalMemory' in found_functions}}
        global __cuDestroyExternalMemory
        __cuDestroyExternalMemory = dlfcn.dlsym(handle, 'cuDestroyExternalMemory')
        {{endif}}
        {{if 'cuImportExternalSemaphore' in found_functions}}
        global __cuImportExternalSemaphore
        __cuImportExternalSemaphore = dlfcn.dlsym(handle, 'cuImportExternalSemaphore')
        {{endif}}
        {{if 'cuDestroyExternalSemaphore' in found_functions}}
        global __cuDestroyExternalSemaphore
        __cuDestroyExternalSemaphore = dlfcn.dlsym(handle, 'cuDestroyExternalSemaphore')
        {{endif}}
        {{if 'cuFuncGetAttribute' in found_functions}}
        global __cuFuncGetAttribute
        __cuFuncGetAttribute = dlfcn.dlsym(handle, 'cuFuncGetAttribute')
        {{endif}}
        {{if 'cuFuncSetAttribute' in found_functions}}
        global __cuFuncSetAttribute
        __cuFuncSetAttribute = dlfcn.dlsym(handle, 'cuFuncSetAttribute')
        {{endif}}
        {{if 'cuFuncSetCacheConfig' in found_functions}}
        global __cuFuncSetCacheConfig
        __cuFuncSetCacheConfig = dlfcn.dlsym(handle, 'cuFuncSetCacheConfig')
        {{endif}}
        {{if 'cuFuncGetModule' in found_functions}}
        global __cuFuncGetModule
        __cuFuncGetModule = dlfcn.dlsym(handle, 'cuFuncGetModule')
        {{endif}}
        {{if 'cuFuncGetName' in found_functions}}
        global __cuFuncGetName
        __cuFuncGetName = dlfcn.dlsym(handle, 'cuFuncGetName')
        {{endif}}
        {{if 'cuFuncGetParamInfo' in found_functions}}
        global __cuFuncGetParamInfo
        __cuFuncGetParamInfo = dlfcn.dlsym(handle, 'cuFuncGetParamInfo')
        {{endif}}
        {{if 'cuFuncIsLoaded' in found_functions}}
        global __cuFuncIsLoaded
        __cuFuncIsLoaded = dlfcn.dlsym(handle, 'cuFuncIsLoaded')
        {{endif}}
        {{if 'cuFuncLoad' in found_functions}}
        global __cuFuncLoad
        __cuFuncLoad = dlfcn.dlsym(handle, 'cuFuncLoad')
        {{endif}}
        {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}}
        global __cuLaunchCooperativeKernelMultiDevice
        __cuLaunchCooperativeKernelMultiDevice = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernelMultiDevice')
        {{endif}}
        {{if 'cuFuncSetBlockShape' in found_functions}}
        global __cuFuncSetBlockShape
        __cuFuncSetBlockShape = dlfcn.dlsym(handle, 'cuFuncSetBlockShape')
        {{endif}}
        {{if 'cuFuncSetSharedSize' in found_functions}}
        global __cuFuncSetSharedSize
        __cuFuncSetSharedSize = dlfcn.dlsym(handle, 'cuFuncSetSharedSize')
        {{endif}}
        {{if 'cuParamSetSize' in found_functions}}
        global __cuParamSetSize
        __cuParamSetSize = dlfcn.dlsym(handle, 'cuParamSetSize')
        {{endif}}
        {{if 'cuParamSeti' in found_functions}}
        global __cuParamSeti
        __cuParamSeti = dlfcn.dlsym(handle, 'cuParamSeti')
        {{endif}}
        {{if 'cuParamSetf' in found_functions}}
        global __cuParamSetf
        __cuParamSetf = dlfcn.dlsym(handle, 'cuParamSetf')
        {{endif}}
        {{if 'cuParamSetv' in found_functions}}
        global __cuParamSetv
        __cuParamSetv = dlfcn.dlsym(handle, 'cuParamSetv')
        {{endif}}
        {{if 'cuLaunch' in found_functions}}
        global __cuLaunch
        __cuLaunch = dlfcn.dlsym(handle, 'cuLaunch')
        {{endif}}
        {{if 'cuLaunchGrid' in found_functions}}
        global __cuLaunchGrid
        __cuLaunchGrid = dlfcn.dlsym(handle, 'cuLaunchGrid')
        {{endif}}
        {{if 'cuLaunchGridAsync' in found_functions}}
        global __cuLaunchGridAsync
        __cuLaunchGridAsync = dlfcn.dlsym(handle, 'cuLaunchGridAsync')
        {{endif}}
        {{if 'cuParamSetTexRef' in found_functions}}
        global __cuParamSetTexRef
        __cuParamSetTexRef = dlfcn.dlsym(handle, 'cuParamSetTexRef')
        {{endif}}
        {{if 'cuFuncSetSharedMemConfig' in found_functions}}
        global __cuFuncSetSharedMemConfig
        __cuFuncSetSharedMemConfig = dlfcn.dlsym(handle, 'cuFuncSetSharedMemConfig')
        {{endif}}
        {{if 'cuGraphCreate' in found_functions}}
        global __cuGraphCreate
        __cuGraphCreate = dlfcn.dlsym(handle, 'cuGraphCreate')
        {{endif}}
        {{if 'cuGraphAddKernelNode_v2' in found_functions}}
        global __cuGraphAddKernelNode_v2
        __cuGraphAddKernelNode_v2 = dlfcn.dlsym(handle, 'cuGraphAddKernelNode_v2')
        {{endif}}
        {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}}
        global __cuGraphKernelNodeGetParams_v2
        __cuGraphKernelNodeGetParams_v2 = dlfcn.dlsym(handle, 'cuGraphKernelNodeGetParams_v2')
        {{endif}}
        {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}}
        global __cuGraphKernelNodeSetParams_v2
        __cuGraphKernelNodeSetParams_v2 = dlfcn.dlsym(handle, 'cuGraphKernelNodeSetParams_v2')
        {{endif}}
        {{if 'cuGraphAddMemcpyNode' in found_functions}}
        global __cuGraphAddMemcpyNode
        __cuGraphAddMemcpyNode = dlfcn.dlsym(handle, 'cuGraphAddMemcpyNode')
        {{endif}}
        {{if 'cuGraphMemcpyNodeGetParams' in found_functions}}
        global __cuGraphMemcpyNodeGetParams
        __cuGraphMemcpyNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemcpyNodeGetParams')
        {{endif}}
        {{if 'cuGraphMemcpyNodeSetParams' in found_functions}}
        global __cuGraphMemcpyNodeSetParams
        __cuGraphMemcpyNodeSetParams = dlfcn.dlsym(handle, 'cuGraphMemcpyNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddMemsetNode' in found_functions}}
        global __cuGraphAddMemsetNode
        __cuGraphAddMemsetNode = dlfcn.dlsym(handle, 'cuGraphAddMemsetNode')
        {{endif}}
        {{if 'cuGraphMemsetNodeGetParams' in found_functions}}
        global __cuGraphMemsetNodeGetParams
        __cuGraphMemsetNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemsetNodeGetParams')
        {{endif}}
        {{if 'cuGraphMemsetNodeSetParams' in found_functions}}
        global __cuGraphMemsetNodeSetParams
        __cuGraphMemsetNodeSetParams = dlfcn.dlsym(handle, 'cuGraphMemsetNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddHostNode' in found_functions}}
        global __cuGraphAddHostNode
        __cuGraphAddHostNode = dlfcn.dlsym(handle, 'cuGraphAddHostNode')
        {{endif}}
        {{if 'cuGraphHostNodeGetParams' in found_functions}}
        global __cuGraphHostNodeGetParams
        __cuGraphHostNodeGetParams = dlfcn.dlsym(handle, 'cuGraphHostNodeGetParams')
        {{endif}}
        {{if 'cuGraphHostNodeSetParams' in found_functions}}
        global __cuGraphHostNodeSetParams
        __cuGraphHostNodeSetParams = dlfcn.dlsym(handle, 'cuGraphHostNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddChildGraphNode' in found_functions}}
        global __cuGraphAddChildGraphNode
        __cuGraphAddChildGraphNode = dlfcn.dlsym(handle, 'cuGraphAddChildGraphNode')
        {{endif}}
        {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}}
        global __cuGraphChildGraphNodeGetGraph
        __cuGraphChildGraphNodeGetGraph = dlfcn.dlsym(handle, 'cuGraphChildGraphNodeGetGraph')
        {{endif}}
        {{if 'cuGraphAddEmptyNode' in found_functions}}
        global __cuGraphAddEmptyNode
        __cuGraphAddEmptyNode = dlfcn.dlsym(handle, 'cuGraphAddEmptyNode')
        {{endif}}
        {{if 'cuGraphAddEventRecordNode' in found_functions}}
        global __cuGraphAddEventRecordNode
        __cuGraphAddEventRecordNode = dlfcn.dlsym(handle, 'cuGraphAddEventRecordNode')
        {{endif}}
        {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}}
        global __cuGraphEventRecordNodeGetEvent
        __cuGraphEventRecordNodeGetEvent = dlfcn.dlsym(handle, 'cuGraphEventRecordNodeGetEvent')
        {{endif}}
        {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}}
        global __cuGraphEventRecordNodeSetEvent
        __cuGraphEventRecordNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphEventRecordNodeSetEvent')
        {{endif}}
        {{if 'cuGraphAddEventWaitNode' in found_functions}}
        global __cuGraphAddEventWaitNode
        __cuGraphAddEventWaitNode = dlfcn.dlsym(handle, 'cuGraphAddEventWaitNode')
        {{endif}}
        {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}}
        global __cuGraphEventWaitNodeGetEvent
        __cuGraphEventWaitNodeGetEvent = dlfcn.dlsym(handle, 'cuGraphEventWaitNodeGetEvent')
        {{endif}}
        {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}}
        global __cuGraphEventWaitNodeSetEvent
        __cuGraphEventWaitNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphEventWaitNodeSetEvent')
        {{endif}}
        {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}}
        global __cuGraphAddExternalSemaphoresSignalNode
        __cuGraphAddExternalSemaphoresSignalNode = dlfcn.dlsym(handle, 'cuGraphAddExternalSemaphoresSignalNode')
        {{endif}}
        {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}}
        global __cuGraphExternalSemaphoresSignalNodeGetParams
        __cuGraphExternalSemaphoresSignalNodeGetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams')
        {{endif}}
        {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}}
        global __cuGraphExternalSemaphoresSignalNodeSetParams
        __cuGraphExternalSemaphoresSignalNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}}
        global __cuGraphAddExternalSemaphoresWaitNode
        __cuGraphAddExternalSemaphoresWaitNode = dlfcn.dlsym(handle, 'cuGraphAddExternalSemaphoresWaitNode')
        {{endif}}
        {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}}
        global __cuGraphExternalSemaphoresWaitNodeGetParams
        __cuGraphExternalSemaphoresWaitNodeGetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams')
        {{endif}}
        {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}}
        global __cuGraphExternalSemaphoresWaitNodeSetParams
        __cuGraphExternalSemaphoresWaitNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddBatchMemOpNode' in found_functions}}
        global __cuGraphAddBatchMemOpNode
        __cuGraphAddBatchMemOpNode = dlfcn.dlsym(handle, 'cuGraphAddBatchMemOpNode')
        {{endif}}
        {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}}
        global __cuGraphBatchMemOpNodeGetParams
        __cuGraphBatchMemOpNodeGetParams = dlfcn.dlsym(handle, 'cuGraphBatchMemOpNodeGetParams')
        {{endif}}
        {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}}
        global __cuGraphBatchMemOpNodeSetParams
        __cuGraphBatchMemOpNodeSetParams = dlfcn.dlsym(handle, 'cuGraphBatchMemOpNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}}
        global __cuGraphExecBatchMemOpNodeSetParams
        __cuGraphExecBatchMemOpNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecBatchMemOpNodeSetParams')
        {{endif}}
        {{if 'cuGraphAddMemAllocNode' in found_functions}}
        global __cuGraphAddMemAllocNode
        __cuGraphAddMemAllocNode = dlfcn.dlsym(handle, 'cuGraphAddMemAllocNode')
        {{endif}}
        {{if 'cuGraphMemAllocNodeGetParams' in found_functions}}
        global __cuGraphMemAllocNodeGetParams
        __cuGraphMemAllocNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemAllocNodeGetParams')
        {{endif}}
        {{if 'cuGraphAddMemFreeNode' in found_functions}}
        global __cuGraphAddMemFreeNode
        __cuGraphAddMemFreeNode = dlfcn.dlsym(handle, 'cuGraphAddMemFreeNode')
        {{endif}}
        {{if 'cuGraphMemFreeNodeGetParams' in found_functions}}
        global __cuGraphMemFreeNodeGetParams
        __cuGraphMemFreeNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemFreeNodeGetParams')
        {{endif}}
        {{if 'cuDeviceGraphMemTrim' in found_functions}}
        global __cuDeviceGraphMemTrim
        __cuDeviceGraphMemTrim = dlfcn.dlsym(handle, 'cuDeviceGraphMemTrim')
        {{endif}}
        {{if 'cuDeviceGetGraphMemAttribute' in found_functions}}
        global __cuDeviceGetGraphMemAttribute
        __cuDeviceGetGraphMemAttribute = dlfcn.dlsym(handle, 'cuDeviceGetGraphMemAttribute')
        {{endif}}
        {{if 'cuDeviceSetGraphMemAttribute' in found_functions}}
        global __cuDeviceSetGraphMemAttribute
        __cuDeviceSetGraphMemAttribute = dlfcn.dlsym(handle, 'cuDeviceSetGraphMemAttribute')
        {{endif}}
        {{if 'cuGraphClone' in found_functions}}
        global __cuGraphClone
        __cuGraphClone = dlfcn.dlsym(handle, 'cuGraphClone')
        {{endif}}
        {{if 'cuGraphNodeFindInClone' in found_functions}}
        global __cuGraphNodeFindInClone
        __cuGraphNodeFindInClone = dlfcn.dlsym(handle, 'cuGraphNodeFindInClone')
        {{endif}}
        {{if 'cuGraphNodeGetType' in found_functions}}
        global __cuGraphNodeGetType
        __cuGraphNodeGetType = dlfcn.dlsym(handle, 'cuGraphNodeGetType')
        {{endif}}
        {{if 'cuGraphGetNodes' in found_functions}}
        global __cuGraphGetNodes
        __cuGraphGetNodes = dlfcn.dlsym(handle, 'cuGraphGetNodes')
        {{endif}}
        {{if 'cuGraphGetRootNodes' in found_functions}}
        global __cuGraphGetRootNodes
        __cuGraphGetRootNodes = dlfcn.dlsym(handle, 'cuGraphGetRootNodes')
        {{endif}}
        {{if 'cuGraphGetEdges' in found_functions}}
        global __cuGraphGetEdges
        __cuGraphGetEdges = dlfcn.dlsym(handle, 'cuGraphGetEdges')
        {{endif}}
        {{if 'cuGraphGetEdges_v2' in found_functions}}
        global __cuGraphGetEdges_v2
        __cuGraphGetEdges_v2 = dlfcn.dlsym(handle, 'cuGraphGetEdges_v2')
        {{endif}}
        {{if 'cuGraphNodeGetDependencies' in found_functions}}
        global __cuGraphNodeGetDependencies
        __cuGraphNodeGetDependencies = dlfcn.dlsym(handle, 'cuGraphNodeGetDependencies')
        {{endif}}
        {{if 'cuGraphNodeGetDependencies_v2' in found_functions}}
        global __cuGraphNodeGetDependencies_v2
        __cuGraphNodeGetDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependencies_v2')
        {{endif}}
        {{if 'cuGraphNodeGetDependentNodes' in found_functions}}
        global __cuGraphNodeGetDependentNodes
        __cuGraphNodeGetDependentNodes = dlfcn.dlsym(handle, 'cuGraphNodeGetDependentNodes')
        {{endif}}
        {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}}
        global __cuGraphNodeGetDependentNodes_v2
        __cuGraphNodeGetDependentNodes_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependentNodes_v2')
        {{endif}}
        {{if 'cuGraphAddDependencies' in found_functions}}
        global __cuGraphAddDependencies
        __cuGraphAddDependencies = dlfcn.dlsym(handle, 'cuGraphAddDependencies')
        {{endif}}
        {{if 'cuGraphAddDependencies_v2' in found_functions}}
        global __cuGraphAddDependencies_v2
        __cuGraphAddDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphAddDependencies_v2')
        {{endif}}
        {{if 'cuGraphRemoveDependencies' in found_functions}}
        global __cuGraphRemoveDependencies
        __cuGraphRemoveDependencies = dlfcn.dlsym(handle, 'cuGraphRemoveDependencies')
        {{endif}}
        {{if 'cuGraphRemoveDependencies_v2' in found_functions}}
        global __cuGraphRemoveDependencies_v2
        __cuGraphRemoveDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphRemoveDependencies_v2')
        {{endif}}
        {{if 'cuGraphDestroyNode' in found_functions}}
        global __cuGraphDestroyNode
        __cuGraphDestroyNode = dlfcn.dlsym(handle, 'cuGraphDestroyNode')
        {{endif}}
        {{if 'cuGraphInstantiateWithFlags' in found_functions}}
        global __cuGraphInstantiateWithFlags
        __cuGraphInstantiateWithFlags = dlfcn.dlsym(handle, 'cuGraphInstantiateWithFlags')
        {{endif}}
        {{if 'cuGraphExecGetFlags' in found_functions}}
        global __cuGraphExecGetFlags
        __cuGraphExecGetFlags = dlfcn.dlsym(handle, 'cuGraphExecGetFlags')
        {{endif}}
        {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}}
        global __cuGraphExecKernelNodeSetParams_v2
        __cuGraphExecKernelNodeSetParams_v2 = dlfcn.dlsym(handle, 'cuGraphExecKernelNodeSetParams_v2')
        {{endif}}
        {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}}
        global __cuGraphExecMemcpyNodeSetParams
        __cuGraphExecMemcpyNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecMemcpyNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}}
        global __cuGraphExecMemsetNodeSetParams
        __cuGraphExecMemsetNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecMemsetNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecHostNodeSetParams' in found_functions}}
        global __cuGraphExecHostNodeSetParams
        __cuGraphExecHostNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecHostNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}}
        global __cuGraphExecChildGraphNodeSetParams
        __cuGraphExecChildGraphNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecChildGraphNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}}
        global __cuGraphExecEventRecordNodeSetEvent
        __cuGraphExecEventRecordNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphExecEventRecordNodeSetEvent')
        {{endif}}
        {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}}
        global __cuGraphExecEventWaitNodeSetEvent
        __cuGraphExecEventWaitNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphExecEventWaitNodeSetEvent')
        {{endif}}
        {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}}
        global __cuGraphExecExternalSemaphoresSignalNodeSetParams
        __cuGraphExecExternalSemaphoresSignalNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}}
        global __cuGraphExecExternalSemaphoresWaitNodeSetParams
        __cuGraphExecExternalSemaphoresWaitNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams')
        {{endif}}
        {{if 'cuGraphNodeSetEnabled' in found_functions}}
        global __cuGraphNodeSetEnabled
        __cuGraphNodeSetEnabled = dlfcn.dlsym(handle, 'cuGraphNodeSetEnabled')
        {{endif}}
        {{if 'cuGraphNodeGetEnabled' in found_functions}}
        global __cuGraphNodeGetEnabled
        __cuGraphNodeGetEnabled = dlfcn.dlsym(handle, 'cuGraphNodeGetEnabled')
        {{endif}}
        {{if 'cuGraphExecDestroy' in found_functions}}
        global __cuGraphExecDestroy
        __cuGraphExecDestroy = dlfcn.dlsym(handle, 'cuGraphExecDestroy')
        {{endif}}
        {{if 'cuGraphDestroy' in found_functions}}
        global __cuGraphDestroy
        __cuGraphDestroy = dlfcn.dlsym(handle, 'cuGraphDestroy')
        {{endif}}
        {{if 'cuGraphExecUpdate_v2' in found_functions}}
        global __cuGraphExecUpdate_v2
        __cuGraphExecUpdate_v2 = dlfcn.dlsym(handle, 'cuGraphExecUpdate_v2')
        {{endif}}
        {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}}
        global __cuGraphKernelNodeCopyAttributes
        __cuGraphKernelNodeCopyAttributes = dlfcn.dlsym(handle, 'cuGraphKernelNodeCopyAttributes')
        {{endif}}
        {{if 'cuGraphKernelNodeGetAttribute' in found_functions}}
        global __cuGraphKernelNodeGetAttribute
        __cuGraphKernelNodeGetAttribute = dlfcn.dlsym(handle, 'cuGraphKernelNodeGetAttribute')
        {{endif}}
        {{if 'cuGraphKernelNodeSetAttribute' in found_functions}}
        global __cuGraphKernelNodeSetAttribute
        __cuGraphKernelNodeSetAttribute = dlfcn.dlsym(handle, 'cuGraphKernelNodeSetAttribute')
        {{endif}}
        {{if 'cuGraphDebugDotPrint' in found_functions}}
        global __cuGraphDebugDotPrint
        __cuGraphDebugDotPrint = dlfcn.dlsym(handle, 'cuGraphDebugDotPrint')
        {{endif}}
        {{if 'cuUserObjectCreate' in found_functions}}
        global __cuUserObjectCreate
        __cuUserObjectCreate = dlfcn.dlsym(handle, 'cuUserObjectCreate')
        {{endif}}
        {{if 'cuUserObjectRetain' in found_functions}}
        global __cuUserObjectRetain
        __cuUserObjectRetain = dlfcn.dlsym(handle, 'cuUserObjectRetain')
        {{endif}}
        {{if 'cuUserObjectRelease' in found_functions}}
        global __cuUserObjectRelease
        __cuUserObjectRelease = dlfcn.dlsym(handle, 'cuUserObjectRelease')
        {{endif}}
        {{if 'cuGraphRetainUserObject' in found_functions}}
        global __cuGraphRetainUserObject
        __cuGraphRetainUserObject = dlfcn.dlsym(handle, 'cuGraphRetainUserObject')
        {{endif}}
        {{if 'cuGraphReleaseUserObject' in found_functions}}
        global __cuGraphReleaseUserObject
        __cuGraphReleaseUserObject = dlfcn.dlsym(handle, 'cuGraphReleaseUserObject')
        {{endif}}
        {{if 'cuGraphAddNode' in found_functions}}
        global __cuGraphAddNode
        __cuGraphAddNode = dlfcn.dlsym(handle, 'cuGraphAddNode')
        {{endif}}
        {{if 'cuGraphAddNode_v2' in found_functions}}
        global __cuGraphAddNode_v2
        __cuGraphAddNode_v2 = dlfcn.dlsym(handle, 'cuGraphAddNode_v2')
        {{endif}}
        {{if 'cuGraphNodeSetParams' in found_functions}}
        global __cuGraphNodeSetParams
        __cuGraphNodeSetParams = dlfcn.dlsym(handle, 'cuGraphNodeSetParams')
        {{endif}}
        {{if 'cuGraphExecNodeSetParams' in found_functions}}
        global __cuGraphExecNodeSetParams
        __cuGraphExecNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecNodeSetParams')
        {{endif}}
        {{if 'cuGraphConditionalHandleCreate' in found_functions}}
        global __cuGraphConditionalHandleCreate
        __cuGraphConditionalHandleCreate = dlfcn.dlsym(handle, 'cuGraphConditionalHandleCreate')
        {{endif}}
        {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}}
        global __cuOccupancyMaxActiveBlocksPerMultiprocessor
        __cuOccupancyMaxActiveBlocksPerMultiprocessor = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor')
        {{endif}}
        {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}}
        global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
        __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags')
        {{endif}}
        {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}}
        global __cuOccupancyMaxPotentialBlockSize
        __cuOccupancyMaxPotentialBlockSize = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialBlockSize')
        {{endif}}
        {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}}
        global __cuOccupancyMaxPotentialBlockSizeWithFlags
        __cuOccupancyMaxPotentialBlockSizeWithFlags = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags')
        {{endif}}
        {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}}
        global __cuOccupancyAvailableDynamicSMemPerBlock
        __cuOccupancyAvailableDynamicSMemPerBlock = dlfcn.dlsym(handle, 'cuOccupancyAvailableDynamicSMemPerBlock')
        {{endif}}
        {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}}
        global __cuOccupancyMaxPotentialClusterSize
        __cuOccupancyMaxPotentialClusterSize = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialClusterSize')
        {{endif}}
        {{if 'cuOccupancyMaxActiveClusters' in found_functions}}
        global __cuOccupancyMaxActiveClusters
        __cuOccupancyMaxActiveClusters = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveClusters')
        {{endif}}
        {{if 'cuTexRefSetArray' in found_functions}}
        global __cuTexRefSetArray
        __cuTexRefSetArray = dlfcn.dlsym(handle, 'cuTexRefSetArray')
        {{endif}}
        {{if 'cuTexRefSetMipmappedArray' in found_functions}}
        global __cuTexRefSetMipmappedArray
        __cuTexRefSetMipmappedArray = dlfcn.dlsym(handle, 'cuTexRefSetMipmappedArray')
        {{endif}}
        {{if 'cuTexRefSetAddress_v2' in found_functions}}
        global __cuTexRefSetAddress_v2
        __cuTexRefSetAddress_v2 = dlfcn.dlsym(handle, 'cuTexRefSetAddress_v2')
        {{endif}}
        {{if 'cuTexRefSetAddress2D_v3' in found_functions}}
        global __cuTexRefSetAddress2D_v3
        __cuTexRefSetAddress2D_v3 = dlfcn.dlsym(handle, 'cuTexRefSetAddress2D_v3')
        {{endif}}
        {{if 'cuTexRefSetFormat' in found_functions}}
        global __cuTexRefSetFormat
        __cuTexRefSetFormat = dlfcn.dlsym(handle, 'cuTexRefSetFormat')
        {{endif}}
        {{if 'cuTexRefSetAddressMode' in found_functions}}
        global __cuTexRefSetAddressMode
        __cuTexRefSetAddressMode = dlfcn.dlsym(handle, 'cuTexRefSetAddressMode')
        {{endif}}
        {{if 'cuTexRefSetFilterMode' in found_functions}}
        global __cuTexRefSetFilterMode
        __cuTexRefSetFilterMode = dlfcn.dlsym(handle, 'cuTexRefSetFilterMode')
        {{endif}}
        {{if 'cuTexRefSetMipmapFilterMode' in found_functions}}
        global __cuTexRefSetMipmapFilterMode
        __cuTexRefSetMipmapFilterMode = dlfcn.dlsym(handle, 'cuTexRefSetMipmapFilterMode')
        {{endif}}
        {{if 'cuTexRefSetMipmapLevelBias' in found_functions}}
        global __cuTexRefSetMipmapLevelBias
        __cuTexRefSetMipmapLevelBias = dlfcn.dlsym(handle, 'cuTexRefSetMipmapLevelBias')
        {{endif}}
        {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}}
        global __cuTexRefSetMipmapLevelClamp
        __cuTexRefSetMipmapLevelClamp = dlfcn.dlsym(handle, 'cuTexRefSetMipmapLevelClamp')
        {{endif}}
        {{if 'cuTexRefSetMaxAnisotropy' in found_functions}}
        global __cuTexRefSetMaxAnisotropy
        __cuTexRefSetMaxAnisotropy = dlfcn.dlsym(handle, 'cuTexRefSetMaxAnisotropy')
        {{endif}}
        {{if 'cuTexRefSetBorderColor' in found_functions}}
        global __cuTexRefSetBorderColor
        __cuTexRefSetBorderColor = dlfcn.dlsym(handle, 'cuTexRefSetBorderColor')
        {{endif}}
        {{if 'cuTexRefSetFlags' in found_functions}}
        global __cuTexRefSetFlags
        __cuTexRefSetFlags = dlfcn.dlsym(handle, 'cuTexRefSetFlags')
        {{endif}}
        {{if 'cuTexRefGetAddress_v2' in found_functions}}
        global __cuTexRefGetAddress_v2
        __cuTexRefGetAddress_v2 = dlfcn.dlsym(handle, 'cuTexRefGetAddress_v2')
        {{endif}}
        {{if 'cuTexRefGetArray' in found_functions}}
        global __cuTexRefGetArray
        __cuTexRefGetArray = dlfcn.dlsym(handle, 'cuTexRefGetArray')
        {{endif}}
        {{if 'cuTexRefGetMipmappedArray' in found_functions}}
        global __cuTexRefGetMipmappedArray
        __cuTexRefGetMipmappedArray = dlfcn.dlsym(handle, 'cuTexRefGetMipmappedArray')
        {{endif}}
        {{if 'cuTexRefGetAddressMode' in found_functions}}
        global __cuTexRefGetAddressMode
        __cuTexRefGetAddressMode = dlfcn.dlsym(handle, 'cuTexRefGetAddressMode')
        {{endif}}
        {{if 'cuTexRefGetFilterMode' in found_functions}}
        global __cuTexRefGetFilterMode
        __cuTexRefGetFilterMode = dlfcn.dlsym(handle, 'cuTexRefGetFilterMode')
        {{endif}}
        {{if 'cuTexRefGetFormat' in found_functions}}
        global __cuTexRefGetFormat
        __cuTexRefGetFormat = dlfcn.dlsym(handle, 'cuTexRefGetFormat')
        {{endif}}
        {{if 'cuTexRefGetMipmapFilterMode' in found_functions}}
        global __cuTexRefGetMipmapFilterMode
        __cuTexRefGetMipmapFilterMode = dlfcn.dlsym(handle, 'cuTexRefGetMipmapFilterMode')
        {{endif}}
        {{if 'cuTexRefGetMipmapLevelBias' in found_functions}}
        global __cuTexRefGetMipmapLevelBias
        __cuTexRefGetMipmapLevelBias = dlfcn.dlsym(handle, 'cuTexRefGetMipmapLevelBias')
        {{endif}}
        {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}}
        global __cuTexRefGetMipmapLevelClamp
        __cuTexRefGetMipmapLevelClamp = dlfcn.dlsym(handle, 'cuTexRefGetMipmapLevelClamp')
        {{endif}}
        {{if 'cuTexRefGetMaxAnisotropy' in found_functions}}
        global __cuTexRefGetMaxAnisotropy
        __cuTexRefGetMaxAnisotropy = dlfcn.dlsym(handle, 'cuTexRefGetMaxAnisotropy')
        {{endif}}
        {{if 'cuTexRefGetBorderColor' in found_functions}}
        global __cuTexRefGetBorderColor
        __cuTexRefGetBorderColor = dlfcn.dlsym(handle, 'cuTexRefGetBorderColor')
        {{endif}}
        {{if 'cuTexRefGetFlags' in found_functions}}
        global __cuTexRefGetFlags
        __cuTexRefGetFlags = dlfcn.dlsym(handle, 'cuTexRefGetFlags')
        {{endif}}
        {{if 'cuTexRefCreate' in found_functions}}
        global __cuTexRefCreate
        __cuTexRefCreate = dlfcn.dlsym(handle, 'cuTexRefCreate')
        {{endif}}
        {{if 'cuTexRefDestroy' in found_functions}}
        global __cuTexRefDestroy
        __cuTexRefDestroy = dlfcn.dlsym(handle, 'cuTexRefDestroy')
        {{endif}}
        {{if 'cuSurfRefSetArray' in found_functions}}
        global __cuSurfRefSetArray
        __cuSurfRefSetArray = dlfcn.dlsym(handle, 'cuSurfRefSetArray')
        {{endif}}
        {{if 'cuSurfRefGetArray' in found_functions}}
        global __cuSurfRefGetArray
        __cuSurfRefGetArray = dlfcn.dlsym(handle, 'cuSurfRefGetArray')
        {{endif}}
        {{if 'cuTexObjectCreate' in found_functions}}
        global __cuTexObjectCreate
        __cuTexObjectCreate = dlfcn.dlsym(handle, 'cuTexObjectCreate')
        {{endif}}
        {{if 'cuTexObjectDestroy' in found_functions}}
        global __cuTexObjectDestroy
        __cuTexObjectDestroy = dlfcn.dlsym(handle, 'cuTexObjectDestroy')
        {{endif}}
        {{if 'cuTexObjectGetResourceDesc' in found_functions}}
        global __cuTexObjectGetResourceDesc
        __cuTexObjectGetResourceDesc = dlfcn.dlsym(handle, 'cuTexObjectGetResourceDesc')
        {{endif}}
        {{if 'cuTexObjectGetTextureDesc' in found_functions}}
        global __cuTexObjectGetTextureDesc
        __cuTexObjectGetTextureDesc = dlfcn.dlsym(handle, 'cuTexObjectGetTextureDesc')
        {{endif}}
        {{if 'cuTexObjectGetResourceViewDesc' in found_functions}}
        global __cuTexObjectGetResourceViewDesc
        __cuTexObjectGetResourceViewDesc = dlfcn.dlsym(handle, 'cuTexObjectGetResourceViewDesc')
        {{endif}}
        {{if 'cuSurfObjectCreate' in found_functions}}
        global __cuSurfObjectCreate
        __cuSurfObjectCreate = dlfcn.dlsym(handle, 'cuSurfObjectCreate')
        {{endif}}
        {{if 'cuSurfObjectDestroy' in found_functions}}
        global __cuSurfObjectDestroy
        __cuSurfObjectDestroy = dlfcn.dlsym(handle, 'cuSurfObjectDestroy')
        {{endif}}
        {{if 'cuSurfObjectGetResourceDesc' in found_functions}}
        global __cuSurfObjectGetResourceDesc
        __cuSurfObjectGetResourceDesc = dlfcn.dlsym(handle, 'cuSurfObjectGetResourceDesc')
        {{endif}}
        {{if 'cuTensorMapEncodeTiled' in found_functions}}
        global __cuTensorMapEncodeTiled
        __cuTensorMapEncodeTiled = dlfcn.dlsym(handle, 'cuTensorMapEncodeTiled')
        {{endif}}
        {{if 'cuTensorMapEncodeIm2col' in found_functions}}
        global __cuTensorMapEncodeIm2col
        __cuTensorMapEncodeIm2col = dlfcn.dlsym(handle, 'cuTensorMapEncodeIm2col')
        {{endif}}
        {{if 'cuTensorMapEncodeIm2colWide' in found_functions}}
        global __cuTensorMapEncodeIm2colWide
        __cuTensorMapEncodeIm2colWide = dlfcn.dlsym(handle, 'cuTensorMapEncodeIm2colWide')
        {{endif}}
        {{if 'cuTensorMapReplaceAddress' in found_functions}}
        global __cuTensorMapReplaceAddress
        __cuTensorMapReplaceAddress = dlfcn.dlsym(handle, 'cuTensorMapReplaceAddress')
        {{endif}}
        {{if 'cuDeviceCanAccessPeer' in found_functions}}
        global __cuDeviceCanAccessPeer
        __cuDeviceCanAccessPeer = dlfcn.dlsym(handle, 'cuDeviceCanAccessPeer')
        {{endif}}
        {{if 'cuCtxEnablePeerAccess' in found_functions}}
        global __cuCtxEnablePeerAccess
        __cuCtxEnablePeerAccess = dlfcn.dlsym(handle, 'cuCtxEnablePeerAccess')
        {{endif}}
        {{if 'cuCtxDisablePeerAccess' in found_functions}}
        global __cuCtxDisablePeerAccess
        __cuCtxDisablePeerAccess = dlfcn.dlsym(handle, 'cuCtxDisablePeerAccess')
        {{endif}}
        {{if 'cuDeviceGetP2PAttribute' in found_functions}}
        global __cuDeviceGetP2PAttribute
        __cuDeviceGetP2PAttribute = dlfcn.dlsym(handle, 'cuDeviceGetP2PAttribute')
        {{endif}}
        {{if 'cuGraphicsUnregisterResource' in found_functions}}
        global __cuGraphicsUnregisterResource
        __cuGraphicsUnregisterResource = dlfcn.dlsym(handle, 'cuGraphicsUnregisterResource')
        {{endif}}
        {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}}
        global __cuGraphicsSubResourceGetMappedArray
        __cuGraphicsSubResourceGetMappedArray = dlfcn.dlsym(handle, 'cuGraphicsSubResourceGetMappedArray')
        {{endif}}
        {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}}
        global __cuGraphicsResourceGetMappedMipmappedArray
        __cuGraphicsResourceGetMappedMipmappedArray = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedMipmappedArray')
        {{endif}}
        {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}}
        global __cuGraphicsResourceGetMappedPointer_v2
        __cuGraphicsResourceGetMappedPointer_v2 = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedPointer_v2')
        {{endif}}
        {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}}
        global __cuGraphicsResourceSetMapFlags_v2
        __cuGraphicsResourceSetMapFlags_v2 = dlfcn.dlsym(handle, 'cuGraphicsResourceSetMapFlags_v2')
        {{endif}}
        {{if 'cuGetProcAddress_v2' in found_functions}}
        global __cuGetProcAddress_v2
        __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2')
        {{endif}}
        {{if 'cuCoredumpGetAttribute' in found_functions}}
        global __cuCoredumpGetAttribute
        __cuCoredumpGetAttribute = dlfcn.dlsym(handle, 'cuCoredumpGetAttribute')
        {{endif}}
        {{if 'cuCoredumpGetAttributeGlobal' in found_functions}}
        global __cuCoredumpGetAttributeGlobal
        __cuCoredumpGetAttributeGlobal = dlfcn.dlsym(handle, 'cuCoredumpGetAttributeGlobal')
        {{endif}}
        {{if 'cuCoredumpSetAttribute' in found_functions}}
        global __cuCoredumpSetAttribute
        __cuCoredumpSetAttribute = dlfcn.dlsym(handle, 'cuCoredumpSetAttribute')
        {{endif}}
        {{if 'cuCoredumpSetAttributeGlobal' in found_functions}}
        global __cuCoredumpSetAttributeGlobal
        __cuCoredumpSetAttributeGlobal = dlfcn.dlsym(handle, 'cuCoredumpSetAttributeGlobal')
        {{endif}}
        {{if 'cuGetExportTable' in found_functions}}
        global __cuGetExportTable
        __cuGetExportTable = dlfcn.dlsym(handle, 'cuGetExportTable')
        {{endif}}
        {{if 'cuGreenCtxCreate' in found_functions}}
        global __cuGreenCtxCreate
        __cuGreenCtxCreate = dlfcn.dlsym(handle, 'cuGreenCtxCreate')
        {{endif}}
        {{if 'cuGreenCtxDestroy' in found_functions}}
        global __cuGreenCtxDestroy
        __cuGreenCtxDestroy = dlfcn.dlsym(handle, 'cuGreenCtxDestroy')
        {{endif}}
        {{if 'cuCtxFromGreenCtx' in found_functions}}
        global __cuCtxFromGreenCtx
        __cuCtxFromGreenCtx = dlfcn.dlsym(handle, 'cuCtxFromGreenCtx')
        {{endif}}
        {{if 'cuDeviceGetDevResource' in found_functions}}
        global __cuDeviceGetDevResource
        __cuDeviceGetDevResource = dlfcn.dlsym(handle, 'cuDeviceGetDevResource')
        {{endif}}
        {{if 'cuCtxGetDevResource' in found_functions}}
        global __cuCtxGetDevResource
        __cuCtxGetDevResource = dlfcn.dlsym(handle, 'cuCtxGetDevResource')
        {{endif}}
        {{if 'cuGreenCtxGetDevResource' in found_functions}}
        global __cuGreenCtxGetDevResource
        __cuGreenCtxGetDevResource = dlfcn.dlsym(handle, 'cuGreenCtxGetDevResource')
        {{endif}}
        {{if 'cuDevSmResourceSplitByCount' in found_functions}}
        global __cuDevSmResourceSplitByCount
        __cuDevSmResourceSplitByCount = dlfcn.dlsym(handle, 'cuDevSmResourceSplitByCount')
        {{endif}}
        {{if 'cuDevResourceGenerateDesc' in found_functions}}
        global __cuDevResourceGenerateDesc
        __cuDevResourceGenerateDesc = dlfcn.dlsym(handle, 'cuDevResourceGenerateDesc')
        {{endif}}
        {{if 'cuGreenCtxRecordEvent' in found_functions}}
        global __cuGreenCtxRecordEvent
        __cuGreenCtxRecordEvent = dlfcn.dlsym(handle, 'cuGreenCtxRecordEvent')
        {{endif}}
        {{if 'cuGreenCtxWaitEvent' in found_functions}}
        global __cuGreenCtxWaitEvent
        __cuGreenCtxWaitEvent = dlfcn.dlsym(handle, 'cuGreenCtxWaitEvent')
        {{endif}}
        {{if 'cuStreamGetGreenCtx' in found_functions}}
        global __cuStreamGetGreenCtx
        __cuStreamGetGreenCtx = dlfcn.dlsym(handle, 'cuStreamGetGreenCtx')
        {{endif}}
        {{if 'cuGreenCtxStreamCreate' in found_functions}}
        global __cuGreenCtxStreamCreate
        __cuGreenCtxStreamCreate = dlfcn.dlsym(handle, 'cuGreenCtxStreamCreate')
        {{endif}}
        {{if 'cuLogsRegisterCallback' in found_functions}}
        global __cuLogsRegisterCallback
        __cuLogsRegisterCallback = dlfcn.dlsym(handle, 'cuLogsRegisterCallback')
        {{endif}}
        {{if 'cuLogsUnregisterCallback' in found_functions}}
        global __cuLogsUnregisterCallback
        __cuLogsUnregisterCallback = dlfcn.dlsym(handle, 'cuLogsUnregisterCallback')
        {{endif}}
        {{if 'cuLogsCurrent' in found_functions}}
        global __cuLogsCurrent
        __cuLogsCurrent = dlfcn.dlsym(handle, 'cuLogsCurrent')
        {{endif}}
        {{if 'cuLogsDumpToFile' in found_functions}}
        global __cuLogsDumpToFile
        __cuLogsDumpToFile = dlfcn.dlsym(handle, 'cuLogsDumpToFile')
        {{endif}}
        {{if 'cuLogsDumpToMemory' in found_functions}}
        global __cuLogsDumpToMemory
        __cuLogsDumpToMemory = dlfcn.dlsym(handle, 'cuLogsDumpToMemory')
        {{endif}}
        {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}}
        global __cuCheckpointProcessGetRestoreThreadId
        __cuCheckpointProcessGetRestoreThreadId = dlfcn.dlsym(handle, 'cuCheckpointProcessGetRestoreThreadId')
        {{endif}}
        {{if 'cuCheckpointProcessGetState' in found_functions}}
        global __cuCheckpointProcessGetState
        __cuCheckpointProcessGetState = dlfcn.dlsym(handle, 'cuCheckpointProcessGetState')
        {{endif}}
        {{if 'cuCheckpointProcessLock' in found_functions}}
        global __cuCheckpointProcessLock
        __cuCheckpointProcessLock = dlfcn.dlsym(handle, 'cuCheckpointProcessLock')
        {{endif}}
        {{if 'cuCheckpointProcessCheckpoint' in found_functions}}
        global __cuCheckpointProcessCheckpoint
        __cuCheckpointProcessCheckpoint = dlfcn.dlsym(handle, 'cuCheckpointProcessCheckpoint')
        {{endif}}
        {{if 'cuCheckpointProcessRestore' in found_functions}}
        global __cuCheckpointProcessRestore
        __cuCheckpointProcessRestore = dlfcn.dlsym(handle, 'cuCheckpointProcessRestore')
        {{endif}}
        {{if 'cuCheckpointProcessUnlock' in found_functions}}
        global __cuCheckpointProcessUnlock
        __cuCheckpointProcessUnlock = dlfcn.dlsym(handle, 'cuCheckpointProcessUnlock')
        {{endif}}
        {{if 'cuProfilerStart' in found_functions}}
        global __cuProfilerStart
        __cuProfilerStart = dlfcn.dlsym(handle, 'cuProfilerStart')
        {{endif}}
        {{if 'cuProfilerStop' in found_functions}}
        global __cuProfilerStop
        __cuProfilerStop = dlfcn.dlsym(handle, 'cuProfilerStop')
        {{endif}}
        {{if True}}
        global __cuGraphicsEGLRegisterImage
        __cuGraphicsEGLRegisterImage = dlfcn.dlsym(handle, 'cuGraphicsEGLRegisterImage')
        {{endif}}
        {{if True}}
        global __cuEGLStreamConsumerConnect
        __cuEGLStreamConsumerConnect = dlfcn.dlsym(handle, 'cuEGLStreamConsumerConnect')
        {{endif}}
        {{if True}}
        global __cuEGLStreamConsumerConnectWithFlags
        __cuEGLStreamConsumerConnectWithFlags = dlfcn.dlsym(handle, 'cuEGLStreamConsumerConnectWithFlags')
        {{endif}}
        {{if True}}
        global __cuEGLStreamConsumerDisconnect
        __cuEGLStreamConsumerDisconnect = dlfcn.dlsym(handle, 'cuEGLStreamConsumerDisconnect')
        {{endif}}
        {{if True}}
        global __cuEGLStreamConsumerAcquireFrame
        __cuEGLStreamConsumerAcquireFrame = dlfcn.dlsym(handle, 'cuEGLStreamConsumerAcquireFrame')
        {{endif}}
        {{if True}}
        global __cuEGLStreamConsumerReleaseFrame
        __cuEGLStreamConsumerReleaseFrame = dlfcn.dlsym(handle, 'cuEGLStreamConsumerReleaseFrame')
        {{endif}}
        {{if True}}
        global __cuEGLStreamProducerConnect
        __cuEGLStreamProducerConnect = dlfcn.dlsym(handle, 'cuEGLStreamProducerConnect')
        {{endif}}
        {{if True}}
        global __cuEGLStreamProducerDisconnect
        __cuEGLStreamProducerDisconnect = dlfcn.dlsym(handle, 'cuEGLStreamProducerDisconnect')
        {{endif}}
        {{if True}}
        global __cuEGLStreamProducerPresentFrame
        __cuEGLStreamProducerPresentFrame = dlfcn.dlsym(handle, 'cuEGLStreamProducerPresentFrame')
        {{endif}}
        {{if True}}
        global __cuEGLStreamProducerReturnFrame
        __cuEGLStreamProducerReturnFrame = dlfcn.dlsym(handle, 'cuEGLStreamProducerReturnFrame')
        {{endif}}
        {{if True}}
        global __cuGraphicsResourceGetMappedEglFrame
        __cuGraphicsResourceGetMappedEglFrame = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedEglFrame')
        {{endif}}
        {{if True}}
        global __cuEventCreateFromEGLSync
        __cuEventCreateFromEGLSync = dlfcn.dlsym(handle, 'cuEventCreateFromEGLSync')
        {{endif}}
        {{if True}}
        global __cuGraphicsGLRegisterBuffer
        __cuGraphicsGLRegisterBuffer = dlfcn.dlsym(handle, 'cuGraphicsGLRegisterBuffer')
        {{endif}}
        {{if True}}
        global __cuGraphicsGLRegisterImage
        __cuGraphicsGLRegisterImage = dlfcn.dlsym(handle, 'cuGraphicsGLRegisterImage')
        {{endif}}
        {{if True}}
        global __cuGLGetDevices_v2
        __cuGLGetDevices_v2 = dlfcn.dlsym(handle, 'cuGLGetDevices_v2')
        {{endif}}
        {{if True}}
        global __cuVDPAUGetDevice
        __cuVDPAUGetDevice = dlfcn.dlsym(handle, 'cuVDPAUGetDevice')
        {{endif}}
        {{if True}}
        global __cuVDPAUCtxCreate_v2
        __cuVDPAUCtxCreate_v2 = dlfcn.dlsym(handle, 'cuVDPAUCtxCreate_v2')
        {{endif}}
        {{if True}}
        global __cuGraphicsVDPAURegisterVideoSurface
        __cuGraphicsVDPAURegisterVideoSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterVideoSurface')
        {{endif}}
        {{if True}}
        global __cuGraphicsVDPAURegisterOutputSurface
        __cuGraphicsVDPAURegisterOutputSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterOutputSurface')
        {{endif}}
        {{endif}}
        __cuPythonInit = True
        return 0

# Create a very small function to check whether we are init'ed, so the C
# compiler can inline it.
cdef inline int cuPythonInit() except -1 nogil:
    if __cuPythonInit:
        return 0
    return _cuPythonInit()

{{if 'cuGetErrorString' in found_functions}}

cdef CUresult _cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGetErrorString
    cuPythonInit()
    if __cuGetErrorString == NULL:
        with gil:
            raise RuntimeError('Function "cuGetErrorString" not found')
    err = (<CUresult (*)(CUresult, const char**) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGetErrorString)(error, pStr)
    return err
{{endif}}

{{if 'cuGetErrorName' in found_functions}}

cdef CUresult _cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGetErrorName
    cuPythonInit()
    if __cuGetErrorName == NULL:
        with gil:
            raise RuntimeError('Function "cuGetErrorName" not found')
    err = (<CUresult (*)(CUresult, const char**) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGetErrorName)(error, pStr)
    return err
{{endif}}

{{if 'cuInit' in found_functions}}

cdef CUresult _cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuInit
    cuPythonInit()
    if __cuInit == NULL:
        with gil:
            raise RuntimeError('Function "cuInit" not found')
    err = (<CUresult (*)(unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuInit)(Flags)
    return err
{{endif}}

{{if 'cuDriverGetVersion' in found_functions}}

cdef CUresult _cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDriverGetVersion
    cuPythonInit()
    if __cuDriverGetVersion == NULL:
        with gil:
            raise RuntimeError('Function "cuDriverGetVersion" not found')
    err = (<CUresult (*)(int*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDriverGetVersion)(driverVersion)
    return err
{{endif}}

{{if 'cuDeviceGet' in found_functions}}

cdef CUresult _cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGet
    cuPythonInit()
    if __cuDeviceGet == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGet" not found')
    err = (<CUresult (*)(CUdevice*, int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGet)(device, ordinal)
    return err
{{endif}}

{{if 'cuDeviceGetCount' in found_functions}}

cdef CUresult _cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetCount
    cuPythonInit()
    if __cuDeviceGetCount == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetCount" not found')
    err = (<CUresult (*)(int*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetCount)(count)
    return err
{{endif}}

{{if 'cuDeviceGetName' in found_functions}}

cdef CUresult _cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetName
    cuPythonInit()
    if __cuDeviceGetName == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetName" not found')
    err = (<CUresult (*)(char*, int, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetName)(name, length, dev)
    return err
{{endif}}

{{if 'cuDeviceGetUuid' in found_functions}}

cdef CUresult _cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetUuid
    cuPythonInit()
    if __cuDeviceGetUuid == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetUuid" not found')
    err = (<CUresult (*)(CUuuid*, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetUuid)(uuid, dev)
    return err
{{endif}}

{{if 'cuDeviceGetUuid_v2' in found_functions}}

cdef CUresult _cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetUuid_v2
    cuPythonInit()
    if __cuDeviceGetUuid_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetUuid_v2" not found')
    err = (<CUresult (*)(CUuuid*, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetUuid_v2)(uuid, dev)
    return err
{{endif}}

{{if 'cuDeviceGetLuid' in found_functions}}

cdef CUresult _cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetLuid
    cuPythonInit()
    if __cuDeviceGetLuid == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetLuid" not found')
    err = (<CUresult (*)(char*, unsigned int*, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetLuid)(luid, deviceNodeMask, dev)
    return err
{{endif}}

{{if 'cuDeviceTotalMem_v2' in found_functions}}

cdef CUresult _cuDeviceTotalMem_v2(size_t* numbytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceTotalMem_v2
    cuPythonInit()
    if __cuDeviceTotalMem_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceTotalMem_v2" not found')
    err = (<CUresult (*)(size_t*, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceTotalMem_v2)(numbytes, dev)
    return err
{{endif}}

{{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}}

cdef CUresult _cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format pformat, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetTexture1DLinearMaxWidth
    cuPythonInit()
    if __cuDeviceGetTexture1DLinearMaxWidth == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetTexture1DLinearMaxWidth" not found')
    err = (<CUresult (*)(size_t*, CUarray_format, unsigned, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetTexture1DLinearMaxWidth)(maxWidthInElements, pformat, numChannels, dev)
    return err
{{endif}}

{{if 'cuDeviceGetAttribute' in found_functions}}

cdef CUresult _cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetAttribute
    cuPythonInit()
    if __cuDeviceGetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetAttribute" not found')
    err = (<CUresult (*)(int*, CUdevice_attribute, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetAttribute)(pi, attrib, dev)
    return err
{{endif}}

{{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}}

cdef CUresult _cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetNvSciSyncAttributes
    cuPythonInit()
    if __cuDeviceGetNvSciSyncAttributes == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetNvSciSyncAttributes" not found')
    err = (<CUresult (*)(void*, CUdevice, int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetNvSciSyncAttributes)(nvSciSyncAttrList, dev, flags)
    return err
{{endif}}

{{if 'cuDeviceSetMemPool' in found_functions}}

cdef CUresult _cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceSetMemPool
    cuPythonInit()
    if __cuDeviceSetMemPool == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceSetMemPool" not found')
    err = (<CUresult (*)(CUdevice, CUmemoryPool) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceSetMemPool)(dev, pool)
    return err
{{endif}}

{{if 'cuDeviceGetMemPool' in found_functions}}

cdef CUresult _cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetMemPool
    cuPythonInit()
    if __cuDeviceGetMemPool == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetMemPool" not found')
    err = (<CUresult (*)(CUmemoryPool*, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetMemPool)(pool, dev)
    return err
{{endif}}

{{if 'cuDeviceGetDefaultMemPool' in found_functions}}

cdef CUresult _cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetDefaultMemPool
    cuPythonInit()
    if __cuDeviceGetDefaultMemPool == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetDefaultMemPool" not found')
    err = (<CUresult (*)(CUmemoryPool*, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetDefaultMemPool)(pool_out, dev)
    return err
{{endif}}

{{if 'cuDeviceGetExecAffinitySupport' in found_functions}}

cdef CUresult _cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType typename, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetExecAffinitySupport
    cuPythonInit()
    if __cuDeviceGetExecAffinitySupport == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetExecAffinitySupport" not found')
    err = (<CUresult (*)(int*, CUexecAffinityType, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetExecAffinitySupport)(pi, typename, dev)
    return err
{{endif}}

{{if 'cuFlushGPUDirectRDMAWrites' in found_functions}}

cdef CUresult _cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFlushGPUDirectRDMAWrites
    cuPythonInit()
    if __cuFlushGPUDirectRDMAWrites == NULL:
        with gil:
            raise RuntimeError('Function "cuFlushGPUDirectRDMAWrites" not found')
    err = (<CUresult (*)(CUflushGPUDirectRDMAWritesTarget, CUflushGPUDirectRDMAWritesScope) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFlushGPUDirectRDMAWrites)(target, scope)
    return err
{{endif}}

{{if 'cuDeviceGetProperties' in found_functions}}

cdef CUresult _cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetProperties
    cuPythonInit()
    if __cuDeviceGetProperties == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetProperties" not found')
    err = (<CUresult (*)(CUdevprop*, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetProperties)(prop, dev)
    return err
{{endif}}

{{if 'cuDeviceComputeCapability' in found_functions}}

cdef CUresult _cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceComputeCapability
    cuPythonInit()
    if __cuDeviceComputeCapability == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceComputeCapability" not found')
    err = (<CUresult (*)(int*, int*, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceComputeCapability)(major, minor, dev)
    return err
{{endif}}

{{if 'cuDevicePrimaryCtxRetain' in found_functions}}

cdef CUresult _cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDevicePrimaryCtxRetain
    cuPythonInit()
    if __cuDevicePrimaryCtxRetain == NULL:
        with gil:
            raise RuntimeError('Function "cuDevicePrimaryCtxRetain" not found')
    err = (<CUresult (*)(CUcontext*, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDevicePrimaryCtxRetain)(pctx, dev)
    return err
{{endif}}

{{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}}

cdef CUresult _cuDevicePrimaryCtxRelease_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDevicePrimaryCtxRelease_v2
    cuPythonInit()
    if __cuDevicePrimaryCtxRelease_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuDevicePrimaryCtxRelease_v2" not found')
    err = (<CUresult (*)(CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDevicePrimaryCtxRelease_v2)(dev)
    return err
{{endif}}

{{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}}

cdef CUresult _cuDevicePrimaryCtxSetFlags_v2(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDevicePrimaryCtxSetFlags_v2
    cuPythonInit()
    if __cuDevicePrimaryCtxSetFlags_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuDevicePrimaryCtxSetFlags_v2" not found')
    err = (<CUresult (*)(CUdevice, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDevicePrimaryCtxSetFlags_v2)(dev, flags)
    return err
{{endif}}

{{if 'cuDevicePrimaryCtxGetState' in found_functions}}

cdef CUresult _cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDevicePrimaryCtxGetState
    cuPythonInit()
    if __cuDevicePrimaryCtxGetState == NULL:
        with gil:
            raise RuntimeError('Function "cuDevicePrimaryCtxGetState" not found')
    err = (<CUresult (*)(CUdevice, unsigned int*, int*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDevicePrimaryCtxGetState)(dev, flags, active)
    return err
{{endif}}

{{if 'cuDevicePrimaryCtxReset_v2' in found_functions}}

cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDevicePrimaryCtxReset_v2
    cuPythonInit()
    if __cuDevicePrimaryCtxReset_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuDevicePrimaryCtxReset_v2" not found')
    err = (<CUresult (*)(CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDevicePrimaryCtxReset_v2)(dev)
    return err
{{endif}}

{{if 'cuCtxCreate_v2' in found_functions}}

cdef CUresult _cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxCreate_v2
    cuPythonInit()
    if __cuCtxCreate_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxCreate_v2" not found')
    err = (<CUresult (*)(CUcontext*, unsigned int, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxCreate_v2)(pctx, flags, dev)
    return err
{{endif}}

{{if 'cuCtxCreate_v3' in found_functions}}

cdef CUresult _cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxCreate_v3
    cuPythonInit()
    if __cuCtxCreate_v3 == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxCreate_v3" not found')
    err = (<CUresult (*)(CUcontext*, CUexecAffinityParam*, int, unsigned int, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxCreate_v3)(pctx, paramsArray, numParams, flags, dev)
    return err
{{endif}}

{{if 'cuCtxCreate_v4' in found_functions}}

cdef CUresult _cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxCreate_v4
    cuPythonInit()
    if __cuCtxCreate_v4 == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxCreate_v4" not found')
    err = (<CUresult (*)(CUcontext*, CUctxCreateParams*, unsigned int, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxCreate_v4)(pctx, ctxCreateParams, flags, dev)
    return err
{{endif}}

{{if 'cuCtxDestroy_v2' in found_functions}}

cdef CUresult _cuCtxDestroy_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxDestroy_v2
    cuPythonInit()
    if __cuCtxDestroy_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxDestroy_v2" not found')
    err = (<CUresult (*)(CUcontext) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxDestroy_v2)(ctx)
    return err
{{endif}}

{{if 'cuCtxPushCurrent_v2' in found_functions}}

cdef CUresult _cuCtxPushCurrent_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxPushCurrent_v2
    cuPythonInit()
    if __cuCtxPushCurrent_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxPushCurrent_v2" not found')
    err = (<CUresult (*)(CUcontext) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxPushCurrent_v2)(ctx)
    return err
{{endif}}

{{if 'cuCtxPopCurrent_v2' in found_functions}}

cdef CUresult _cuCtxPopCurrent_v2(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxPopCurrent_v2
    cuPythonInit()
    if __cuCtxPopCurrent_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxPopCurrent_v2" not found')
    err = (<CUresult (*)(CUcontext*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxPopCurrent_v2)(pctx)
    return err
{{endif}}

{{if 'cuCtxSetCurrent' in found_functions}}

cdef CUresult _cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxSetCurrent
    cuPythonInit()
    if __cuCtxSetCurrent == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxSetCurrent" not found')
    err = (<CUresult (*)(CUcontext) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxSetCurrent)(ctx)
    return err
{{endif}}

{{if 'cuCtxGetCurrent' in found_functions}}

cdef CUresult _cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxGetCurrent
    cuPythonInit()
    if __cuCtxGetCurrent == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxGetCurrent" not found')
    err = (<CUresult (*)(CUcontext*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxGetCurrent)(pctx)
    return err
{{endif}}

{{if 'cuCtxGetDevice' in found_functions}}

cdef CUresult _cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxGetDevice
    cuPythonInit()
    if __cuCtxGetDevice == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxGetDevice" not found')
    err = (<CUresult (*)(CUdevice*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxGetDevice)(device)
    return err
{{endif}}

{{if 'cuCtxGetFlags' in found_functions}}

cdef CUresult _cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxGetFlags
    cuPythonInit()
    if __cuCtxGetFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxGetFlags" not found')
    err = (<CUresult (*)(unsigned int*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxGetFlags)(flags)
    return err
{{endif}}

{{if 'cuCtxSetFlags' in found_functions}}

cdef CUresult _cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxSetFlags
    cuPythonInit()
    if __cuCtxSetFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxSetFlags" not found')
    err = (<CUresult (*)(unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxSetFlags)(flags)
    return err
{{endif}}

{{if 'cuCtxGetId' in found_functions}}

cdef CUresult _cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxGetId
    cuPythonInit()
    if __cuCtxGetId == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxGetId" not found')
    err = (<CUresult (*)(CUcontext, unsigned long long*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxGetId)(ctx, ctxId)
    return err
{{endif}}

{{if 'cuCtxSynchronize' in found_functions}}

cdef CUresult _cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxSynchronize
    cuPythonInit()
    if __cuCtxSynchronize == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxSynchronize" not found')
    err = (<CUresult (*)() except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxSynchronize)()
    return err
{{endif}}

{{if 'cuCtxSetLimit' in found_functions}}

cdef CUresult _cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxSetLimit
    cuPythonInit()
    if __cuCtxSetLimit == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxSetLimit" not found')
    err = (<CUresult (*)(CUlimit, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxSetLimit)(limit, value)
    return err
{{endif}}

{{if 'cuCtxGetLimit' in found_functions}}

cdef CUresult _cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxGetLimit
    cuPythonInit()
    if __cuCtxGetLimit == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxGetLimit" not found')
    err = (<CUresult (*)(size_t*, CUlimit) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxGetLimit)(pvalue, limit)
    return err
{{endif}}

{{if 'cuCtxGetCacheConfig' in found_functions}}

cdef CUresult _cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxGetCacheConfig
    cuPythonInit()
    if __cuCtxGetCacheConfig == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxGetCacheConfig" not found')
    err = (<CUresult (*)(CUfunc_cache*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxGetCacheConfig)(pconfig)
    return err
{{endif}}

{{if 'cuCtxSetCacheConfig' in found_functions}}

cdef CUresult _cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxSetCacheConfig
    cuPythonInit()
    if __cuCtxSetCacheConfig == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxSetCacheConfig" not found')
    err = (<CUresult (*)(CUfunc_cache) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxSetCacheConfig)(config)
    return err
{{endif}}

{{if 'cuCtxGetApiVersion' in found_functions}}

cdef CUresult _cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxGetApiVersion
    cuPythonInit()
    if __cuCtxGetApiVersion == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxGetApiVersion" not found')
    err = (<CUresult (*)(CUcontext, unsigned int*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxGetApiVersion)(ctx, version)
    return err
{{endif}}

{{if 'cuCtxGetStreamPriorityRange' in found_functions}}

cdef CUresult _cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxGetStreamPriorityRange
    cuPythonInit()
    if __cuCtxGetStreamPriorityRange == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxGetStreamPriorityRange" not found')
    err = (<CUresult (*)(int*, int*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxGetStreamPriorityRange)(leastPriority, greatestPriority)
    return err
{{endif}}

{{if 'cuCtxResetPersistingL2Cache' in found_functions}}

cdef CUresult _cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxResetPersistingL2Cache
    cuPythonInit()
    if __cuCtxResetPersistingL2Cache == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxResetPersistingL2Cache" not found')
    err = (<CUresult (*)() except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxResetPersistingL2Cache)()
    return err
{{endif}}

{{if 'cuCtxGetExecAffinity' in found_functions}}

cdef CUresult _cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType typename) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxGetExecAffinity
    cuPythonInit()
    if __cuCtxGetExecAffinity == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxGetExecAffinity" not found')
    err = (<CUresult (*)(CUexecAffinityParam*, CUexecAffinityType) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxGetExecAffinity)(pExecAffinity, typename)
    return err
{{endif}}

{{if 'cuCtxRecordEvent' in found_functions}}

cdef CUresult _cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxRecordEvent
    cuPythonInit()
    if __cuCtxRecordEvent == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxRecordEvent" not found')
    err = (<CUresult (*)(CUcontext, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxRecordEvent)(hCtx, hEvent)
    return err
{{endif}}

{{if 'cuCtxWaitEvent' in found_functions}}

cdef CUresult _cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxWaitEvent
    cuPythonInit()
    if __cuCtxWaitEvent == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxWaitEvent" not found')
    err = (<CUresult (*)(CUcontext, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxWaitEvent)(hCtx, hEvent)
    return err
{{endif}}

{{if 'cuCtxAttach' in found_functions}}

cdef CUresult _cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxAttach
    cuPythonInit()
    if __cuCtxAttach == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxAttach" not found')
    err = (<CUresult (*)(CUcontext*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxAttach)(pctx, flags)
    return err
{{endif}}

{{if 'cuCtxDetach' in found_functions}}

cdef CUresult _cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxDetach
    cuPythonInit()
    if __cuCtxDetach == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxDetach" not found')
    err = (<CUresult (*)(CUcontext) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxDetach)(ctx)
    return err
{{endif}}

{{if 'cuCtxGetSharedMemConfig' in found_functions}}

cdef CUresult _cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxGetSharedMemConfig
    cuPythonInit()
    if __cuCtxGetSharedMemConfig == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxGetSharedMemConfig" not found')
    err = (<CUresult (*)(CUsharedconfig*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxGetSharedMemConfig)(pConfig)
    return err
{{endif}}

{{if 'cuCtxSetSharedMemConfig' in found_functions}}

cdef CUresult _cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxSetSharedMemConfig
    cuPythonInit()
    if __cuCtxSetSharedMemConfig == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxSetSharedMemConfig" not found')
    err = (<CUresult (*)(CUsharedconfig) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxSetSharedMemConfig)(config)
    return err
{{endif}}

{{if 'cuModuleLoad' in found_functions}}

cdef CUresult _cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleLoad
    cuPythonInit()
    if __cuModuleLoad == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleLoad" not found')
    err = (<CUresult (*)(CUmodule*, const char*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleLoad)(module, fname)
    return err
{{endif}}

{{if 'cuModuleLoadData' in found_functions}}

cdef CUresult _cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleLoadData
    cuPythonInit()
    if __cuModuleLoadData == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleLoadData" not found')
    err = (<CUresult (*)(CUmodule*, const void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleLoadData)(module, image)
    return err
{{endif}}

{{if 'cuModuleLoadDataEx' in found_functions}}

cdef CUresult _cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleLoadDataEx
    cuPythonInit()
    if __cuModuleLoadDataEx == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleLoadDataEx" not found')
    err = (<CUresult (*)(CUmodule*, const void*, unsigned int, CUjit_option*, void**) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleLoadDataEx)(module, image, numOptions, options, optionValues)
    return err
{{endif}}

{{if 'cuModuleLoadFatBinary' in found_functions}}

cdef CUresult _cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleLoadFatBinary
    cuPythonInit()
    if __cuModuleLoadFatBinary == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleLoadFatBinary" not found')
    err = (<CUresult (*)(CUmodule*, const void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleLoadFatBinary)(module, fatCubin)
    return err
{{endif}}

{{if 'cuModuleUnload' in found_functions}}

cdef CUresult _cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleUnload
    cuPythonInit()
    if __cuModuleUnload == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleUnload" not found')
    err = (<CUresult (*)(CUmodule) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleUnload)(hmod)
    return err
{{endif}}

{{if 'cuModuleGetLoadingMode' in found_functions}}

cdef CUresult _cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleGetLoadingMode
    cuPythonInit()
    if __cuModuleGetLoadingMode == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleGetLoadingMode" not found')
    err = (<CUresult (*)(CUmoduleLoadingMode*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleGetLoadingMode)(mode)
    return err
{{endif}}

{{if 'cuModuleGetFunction' in found_functions}}

cdef CUresult _cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleGetFunction
    cuPythonInit()
    if __cuModuleGetFunction == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleGetFunction" not found')
    err = (<CUresult (*)(CUfunction*, CUmodule, const char*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleGetFunction)(hfunc, hmod, name)
    return err
{{endif}}

{{if 'cuModuleGetFunctionCount' in found_functions}}

cdef CUresult _cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleGetFunctionCount
    cuPythonInit()
    if __cuModuleGetFunctionCount == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleGetFunctionCount" not found')
    err = (<CUresult (*)(unsigned int*, CUmodule) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleGetFunctionCount)(count, mod)
    return err
{{endif}}

{{if 'cuModuleEnumerateFunctions' in found_functions}}

cdef CUresult _cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleEnumerateFunctions
    cuPythonInit()
    if __cuModuleEnumerateFunctions == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleEnumerateFunctions" not found')
    err = (<CUresult (*)(CUfunction*, unsigned int, CUmodule) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleEnumerateFunctions)(functions, numFunctions, mod)
    return err
{{endif}}

{{if 'cuModuleGetGlobal_v2' in found_functions}}

cdef CUresult _cuModuleGetGlobal_v2(CUdeviceptr* dptr, size_t* numbytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleGetGlobal_v2
    cuPythonInit()
    if __cuModuleGetGlobal_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleGetGlobal_v2" not found')
    err = (<CUresult (*)(CUdeviceptr*, size_t*, CUmodule, const char*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleGetGlobal_v2)(dptr, numbytes, hmod, name)
    return err
{{endif}}

{{if 'cuLinkCreate_v2' in found_functions}}

cdef CUresult _cuLinkCreate_v2(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLinkCreate_v2
    cuPythonInit()
    if __cuLinkCreate_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuLinkCreate_v2" not found')
    err = (<CUresult (*)(unsigned int, CUjit_option*, void**, CUlinkState*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLinkCreate_v2)(numOptions, options, optionValues, stateOut)
    return err
{{endif}}

{{if 'cuLinkAddData_v2' in found_functions}}

cdef CUresult _cuLinkAddData_v2(CUlinkState state, CUjitInputType typename, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLinkAddData_v2
    cuPythonInit()
    if __cuLinkAddData_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuLinkAddData_v2" not found')
    err = (<CUresult (*)(CUlinkState, CUjitInputType, void*, size_t, const char*, unsigned int, CUjit_option*, void**) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLinkAddData_v2)(state, typename, data, size, name, numOptions, options, optionValues)
    return err
{{endif}}

{{if 'cuLinkAddFile_v2' in found_functions}}

cdef CUresult _cuLinkAddFile_v2(CUlinkState state, CUjitInputType typename, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLinkAddFile_v2
    cuPythonInit()
    if __cuLinkAddFile_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuLinkAddFile_v2" not found')
    err = (<CUresult (*)(CUlinkState, CUjitInputType, const char*, unsigned int, CUjit_option*, void**) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLinkAddFile_v2)(state, typename, path, numOptions, options, optionValues)
    return err
{{endif}}

{{if 'cuLinkComplete' in found_functions}}

cdef CUresult _cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLinkComplete
    cuPythonInit()
    if __cuLinkComplete == NULL:
        with gil:
            raise RuntimeError('Function "cuLinkComplete" not found')
    err = (<CUresult (*)(CUlinkState, void**, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLinkComplete)(state, cubinOut, sizeOut)
    return err
{{endif}}

{{if 'cuLinkDestroy' in found_functions}}

cdef CUresult _cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLinkDestroy
    cuPythonInit()
    if __cuLinkDestroy == NULL:
        with gil:
            raise RuntimeError('Function "cuLinkDestroy" not found')
    err = (<CUresult (*)(CUlinkState) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLinkDestroy)(state)
    return err
{{endif}}

{{if 'cuModuleGetTexRef' in found_functions}}

cdef CUresult _cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleGetTexRef
    cuPythonInit()
    if __cuModuleGetTexRef == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleGetTexRef" not found')
    err = (<CUresult (*)(CUtexref*, CUmodule, const char*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleGetTexRef)(pTexRef, hmod, name)
    return err
{{endif}}

{{if 'cuModuleGetSurfRef' in found_functions}}

cdef CUresult _cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuModuleGetSurfRef
    cuPythonInit()
    if __cuModuleGetSurfRef == NULL:
        with gil:
            raise RuntimeError('Function "cuModuleGetSurfRef" not found')
    err = (<CUresult (*)(CUsurfref*, CUmodule, const char*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuModuleGetSurfRef)(pSurfRef, hmod, name)
    return err
{{endif}}

{{if 'cuLibraryLoadData' in found_functions}}

cdef CUresult _cuLibraryLoadData(CUlibrary* library, const void* code, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLibraryLoadData
    cuPythonInit()
    if __cuLibraryLoadData == NULL:
        with gil:
            raise RuntimeError('Function "cuLibraryLoadData" not found')
    err = (<CUresult (*)(CUlibrary*, const void*, CUjit_option*, void**, unsigned int, CUlibraryOption*, void**, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLibraryLoadData)(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions)
    return err
{{endif}}

{{if 'cuLibraryLoadFromFile' in found_functions}}

cdef CUresult _cuLibraryLoadFromFile(CUlibrary* library, const char* fileName, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLibraryLoadFromFile
    cuPythonInit()
    if __cuLibraryLoadFromFile == NULL:
        with gil:
            raise RuntimeError('Function "cuLibraryLoadFromFile" not found')
    err = (<CUresult (*)(CUlibrary*, const char*, CUjit_option*, void**, unsigned int, CUlibraryOption*, void**, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLibraryLoadFromFile)(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions)
    return err
{{endif}}

{{if 'cuLibraryUnload' in found_functions}}

cdef CUresult _cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLibraryUnload
    cuPythonInit()
    if __cuLibraryUnload == NULL:
        with gil:
            raise RuntimeError('Function "cuLibraryUnload" not found')
    err = (<CUresult (*)(CUlibrary) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLibraryUnload)(library)
    return err
{{endif}}

{{if 'cuLibraryGetKernel' in found_functions}}

cdef CUresult _cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLibraryGetKernel
    cuPythonInit()
    if __cuLibraryGetKernel == NULL:
        with gil:
            raise RuntimeError('Function "cuLibraryGetKernel" not found')
    err = (<CUresult (*)(CUkernel*, CUlibrary, const char*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLibraryGetKernel)(pKernel, library, name)
    return err
{{endif}}

{{if 'cuLibraryGetKernelCount' in found_functions}}

cdef CUresult _cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLibraryGetKernelCount
    cuPythonInit()
    if __cuLibraryGetKernelCount == NULL:
        with gil:
            raise RuntimeError('Function "cuLibraryGetKernelCount" not found')
    err = (<CUresult (*)(unsigned int*, CUlibrary) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLibraryGetKernelCount)(count, lib)
    return err
{{endif}}

{{if 'cuLibraryEnumerateKernels' in found_functions}}

cdef CUresult _cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLibraryEnumerateKernels
    cuPythonInit()
    if __cuLibraryEnumerateKernels == NULL:
        with gil:
            raise RuntimeError('Function "cuLibraryEnumerateKernels" not found')
    err = (<CUresult (*)(CUkernel*, unsigned int, CUlibrary) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLibraryEnumerateKernels)(kernels, numKernels, lib)
    return err
{{endif}}

{{if 'cuLibraryGetModule' in found_functions}}

cdef CUresult _cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLibraryGetModule
    cuPythonInit()
    if __cuLibraryGetModule == NULL:
        with gil:
            raise RuntimeError('Function "cuLibraryGetModule" not found')
    err = (<CUresult (*)(CUmodule*, CUlibrary) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLibraryGetModule)(pMod, library)
    return err
{{endif}}

{{if 'cuKernelGetFunction' in found_functions}}

cdef CUresult _cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuKernelGetFunction
    cuPythonInit()
    if __cuKernelGetFunction == NULL:
        with gil:
            raise RuntimeError('Function "cuKernelGetFunction" not found')
    err = (<CUresult (*)(CUfunction*, CUkernel) except ?CUDA_ERROR_NOT_FOUND nogil> __cuKernelGetFunction)(pFunc, kernel)
    return err
{{endif}}

{{if 'cuKernelGetLibrary' in found_functions}}

cdef CUresult _cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuKernelGetLibrary
    cuPythonInit()
    if __cuKernelGetLibrary == NULL:
        with gil:
            raise RuntimeError('Function "cuKernelGetLibrary" not found')
    err = (<CUresult (*)(CUlibrary*, CUkernel) except ?CUDA_ERROR_NOT_FOUND nogil> __cuKernelGetLibrary)(pLib, kernel)
    return err
{{endif}}

{{if 'cuLibraryGetGlobal' in found_functions}}

cdef CUresult _cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLibraryGetGlobal
    cuPythonInit()
    if __cuLibraryGetGlobal == NULL:
        with gil:
            raise RuntimeError('Function "cuLibraryGetGlobal" not found')
    err = (<CUresult (*)(CUdeviceptr*, size_t*, CUlibrary, const char*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLibraryGetGlobal)(dptr, numbytes, library, name)
    return err
{{endif}}

{{if 'cuLibraryGetManaged' in found_functions}}

cdef CUresult _cuLibraryGetManaged(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLibraryGetManaged
    cuPythonInit()
    if __cuLibraryGetManaged == NULL:
        with gil:
            raise RuntimeError('Function "cuLibraryGetManaged" not found')
    err = (<CUresult (*)(CUdeviceptr*, size_t*, CUlibrary, const char*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLibraryGetManaged)(dptr, numbytes, library, name)
    return err
{{endif}}

{{if 'cuLibraryGetUnifiedFunction' in found_functions}}

cdef CUresult _cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLibraryGetUnifiedFunction
    cuPythonInit()
    if __cuLibraryGetUnifiedFunction == NULL:
        with gil:
            raise RuntimeError('Function "cuLibraryGetUnifiedFunction" not found')
    err = (<CUresult (*)(void**, CUlibrary, const char*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLibraryGetUnifiedFunction)(fptr, library, symbol)
    return err
{{endif}}

{{if 'cuKernelGetAttribute' in found_functions}}

cdef CUresult _cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuKernelGetAttribute
    cuPythonInit()
    if __cuKernelGetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuKernelGetAttribute" not found')
    err = (<CUresult (*)(int*, CUfunction_attribute, CUkernel, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuKernelGetAttribute)(pi, attrib, kernel, dev)
    return err
{{endif}}

{{if 'cuKernelSetAttribute' in found_functions}}

cdef CUresult _cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuKernelSetAttribute
    cuPythonInit()
    if __cuKernelSetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuKernelSetAttribute" not found')
    err = (<CUresult (*)(CUfunction_attribute, int, CUkernel, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuKernelSetAttribute)(attrib, val, kernel, dev)
    return err
{{endif}}

{{if 'cuKernelSetCacheConfig' in found_functions}}

cdef CUresult _cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuKernelSetCacheConfig
    cuPythonInit()
    if __cuKernelSetCacheConfig == NULL:
        with gil:
            raise RuntimeError('Function "cuKernelSetCacheConfig" not found')
    err = (<CUresult (*)(CUkernel, CUfunc_cache, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuKernelSetCacheConfig)(kernel, config, dev)
    return err
{{endif}}

{{if 'cuKernelGetName' in found_functions}}

cdef CUresult _cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuKernelGetName
    cuPythonInit()
    if __cuKernelGetName == NULL:
        with gil:
            raise RuntimeError('Function "cuKernelGetName" not found')
    err = (<CUresult (*)(const char**, CUkernel) except ?CUDA_ERROR_NOT_FOUND nogil> __cuKernelGetName)(name, hfunc)
    return err
{{endif}}

{{if 'cuKernelGetParamInfo' in found_functions}}

cdef CUresult _cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuKernelGetParamInfo
    cuPythonInit()
    if __cuKernelGetParamInfo == NULL:
        with gil:
            raise RuntimeError('Function "cuKernelGetParamInfo" not found')
    err = (<CUresult (*)(CUkernel, size_t, size_t*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuKernelGetParamInfo)(kernel, paramIndex, paramOffset, paramSize)
    return err
{{endif}}

{{if 'cuMemGetInfo_v2' in found_functions}}

cdef CUresult _cuMemGetInfo_v2(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemGetInfo_v2
    cuPythonInit()
    if __cuMemGetInfo_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemGetInfo_v2" not found')
    err = (<CUresult (*)(size_t*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemGetInfo_v2)(free, total)
    return err
{{endif}}

{{if 'cuMemAlloc_v2' in found_functions}}

cdef CUresult _cuMemAlloc_v2(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemAlloc_v2
    cuPythonInit()
    if __cuMemAlloc_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemAlloc_v2" not found')
    err = (<CUresult (*)(CUdeviceptr*, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemAlloc_v2)(dptr, bytesize)
    return err
{{endif}}

{{if 'cuMemAllocPitch_v2' in found_functions}}

cdef CUresult _cuMemAllocPitch_v2(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemAllocPitch_v2
    cuPythonInit()
    if __cuMemAllocPitch_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemAllocPitch_v2" not found')
    err = (<CUresult (*)(CUdeviceptr*, size_t*, size_t, size_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemAllocPitch_v2)(dptr, pPitch, WidthInBytes, Height, ElementSizeBytes)
    return err
{{endif}}

{{if 'cuMemFree_v2' in found_functions}}

cdef CUresult _cuMemFree_v2(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemFree_v2
    cuPythonInit()
    if __cuMemFree_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemFree_v2" not found')
    err = (<CUresult (*)(CUdeviceptr) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemFree_v2)(dptr)
    return err
{{endif}}

{{if 'cuMemGetAddressRange_v2' in found_functions}}

cdef CUresult _cuMemGetAddressRange_v2(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemGetAddressRange_v2
    cuPythonInit()
    if __cuMemGetAddressRange_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemGetAddressRange_v2" not found')
    err = (<CUresult (*)(CUdeviceptr*, size_t*, CUdeviceptr) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemGetAddressRange_v2)(pbase, psize, dptr)
    return err
{{endif}}

{{if 'cuMemAllocHost_v2' in found_functions}}

cdef CUresult _cuMemAllocHost_v2(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemAllocHost_v2
    cuPythonInit()
    if __cuMemAllocHost_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemAllocHost_v2" not found')
    err = (<CUresult (*)(void**, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemAllocHost_v2)(pp, bytesize)
    return err
{{endif}}

{{if 'cuMemFreeHost' in found_functions}}

cdef CUresult _cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemFreeHost
    cuPythonInit()
    if __cuMemFreeHost == NULL:
        with gil:
            raise RuntimeError('Function "cuMemFreeHost" not found')
    err = (<CUresult (*)(void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemFreeHost)(p)
    return err
{{endif}}

{{if 'cuMemHostAlloc' in found_functions}}

cdef CUresult _cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemHostAlloc
    cuPythonInit()
    if __cuMemHostAlloc == NULL:
        with gil:
            raise RuntimeError('Function "cuMemHostAlloc" not found')
    err = (<CUresult (*)(void**, size_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemHostAlloc)(pp, bytesize, Flags)
    return err
{{endif}}

{{if 'cuMemHostGetDevicePointer_v2' in found_functions}}

cdef CUresult _cuMemHostGetDevicePointer_v2(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemHostGetDevicePointer_v2
    cuPythonInit()
    if __cuMemHostGetDevicePointer_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemHostGetDevicePointer_v2" not found')
    err = (<CUresult (*)(CUdeviceptr*, void*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemHostGetDevicePointer_v2)(pdptr, p, Flags)
    return err
{{endif}}

{{if 'cuMemHostGetFlags' in found_functions}}

cdef CUresult _cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemHostGetFlags
    cuPythonInit()
    if __cuMemHostGetFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuMemHostGetFlags" not found')
    err = (<CUresult (*)(unsigned int*, void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemHostGetFlags)(pFlags, p)
    return err
{{endif}}

{{if 'cuMemAllocManaged' in found_functions}}

cdef CUresult _cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemAllocManaged
    cuPythonInit()
    if __cuMemAllocManaged == NULL:
        with gil:
            raise RuntimeError('Function "cuMemAllocManaged" not found')
    err = (<CUresult (*)(CUdeviceptr*, size_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemAllocManaged)(dptr, bytesize, flags)
    return err
{{endif}}

{{if 'cuDeviceRegisterAsyncNotification' in found_functions}}

cdef CUresult _cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceRegisterAsyncNotification
    cuPythonInit()
    if __cuDeviceRegisterAsyncNotification == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceRegisterAsyncNotification" not found')
    err = (<CUresult (*)(CUdevice, CUasyncCallback, void*, CUasyncCallbackHandle*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceRegisterAsyncNotification)(device, callbackFunc, userData, callback)
    return err
{{endif}}

{{if 'cuDeviceUnregisterAsyncNotification' in found_functions}}

cdef CUresult _cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceUnregisterAsyncNotification
    cuPythonInit()
    if __cuDeviceUnregisterAsyncNotification == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceUnregisterAsyncNotification" not found')
    err = (<CUresult (*)(CUdevice, CUasyncCallbackHandle) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceUnregisterAsyncNotification)(device, callback)
    return err
{{endif}}

{{if 'cuDeviceGetByPCIBusId' in found_functions}}

cdef CUresult _cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetByPCIBusId
    cuPythonInit()
    if __cuDeviceGetByPCIBusId == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetByPCIBusId" not found')
    err = (<CUresult (*)(CUdevice*, const char*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetByPCIBusId)(dev, pciBusId)
    return err
{{endif}}

{{if 'cuDeviceGetPCIBusId' in found_functions}}

cdef CUresult _cuDeviceGetPCIBusId(char* pciBusId, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetPCIBusId
    cuPythonInit()
    if __cuDeviceGetPCIBusId == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetPCIBusId" not found')
    err = (<CUresult (*)(char*, int, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetPCIBusId)(pciBusId, length, dev)
    return err
{{endif}}

{{if 'cuIpcGetEventHandle' in found_functions}}

cdef CUresult _cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuIpcGetEventHandle
    cuPythonInit()
    if __cuIpcGetEventHandle == NULL:
        with gil:
            raise RuntimeError('Function "cuIpcGetEventHandle" not found')
    err = (<CUresult (*)(CUipcEventHandle*, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuIpcGetEventHandle)(pHandle, event)
    return err
{{endif}}

{{if 'cuIpcOpenEventHandle' in found_functions}}

cdef CUresult _cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuIpcOpenEventHandle
    cuPythonInit()
    if __cuIpcOpenEventHandle == NULL:
        with gil:
            raise RuntimeError('Function "cuIpcOpenEventHandle" not found')
    err = (<CUresult (*)(CUevent*, CUipcEventHandle) except ?CUDA_ERROR_NOT_FOUND nogil> __cuIpcOpenEventHandle)(phEvent, handle)
    return err
{{endif}}

{{if 'cuIpcGetMemHandle' in found_functions}}

cdef CUresult _cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuIpcGetMemHandle
    cuPythonInit()
    if __cuIpcGetMemHandle == NULL:
        with gil:
            raise RuntimeError('Function "cuIpcGetMemHandle" not found')
    err = (<CUresult (*)(CUipcMemHandle*, CUdeviceptr) except ?CUDA_ERROR_NOT_FOUND nogil> __cuIpcGetMemHandle)(pHandle, dptr)
    return err
{{endif}}

{{if 'cuIpcOpenMemHandle_v2' in found_functions}}

cdef CUresult _cuIpcOpenMemHandle_v2(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuIpcOpenMemHandle_v2
    cuPythonInit()
    if __cuIpcOpenMemHandle_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuIpcOpenMemHandle_v2" not found')
    err = (<CUresult (*)(CUdeviceptr*, CUipcMemHandle, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuIpcOpenMemHandle_v2)(pdptr, handle, Flags)
    return err
{{endif}}

{{if 'cuIpcCloseMemHandle' in found_functions}}

cdef CUresult _cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuIpcCloseMemHandle
    cuPythonInit()
    if __cuIpcCloseMemHandle == NULL:
        with gil:
            raise RuntimeError('Function "cuIpcCloseMemHandle" not found')
    err = (<CUresult (*)(CUdeviceptr) except ?CUDA_ERROR_NOT_FOUND nogil> __cuIpcCloseMemHandle)(dptr)
    return err
{{endif}}

{{if 'cuMemHostRegister_v2' in found_functions}}

cdef CUresult _cuMemHostRegister_v2(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemHostRegister_v2
    cuPythonInit()
    if __cuMemHostRegister_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemHostRegister_v2" not found')
    err = (<CUresult (*)(void*, size_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemHostRegister_v2)(p, bytesize, Flags)
    return err
{{endif}}

{{if 'cuMemHostUnregister' in found_functions}}

cdef CUresult _cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemHostUnregister
    cuPythonInit()
    if __cuMemHostUnregister == NULL:
        with gil:
            raise RuntimeError('Function "cuMemHostUnregister" not found')
    err = (<CUresult (*)(void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemHostUnregister)(p)
    return err
{{endif}}

{{if 'cuMemcpy' in found_functions}}

cdef CUresult _cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpy
    cuPythonInit()
    if __cuMemcpy == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpy" not found')
    err = (<CUresult (*)(CUdeviceptr, CUdeviceptr, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpy)(dst, src, ByteCount)
    return err
{{endif}}

{{if 'cuMemcpyPeer' in found_functions}}

cdef CUresult _cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyPeer
    cuPythonInit()
    if __cuMemcpyPeer == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyPeer" not found')
    err = (<CUresult (*)(CUdeviceptr, CUcontext, CUdeviceptr, CUcontext, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyPeer)(dstDevice, dstContext, srcDevice, srcContext, ByteCount)
    return err
{{endif}}

{{if 'cuMemcpyHtoD_v2' in found_functions}}

cdef CUresult _cuMemcpyHtoD_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyHtoD_v2
    cuPythonInit()
    if __cuMemcpyHtoD_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyHtoD_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, const void*, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyHtoD_v2)(dstDevice, srcHost, ByteCount)
    return err
{{endif}}

{{if 'cuMemcpyDtoH_v2' in found_functions}}

cdef CUresult _cuMemcpyDtoH_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyDtoH_v2
    cuPythonInit()
    if __cuMemcpyDtoH_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyDtoH_v2" not found')
    err = (<CUresult (*)(void*, CUdeviceptr, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyDtoH_v2)(dstHost, srcDevice, ByteCount)
    return err
{{endif}}

{{if 'cuMemcpyDtoD_v2' in found_functions}}

cdef CUresult _cuMemcpyDtoD_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyDtoD_v2
    cuPythonInit()
    if __cuMemcpyDtoD_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyDtoD_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, CUdeviceptr, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyDtoD_v2)(dstDevice, srcDevice, ByteCount)
    return err
{{endif}}

{{if 'cuMemcpyDtoA_v2' in found_functions}}

cdef CUresult _cuMemcpyDtoA_v2(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyDtoA_v2
    cuPythonInit()
    if __cuMemcpyDtoA_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyDtoA_v2" not found')
    err = (<CUresult (*)(CUarray, size_t, CUdeviceptr, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyDtoA_v2)(dstArray, dstOffset, srcDevice, ByteCount)
    return err
{{endif}}

{{if 'cuMemcpyAtoD_v2' in found_functions}}

cdef CUresult _cuMemcpyAtoD_v2(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyAtoD_v2
    cuPythonInit()
    if __cuMemcpyAtoD_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyAtoD_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, CUarray, size_t, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyAtoD_v2)(dstDevice, srcArray, srcOffset, ByteCount)
    return err
{{endif}}

{{if 'cuMemcpyHtoA_v2' in found_functions}}

cdef CUresult _cuMemcpyHtoA_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyHtoA_v2
    cuPythonInit()
    if __cuMemcpyHtoA_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyHtoA_v2" not found')
    err = (<CUresult (*)(CUarray, size_t, const void*, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyHtoA_v2)(dstArray, dstOffset, srcHost, ByteCount)
    return err
{{endif}}

{{if 'cuMemcpyAtoH_v2' in found_functions}}

cdef CUresult _cuMemcpyAtoH_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyAtoH_v2
    cuPythonInit()
    if __cuMemcpyAtoH_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyAtoH_v2" not found')
    err = (<CUresult (*)(void*, CUarray, size_t, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyAtoH_v2)(dstHost, srcArray, srcOffset, ByteCount)
    return err
{{endif}}

{{if 'cuMemcpyAtoA_v2' in found_functions}}

cdef CUresult _cuMemcpyAtoA_v2(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyAtoA_v2
    cuPythonInit()
    if __cuMemcpyAtoA_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyAtoA_v2" not found')
    err = (<CUresult (*)(CUarray, size_t, CUarray, size_t, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyAtoA_v2)(dstArray, dstOffset, srcArray, srcOffset, ByteCount)
    return err
{{endif}}

{{if 'cuMemcpy2D_v2' in found_functions}}

cdef CUresult _cuMemcpy2D_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpy2D_v2
    cuPythonInit()
    if __cuMemcpy2D_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpy2D_v2" not found')
    err = (<CUresult (*)(const CUDA_MEMCPY2D*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpy2D_v2)(pCopy)
    return err
{{endif}}

{{if 'cuMemcpy2DUnaligned_v2' in found_functions}}

cdef CUresult _cuMemcpy2DUnaligned_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpy2DUnaligned_v2
    cuPythonInit()
    if __cuMemcpy2DUnaligned_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpy2DUnaligned_v2" not found')
    err = (<CUresult (*)(const CUDA_MEMCPY2D*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpy2DUnaligned_v2)(pCopy)
    return err
{{endif}}

{{if 'cuMemcpy3D_v2' in found_functions}}

cdef CUresult _cuMemcpy3D_v2(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpy3D_v2
    cuPythonInit()
    if __cuMemcpy3D_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpy3D_v2" not found')
    err = (<CUresult (*)(const CUDA_MEMCPY3D*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpy3D_v2)(pCopy)
    return err
{{endif}}

{{if 'cuMemcpy3DPeer' in found_functions}}

cdef CUresult _cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpy3DPeer
    cuPythonInit()
    if __cuMemcpy3DPeer == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpy3DPeer" not found')
    err = (<CUresult (*)(const CUDA_MEMCPY3D_PEER*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpy3DPeer)(pCopy)
    return err
{{endif}}

{{if 'cuMemcpyAsync' in found_functions}}

cdef CUresult _cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyAsync
    cuPythonInit()
    if __cuMemcpyAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyAsync" not found')
    err = (<CUresult (*)(CUdeviceptr, CUdeviceptr, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyAsync)(dst, src, ByteCount, hStream)
    return err
{{endif}}

{{if 'cuMemcpyPeerAsync' in found_functions}}

cdef CUresult _cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyPeerAsync
    cuPythonInit()
    if __cuMemcpyPeerAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyPeerAsync" not found')
    err = (<CUresult (*)(CUdeviceptr, CUcontext, CUdeviceptr, CUcontext, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyPeerAsync)(dstDevice, dstContext, srcDevice, srcContext, ByteCount, hStream)
    return err
{{endif}}

{{if 'cuMemcpyHtoDAsync_v2' in found_functions}}

cdef CUresult _cuMemcpyHtoDAsync_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyHtoDAsync_v2
    cuPythonInit()
    if __cuMemcpyHtoDAsync_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyHtoDAsync_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, const void*, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyHtoDAsync_v2)(dstDevice, srcHost, ByteCount, hStream)
    return err
{{endif}}

{{if 'cuMemcpyDtoHAsync_v2' in found_functions}}

cdef CUresult _cuMemcpyDtoHAsync_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyDtoHAsync_v2
    cuPythonInit()
    if __cuMemcpyDtoHAsync_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyDtoHAsync_v2" not found')
    err = (<CUresult (*)(void*, CUdeviceptr, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyDtoHAsync_v2)(dstHost, srcDevice, ByteCount, hStream)
    return err
{{endif}}

{{if 'cuMemcpyDtoDAsync_v2' in found_functions}}

cdef CUresult _cuMemcpyDtoDAsync_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyDtoDAsync_v2
    cuPythonInit()
    if __cuMemcpyDtoDAsync_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyDtoDAsync_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, CUdeviceptr, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyDtoDAsync_v2)(dstDevice, srcDevice, ByteCount, hStream)
    return err
{{endif}}

{{if 'cuMemcpyHtoAAsync_v2' in found_functions}}

cdef CUresult _cuMemcpyHtoAAsync_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyHtoAAsync_v2
    cuPythonInit()
    if __cuMemcpyHtoAAsync_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyHtoAAsync_v2" not found')
    err = (<CUresult (*)(CUarray, size_t, const void*, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyHtoAAsync_v2)(dstArray, dstOffset, srcHost, ByteCount, hStream)
    return err
{{endif}}

{{if 'cuMemcpyAtoHAsync_v2' in found_functions}}

cdef CUresult _cuMemcpyAtoHAsync_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyAtoHAsync_v2
    cuPythonInit()
    if __cuMemcpyAtoHAsync_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyAtoHAsync_v2" not found')
    err = (<CUresult (*)(void*, CUarray, size_t, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyAtoHAsync_v2)(dstHost, srcArray, srcOffset, ByteCount, hStream)
    return err
{{endif}}

{{if 'cuMemcpy2DAsync_v2' in found_functions}}

cdef CUresult _cuMemcpy2DAsync_v2(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpy2DAsync_v2
    cuPythonInit()
    if __cuMemcpy2DAsync_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpy2DAsync_v2" not found')
    err = (<CUresult (*)(const CUDA_MEMCPY2D*, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpy2DAsync_v2)(pCopy, hStream)
    return err
{{endif}}

{{if 'cuMemcpy3DAsync_v2' in found_functions}}

cdef CUresult _cuMemcpy3DAsync_v2(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpy3DAsync_v2
    cuPythonInit()
    if __cuMemcpy3DAsync_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpy3DAsync_v2" not found')
    err = (<CUresult (*)(const CUDA_MEMCPY3D*, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpy3DAsync_v2)(pCopy, hStream)
    return err
{{endif}}

{{if 'cuMemcpy3DPeerAsync' in found_functions}}

cdef CUresult _cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpy3DPeerAsync
    cuPythonInit()
    if __cuMemcpy3DPeerAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpy3DPeerAsync" not found')
    err = (<CUresult (*)(const CUDA_MEMCPY3D_PEER*, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpy3DPeerAsync)(pCopy, hStream)
    return err
{{endif}}

{{if 'cuMemcpyBatchAsync' in found_functions}}

cdef CUresult _cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpyBatchAsync
    cuPythonInit()
    if __cuMemcpyBatchAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpyBatchAsync" not found')
    err = (<CUresult (*)(CUdeviceptr*, CUdeviceptr*, size_t*, size_t, CUmemcpyAttributes*, size_t*, size_t, size_t*, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpyBatchAsync)(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, hStream)
    return err
{{endif}}

{{if 'cuMemcpy3DBatchAsync' in found_functions}}

cdef CUresult _cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, size_t* failIdx, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemcpy3DBatchAsync
    cuPythonInit()
    if __cuMemcpy3DBatchAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuMemcpy3DBatchAsync" not found')
    err = (<CUresult (*)(size_t, CUDA_MEMCPY3D_BATCH_OP*, size_t*, unsigned long long, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemcpy3DBatchAsync)(numOps, opList, failIdx, flags, hStream)
    return err
{{endif}}

{{if 'cuMemsetD8_v2' in found_functions}}

cdef CUresult _cuMemsetD8_v2(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD8_v2
    cuPythonInit()
    if __cuMemsetD8_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD8_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, unsigned char, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD8_v2)(dstDevice, uc, N)
    return err
{{endif}}

{{if 'cuMemsetD16_v2' in found_functions}}

cdef CUresult _cuMemsetD16_v2(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD16_v2
    cuPythonInit()
    if __cuMemsetD16_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD16_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, unsigned short, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD16_v2)(dstDevice, us, N)
    return err
{{endif}}

{{if 'cuMemsetD32_v2' in found_functions}}

cdef CUresult _cuMemsetD32_v2(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD32_v2
    cuPythonInit()
    if __cuMemsetD32_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD32_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, unsigned int, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD32_v2)(dstDevice, ui, N)
    return err
{{endif}}

{{if 'cuMemsetD2D8_v2' in found_functions}}

cdef CUresult _cuMemsetD2D8_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD2D8_v2
    cuPythonInit()
    if __cuMemsetD2D8_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD2D8_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, unsigned char, size_t, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD2D8_v2)(dstDevice, dstPitch, uc, Width, Height)
    return err
{{endif}}

{{if 'cuMemsetD2D16_v2' in found_functions}}

cdef CUresult _cuMemsetD2D16_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD2D16_v2
    cuPythonInit()
    if __cuMemsetD2D16_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD2D16_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, unsigned short, size_t, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD2D16_v2)(dstDevice, dstPitch, us, Width, Height)
    return err
{{endif}}

{{if 'cuMemsetD2D32_v2' in found_functions}}

cdef CUresult _cuMemsetD2D32_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD2D32_v2
    cuPythonInit()
    if __cuMemsetD2D32_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD2D32_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, unsigned int, size_t, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD2D32_v2)(dstDevice, dstPitch, ui, Width, Height)
    return err
{{endif}}

{{if 'cuMemsetD8Async' in found_functions}}

cdef CUresult _cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD8Async
    cuPythonInit()
    if __cuMemsetD8Async == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD8Async" not found')
    err = (<CUresult (*)(CUdeviceptr, unsigned char, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD8Async)(dstDevice, uc, N, hStream)
    return err
{{endif}}

{{if 'cuMemsetD16Async' in found_functions}}

cdef CUresult _cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD16Async
    cuPythonInit()
    if __cuMemsetD16Async == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD16Async" not found')
    err = (<CUresult (*)(CUdeviceptr, unsigned short, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD16Async)(dstDevice, us, N, hStream)
    return err
{{endif}}

{{if 'cuMemsetD32Async' in found_functions}}

cdef CUresult _cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD32Async
    cuPythonInit()
    if __cuMemsetD32Async == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD32Async" not found')
    err = (<CUresult (*)(CUdeviceptr, unsigned int, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD32Async)(dstDevice, ui, N, hStream)
    return err
{{endif}}

{{if 'cuMemsetD2D8Async' in found_functions}}

cdef CUresult _cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD2D8Async
    cuPythonInit()
    if __cuMemsetD2D8Async == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD2D8Async" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, unsigned char, size_t, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD2D8Async)(dstDevice, dstPitch, uc, Width, Height, hStream)
    return err
{{endif}}

{{if 'cuMemsetD2D16Async' in found_functions}}

cdef CUresult _cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD2D16Async
    cuPythonInit()
    if __cuMemsetD2D16Async == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD2D16Async" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, unsigned short, size_t, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD2D16Async)(dstDevice, dstPitch, us, Width, Height, hStream)
    return err
{{endif}}

{{if 'cuMemsetD2D32Async' in found_functions}}

cdef CUresult _cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemsetD2D32Async
    cuPythonInit()
    if __cuMemsetD2D32Async == NULL:
        with gil:
            raise RuntimeError('Function "cuMemsetD2D32Async" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, unsigned int, size_t, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemsetD2D32Async)(dstDevice, dstPitch, ui, Width, Height, hStream)
    return err
{{endif}}

{{if 'cuArrayCreate_v2' in found_functions}}

cdef CUresult _cuArrayCreate_v2(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuArrayCreate_v2
    cuPythonInit()
    if __cuArrayCreate_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuArrayCreate_v2" not found')
    err = (<CUresult (*)(CUarray*, const CUDA_ARRAY_DESCRIPTOR*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuArrayCreate_v2)(pHandle, pAllocateArray)
    return err
{{endif}}

{{if 'cuArrayGetDescriptor_v2' in found_functions}}

cdef CUresult _cuArrayGetDescriptor_v2(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuArrayGetDescriptor_v2
    cuPythonInit()
    if __cuArrayGetDescriptor_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuArrayGetDescriptor_v2" not found')
    err = (<CUresult (*)(CUDA_ARRAY_DESCRIPTOR*, CUarray) except ?CUDA_ERROR_NOT_FOUND nogil> __cuArrayGetDescriptor_v2)(pArrayDescriptor, hArray)
    return err
{{endif}}

{{if 'cuArrayGetSparseProperties' in found_functions}}

cdef CUresult _cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuArrayGetSparseProperties
    cuPythonInit()
    if __cuArrayGetSparseProperties == NULL:
        with gil:
            raise RuntimeError('Function "cuArrayGetSparseProperties" not found')
    err = (<CUresult (*)(CUDA_ARRAY_SPARSE_PROPERTIES*, CUarray) except ?CUDA_ERROR_NOT_FOUND nogil> __cuArrayGetSparseProperties)(sparseProperties, array)
    return err
{{endif}}

{{if 'cuMipmappedArrayGetSparseProperties' in found_functions}}

cdef CUresult _cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMipmappedArrayGetSparseProperties
    cuPythonInit()
    if __cuMipmappedArrayGetSparseProperties == NULL:
        with gil:
            raise RuntimeError('Function "cuMipmappedArrayGetSparseProperties" not found')
    err = (<CUresult (*)(CUDA_ARRAY_SPARSE_PROPERTIES*, CUmipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMipmappedArrayGetSparseProperties)(sparseProperties, mipmap)
    return err
{{endif}}

{{if 'cuArrayGetMemoryRequirements' in found_functions}}

cdef CUresult _cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuArrayGetMemoryRequirements
    cuPythonInit()
    if __cuArrayGetMemoryRequirements == NULL:
        with gil:
            raise RuntimeError('Function "cuArrayGetMemoryRequirements" not found')
    err = (<CUresult (*)(CUDA_ARRAY_MEMORY_REQUIREMENTS*, CUarray, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuArrayGetMemoryRequirements)(memoryRequirements, array, device)
    return err
{{endif}}

{{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}}

cdef CUresult _cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMipmappedArrayGetMemoryRequirements
    cuPythonInit()
    if __cuMipmappedArrayGetMemoryRequirements == NULL:
        with gil:
            raise RuntimeError('Function "cuMipmappedArrayGetMemoryRequirements" not found')
    err = (<CUresult (*)(CUDA_ARRAY_MEMORY_REQUIREMENTS*, CUmipmappedArray, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMipmappedArrayGetMemoryRequirements)(memoryRequirements, mipmap, device)
    return err
{{endif}}

{{if 'cuArrayGetPlane' in found_functions}}

cdef CUresult _cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuArrayGetPlane
    cuPythonInit()
    if __cuArrayGetPlane == NULL:
        with gil:
            raise RuntimeError('Function "cuArrayGetPlane" not found')
    err = (<CUresult (*)(CUarray*, CUarray, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuArrayGetPlane)(pPlaneArray, hArray, planeIdx)
    return err
{{endif}}

{{if 'cuArrayDestroy' in found_functions}}

cdef CUresult _cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuArrayDestroy
    cuPythonInit()
    if __cuArrayDestroy == NULL:
        with gil:
            raise RuntimeError('Function "cuArrayDestroy" not found')
    err = (<CUresult (*)(CUarray) except ?CUDA_ERROR_NOT_FOUND nogil> __cuArrayDestroy)(hArray)
    return err
{{endif}}

{{if 'cuArray3DCreate_v2' in found_functions}}

cdef CUresult _cuArray3DCreate_v2(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuArray3DCreate_v2
    cuPythonInit()
    if __cuArray3DCreate_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuArray3DCreate_v2" not found')
    err = (<CUresult (*)(CUarray*, const CUDA_ARRAY3D_DESCRIPTOR*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuArray3DCreate_v2)(pHandle, pAllocateArray)
    return err
{{endif}}

{{if 'cuArray3DGetDescriptor_v2' in found_functions}}

cdef CUresult _cuArray3DGetDescriptor_v2(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuArray3DGetDescriptor_v2
    cuPythonInit()
    if __cuArray3DGetDescriptor_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuArray3DGetDescriptor_v2" not found')
    err = (<CUresult (*)(CUDA_ARRAY3D_DESCRIPTOR*, CUarray) except ?CUDA_ERROR_NOT_FOUND nogil> __cuArray3DGetDescriptor_v2)(pArrayDescriptor, hArray)
    return err
{{endif}}

{{if 'cuMipmappedArrayCreate' in found_functions}}

cdef CUresult _cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMipmappedArrayCreate
    cuPythonInit()
    if __cuMipmappedArrayCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuMipmappedArrayCreate" not found')
    err = (<CUresult (*)(CUmipmappedArray*, const CUDA_ARRAY3D_DESCRIPTOR*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMipmappedArrayCreate)(pHandle, pMipmappedArrayDesc, numMipmapLevels)
    return err
{{endif}}

{{if 'cuMipmappedArrayGetLevel' in found_functions}}

cdef CUresult _cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMipmappedArrayGetLevel
    cuPythonInit()
    if __cuMipmappedArrayGetLevel == NULL:
        with gil:
            raise RuntimeError('Function "cuMipmappedArrayGetLevel" not found')
    err = (<CUresult (*)(CUarray*, CUmipmappedArray, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMipmappedArrayGetLevel)(pLevelArray, hMipmappedArray, level)
    return err
{{endif}}

{{if 'cuMipmappedArrayDestroy' in found_functions}}

cdef CUresult _cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMipmappedArrayDestroy
    cuPythonInit()
    if __cuMipmappedArrayDestroy == NULL:
        with gil:
            raise RuntimeError('Function "cuMipmappedArrayDestroy" not found')
    err = (<CUresult (*)(CUmipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMipmappedArrayDestroy)(hMipmappedArray)
    return err
{{endif}}

{{if 'cuMemGetHandleForAddressRange' in found_functions}}

cdef CUresult _cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemGetHandleForAddressRange
    cuPythonInit()
    if __cuMemGetHandleForAddressRange == NULL:
        with gil:
            raise RuntimeError('Function "cuMemGetHandleForAddressRange" not found')
    err = (<CUresult (*)(void*, CUdeviceptr, size_t, CUmemRangeHandleType, unsigned long long) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemGetHandleForAddressRange)(handle, dptr, size, handleType, flags)
    return err
{{endif}}

{{if 'cuMemBatchDecompressAsync' in found_functions}}

cdef CUresult _cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemBatchDecompressAsync
    cuPythonInit()
    if __cuMemBatchDecompressAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuMemBatchDecompressAsync" not found')
    err = (<CUresult (*)(CUmemDecompressParams*, size_t, unsigned int, size_t*, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemBatchDecompressAsync)(paramsArray, count, flags, errorIndex, stream)
    return err
{{endif}}

{{if 'cuMemAddressReserve' in found_functions}}

cdef CUresult _cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemAddressReserve
    cuPythonInit()
    if __cuMemAddressReserve == NULL:
        with gil:
            raise RuntimeError('Function "cuMemAddressReserve" not found')
    err = (<CUresult (*)(CUdeviceptr*, size_t, size_t, CUdeviceptr, unsigned long long) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemAddressReserve)(ptr, size, alignment, addr, flags)
    return err
{{endif}}

{{if 'cuMemAddressFree' in found_functions}}

cdef CUresult _cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemAddressFree
    cuPythonInit()
    if __cuMemAddressFree == NULL:
        with gil:
            raise RuntimeError('Function "cuMemAddressFree" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemAddressFree)(ptr, size)
    return err
{{endif}}

{{if 'cuMemCreate' in found_functions}}

cdef CUresult _cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemCreate
    cuPythonInit()
    if __cuMemCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuMemCreate" not found')
    err = (<CUresult (*)(CUmemGenericAllocationHandle*, size_t, const CUmemAllocationProp*, unsigned long long) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemCreate)(handle, size, prop, flags)
    return err
{{endif}}

{{if 'cuMemRelease' in found_functions}}

cdef CUresult _cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemRelease
    cuPythonInit()
    if __cuMemRelease == NULL:
        with gil:
            raise RuntimeError('Function "cuMemRelease" not found')
    err = (<CUresult (*)(CUmemGenericAllocationHandle) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemRelease)(handle)
    return err
{{endif}}

{{if 'cuMemMap' in found_functions}}

cdef CUresult _cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemMap
    cuPythonInit()
    if __cuMemMap == NULL:
        with gil:
            raise RuntimeError('Function "cuMemMap" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, size_t, CUmemGenericAllocationHandle, unsigned long long) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemMap)(ptr, size, offset, handle, flags)
    return err
{{endif}}

{{if 'cuMemMapArrayAsync' in found_functions}}

cdef CUresult _cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemMapArrayAsync
    cuPythonInit()
    if __cuMemMapArrayAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuMemMapArrayAsync" not found')
    err = (<CUresult (*)(CUarrayMapInfo*, unsigned int, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemMapArrayAsync)(mapInfoList, count, hStream)
    return err
{{endif}}

{{if 'cuMemUnmap' in found_functions}}

cdef CUresult _cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemUnmap
    cuPythonInit()
    if __cuMemUnmap == NULL:
        with gil:
            raise RuntimeError('Function "cuMemUnmap" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemUnmap)(ptr, size)
    return err
{{endif}}

{{if 'cuMemSetAccess' in found_functions}}

cdef CUresult _cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemSetAccess
    cuPythonInit()
    if __cuMemSetAccess == NULL:
        with gil:
            raise RuntimeError('Function "cuMemSetAccess" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, const CUmemAccessDesc*, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemSetAccess)(ptr, size, desc, count)
    return err
{{endif}}

{{if 'cuMemGetAccess' in found_functions}}

cdef CUresult _cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemGetAccess
    cuPythonInit()
    if __cuMemGetAccess == NULL:
        with gil:
            raise RuntimeError('Function "cuMemGetAccess" not found')
    err = (<CUresult (*)(unsigned long long*, const CUmemLocation*, CUdeviceptr) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemGetAccess)(flags, location, ptr)
    return err
{{endif}}

{{if 'cuMemExportToShareableHandle' in found_functions}}

cdef CUresult _cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemExportToShareableHandle
    cuPythonInit()
    if __cuMemExportToShareableHandle == NULL:
        with gil:
            raise RuntimeError('Function "cuMemExportToShareableHandle" not found')
    err = (<CUresult (*)(void*, CUmemGenericAllocationHandle, CUmemAllocationHandleType, unsigned long long) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemExportToShareableHandle)(shareableHandle, handle, handleType, flags)
    return err
{{endif}}

{{if 'cuMemImportFromShareableHandle' in found_functions}}

cdef CUresult _cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemImportFromShareableHandle
    cuPythonInit()
    if __cuMemImportFromShareableHandle == NULL:
        with gil:
            raise RuntimeError('Function "cuMemImportFromShareableHandle" not found')
    err = (<CUresult (*)(CUmemGenericAllocationHandle*, void*, CUmemAllocationHandleType) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemImportFromShareableHandle)(handle, osHandle, shHandleType)
    return err
{{endif}}

{{if 'cuMemGetAllocationGranularity' in found_functions}}

cdef CUresult _cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemGetAllocationGranularity
    cuPythonInit()
    if __cuMemGetAllocationGranularity == NULL:
        with gil:
            raise RuntimeError('Function "cuMemGetAllocationGranularity" not found')
    err = (<CUresult (*)(size_t*, const CUmemAllocationProp*, CUmemAllocationGranularity_flags) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemGetAllocationGranularity)(granularity, prop, option)
    return err
{{endif}}

{{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}}

cdef CUresult _cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemGetAllocationPropertiesFromHandle
    cuPythonInit()
    if __cuMemGetAllocationPropertiesFromHandle == NULL:
        with gil:
            raise RuntimeError('Function "cuMemGetAllocationPropertiesFromHandle" not found')
    err = (<CUresult (*)(CUmemAllocationProp*, CUmemGenericAllocationHandle) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemGetAllocationPropertiesFromHandle)(prop, handle)
    return err
{{endif}}

{{if 'cuMemRetainAllocationHandle' in found_functions}}

cdef CUresult _cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemRetainAllocationHandle
    cuPythonInit()
    if __cuMemRetainAllocationHandle == NULL:
        with gil:
            raise RuntimeError('Function "cuMemRetainAllocationHandle" not found')
    err = (<CUresult (*)(CUmemGenericAllocationHandle*, void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemRetainAllocationHandle)(handle, addr)
    return err
{{endif}}

{{if 'cuMemFreeAsync' in found_functions}}

cdef CUresult _cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemFreeAsync
    cuPythonInit()
    if __cuMemFreeAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuMemFreeAsync" not found')
    err = (<CUresult (*)(CUdeviceptr, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemFreeAsync)(dptr, hStream)
    return err
{{endif}}

{{if 'cuMemAllocAsync' in found_functions}}

cdef CUresult _cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemAllocAsync
    cuPythonInit()
    if __cuMemAllocAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuMemAllocAsync" not found')
    err = (<CUresult (*)(CUdeviceptr*, size_t, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemAllocAsync)(dptr, bytesize, hStream)
    return err
{{endif}}

{{if 'cuMemPoolTrimTo' in found_functions}}

cdef CUresult _cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPoolTrimTo
    cuPythonInit()
    if __cuMemPoolTrimTo == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPoolTrimTo" not found')
    err = (<CUresult (*)(CUmemoryPool, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPoolTrimTo)(pool, minBytesToKeep)
    return err
{{endif}}

{{if 'cuMemPoolSetAttribute' in found_functions}}

cdef CUresult _cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPoolSetAttribute
    cuPythonInit()
    if __cuMemPoolSetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPoolSetAttribute" not found')
    err = (<CUresult (*)(CUmemoryPool, CUmemPool_attribute, void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPoolSetAttribute)(pool, attr, value)
    return err
{{endif}}

{{if 'cuMemPoolGetAttribute' in found_functions}}

cdef CUresult _cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPoolGetAttribute
    cuPythonInit()
    if __cuMemPoolGetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPoolGetAttribute" not found')
    err = (<CUresult (*)(CUmemoryPool, CUmemPool_attribute, void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPoolGetAttribute)(pool, attr, value)
    return err
{{endif}}

{{if 'cuMemPoolSetAccess' in found_functions}}

cdef CUresult _cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPoolSetAccess
    cuPythonInit()
    if __cuMemPoolSetAccess == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPoolSetAccess" not found')
    err = (<CUresult (*)(CUmemoryPool, const CUmemAccessDesc*, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPoolSetAccess)(pool, map, count)
    return err
{{endif}}

{{if 'cuMemPoolGetAccess' in found_functions}}

cdef CUresult _cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPoolGetAccess
    cuPythonInit()
    if __cuMemPoolGetAccess == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPoolGetAccess" not found')
    err = (<CUresult (*)(CUmemAccess_flags*, CUmemoryPool, CUmemLocation*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPoolGetAccess)(flags, memPool, location)
    return err
{{endif}}

{{if 'cuMemPoolCreate' in found_functions}}

cdef CUresult _cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPoolCreate
    cuPythonInit()
    if __cuMemPoolCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPoolCreate" not found')
    err = (<CUresult (*)(CUmemoryPool*, const CUmemPoolProps*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPoolCreate)(pool, poolProps)
    return err
{{endif}}

{{if 'cuMemPoolDestroy' in found_functions}}

cdef CUresult _cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPoolDestroy
    cuPythonInit()
    if __cuMemPoolDestroy == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPoolDestroy" not found')
    err = (<CUresult (*)(CUmemoryPool) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPoolDestroy)(pool)
    return err
{{endif}}

{{if 'cuMemAllocFromPoolAsync' in found_functions}}

cdef CUresult _cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemAllocFromPoolAsync
    cuPythonInit()
    if __cuMemAllocFromPoolAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuMemAllocFromPoolAsync" not found')
    err = (<CUresult (*)(CUdeviceptr*, size_t, CUmemoryPool, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemAllocFromPoolAsync)(dptr, bytesize, pool, hStream)
    return err
{{endif}}

{{if 'cuMemPoolExportToShareableHandle' in found_functions}}

cdef CUresult _cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPoolExportToShareableHandle
    cuPythonInit()
    if __cuMemPoolExportToShareableHandle == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPoolExportToShareableHandle" not found')
    err = (<CUresult (*)(void*, CUmemoryPool, CUmemAllocationHandleType, unsigned long long) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPoolExportToShareableHandle)(handle_out, pool, handleType, flags)
    return err
{{endif}}

{{if 'cuMemPoolImportFromShareableHandle' in found_functions}}

cdef CUresult _cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPoolImportFromShareableHandle
    cuPythonInit()
    if __cuMemPoolImportFromShareableHandle == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPoolImportFromShareableHandle" not found')
    err = (<CUresult (*)(CUmemoryPool*, void*, CUmemAllocationHandleType, unsigned long long) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPoolImportFromShareableHandle)(pool_out, handle, handleType, flags)
    return err
{{endif}}

{{if 'cuMemPoolExportPointer' in found_functions}}

cdef CUresult _cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPoolExportPointer
    cuPythonInit()
    if __cuMemPoolExportPointer == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPoolExportPointer" not found')
    err = (<CUresult (*)(CUmemPoolPtrExportData*, CUdeviceptr) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPoolExportPointer)(shareData_out, ptr)
    return err
{{endif}}

{{if 'cuMemPoolImportPointer' in found_functions}}

cdef CUresult _cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPoolImportPointer
    cuPythonInit()
    if __cuMemPoolImportPointer == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPoolImportPointer" not found')
    err = (<CUresult (*)(CUdeviceptr*, CUmemoryPool, CUmemPoolPtrExportData*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPoolImportPointer)(ptr_out, pool, shareData)
    return err
{{endif}}

{{if 'cuMulticastCreate' in found_functions}}

cdef CUresult _cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMulticastCreate
    cuPythonInit()
    if __cuMulticastCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuMulticastCreate" not found')
    err = (<CUresult (*)(CUmemGenericAllocationHandle*, const CUmulticastObjectProp*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMulticastCreate)(mcHandle, prop)
    return err
{{endif}}

{{if 'cuMulticastAddDevice' in found_functions}}

cdef CUresult _cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMulticastAddDevice
    cuPythonInit()
    if __cuMulticastAddDevice == NULL:
        with gil:
            raise RuntimeError('Function "cuMulticastAddDevice" not found')
    err = (<CUresult (*)(CUmemGenericAllocationHandle, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMulticastAddDevice)(mcHandle, dev)
    return err
{{endif}}

{{if 'cuMulticastBindMem' in found_functions}}

cdef CUresult _cuMulticastBindMem(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMulticastBindMem
    cuPythonInit()
    if __cuMulticastBindMem == NULL:
        with gil:
            raise RuntimeError('Function "cuMulticastBindMem" not found')
    err = (<CUresult (*)(CUmemGenericAllocationHandle, size_t, CUmemGenericAllocationHandle, size_t, size_t, unsigned long long) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMulticastBindMem)(mcHandle, mcOffset, memHandle, memOffset, size, flags)
    return err
{{endif}}

{{if 'cuMulticastBindAddr' in found_functions}}

cdef CUresult _cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMulticastBindAddr
    cuPythonInit()
    if __cuMulticastBindAddr == NULL:
        with gil:
            raise RuntimeError('Function "cuMulticastBindAddr" not found')
    err = (<CUresult (*)(CUmemGenericAllocationHandle, size_t, CUdeviceptr, size_t, unsigned long long) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMulticastBindAddr)(mcHandle, mcOffset, memptr, size, flags)
    return err
{{endif}}

{{if 'cuMulticastUnbind' in found_functions}}

cdef CUresult _cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMulticastUnbind
    cuPythonInit()
    if __cuMulticastUnbind == NULL:
        with gil:
            raise RuntimeError('Function "cuMulticastUnbind" not found')
    err = (<CUresult (*)(CUmemGenericAllocationHandle, CUdevice, size_t, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMulticastUnbind)(mcHandle, dev, mcOffset, size)
    return err
{{endif}}

{{if 'cuMulticastGetGranularity' in found_functions}}

cdef CUresult _cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMulticastGetGranularity
    cuPythonInit()
    if __cuMulticastGetGranularity == NULL:
        with gil:
            raise RuntimeError('Function "cuMulticastGetGranularity" not found')
    err = (<CUresult (*)(size_t*, const CUmulticastObjectProp*, CUmulticastGranularity_flags) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMulticastGetGranularity)(granularity, prop, option)
    return err
{{endif}}

{{if 'cuPointerGetAttribute' in found_functions}}

cdef CUresult _cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuPointerGetAttribute
    cuPythonInit()
    if __cuPointerGetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuPointerGetAttribute" not found')
    err = (<CUresult (*)(void*, CUpointer_attribute, CUdeviceptr) except ?CUDA_ERROR_NOT_FOUND nogil> __cuPointerGetAttribute)(data, attribute, ptr)
    return err
{{endif}}

{{if 'cuMemPrefetchAsync' in found_functions}}

cdef CUresult _cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPrefetchAsync
    cuPythonInit()
    if __cuMemPrefetchAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPrefetchAsync" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, CUdevice, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPrefetchAsync)(devPtr, count, dstDevice, hStream)
    return err
{{endif}}

{{if 'cuMemPrefetchAsync_v2' in found_functions}}

cdef CUresult _cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemPrefetchAsync_v2
    cuPythonInit()
    if __cuMemPrefetchAsync_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemPrefetchAsync_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, CUmemLocation, unsigned int, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemPrefetchAsync_v2)(devPtr, count, location, flags, hStream)
    return err
{{endif}}

{{if 'cuMemAdvise' in found_functions}}

cdef CUresult _cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemAdvise
    cuPythonInit()
    if __cuMemAdvise == NULL:
        with gil:
            raise RuntimeError('Function "cuMemAdvise" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, CUmem_advise, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemAdvise)(devPtr, count, advice, device)
    return err
{{endif}}

{{if 'cuMemAdvise_v2' in found_functions}}

cdef CUresult _cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemAdvise_v2
    cuPythonInit()
    if __cuMemAdvise_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuMemAdvise_v2" not found')
    err = (<CUresult (*)(CUdeviceptr, size_t, CUmem_advise, CUmemLocation) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemAdvise_v2)(devPtr, count, advice, location)
    return err
{{endif}}

{{if 'cuMemRangeGetAttribute' in found_functions}}

cdef CUresult _cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemRangeGetAttribute
    cuPythonInit()
    if __cuMemRangeGetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuMemRangeGetAttribute" not found')
    err = (<CUresult (*)(void*, size_t, CUmem_range_attribute, CUdeviceptr, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemRangeGetAttribute)(data, dataSize, attribute, devPtr, count)
    return err
{{endif}}

{{if 'cuMemRangeGetAttributes' in found_functions}}

cdef CUresult _cuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuMemRangeGetAttributes
    cuPythonInit()
    if __cuMemRangeGetAttributes == NULL:
        with gil:
            raise RuntimeError('Function "cuMemRangeGetAttributes" not found')
    err = (<CUresult (*)(void**, size_t*, CUmem_range_attribute*, size_t, CUdeviceptr, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuMemRangeGetAttributes)(data, dataSizes, attributes, numAttributes, devPtr, count)
    return err
{{endif}}

{{if 'cuPointerSetAttribute' in found_functions}}

cdef CUresult _cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuPointerSetAttribute
    cuPythonInit()
    if __cuPointerSetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuPointerSetAttribute" not found')
    err = (<CUresult (*)(const void*, CUpointer_attribute, CUdeviceptr) except ?CUDA_ERROR_NOT_FOUND nogil> __cuPointerSetAttribute)(value, attribute, ptr)
    return err
{{endif}}

{{if 'cuPointerGetAttributes' in found_functions}}

cdef CUresult _cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuPointerGetAttributes
    cuPythonInit()
    if __cuPointerGetAttributes == NULL:
        with gil:
            raise RuntimeError('Function "cuPointerGetAttributes" not found')
    err = (<CUresult (*)(unsigned int, CUpointer_attribute*, void**, CUdeviceptr) except ?CUDA_ERROR_NOT_FOUND nogil> __cuPointerGetAttributes)(numAttributes, attributes, data, ptr)
    return err
{{endif}}

{{if 'cuStreamCreate' in found_functions}}

cdef CUresult _cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamCreate
    cuPythonInit()
    if __cuStreamCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamCreate" not found')
    err = (<CUresult (*)(CUstream*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamCreate)(phStream, Flags)
    return err
{{endif}}

{{if 'cuStreamCreateWithPriority' in found_functions}}

cdef CUresult _cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamCreateWithPriority
    cuPythonInit()
    if __cuStreamCreateWithPriority == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamCreateWithPriority" not found')
    err = (<CUresult (*)(CUstream*, unsigned int, int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamCreateWithPriority)(phStream, flags, priority)
    return err
{{endif}}

{{if 'cuStreamGetPriority' in found_functions}}

cdef CUresult _cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamGetPriority
    cuPythonInit()
    if __cuStreamGetPriority == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamGetPriority" not found')
    err = (<CUresult (*)(CUstream, int*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamGetPriority)(hStream, priority)
    return err
{{endif}}

{{if 'cuStreamGetDevice' in found_functions}}

cdef CUresult _cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamGetDevice
    cuPythonInit()
    if __cuStreamGetDevice == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamGetDevice" not found')
    err = (<CUresult (*)(CUstream, CUdevice*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamGetDevice)(hStream, device)
    return err
{{endif}}

{{if 'cuStreamGetFlags' in found_functions}}

cdef CUresult _cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamGetFlags
    cuPythonInit()
    if __cuStreamGetFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamGetFlags" not found')
    err = (<CUresult (*)(CUstream, unsigned int*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamGetFlags)(hStream, flags)
    return err
{{endif}}

{{if 'cuStreamGetId' in found_functions}}

cdef CUresult _cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamGetId
    cuPythonInit()
    if __cuStreamGetId == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamGetId" not found')
    err = (<CUresult (*)(CUstream, unsigned long long*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamGetId)(hStream, streamId)
    return err
{{endif}}

{{if 'cuStreamGetCtx' in found_functions}}

cdef CUresult _cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamGetCtx
    cuPythonInit()
    if __cuStreamGetCtx == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamGetCtx" not found')
    err = (<CUresult (*)(CUstream, CUcontext*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamGetCtx)(hStream, pctx)
    return err
{{endif}}

{{if 'cuStreamGetCtx_v2' in found_functions}}

cdef CUresult _cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamGetCtx_v2
    cuPythonInit()
    if __cuStreamGetCtx_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamGetCtx_v2" not found')
    err = (<CUresult (*)(CUstream, CUcontext*, CUgreenCtx*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamGetCtx_v2)(hStream, pCtx, pGreenCtx)
    return err
{{endif}}

{{if 'cuStreamWaitEvent' in found_functions}}

cdef CUresult _cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamWaitEvent
    cuPythonInit()
    if __cuStreamWaitEvent == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamWaitEvent" not found')
    err = (<CUresult (*)(CUstream, CUevent, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamWaitEvent)(hStream, hEvent, Flags)
    return err
{{endif}}

{{if 'cuStreamAddCallback' in found_functions}}

cdef CUresult _cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamAddCallback
    cuPythonInit()
    if __cuStreamAddCallback == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamAddCallback" not found')
    err = (<CUresult (*)(CUstream, CUstreamCallback, void*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamAddCallback)(hStream, callback, userData, flags)
    return err
{{endif}}

{{if 'cuStreamBeginCapture_v2' in found_functions}}

cdef CUresult _cuStreamBeginCapture_v2(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamBeginCapture_v2
    cuPythonInit()
    if __cuStreamBeginCapture_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamBeginCapture_v2" not found')
    err = (<CUresult (*)(CUstream, CUstreamCaptureMode) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamBeginCapture_v2)(hStream, mode)
    return err
{{endif}}

{{if 'cuStreamBeginCaptureToGraph' in found_functions}}

cdef CUresult _cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamBeginCaptureToGraph
    cuPythonInit()
    if __cuStreamBeginCaptureToGraph == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamBeginCaptureToGraph" not found')
    err = (<CUresult (*)(CUstream, CUgraph, const CUgraphNode*, const CUgraphEdgeData*, size_t, CUstreamCaptureMode) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamBeginCaptureToGraph)(hStream, hGraph, dependencies, dependencyData, numDependencies, mode)
    return err
{{endif}}

{{if 'cuThreadExchangeStreamCaptureMode' in found_functions}}

cdef CUresult _cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuThreadExchangeStreamCaptureMode
    cuPythonInit()
    if __cuThreadExchangeStreamCaptureMode == NULL:
        with gil:
            raise RuntimeError('Function "cuThreadExchangeStreamCaptureMode" not found')
    err = (<CUresult (*)(CUstreamCaptureMode*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuThreadExchangeStreamCaptureMode)(mode)
    return err
{{endif}}

{{if 'cuStreamEndCapture' in found_functions}}

cdef CUresult _cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamEndCapture
    cuPythonInit()
    if __cuStreamEndCapture == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamEndCapture" not found')
    err = (<CUresult (*)(CUstream, CUgraph*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamEndCapture)(hStream, phGraph)
    return err
{{endif}}

{{if 'cuStreamIsCapturing' in found_functions}}

cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamIsCapturing
    cuPythonInit()
    if __cuStreamIsCapturing == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamIsCapturing" not found')
    err = (<CUresult (*)(CUstream, CUstreamCaptureStatus*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamIsCapturing)(hStream, captureStatus)
    return err
{{endif}}

{{if 'cuStreamGetCaptureInfo_v2' in found_functions}}

cdef CUresult _cuStreamGetCaptureInfo_v2(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamGetCaptureInfo_v2
    cuPythonInit()
    if __cuStreamGetCaptureInfo_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamGetCaptureInfo_v2" not found')
    err = (<CUresult (*)(CUstream, CUstreamCaptureStatus*, cuuint64_t*, CUgraph*, const CUgraphNode**, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamGetCaptureInfo_v2)(hStream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)
    return err
{{endif}}

{{if 'cuStreamGetCaptureInfo_v3' in found_functions}}

cdef CUresult _cuStreamGetCaptureInfo_v3(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, const CUgraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamGetCaptureInfo_v3
    cuPythonInit()
    if __cuStreamGetCaptureInfo_v3 == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamGetCaptureInfo_v3" not found')
    err = (<CUresult (*)(CUstream, CUstreamCaptureStatus*, cuuint64_t*, CUgraph*, const CUgraphNode**, const CUgraphEdgeData**, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamGetCaptureInfo_v3)(hStream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out)
    return err
{{endif}}

{{if 'cuStreamUpdateCaptureDependencies' in found_functions}}

cdef CUresult _cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamUpdateCaptureDependencies
    cuPythonInit()
    if __cuStreamUpdateCaptureDependencies == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamUpdateCaptureDependencies" not found')
    err = (<CUresult (*)(CUstream, CUgraphNode*, size_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamUpdateCaptureDependencies)(hStream, dependencies, numDependencies, flags)
    return err
{{endif}}

{{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}}

cdef CUresult _cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamUpdateCaptureDependencies_v2
    cuPythonInit()
    if __cuStreamUpdateCaptureDependencies_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamUpdateCaptureDependencies_v2" not found')
    err = (<CUresult (*)(CUstream, CUgraphNode*, const CUgraphEdgeData*, size_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamUpdateCaptureDependencies_v2)(hStream, dependencies, dependencyData, numDependencies, flags)
    return err
{{endif}}

{{if 'cuStreamAttachMemAsync' in found_functions}}

cdef CUresult _cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamAttachMemAsync
    cuPythonInit()
    if __cuStreamAttachMemAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamAttachMemAsync" not found')
    err = (<CUresult (*)(CUstream, CUdeviceptr, size_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamAttachMemAsync)(hStream, dptr, length, flags)
    return err
{{endif}}

{{if 'cuStreamQuery' in found_functions}}

cdef CUresult _cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamQuery
    cuPythonInit()
    if __cuStreamQuery == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamQuery" not found')
    err = (<CUresult (*)(CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamQuery)(hStream)
    return err
{{endif}}

{{if 'cuStreamSynchronize' in found_functions}}

cdef CUresult _cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamSynchronize
    cuPythonInit()
    if __cuStreamSynchronize == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamSynchronize" not found')
    err = (<CUresult (*)(CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamSynchronize)(hStream)
    return err
{{endif}}

{{if 'cuStreamDestroy_v2' in found_functions}}

cdef CUresult _cuStreamDestroy_v2(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamDestroy_v2
    cuPythonInit()
    if __cuStreamDestroy_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamDestroy_v2" not found')
    err = (<CUresult (*)(CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamDestroy_v2)(hStream)
    return err
{{endif}}

{{if 'cuStreamCopyAttributes' in found_functions}}

cdef CUresult _cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamCopyAttributes
    cuPythonInit()
    if __cuStreamCopyAttributes == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamCopyAttributes" not found')
    err = (<CUresult (*)(CUstream, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamCopyAttributes)(dst, src)
    return err
{{endif}}

{{if 'cuStreamGetAttribute' in found_functions}}

cdef CUresult _cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamGetAttribute
    cuPythonInit()
    if __cuStreamGetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamGetAttribute" not found')
    err = (<CUresult (*)(CUstream, CUstreamAttrID, CUstreamAttrValue*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamGetAttribute)(hStream, attr, value_out)
    return err
{{endif}}

{{if 'cuStreamSetAttribute' in found_functions}}

cdef CUresult _cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamSetAttribute
    cuPythonInit()
    if __cuStreamSetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamSetAttribute" not found')
    err = (<CUresult (*)(CUstream, CUstreamAttrID, const CUstreamAttrValue*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamSetAttribute)(hStream, attr, value)
    return err
{{endif}}

{{if 'cuEventCreate' in found_functions}}

cdef CUresult _cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEventCreate
    cuPythonInit()
    if __cuEventCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuEventCreate" not found')
    err = (<CUresult (*)(CUevent*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEventCreate)(phEvent, Flags)
    return err
{{endif}}

{{if 'cuEventRecord' in found_functions}}

cdef CUresult _cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEventRecord
    cuPythonInit()
    if __cuEventRecord == NULL:
        with gil:
            raise RuntimeError('Function "cuEventRecord" not found')
    err = (<CUresult (*)(CUevent, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEventRecord)(hEvent, hStream)
    return err
{{endif}}

{{if 'cuEventRecordWithFlags' in found_functions}}

cdef CUresult _cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEventRecordWithFlags
    cuPythonInit()
    if __cuEventRecordWithFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuEventRecordWithFlags" not found')
    err = (<CUresult (*)(CUevent, CUstream, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEventRecordWithFlags)(hEvent, hStream, flags)
    return err
{{endif}}

{{if 'cuEventQuery' in found_functions}}

cdef CUresult _cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEventQuery
    cuPythonInit()
    if __cuEventQuery == NULL:
        with gil:
            raise RuntimeError('Function "cuEventQuery" not found')
    err = (<CUresult (*)(CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEventQuery)(hEvent)
    return err
{{endif}}

{{if 'cuEventSynchronize' in found_functions}}

cdef CUresult _cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEventSynchronize
    cuPythonInit()
    if __cuEventSynchronize == NULL:
        with gil:
            raise RuntimeError('Function "cuEventSynchronize" not found')
    err = (<CUresult (*)(CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEventSynchronize)(hEvent)
    return err
{{endif}}

{{if 'cuEventDestroy_v2' in found_functions}}

cdef CUresult _cuEventDestroy_v2(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEventDestroy_v2
    cuPythonInit()
    if __cuEventDestroy_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuEventDestroy_v2" not found')
    err = (<CUresult (*)(CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEventDestroy_v2)(hEvent)
    return err
{{endif}}

{{if 'cuEventElapsedTime' in found_functions}}

cdef CUresult _cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEventElapsedTime
    cuPythonInit()
    if __cuEventElapsedTime == NULL:
        with gil:
            raise RuntimeError('Function "cuEventElapsedTime" not found')
    err = (<CUresult (*)(float*, CUevent, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEventElapsedTime)(pMilliseconds, hStart, hEnd)
    return err
{{endif}}

{{if 'cuEventElapsedTime_v2' in found_functions}}

cdef CUresult _cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEventElapsedTime_v2
    cuPythonInit()
    if __cuEventElapsedTime_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuEventElapsedTime_v2" not found')
    err = (<CUresult (*)(float*, CUevent, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEventElapsedTime_v2)(pMilliseconds, hStart, hEnd)
    return err
{{endif}}

{{if 'cuImportExternalMemory' in found_functions}}

cdef CUresult _cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuImportExternalMemory
    cuPythonInit()
    if __cuImportExternalMemory == NULL:
        with gil:
            raise RuntimeError('Function "cuImportExternalMemory" not found')
    err = (<CUresult (*)(CUexternalMemory*, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuImportExternalMemory)(extMem_out, memHandleDesc)
    return err
{{endif}}

{{if 'cuExternalMemoryGetMappedBuffer' in found_functions}}

cdef CUresult _cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuExternalMemoryGetMappedBuffer
    cuPythonInit()
    if __cuExternalMemoryGetMappedBuffer == NULL:
        with gil:
            raise RuntimeError('Function "cuExternalMemoryGetMappedBuffer" not found')
    err = (<CUresult (*)(CUdeviceptr*, CUexternalMemory, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuExternalMemoryGetMappedBuffer)(devPtr, extMem, bufferDesc)
    return err
{{endif}}

{{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}}

cdef CUresult _cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuExternalMemoryGetMappedMipmappedArray
    cuPythonInit()
    if __cuExternalMemoryGetMappedMipmappedArray == NULL:
        with gil:
            raise RuntimeError('Function "cuExternalMemoryGetMappedMipmappedArray" not found')
    err = (<CUresult (*)(CUmipmappedArray*, CUexternalMemory, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuExternalMemoryGetMappedMipmappedArray)(mipmap, extMem, mipmapDesc)
    return err
{{endif}}

{{if 'cuDestroyExternalMemory' in found_functions}}

cdef CUresult _cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDestroyExternalMemory
    cuPythonInit()
    if __cuDestroyExternalMemory == NULL:
        with gil:
            raise RuntimeError('Function "cuDestroyExternalMemory" not found')
    err = (<CUresult (*)(CUexternalMemory) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDestroyExternalMemory)(extMem)
    return err
{{endif}}

{{if 'cuImportExternalSemaphore' in found_functions}}

cdef CUresult _cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuImportExternalSemaphore
    cuPythonInit()
    if __cuImportExternalSemaphore == NULL:
        with gil:
            raise RuntimeError('Function "cuImportExternalSemaphore" not found')
    err = (<CUresult (*)(CUexternalSemaphore*, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuImportExternalSemaphore)(extSem_out, semHandleDesc)
    return err
{{endif}}

{{if 'cuSignalExternalSemaphoresAsync' in found_functions}}

cdef CUresult _cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuSignalExternalSemaphoresAsync
    cuPythonInit()
    if __cuSignalExternalSemaphoresAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuSignalExternalSemaphoresAsync" not found')
    err = (<CUresult (*)(const CUexternalSemaphore*, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS*, unsigned int, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuSignalExternalSemaphoresAsync)(extSemArray, paramsArray, numExtSems, stream)
    return err
{{endif}}

{{if 'cuWaitExternalSemaphoresAsync' in found_functions}}

cdef CUresult _cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuWaitExternalSemaphoresAsync
    cuPythonInit()
    if __cuWaitExternalSemaphoresAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuWaitExternalSemaphoresAsync" not found')
    err = (<CUresult (*)(const CUexternalSemaphore*, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS*, unsigned int, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuWaitExternalSemaphoresAsync)(extSemArray, paramsArray, numExtSems, stream)
    return err
{{endif}}

{{if 'cuDestroyExternalSemaphore' in found_functions}}

cdef CUresult _cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDestroyExternalSemaphore
    cuPythonInit()
    if __cuDestroyExternalSemaphore == NULL:
        with gil:
            raise RuntimeError('Function "cuDestroyExternalSemaphore" not found')
    err = (<CUresult (*)(CUexternalSemaphore) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDestroyExternalSemaphore)(extSem)
    return err
{{endif}}

{{if 'cuStreamWaitValue32_v2' in found_functions}}

cdef CUresult _cuStreamWaitValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamWaitValue32_v2
    cuPythonInit()
    if __cuStreamWaitValue32_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamWaitValue32_v2" not found')
    err = (<CUresult (*)(CUstream, CUdeviceptr, cuuint32_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamWaitValue32_v2)(stream, addr, value, flags)
    return err
{{endif}}

{{if 'cuStreamWaitValue64_v2' in found_functions}}

cdef CUresult _cuStreamWaitValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamWaitValue64_v2
    cuPythonInit()
    if __cuStreamWaitValue64_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamWaitValue64_v2" not found')
    err = (<CUresult (*)(CUstream, CUdeviceptr, cuuint64_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamWaitValue64_v2)(stream, addr, value, flags)
    return err
{{endif}}

{{if 'cuStreamWriteValue32_v2' in found_functions}}

cdef CUresult _cuStreamWriteValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamWriteValue32_v2
    cuPythonInit()
    if __cuStreamWriteValue32_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamWriteValue32_v2" not found')
    err = (<CUresult (*)(CUstream, CUdeviceptr, cuuint32_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamWriteValue32_v2)(stream, addr, value, flags)
    return err
{{endif}}

{{if 'cuStreamWriteValue64_v2' in found_functions}}

cdef CUresult _cuStreamWriteValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamWriteValue64_v2
    cuPythonInit()
    if __cuStreamWriteValue64_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamWriteValue64_v2" not found')
    err = (<CUresult (*)(CUstream, CUdeviceptr, cuuint64_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamWriteValue64_v2)(stream, addr, value, flags)
    return err
{{endif}}

{{if 'cuStreamBatchMemOp_v2' in found_functions}}

cdef CUresult _cuStreamBatchMemOp_v2(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamBatchMemOp_v2
    cuPythonInit()
    if __cuStreamBatchMemOp_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamBatchMemOp_v2" not found')
    err = (<CUresult (*)(CUstream, unsigned int, CUstreamBatchMemOpParams*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamBatchMemOp_v2)(stream, count, paramArray, flags)
    return err
{{endif}}

{{if 'cuFuncGetAttribute' in found_functions}}

cdef CUresult _cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFuncGetAttribute
    cuPythonInit()
    if __cuFuncGetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuFuncGetAttribute" not found')
    err = (<CUresult (*)(int*, CUfunction_attribute, CUfunction) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFuncGetAttribute)(pi, attrib, hfunc)
    return err
{{endif}}

{{if 'cuFuncSetAttribute' in found_functions}}

cdef CUresult _cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFuncSetAttribute
    cuPythonInit()
    if __cuFuncSetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuFuncSetAttribute" not found')
    err = (<CUresult (*)(CUfunction, CUfunction_attribute, int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFuncSetAttribute)(hfunc, attrib, value)
    return err
{{endif}}

{{if 'cuFuncSetCacheConfig' in found_functions}}

cdef CUresult _cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFuncSetCacheConfig
    cuPythonInit()
    if __cuFuncSetCacheConfig == NULL:
        with gil:
            raise RuntimeError('Function "cuFuncSetCacheConfig" not found')
    err = (<CUresult (*)(CUfunction, CUfunc_cache) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFuncSetCacheConfig)(hfunc, config)
    return err
{{endif}}

{{if 'cuFuncGetModule' in found_functions}}

cdef CUresult _cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFuncGetModule
    cuPythonInit()
    if __cuFuncGetModule == NULL:
        with gil:
            raise RuntimeError('Function "cuFuncGetModule" not found')
    err = (<CUresult (*)(CUmodule*, CUfunction) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFuncGetModule)(hmod, hfunc)
    return err
{{endif}}

{{if 'cuFuncGetName' in found_functions}}

cdef CUresult _cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFuncGetName
    cuPythonInit()
    if __cuFuncGetName == NULL:
        with gil:
            raise RuntimeError('Function "cuFuncGetName" not found')
    err = (<CUresult (*)(const char**, CUfunction) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFuncGetName)(name, hfunc)
    return err
{{endif}}

{{if 'cuFuncGetParamInfo' in found_functions}}

cdef CUresult _cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFuncGetParamInfo
    cuPythonInit()
    if __cuFuncGetParamInfo == NULL:
        with gil:
            raise RuntimeError('Function "cuFuncGetParamInfo" not found')
    err = (<CUresult (*)(CUfunction, size_t, size_t*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFuncGetParamInfo)(func, paramIndex, paramOffset, paramSize)
    return err
{{endif}}

{{if 'cuFuncIsLoaded' in found_functions}}

cdef CUresult _cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFuncIsLoaded
    cuPythonInit()
    if __cuFuncIsLoaded == NULL:
        with gil:
            raise RuntimeError('Function "cuFuncIsLoaded" not found')
    err = (<CUresult (*)(CUfunctionLoadingState*, CUfunction) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFuncIsLoaded)(state, function)
    return err
{{endif}}

{{if 'cuFuncLoad' in found_functions}}

cdef CUresult _cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFuncLoad
    cuPythonInit()
    if __cuFuncLoad == NULL:
        with gil:
            raise RuntimeError('Function "cuFuncLoad" not found')
    err = (<CUresult (*)(CUfunction) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFuncLoad)(function)
    return err
{{endif}}

{{if 'cuLaunchKernel' in found_functions}}

cdef CUresult _cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLaunchKernel
    cuPythonInit()
    if __cuLaunchKernel == NULL:
        with gil:
            raise RuntimeError('Function "cuLaunchKernel" not found')
    err = (<CUresult (*)(CUfunction, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, CUstream, void**, void**) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLaunchKernel)(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams, extra)
    return err
{{endif}}

{{if 'cuLaunchKernelEx' in found_functions}}

cdef CUresult _cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLaunchKernelEx
    cuPythonInit()
    if __cuLaunchKernelEx == NULL:
        with gil:
            raise RuntimeError('Function "cuLaunchKernelEx" not found')
    err = (<CUresult (*)(const CUlaunchConfig*, CUfunction, void**, void**) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLaunchKernelEx)(config, f, kernelParams, extra)
    return err
{{endif}}

{{if 'cuLaunchCooperativeKernel' in found_functions}}

cdef CUresult _cuLaunchCooperativeKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLaunchCooperativeKernel
    cuPythonInit()
    if __cuLaunchCooperativeKernel == NULL:
        with gil:
            raise RuntimeError('Function "cuLaunchCooperativeKernel" not found')
    err = (<CUresult (*)(CUfunction, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, CUstream, void**) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLaunchCooperativeKernel)(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams)
    return err
{{endif}}

{{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}}

cdef CUresult _cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLaunchCooperativeKernelMultiDevice
    cuPythonInit()
    if __cuLaunchCooperativeKernelMultiDevice == NULL:
        with gil:
            raise RuntimeError('Function "cuLaunchCooperativeKernelMultiDevice" not found')
    err = (<CUresult (*)(CUDA_LAUNCH_PARAMS*, unsigned int, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLaunchCooperativeKernelMultiDevice)(launchParamsList, numDevices, flags)
    return err
{{endif}}

{{if 'cuLaunchHostFunc' in found_functions}}

cdef CUresult _cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLaunchHostFunc
    cuPythonInit()
    if __cuLaunchHostFunc == NULL:
        with gil:
            raise RuntimeError('Function "cuLaunchHostFunc" not found')
    err = (<CUresult (*)(CUstream, CUhostFn, void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLaunchHostFunc)(hStream, fn, userData)
    return err
{{endif}}

{{if 'cuFuncSetBlockShape' in found_functions}}

cdef CUresult _cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFuncSetBlockShape
    cuPythonInit()
    if __cuFuncSetBlockShape == NULL:
        with gil:
            raise RuntimeError('Function "cuFuncSetBlockShape" not found')
    err = (<CUresult (*)(CUfunction, int, int, int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFuncSetBlockShape)(hfunc, x, y, z)
    return err
{{endif}}

{{if 'cuFuncSetSharedSize' in found_functions}}

cdef CUresult _cuFuncSetSharedSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFuncSetSharedSize
    cuPythonInit()
    if __cuFuncSetSharedSize == NULL:
        with gil:
            raise RuntimeError('Function "cuFuncSetSharedSize" not found')
    err = (<CUresult (*)(CUfunction, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFuncSetSharedSize)(hfunc, numbytes)
    return err
{{endif}}

{{if 'cuParamSetSize' in found_functions}}

cdef CUresult _cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuParamSetSize
    cuPythonInit()
    if __cuParamSetSize == NULL:
        with gil:
            raise RuntimeError('Function "cuParamSetSize" not found')
    err = (<CUresult (*)(CUfunction, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuParamSetSize)(hfunc, numbytes)
    return err
{{endif}}

{{if 'cuParamSeti' in found_functions}}

cdef CUresult _cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuParamSeti
    cuPythonInit()
    if __cuParamSeti == NULL:
        with gil:
            raise RuntimeError('Function "cuParamSeti" not found')
    err = (<CUresult (*)(CUfunction, int, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuParamSeti)(hfunc, offset, value)
    return err
{{endif}}

{{if 'cuParamSetf' in found_functions}}

cdef CUresult _cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuParamSetf
    cuPythonInit()
    if __cuParamSetf == NULL:
        with gil:
            raise RuntimeError('Function "cuParamSetf" not found')
    err = (<CUresult (*)(CUfunction, int, float) except ?CUDA_ERROR_NOT_FOUND nogil> __cuParamSetf)(hfunc, offset, value)
    return err
{{endif}}

{{if 'cuParamSetv' in found_functions}}

cdef CUresult _cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuParamSetv
    cuPythonInit()
    if __cuParamSetv == NULL:
        with gil:
            raise RuntimeError('Function "cuParamSetv" not found')
    err = (<CUresult (*)(CUfunction, int, void*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuParamSetv)(hfunc, offset, ptr, numbytes)
    return err
{{endif}}

{{if 'cuLaunch' in found_functions}}

cdef CUresult _cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLaunch
    cuPythonInit()
    if __cuLaunch == NULL:
        with gil:
            raise RuntimeError('Function "cuLaunch" not found')
    err = (<CUresult (*)(CUfunction) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLaunch)(f)
    return err
{{endif}}

{{if 'cuLaunchGrid' in found_functions}}

cdef CUresult _cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLaunchGrid
    cuPythonInit()
    if __cuLaunchGrid == NULL:
        with gil:
            raise RuntimeError('Function "cuLaunchGrid" not found')
    err = (<CUresult (*)(CUfunction, int, int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLaunchGrid)(f, grid_width, grid_height)
    return err
{{endif}}

{{if 'cuLaunchGridAsync' in found_functions}}

cdef CUresult _cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLaunchGridAsync
    cuPythonInit()
    if __cuLaunchGridAsync == NULL:
        with gil:
            raise RuntimeError('Function "cuLaunchGridAsync" not found')
    err = (<CUresult (*)(CUfunction, int, int, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLaunchGridAsync)(f, grid_width, grid_height, hStream)
    return err
{{endif}}

{{if 'cuParamSetTexRef' in found_functions}}

cdef CUresult _cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuParamSetTexRef
    cuPythonInit()
    if __cuParamSetTexRef == NULL:
        with gil:
            raise RuntimeError('Function "cuParamSetTexRef" not found')
    err = (<CUresult (*)(CUfunction, int, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuParamSetTexRef)(hfunc, texunit, hTexRef)
    return err
{{endif}}

{{if 'cuFuncSetSharedMemConfig' in found_functions}}

cdef CUresult _cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuFuncSetSharedMemConfig
    cuPythonInit()
    if __cuFuncSetSharedMemConfig == NULL:
        with gil:
            raise RuntimeError('Function "cuFuncSetSharedMemConfig" not found')
    err = (<CUresult (*)(CUfunction, CUsharedconfig) except ?CUDA_ERROR_NOT_FOUND nogil> __cuFuncSetSharedMemConfig)(hfunc, config)
    return err
{{endif}}

{{if 'cuGraphCreate' in found_functions}}

cdef CUresult _cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphCreate
    cuPythonInit()
    if __cuGraphCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphCreate" not found')
    err = (<CUresult (*)(CUgraph*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphCreate)(phGraph, flags)
    return err
{{endif}}

{{if 'cuGraphAddKernelNode_v2' in found_functions}}

cdef CUresult _cuGraphAddKernelNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddKernelNode_v2
    cuPythonInit()
    if __cuGraphAddKernelNode_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddKernelNode_v2" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, const CUDA_KERNEL_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddKernelNode_v2)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams)
    return err
{{endif}}

{{if 'cuGraphKernelNodeGetParams_v2' in found_functions}}

cdef CUresult _cuGraphKernelNodeGetParams_v2(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphKernelNodeGetParams_v2
    cuPythonInit()
    if __cuGraphKernelNodeGetParams_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphKernelNodeGetParams_v2" not found')
    err = (<CUresult (*)(CUgraphNode, CUDA_KERNEL_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphKernelNodeGetParams_v2)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphKernelNodeSetParams_v2' in found_functions}}

cdef CUresult _cuGraphKernelNodeSetParams_v2(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphKernelNodeSetParams_v2
    cuPythonInit()
    if __cuGraphKernelNodeSetParams_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphKernelNodeSetParams_v2" not found')
    err = (<CUresult (*)(CUgraphNode, const CUDA_KERNEL_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphKernelNodeSetParams_v2)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphAddMemcpyNode' in found_functions}}

cdef CUresult _cuGraphAddMemcpyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddMemcpyNode
    cuPythonInit()
    if __cuGraphAddMemcpyNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddMemcpyNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, const CUDA_MEMCPY3D*, CUcontext) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddMemcpyNode)(phGraphNode, hGraph, dependencies, numDependencies, copyParams, ctx)
    return err
{{endif}}

{{if 'cuGraphMemcpyNodeGetParams' in found_functions}}

cdef CUresult _cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphMemcpyNodeGetParams
    cuPythonInit()
    if __cuGraphMemcpyNodeGetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphMemcpyNodeGetParams" not found')
    err = (<CUresult (*)(CUgraphNode, CUDA_MEMCPY3D*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphMemcpyNodeGetParams)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphMemcpyNodeSetParams' in found_functions}}

cdef CUresult _cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphMemcpyNodeSetParams
    cuPythonInit()
    if __cuGraphMemcpyNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphMemcpyNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphNode, const CUDA_MEMCPY3D*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphMemcpyNodeSetParams)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphAddMemsetNode' in found_functions}}

cdef CUresult _cuGraphAddMemsetNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddMemsetNode
    cuPythonInit()
    if __cuGraphAddMemsetNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddMemsetNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, const CUDA_MEMSET_NODE_PARAMS*, CUcontext) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddMemsetNode)(phGraphNode, hGraph, dependencies, numDependencies, memsetParams, ctx)
    return err
{{endif}}

{{if 'cuGraphMemsetNodeGetParams' in found_functions}}

cdef CUresult _cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphMemsetNodeGetParams
    cuPythonInit()
    if __cuGraphMemsetNodeGetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphMemsetNodeGetParams" not found')
    err = (<CUresult (*)(CUgraphNode, CUDA_MEMSET_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphMemsetNodeGetParams)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphMemsetNodeSetParams' in found_functions}}

cdef CUresult _cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphMemsetNodeSetParams
    cuPythonInit()
    if __cuGraphMemsetNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphMemsetNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphNode, const CUDA_MEMSET_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphMemsetNodeSetParams)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphAddHostNode' in found_functions}}

cdef CUresult _cuGraphAddHostNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddHostNode
    cuPythonInit()
    if __cuGraphAddHostNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddHostNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, const CUDA_HOST_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddHostNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams)
    return err
{{endif}}

{{if 'cuGraphHostNodeGetParams' in found_functions}}

cdef CUresult _cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphHostNodeGetParams
    cuPythonInit()
    if __cuGraphHostNodeGetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphHostNodeGetParams" not found')
    err = (<CUresult (*)(CUgraphNode, CUDA_HOST_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphHostNodeGetParams)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphHostNodeSetParams' in found_functions}}

cdef CUresult _cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphHostNodeSetParams
    cuPythonInit()
    if __cuGraphHostNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphHostNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphNode, const CUDA_HOST_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphHostNodeSetParams)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphAddChildGraphNode' in found_functions}}

cdef CUresult _cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddChildGraphNode
    cuPythonInit()
    if __cuGraphAddChildGraphNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddChildGraphNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, CUgraph) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddChildGraphNode)(phGraphNode, hGraph, dependencies, numDependencies, childGraph)
    return err
{{endif}}

{{if 'cuGraphChildGraphNodeGetGraph' in found_functions}}

cdef CUresult _cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphChildGraphNodeGetGraph
    cuPythonInit()
    if __cuGraphChildGraphNodeGetGraph == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphChildGraphNodeGetGraph" not found')
    err = (<CUresult (*)(CUgraphNode, CUgraph*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphChildGraphNodeGetGraph)(hNode, phGraph)
    return err
{{endif}}

{{if 'cuGraphAddEmptyNode' in found_functions}}

cdef CUresult _cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddEmptyNode
    cuPythonInit()
    if __cuGraphAddEmptyNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddEmptyNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddEmptyNode)(phGraphNode, hGraph, dependencies, numDependencies)
    return err
{{endif}}

{{if 'cuGraphAddEventRecordNode' in found_functions}}

cdef CUresult _cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddEventRecordNode
    cuPythonInit()
    if __cuGraphAddEventRecordNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddEventRecordNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddEventRecordNode)(phGraphNode, hGraph, dependencies, numDependencies, event)
    return err
{{endif}}

{{if 'cuGraphEventRecordNodeGetEvent' in found_functions}}

cdef CUresult _cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphEventRecordNodeGetEvent
    cuPythonInit()
    if __cuGraphEventRecordNodeGetEvent == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphEventRecordNodeGetEvent" not found')
    err = (<CUresult (*)(CUgraphNode, CUevent*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphEventRecordNodeGetEvent)(hNode, event_out)
    return err
{{endif}}

{{if 'cuGraphEventRecordNodeSetEvent' in found_functions}}

cdef CUresult _cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphEventRecordNodeSetEvent
    cuPythonInit()
    if __cuGraphEventRecordNodeSetEvent == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphEventRecordNodeSetEvent" not found')
    err = (<CUresult (*)(CUgraphNode, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphEventRecordNodeSetEvent)(hNode, event)
    return err
{{endif}}

{{if 'cuGraphAddEventWaitNode' in found_functions}}

cdef CUresult _cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddEventWaitNode
    cuPythonInit()
    if __cuGraphAddEventWaitNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddEventWaitNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddEventWaitNode)(phGraphNode, hGraph, dependencies, numDependencies, event)
    return err
{{endif}}

{{if 'cuGraphEventWaitNodeGetEvent' in found_functions}}

cdef CUresult _cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphEventWaitNodeGetEvent
    cuPythonInit()
    if __cuGraphEventWaitNodeGetEvent == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphEventWaitNodeGetEvent" not found')
    err = (<CUresult (*)(CUgraphNode, CUevent*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphEventWaitNodeGetEvent)(hNode, event_out)
    return err
{{endif}}

{{if 'cuGraphEventWaitNodeSetEvent' in found_functions}}

cdef CUresult _cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphEventWaitNodeSetEvent
    cuPythonInit()
    if __cuGraphEventWaitNodeSetEvent == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphEventWaitNodeSetEvent" not found')
    err = (<CUresult (*)(CUgraphNode, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphEventWaitNodeSetEvent)(hNode, event)
    return err
{{endif}}

{{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}}

cdef CUresult _cuGraphAddExternalSemaphoresSignalNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddExternalSemaphoresSignalNode
    cuPythonInit()
    if __cuGraphAddExternalSemaphoresSignalNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddExternalSemaphoresSignalNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddExternalSemaphoresSignalNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams)
    return err
{{endif}}

{{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}}

cdef CUresult _cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExternalSemaphoresSignalNodeGetParams
    cuPythonInit()
    if __cuGraphExternalSemaphoresSignalNodeGetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExternalSemaphoresSignalNodeGetParams" not found')
    err = (<CUresult (*)(CUgraphNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExternalSemaphoresSignalNodeGetParams)(hNode, params_out)
    return err
{{endif}}

{{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}}

cdef CUresult _cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExternalSemaphoresSignalNodeSetParams
    cuPythonInit()
    if __cuGraphExternalSemaphoresSignalNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExternalSemaphoresSignalNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExternalSemaphoresSignalNodeSetParams)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}}

cdef CUresult _cuGraphAddExternalSemaphoresWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddExternalSemaphoresWaitNode
    cuPythonInit()
    if __cuGraphAddExternalSemaphoresWaitNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddExternalSemaphoresWaitNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, const CUDA_EXT_SEM_WAIT_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddExternalSemaphoresWaitNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams)
    return err
{{endif}}

{{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}}

cdef CUresult _cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExternalSemaphoresWaitNodeGetParams
    cuPythonInit()
    if __cuGraphExternalSemaphoresWaitNodeGetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExternalSemaphoresWaitNodeGetParams" not found')
    err = (<CUresult (*)(CUgraphNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExternalSemaphoresWaitNodeGetParams)(hNode, params_out)
    return err
{{endif}}

{{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}}

cdef CUresult _cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExternalSemaphoresWaitNodeSetParams
    cuPythonInit()
    if __cuGraphExternalSemaphoresWaitNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExternalSemaphoresWaitNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExternalSemaphoresWaitNodeSetParams)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphAddBatchMemOpNode' in found_functions}}

cdef CUresult _cuGraphAddBatchMemOpNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddBatchMemOpNode
    cuPythonInit()
    if __cuGraphAddBatchMemOpNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddBatchMemOpNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, const CUDA_BATCH_MEM_OP_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddBatchMemOpNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams)
    return err
{{endif}}

{{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}}

cdef CUresult _cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphBatchMemOpNodeGetParams
    cuPythonInit()
    if __cuGraphBatchMemOpNodeGetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphBatchMemOpNodeGetParams" not found')
    err = (<CUresult (*)(CUgraphNode, CUDA_BATCH_MEM_OP_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphBatchMemOpNodeGetParams)(hNode, nodeParams_out)
    return err
{{endif}}

{{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}}

cdef CUresult _cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphBatchMemOpNodeSetParams
    cuPythonInit()
    if __cuGraphBatchMemOpNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphBatchMemOpNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphBatchMemOpNodeSetParams)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}}

cdef CUresult _cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecBatchMemOpNodeSetParams
    cuPythonInit()
    if __cuGraphExecBatchMemOpNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecBatchMemOpNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecBatchMemOpNodeSetParams)(hGraphExec, hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphAddMemAllocNode' in found_functions}}

cdef CUresult _cuGraphAddMemAllocNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUDA_MEM_ALLOC_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddMemAllocNode
    cuPythonInit()
    if __cuGraphAddMemAllocNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddMemAllocNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, CUDA_MEM_ALLOC_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddMemAllocNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams)
    return err
{{endif}}

{{if 'cuGraphMemAllocNodeGetParams' in found_functions}}

cdef CUresult _cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphMemAllocNodeGetParams
    cuPythonInit()
    if __cuGraphMemAllocNodeGetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphMemAllocNodeGetParams" not found')
    err = (<CUresult (*)(CUgraphNode, CUDA_MEM_ALLOC_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphMemAllocNodeGetParams)(hNode, params_out)
    return err
{{endif}}

{{if 'cuGraphAddMemFreeNode' in found_functions}}

cdef CUresult _cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddMemFreeNode
    cuPythonInit()
    if __cuGraphAddMemFreeNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddMemFreeNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, CUdeviceptr) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddMemFreeNode)(phGraphNode, hGraph, dependencies, numDependencies, dptr)
    return err
{{endif}}

{{if 'cuGraphMemFreeNodeGetParams' in found_functions}}

cdef CUresult _cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphMemFreeNodeGetParams
    cuPythonInit()
    if __cuGraphMemFreeNodeGetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphMemFreeNodeGetParams" not found')
    err = (<CUresult (*)(CUgraphNode, CUdeviceptr*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphMemFreeNodeGetParams)(hNode, dptr_out)
    return err
{{endif}}

{{if 'cuDeviceGraphMemTrim' in found_functions}}

cdef CUresult _cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGraphMemTrim
    cuPythonInit()
    if __cuDeviceGraphMemTrim == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGraphMemTrim" not found')
    err = (<CUresult (*)(CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGraphMemTrim)(device)
    return err
{{endif}}

{{if 'cuDeviceGetGraphMemAttribute' in found_functions}}

cdef CUresult _cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetGraphMemAttribute
    cuPythonInit()
    if __cuDeviceGetGraphMemAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetGraphMemAttribute" not found')
    err = (<CUresult (*)(CUdevice, CUgraphMem_attribute, void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetGraphMemAttribute)(device, attr, value)
    return err
{{endif}}

{{if 'cuDeviceSetGraphMemAttribute' in found_functions}}

cdef CUresult _cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceSetGraphMemAttribute
    cuPythonInit()
    if __cuDeviceSetGraphMemAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceSetGraphMemAttribute" not found')
    err = (<CUresult (*)(CUdevice, CUgraphMem_attribute, void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceSetGraphMemAttribute)(device, attr, value)
    return err
{{endif}}

{{if 'cuGraphClone' in found_functions}}

cdef CUresult _cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphClone
    cuPythonInit()
    if __cuGraphClone == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphClone" not found')
    err = (<CUresult (*)(CUgraph*, CUgraph) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphClone)(phGraphClone, originalGraph)
    return err
{{endif}}

{{if 'cuGraphNodeFindInClone' in found_functions}}

cdef CUresult _cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphNodeFindInClone
    cuPythonInit()
    if __cuGraphNodeFindInClone == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphNodeFindInClone" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraphNode, CUgraph) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphNodeFindInClone)(phNode, hOriginalNode, hClonedGraph)
    return err
{{endif}}

{{if 'cuGraphNodeGetType' in found_functions}}

cdef CUresult _cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* typename) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphNodeGetType
    cuPythonInit()
    if __cuGraphNodeGetType == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphNodeGetType" not found')
    err = (<CUresult (*)(CUgraphNode, CUgraphNodeType*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphNodeGetType)(hNode, typename)
    return err
{{endif}}

{{if 'cuGraphGetNodes' in found_functions}}

cdef CUresult _cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphGetNodes
    cuPythonInit()
    if __cuGraphGetNodes == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphGetNodes" not found')
    err = (<CUresult (*)(CUgraph, CUgraphNode*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphGetNodes)(hGraph, nodes, numNodes)
    return err
{{endif}}

{{if 'cuGraphGetRootNodes' in found_functions}}

cdef CUresult _cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphGetRootNodes
    cuPythonInit()
    if __cuGraphGetRootNodes == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphGetRootNodes" not found')
    err = (<CUresult (*)(CUgraph, CUgraphNode*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphGetRootNodes)(hGraph, rootNodes, numRootNodes)
    return err
{{endif}}

{{if 'cuGraphGetEdges' in found_functions}}

cdef CUresult _cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphGetEdges
    cuPythonInit()
    if __cuGraphGetEdges == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphGetEdges" not found')
    err = (<CUresult (*)(CUgraph, CUgraphNode*, CUgraphNode*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphGetEdges)(hGraph, from_, to, numEdges)
    return err
{{endif}}

{{if 'cuGraphGetEdges_v2' in found_functions}}

cdef CUresult _cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphGetEdges_v2
    cuPythonInit()
    if __cuGraphGetEdges_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphGetEdges_v2" not found')
    err = (<CUresult (*)(CUgraph, CUgraphNode*, CUgraphNode*, CUgraphEdgeData*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphGetEdges_v2)(hGraph, from_, to, edgeData, numEdges)
    return err
{{endif}}

{{if 'cuGraphNodeGetDependencies' in found_functions}}

cdef CUresult _cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphNodeGetDependencies
    cuPythonInit()
    if __cuGraphNodeGetDependencies == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphNodeGetDependencies" not found')
    err = (<CUresult (*)(CUgraphNode, CUgraphNode*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphNodeGetDependencies)(hNode, dependencies, numDependencies)
    return err
{{endif}}

{{if 'cuGraphNodeGetDependencies_v2' in found_functions}}

cdef CUresult _cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphNodeGetDependencies_v2
    cuPythonInit()
    if __cuGraphNodeGetDependencies_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphNodeGetDependencies_v2" not found')
    err = (<CUresult (*)(CUgraphNode, CUgraphNode*, CUgraphEdgeData*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphNodeGetDependencies_v2)(hNode, dependencies, edgeData, numDependencies)
    return err
{{endif}}

{{if 'cuGraphNodeGetDependentNodes' in found_functions}}

cdef CUresult _cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphNodeGetDependentNodes
    cuPythonInit()
    if __cuGraphNodeGetDependentNodes == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphNodeGetDependentNodes" not found')
    err = (<CUresult (*)(CUgraphNode, CUgraphNode*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphNodeGetDependentNodes)(hNode, dependentNodes, numDependentNodes)
    return err
{{endif}}

{{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}}

cdef CUresult _cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphNodeGetDependentNodes_v2
    cuPythonInit()
    if __cuGraphNodeGetDependentNodes_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphNodeGetDependentNodes_v2" not found')
    err = (<CUresult (*)(CUgraphNode, CUgraphNode*, CUgraphEdgeData*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphNodeGetDependentNodes_v2)(hNode, dependentNodes, edgeData, numDependentNodes)
    return err
{{endif}}

{{if 'cuGraphAddDependencies' in found_functions}}

cdef CUresult _cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddDependencies
    cuPythonInit()
    if __cuGraphAddDependencies == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddDependencies" not found')
    err = (<CUresult (*)(CUgraph, const CUgraphNode*, const CUgraphNode*, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddDependencies)(hGraph, from_, to, numDependencies)
    return err
{{endif}}

{{if 'cuGraphAddDependencies_v2' in found_functions}}

cdef CUresult _cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddDependencies_v2
    cuPythonInit()
    if __cuGraphAddDependencies_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddDependencies_v2" not found')
    err = (<CUresult (*)(CUgraph, const CUgraphNode*, const CUgraphNode*, const CUgraphEdgeData*, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddDependencies_v2)(hGraph, from_, to, edgeData, numDependencies)
    return err
{{endif}}

{{if 'cuGraphRemoveDependencies' in found_functions}}

cdef CUresult _cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphRemoveDependencies
    cuPythonInit()
    if __cuGraphRemoveDependencies == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphRemoveDependencies" not found')
    err = (<CUresult (*)(CUgraph, const CUgraphNode*, const CUgraphNode*, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphRemoveDependencies)(hGraph, from_, to, numDependencies)
    return err
{{endif}}

{{if 'cuGraphRemoveDependencies_v2' in found_functions}}

cdef CUresult _cuGraphRemoveDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphRemoveDependencies_v2
    cuPythonInit()
    if __cuGraphRemoveDependencies_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphRemoveDependencies_v2" not found')
    err = (<CUresult (*)(CUgraph, const CUgraphNode*, const CUgraphNode*, const CUgraphEdgeData*, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphRemoveDependencies_v2)(hGraph, from_, to, edgeData, numDependencies)
    return err
{{endif}}

{{if 'cuGraphDestroyNode' in found_functions}}

cdef CUresult _cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphDestroyNode
    cuPythonInit()
    if __cuGraphDestroyNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphDestroyNode" not found')
    err = (<CUresult (*)(CUgraphNode) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphDestroyNode)(hNode)
    return err
{{endif}}

{{if 'cuGraphInstantiateWithFlags' in found_functions}}

cdef CUresult _cuGraphInstantiateWithFlags(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphInstantiateWithFlags
    cuPythonInit()
    if __cuGraphInstantiateWithFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphInstantiateWithFlags" not found')
    err = (<CUresult (*)(CUgraphExec*, CUgraph, unsigned long long) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphInstantiateWithFlags)(phGraphExec, hGraph, flags)
    return err
{{endif}}

{{if 'cuGraphInstantiateWithParams' in found_functions}}

cdef CUresult _cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphInstantiateWithParams
    cuPythonInit()
    if __cuGraphInstantiateWithParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphInstantiateWithParams" not found')
    err = (<CUresult (*)(CUgraphExec*, CUgraph, CUDA_GRAPH_INSTANTIATE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphInstantiateWithParams)(phGraphExec, hGraph, instantiateParams)
    return err
{{endif}}

{{if 'cuGraphExecGetFlags' in found_functions}}

cdef CUresult _cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecGetFlags
    cuPythonInit()
    if __cuGraphExecGetFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecGetFlags" not found')
    err = (<CUresult (*)(CUgraphExec, cuuint64_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecGetFlags)(hGraphExec, flags)
    return err
{{endif}}

{{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}}

cdef CUresult _cuGraphExecKernelNodeSetParams_v2(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecKernelNodeSetParams_v2
    cuPythonInit()
    if __cuGraphExecKernelNodeSetParams_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecKernelNodeSetParams_v2" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, const CUDA_KERNEL_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecKernelNodeSetParams_v2)(hGraphExec, hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}}

cdef CUresult _cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecMemcpyNodeSetParams
    cuPythonInit()
    if __cuGraphExecMemcpyNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecMemcpyNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, const CUDA_MEMCPY3D*, CUcontext) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecMemcpyNodeSetParams)(hGraphExec, hNode, copyParams, ctx)
    return err
{{endif}}

{{if 'cuGraphExecMemsetNodeSetParams' in found_functions}}

cdef CUresult _cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecMemsetNodeSetParams
    cuPythonInit()
    if __cuGraphExecMemsetNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecMemsetNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, const CUDA_MEMSET_NODE_PARAMS*, CUcontext) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecMemsetNodeSetParams)(hGraphExec, hNode, memsetParams, ctx)
    return err
{{endif}}

{{if 'cuGraphExecHostNodeSetParams' in found_functions}}

cdef CUresult _cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecHostNodeSetParams
    cuPythonInit()
    if __cuGraphExecHostNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecHostNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, const CUDA_HOST_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecHostNodeSetParams)(hGraphExec, hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}}

cdef CUresult _cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecChildGraphNodeSetParams
    cuPythonInit()
    if __cuGraphExecChildGraphNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecChildGraphNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, CUgraph) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecChildGraphNodeSetParams)(hGraphExec, hNode, childGraph)
    return err
{{endif}}

{{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}}

cdef CUresult _cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecEventRecordNodeSetEvent
    cuPythonInit()
    if __cuGraphExecEventRecordNodeSetEvent == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecEventRecordNodeSetEvent" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecEventRecordNodeSetEvent)(hGraphExec, hNode, event)
    return err
{{endif}}

{{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}}

cdef CUresult _cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecEventWaitNodeSetEvent
    cuPythonInit()
    if __cuGraphExecEventWaitNodeSetEvent == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecEventWaitNodeSetEvent" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecEventWaitNodeSetEvent)(hGraphExec, hNode, event)
    return err
{{endif}}

{{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}}

cdef CUresult _cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecExternalSemaphoresSignalNodeSetParams
    cuPythonInit()
    if __cuGraphExecExternalSemaphoresSignalNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecExternalSemaphoresSignalNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecExternalSemaphoresSignalNodeSetParams)(hGraphExec, hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}}

cdef CUresult _cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecExternalSemaphoresWaitNodeSetParams
    cuPythonInit()
    if __cuGraphExecExternalSemaphoresWaitNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecExternalSemaphoresWaitNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecExternalSemaphoresWaitNodeSetParams)(hGraphExec, hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphNodeSetEnabled' in found_functions}}

cdef CUresult _cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphNodeSetEnabled
    cuPythonInit()
    if __cuGraphNodeSetEnabled == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphNodeSetEnabled" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphNodeSetEnabled)(hGraphExec, hNode, isEnabled)
    return err
{{endif}}

{{if 'cuGraphNodeGetEnabled' in found_functions}}

cdef CUresult _cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphNodeGetEnabled
    cuPythonInit()
    if __cuGraphNodeGetEnabled == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphNodeGetEnabled" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, unsigned int*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphNodeGetEnabled)(hGraphExec, hNode, isEnabled)
    return err
{{endif}}

{{if 'cuGraphUpload' in found_functions}}

cdef CUresult _cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphUpload
    cuPythonInit()
    if __cuGraphUpload == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphUpload" not found')
    err = (<CUresult (*)(CUgraphExec, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphUpload)(hGraphExec, hStream)
    return err
{{endif}}

{{if 'cuGraphLaunch' in found_functions}}

cdef CUresult _cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphLaunch
    cuPythonInit()
    if __cuGraphLaunch == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphLaunch" not found')
    err = (<CUresult (*)(CUgraphExec, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphLaunch)(hGraphExec, hStream)
    return err
{{endif}}

{{if 'cuGraphExecDestroy' in found_functions}}

cdef CUresult _cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecDestroy
    cuPythonInit()
    if __cuGraphExecDestroy == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecDestroy" not found')
    err = (<CUresult (*)(CUgraphExec) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecDestroy)(hGraphExec)
    return err
{{endif}}

{{if 'cuGraphDestroy' in found_functions}}

cdef CUresult _cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphDestroy
    cuPythonInit()
    if __cuGraphDestroy == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphDestroy" not found')
    err = (<CUresult (*)(CUgraph) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphDestroy)(hGraph)
    return err
{{endif}}

{{if 'cuGraphExecUpdate_v2' in found_functions}}

cdef CUresult _cuGraphExecUpdate_v2(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecUpdate_v2
    cuPythonInit()
    if __cuGraphExecUpdate_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecUpdate_v2" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraph, CUgraphExecUpdateResultInfo*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecUpdate_v2)(hGraphExec, hGraph, resultInfo)
    return err
{{endif}}

{{if 'cuGraphKernelNodeCopyAttributes' in found_functions}}

cdef CUresult _cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphKernelNodeCopyAttributes
    cuPythonInit()
    if __cuGraphKernelNodeCopyAttributes == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphKernelNodeCopyAttributes" not found')
    err = (<CUresult (*)(CUgraphNode, CUgraphNode) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphKernelNodeCopyAttributes)(dst, src)
    return err
{{endif}}

{{if 'cuGraphKernelNodeGetAttribute' in found_functions}}

cdef CUresult _cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphKernelNodeGetAttribute
    cuPythonInit()
    if __cuGraphKernelNodeGetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphKernelNodeGetAttribute" not found')
    err = (<CUresult (*)(CUgraphNode, CUkernelNodeAttrID, CUkernelNodeAttrValue*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphKernelNodeGetAttribute)(hNode, attr, value_out)
    return err
{{endif}}

{{if 'cuGraphKernelNodeSetAttribute' in found_functions}}

cdef CUresult _cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphKernelNodeSetAttribute
    cuPythonInit()
    if __cuGraphKernelNodeSetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphKernelNodeSetAttribute" not found')
    err = (<CUresult (*)(CUgraphNode, CUkernelNodeAttrID, const CUkernelNodeAttrValue*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphKernelNodeSetAttribute)(hNode, attr, value)
    return err
{{endif}}

{{if 'cuGraphDebugDotPrint' in found_functions}}

cdef CUresult _cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphDebugDotPrint
    cuPythonInit()
    if __cuGraphDebugDotPrint == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphDebugDotPrint" not found')
    err = (<CUresult (*)(CUgraph, const char*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphDebugDotPrint)(hGraph, path, flags)
    return err
{{endif}}

{{if 'cuUserObjectCreate' in found_functions}}

cdef CUresult _cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuUserObjectCreate
    cuPythonInit()
    if __cuUserObjectCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuUserObjectCreate" not found')
    err = (<CUresult (*)(CUuserObject*, void*, CUhostFn, unsigned int, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuUserObjectCreate)(object_out, ptr, destroy, initialRefcount, flags)
    return err
{{endif}}

{{if 'cuUserObjectRetain' in found_functions}}

cdef CUresult _cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuUserObjectRetain
    cuPythonInit()
    if __cuUserObjectRetain == NULL:
        with gil:
            raise RuntimeError('Function "cuUserObjectRetain" not found')
    err = (<CUresult (*)(CUuserObject, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuUserObjectRetain)(object, count)
    return err
{{endif}}

{{if 'cuUserObjectRelease' in found_functions}}

cdef CUresult _cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuUserObjectRelease
    cuPythonInit()
    if __cuUserObjectRelease == NULL:
        with gil:
            raise RuntimeError('Function "cuUserObjectRelease" not found')
    err = (<CUresult (*)(CUuserObject, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuUserObjectRelease)(object, count)
    return err
{{endif}}

{{if 'cuGraphRetainUserObject' in found_functions}}

cdef CUresult _cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphRetainUserObject
    cuPythonInit()
    if __cuGraphRetainUserObject == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphRetainUserObject" not found')
    err = (<CUresult (*)(CUgraph, CUuserObject, unsigned int, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphRetainUserObject)(graph, object, count, flags)
    return err
{{endif}}

{{if 'cuGraphReleaseUserObject' in found_functions}}

cdef CUresult _cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphReleaseUserObject
    cuPythonInit()
    if __cuGraphReleaseUserObject == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphReleaseUserObject" not found')
    err = (<CUresult (*)(CUgraph, CUuserObject, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphReleaseUserObject)(graph, object, count)
    return err
{{endif}}

{{if 'cuGraphAddNode' in found_functions}}

cdef CUresult _cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddNode
    cuPythonInit()
    if __cuGraphAddNode == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddNode" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, size_t, CUgraphNodeParams*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams)
    return err
{{endif}}

{{if 'cuGraphAddNode_v2' in found_functions}}

cdef CUresult _cuGraphAddNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphAddNode_v2
    cuPythonInit()
    if __cuGraphAddNode_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphAddNode_v2" not found')
    err = (<CUresult (*)(CUgraphNode*, CUgraph, const CUgraphNode*, const CUgraphEdgeData*, size_t, CUgraphNodeParams*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphAddNode_v2)(phGraphNode, hGraph, dependencies, dependencyData, numDependencies, nodeParams)
    return err
{{endif}}

{{if 'cuGraphNodeSetParams' in found_functions}}

cdef CUresult _cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphNodeSetParams
    cuPythonInit()
    if __cuGraphNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphNode, CUgraphNodeParams*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphNodeSetParams)(hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphExecNodeSetParams' in found_functions}}

cdef CUresult _cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphExecNodeSetParams
    cuPythonInit()
    if __cuGraphExecNodeSetParams == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphExecNodeSetParams" not found')
    err = (<CUresult (*)(CUgraphExec, CUgraphNode, CUgraphNodeParams*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphExecNodeSetParams)(hGraphExec, hNode, nodeParams)
    return err
{{endif}}

{{if 'cuGraphConditionalHandleCreate' in found_functions}}

cdef CUresult _cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphConditionalHandleCreate
    cuPythonInit()
    if __cuGraphConditionalHandleCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphConditionalHandleCreate" not found')
    err = (<CUresult (*)(CUgraphConditionalHandle*, CUgraph, CUcontext, unsigned int, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphConditionalHandleCreate)(pHandle_out, hGraph, ctx, defaultLaunchValue, flags)
    return err
{{endif}}

{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}}

cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuOccupancyMaxActiveBlocksPerMultiprocessor
    cuPythonInit()
    if __cuOccupancyMaxActiveBlocksPerMultiprocessor == NULL:
        with gil:
            raise RuntimeError('Function "cuOccupancyMaxActiveBlocksPerMultiprocessor" not found')
    err = (<CUresult (*)(int*, CUfunction, int, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuOccupancyMaxActiveBlocksPerMultiprocessor)(numBlocks, func, blockSize, dynamicSMemSize)
    return err
{{endif}}

{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}}

cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
    cuPythonInit()
    if __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags" not found')
    err = (<CUresult (*)(int*, CUfunction, int, size_t, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags)(numBlocks, func, blockSize, dynamicSMemSize, flags)
    return err
{{endif}}

{{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}}

cdef CUresult _cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuOccupancyMaxPotentialBlockSize
    cuPythonInit()
    if __cuOccupancyMaxPotentialBlockSize == NULL:
        with gil:
            raise RuntimeError('Function "cuOccupancyMaxPotentialBlockSize" not found')
    err = (<CUresult (*)(int*, int*, CUfunction, CUoccupancyB2DSize, size_t, int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuOccupancyMaxPotentialBlockSize)(minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit)
    return err
{{endif}}

{{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}}

cdef CUresult _cuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuOccupancyMaxPotentialBlockSizeWithFlags
    cuPythonInit()
    if __cuOccupancyMaxPotentialBlockSizeWithFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuOccupancyMaxPotentialBlockSizeWithFlags" not found')
    err = (<CUresult (*)(int*, int*, CUfunction, CUoccupancyB2DSize, size_t, int, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuOccupancyMaxPotentialBlockSizeWithFlags)(minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit, flags)
    return err
{{endif}}

{{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}}

cdef CUresult _cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuOccupancyAvailableDynamicSMemPerBlock
    cuPythonInit()
    if __cuOccupancyAvailableDynamicSMemPerBlock == NULL:
        with gil:
            raise RuntimeError('Function "cuOccupancyAvailableDynamicSMemPerBlock" not found')
    err = (<CUresult (*)(size_t*, CUfunction, int, int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuOccupancyAvailableDynamicSMemPerBlock)(dynamicSmemSize, func, numBlocks, blockSize)
    return err
{{endif}}

{{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}}

cdef CUresult _cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuOccupancyMaxPotentialClusterSize
    cuPythonInit()
    if __cuOccupancyMaxPotentialClusterSize == NULL:
        with gil:
            raise RuntimeError('Function "cuOccupancyMaxPotentialClusterSize" not found')
    err = (<CUresult (*)(int*, CUfunction, const CUlaunchConfig*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuOccupancyMaxPotentialClusterSize)(clusterSize, func, config)
    return err
{{endif}}

{{if 'cuOccupancyMaxActiveClusters' in found_functions}}

cdef CUresult _cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuOccupancyMaxActiveClusters
    cuPythonInit()
    if __cuOccupancyMaxActiveClusters == NULL:
        with gil:
            raise RuntimeError('Function "cuOccupancyMaxActiveClusters" not found')
    err = (<CUresult (*)(int*, CUfunction, const CUlaunchConfig*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuOccupancyMaxActiveClusters)(numClusters, func, config)
    return err
{{endif}}

{{if 'cuTexRefSetArray' in found_functions}}

cdef CUresult _cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetArray
    cuPythonInit()
    if __cuTexRefSetArray == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetArray" not found')
    err = (<CUresult (*)(CUtexref, CUarray, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetArray)(hTexRef, hArray, Flags)
    return err
{{endif}}

{{if 'cuTexRefSetMipmappedArray' in found_functions}}

cdef CUresult _cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetMipmappedArray
    cuPythonInit()
    if __cuTexRefSetMipmappedArray == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetMipmappedArray" not found')
    err = (<CUresult (*)(CUtexref, CUmipmappedArray, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetMipmappedArray)(hTexRef, hMipmappedArray, Flags)
    return err
{{endif}}

{{if 'cuTexRefSetAddress_v2' in found_functions}}

cdef CUresult _cuTexRefSetAddress_v2(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t numbytes) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetAddress_v2
    cuPythonInit()
    if __cuTexRefSetAddress_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetAddress_v2" not found')
    err = (<CUresult (*)(size_t*, CUtexref, CUdeviceptr, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetAddress_v2)(ByteOffset, hTexRef, dptr, numbytes)
    return err
{{endif}}

{{if 'cuTexRefSetAddress2D_v3' in found_functions}}

cdef CUresult _cuTexRefSetAddress2D_v3(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetAddress2D_v3
    cuPythonInit()
    if __cuTexRefSetAddress2D_v3 == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetAddress2D_v3" not found')
    err = (<CUresult (*)(CUtexref, const CUDA_ARRAY_DESCRIPTOR*, CUdeviceptr, size_t) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetAddress2D_v3)(hTexRef, desc, dptr, Pitch)
    return err
{{endif}}

{{if 'cuTexRefSetFormat' in found_functions}}

cdef CUresult _cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetFormat
    cuPythonInit()
    if __cuTexRefSetFormat == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetFormat" not found')
    err = (<CUresult (*)(CUtexref, CUarray_format, int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetFormat)(hTexRef, fmt, NumPackedComponents)
    return err
{{endif}}

{{if 'cuTexRefSetAddressMode' in found_functions}}

cdef CUresult _cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetAddressMode
    cuPythonInit()
    if __cuTexRefSetAddressMode == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetAddressMode" not found')
    err = (<CUresult (*)(CUtexref, int, CUaddress_mode) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetAddressMode)(hTexRef, dim, am)
    return err
{{endif}}

{{if 'cuTexRefSetFilterMode' in found_functions}}

cdef CUresult _cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetFilterMode
    cuPythonInit()
    if __cuTexRefSetFilterMode == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetFilterMode" not found')
    err = (<CUresult (*)(CUtexref, CUfilter_mode) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetFilterMode)(hTexRef, fm)
    return err
{{endif}}

{{if 'cuTexRefSetMipmapFilterMode' in found_functions}}

cdef CUresult _cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetMipmapFilterMode
    cuPythonInit()
    if __cuTexRefSetMipmapFilterMode == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetMipmapFilterMode" not found')
    err = (<CUresult (*)(CUtexref, CUfilter_mode) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetMipmapFilterMode)(hTexRef, fm)
    return err
{{endif}}

{{if 'cuTexRefSetMipmapLevelBias' in found_functions}}

cdef CUresult _cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetMipmapLevelBias
    cuPythonInit()
    if __cuTexRefSetMipmapLevelBias == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetMipmapLevelBias" not found')
    err = (<CUresult (*)(CUtexref, float) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetMipmapLevelBias)(hTexRef, bias)
    return err
{{endif}}

{{if 'cuTexRefSetMipmapLevelClamp' in found_functions}}

cdef CUresult _cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetMipmapLevelClamp
    cuPythonInit()
    if __cuTexRefSetMipmapLevelClamp == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetMipmapLevelClamp" not found')
    err = (<CUresult (*)(CUtexref, float, float) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetMipmapLevelClamp)(hTexRef, minMipmapLevelClamp, maxMipmapLevelClamp)
    return err
{{endif}}

{{if 'cuTexRefSetMaxAnisotropy' in found_functions}}

cdef CUresult _cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetMaxAnisotropy
    cuPythonInit()
    if __cuTexRefSetMaxAnisotropy == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetMaxAnisotropy" not found')
    err = (<CUresult (*)(CUtexref, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetMaxAnisotropy)(hTexRef, maxAniso)
    return err
{{endif}}

{{if 'cuTexRefSetBorderColor' in found_functions}}

cdef CUresult _cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetBorderColor
    cuPythonInit()
    if __cuTexRefSetBorderColor == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetBorderColor" not found')
    err = (<CUresult (*)(CUtexref, float*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetBorderColor)(hTexRef, pBorderColor)
    return err
{{endif}}

{{if 'cuTexRefSetFlags' in found_functions}}

cdef CUresult _cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefSetFlags
    cuPythonInit()
    if __cuTexRefSetFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefSetFlags" not found')
    err = (<CUresult (*)(CUtexref, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefSetFlags)(hTexRef, Flags)
    return err
{{endif}}

{{if 'cuTexRefGetAddress_v2' in found_functions}}

cdef CUresult _cuTexRefGetAddress_v2(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetAddress_v2
    cuPythonInit()
    if __cuTexRefGetAddress_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetAddress_v2" not found')
    err = (<CUresult (*)(CUdeviceptr*, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetAddress_v2)(pdptr, hTexRef)
    return err
{{endif}}

{{if 'cuTexRefGetArray' in found_functions}}

cdef CUresult _cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetArray
    cuPythonInit()
    if __cuTexRefGetArray == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetArray" not found')
    err = (<CUresult (*)(CUarray*, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetArray)(phArray, hTexRef)
    return err
{{endif}}

{{if 'cuTexRefGetMipmappedArray' in found_functions}}

cdef CUresult _cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetMipmappedArray
    cuPythonInit()
    if __cuTexRefGetMipmappedArray == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetMipmappedArray" not found')
    err = (<CUresult (*)(CUmipmappedArray*, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetMipmappedArray)(phMipmappedArray, hTexRef)
    return err
{{endif}}

{{if 'cuTexRefGetAddressMode' in found_functions}}

cdef CUresult _cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetAddressMode
    cuPythonInit()
    if __cuTexRefGetAddressMode == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetAddressMode" not found')
    err = (<CUresult (*)(CUaddress_mode*, CUtexref, int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetAddressMode)(pam, hTexRef, dim)
    return err
{{endif}}

{{if 'cuTexRefGetFilterMode' in found_functions}}

cdef CUresult _cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetFilterMode
    cuPythonInit()
    if __cuTexRefGetFilterMode == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetFilterMode" not found')
    err = (<CUresult (*)(CUfilter_mode*, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetFilterMode)(pfm, hTexRef)
    return err
{{endif}}

{{if 'cuTexRefGetFormat' in found_functions}}

cdef CUresult _cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetFormat
    cuPythonInit()
    if __cuTexRefGetFormat == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetFormat" not found')
    err = (<CUresult (*)(CUarray_format*, int*, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetFormat)(pFormat, pNumChannels, hTexRef)
    return err
{{endif}}

{{if 'cuTexRefGetMipmapFilterMode' in found_functions}}

cdef CUresult _cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetMipmapFilterMode
    cuPythonInit()
    if __cuTexRefGetMipmapFilterMode == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetMipmapFilterMode" not found')
    err = (<CUresult (*)(CUfilter_mode*, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetMipmapFilterMode)(pfm, hTexRef)
    return err
{{endif}}

{{if 'cuTexRefGetMipmapLevelBias' in found_functions}}

cdef CUresult _cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetMipmapLevelBias
    cuPythonInit()
    if __cuTexRefGetMipmapLevelBias == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetMipmapLevelBias" not found')
    err = (<CUresult (*)(float*, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetMipmapLevelBias)(pbias, hTexRef)
    return err
{{endif}}

{{if 'cuTexRefGetMipmapLevelClamp' in found_functions}}

cdef CUresult _cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetMipmapLevelClamp
    cuPythonInit()
    if __cuTexRefGetMipmapLevelClamp == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetMipmapLevelClamp" not found')
    err = (<CUresult (*)(float*, float*, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetMipmapLevelClamp)(pminMipmapLevelClamp, pmaxMipmapLevelClamp, hTexRef)
    return err
{{endif}}

{{if 'cuTexRefGetMaxAnisotropy' in found_functions}}

cdef CUresult _cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetMaxAnisotropy
    cuPythonInit()
    if __cuTexRefGetMaxAnisotropy == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetMaxAnisotropy" not found')
    err = (<CUresult (*)(int*, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetMaxAnisotropy)(pmaxAniso, hTexRef)
    return err
{{endif}}

{{if 'cuTexRefGetBorderColor' in found_functions}}

cdef CUresult _cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetBorderColor
    cuPythonInit()
    if __cuTexRefGetBorderColor == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetBorderColor" not found')
    err = (<CUresult (*)(float*, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetBorderColor)(pBorderColor, hTexRef)
    return err
{{endif}}

{{if 'cuTexRefGetFlags' in found_functions}}

cdef CUresult _cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefGetFlags
    cuPythonInit()
    if __cuTexRefGetFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefGetFlags" not found')
    err = (<CUresult (*)(unsigned int*, CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefGetFlags)(pFlags, hTexRef)
    return err
{{endif}}

{{if 'cuTexRefCreate' in found_functions}}

cdef CUresult _cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefCreate
    cuPythonInit()
    if __cuTexRefCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefCreate" not found')
    err = (<CUresult (*)(CUtexref*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefCreate)(pTexRef)
    return err
{{endif}}

{{if 'cuTexRefDestroy' in found_functions}}

cdef CUresult _cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexRefDestroy
    cuPythonInit()
    if __cuTexRefDestroy == NULL:
        with gil:
            raise RuntimeError('Function "cuTexRefDestroy" not found')
    err = (<CUresult (*)(CUtexref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexRefDestroy)(hTexRef)
    return err
{{endif}}

{{if 'cuSurfRefSetArray' in found_functions}}

cdef CUresult _cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuSurfRefSetArray
    cuPythonInit()
    if __cuSurfRefSetArray == NULL:
        with gil:
            raise RuntimeError('Function "cuSurfRefSetArray" not found')
    err = (<CUresult (*)(CUsurfref, CUarray, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuSurfRefSetArray)(hSurfRef, hArray, Flags)
    return err
{{endif}}

{{if 'cuSurfRefGetArray' in found_functions}}

cdef CUresult _cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuSurfRefGetArray
    cuPythonInit()
    if __cuSurfRefGetArray == NULL:
        with gil:
            raise RuntimeError('Function "cuSurfRefGetArray" not found')
    err = (<CUresult (*)(CUarray*, CUsurfref) except ?CUDA_ERROR_NOT_FOUND nogil> __cuSurfRefGetArray)(phArray, hSurfRef)
    return err
{{endif}}

{{if 'cuTexObjectCreate' in found_functions}}

cdef CUresult _cuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexObjectCreate
    cuPythonInit()
    if __cuTexObjectCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuTexObjectCreate" not found')
    err = (<CUresult (*)(CUtexObject*, const CUDA_RESOURCE_DESC*, const CUDA_TEXTURE_DESC*, const CUDA_RESOURCE_VIEW_DESC*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexObjectCreate)(pTexObject, pResDesc, pTexDesc, pResViewDesc)
    return err
{{endif}}

{{if 'cuTexObjectDestroy' in found_functions}}

cdef CUresult _cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexObjectDestroy
    cuPythonInit()
    if __cuTexObjectDestroy == NULL:
        with gil:
            raise RuntimeError('Function "cuTexObjectDestroy" not found')
    err = (<CUresult (*)(CUtexObject) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexObjectDestroy)(texObject)
    return err
{{endif}}

{{if 'cuTexObjectGetResourceDesc' in found_functions}}

cdef CUresult _cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexObjectGetResourceDesc
    cuPythonInit()
    if __cuTexObjectGetResourceDesc == NULL:
        with gil:
            raise RuntimeError('Function "cuTexObjectGetResourceDesc" not found')
    err = (<CUresult (*)(CUDA_RESOURCE_DESC*, CUtexObject) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexObjectGetResourceDesc)(pResDesc, texObject)
    return err
{{endif}}

{{if 'cuTexObjectGetTextureDesc' in found_functions}}

cdef CUresult _cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexObjectGetTextureDesc
    cuPythonInit()
    if __cuTexObjectGetTextureDesc == NULL:
        with gil:
            raise RuntimeError('Function "cuTexObjectGetTextureDesc" not found')
    err = (<CUresult (*)(CUDA_TEXTURE_DESC*, CUtexObject) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexObjectGetTextureDesc)(pTexDesc, texObject)
    return err
{{endif}}

{{if 'cuTexObjectGetResourceViewDesc' in found_functions}}

cdef CUresult _cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTexObjectGetResourceViewDesc
    cuPythonInit()
    if __cuTexObjectGetResourceViewDesc == NULL:
        with gil:
            raise RuntimeError('Function "cuTexObjectGetResourceViewDesc" not found')
    err = (<CUresult (*)(CUDA_RESOURCE_VIEW_DESC*, CUtexObject) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTexObjectGetResourceViewDesc)(pResViewDesc, texObject)
    return err
{{endif}}

{{if 'cuSurfObjectCreate' in found_functions}}

cdef CUresult _cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuSurfObjectCreate
    cuPythonInit()
    if __cuSurfObjectCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuSurfObjectCreate" not found')
    err = (<CUresult (*)(CUsurfObject*, const CUDA_RESOURCE_DESC*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuSurfObjectCreate)(pSurfObject, pResDesc)
    return err
{{endif}}

{{if 'cuSurfObjectDestroy' in found_functions}}

cdef CUresult _cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuSurfObjectDestroy
    cuPythonInit()
    if __cuSurfObjectDestroy == NULL:
        with gil:
            raise RuntimeError('Function "cuSurfObjectDestroy" not found')
    err = (<CUresult (*)(CUsurfObject) except ?CUDA_ERROR_NOT_FOUND nogil> __cuSurfObjectDestroy)(surfObject)
    return err
{{endif}}

{{if 'cuSurfObjectGetResourceDesc' in found_functions}}

cdef CUresult _cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuSurfObjectGetResourceDesc
    cuPythonInit()
    if __cuSurfObjectGetResourceDesc == NULL:
        with gil:
            raise RuntimeError('Function "cuSurfObjectGetResourceDesc" not found')
    err = (<CUresult (*)(CUDA_RESOURCE_DESC*, CUsurfObject) except ?CUDA_ERROR_NOT_FOUND nogil> __cuSurfObjectGetResourceDesc)(pResDesc, surfObject)
    return err
{{endif}}

{{if 'cuTensorMapEncodeTiled' in found_functions}}

cdef CUresult _cuTensorMapEncodeTiled(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const cuuint32_t* boxDim, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTensorMapEncodeTiled
    cuPythonInit()
    if __cuTensorMapEncodeTiled == NULL:
        with gil:
            raise RuntimeError('Function "cuTensorMapEncodeTiled" not found')
    err = (<CUresult (*)(CUtensorMap*, CUtensorMapDataType, cuuint32_t, void*, const cuuint64_t*, const cuuint64_t*, const cuuint32_t*, const cuuint32_t*, CUtensorMapInterleave, CUtensorMapSwizzle, CUtensorMapL2promotion, CUtensorMapFloatOOBfill) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTensorMapEncodeTiled)(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, boxDim, elementStrides, interleave, swizzle, l2Promotion, oobFill)
    return err
{{endif}}

{{if 'cuTensorMapEncodeIm2col' in found_functions}}

cdef CUresult _cuTensorMapEncodeIm2col(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const int* pixelBoxLowerCorner, const int* pixelBoxUpperCorner, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTensorMapEncodeIm2col
    cuPythonInit()
    if __cuTensorMapEncodeIm2col == NULL:
        with gil:
            raise RuntimeError('Function "cuTensorMapEncodeIm2col" not found')
    err = (<CUresult (*)(CUtensorMap*, CUtensorMapDataType, cuuint32_t, void*, const cuuint64_t*, const cuuint64_t*, const int*, const int*, cuuint32_t, cuuint32_t, const cuuint32_t*, CUtensorMapInterleave, CUtensorMapSwizzle, CUtensorMapL2promotion, CUtensorMapFloatOOBfill) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTensorMapEncodeIm2col)(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCorner, pixelBoxUpperCorner, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, swizzle, l2Promotion, oobFill)
    return err
{{endif}}

{{if 'cuTensorMapEncodeIm2colWide' in found_functions}}

cdef CUresult _cuTensorMapEncodeIm2colWide(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapIm2ColWideMode mode, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTensorMapEncodeIm2colWide
    cuPythonInit()
    if __cuTensorMapEncodeIm2colWide == NULL:
        with gil:
            raise RuntimeError('Function "cuTensorMapEncodeIm2colWide" not found')
    err = (<CUresult (*)(CUtensorMap*, CUtensorMapDataType, cuuint32_t, void*, const cuuint64_t*, const cuuint64_t*, int, int, cuuint32_t, cuuint32_t, const cuuint32_t*, CUtensorMapInterleave, CUtensorMapIm2ColWideMode, CUtensorMapSwizzle, CUtensorMapL2promotion, CUtensorMapFloatOOBfill) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTensorMapEncodeIm2colWide)(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCornerWidth, pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, mode, swizzle, l2Promotion, oobFill)
    return err
{{endif}}

{{if 'cuTensorMapReplaceAddress' in found_functions}}

cdef CUresult _cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuTensorMapReplaceAddress
    cuPythonInit()
    if __cuTensorMapReplaceAddress == NULL:
        with gil:
            raise RuntimeError('Function "cuTensorMapReplaceAddress" not found')
    err = (<CUresult (*)(CUtensorMap*, void*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuTensorMapReplaceAddress)(tensorMap, globalAddress)
    return err
{{endif}}

{{if 'cuDeviceCanAccessPeer' in found_functions}}

cdef CUresult _cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceCanAccessPeer
    cuPythonInit()
    if __cuDeviceCanAccessPeer == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceCanAccessPeer" not found')
    err = (<CUresult (*)(int*, CUdevice, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceCanAccessPeer)(canAccessPeer, dev, peerDev)
    return err
{{endif}}

{{if 'cuCtxEnablePeerAccess' in found_functions}}

cdef CUresult _cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxEnablePeerAccess
    cuPythonInit()
    if __cuCtxEnablePeerAccess == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxEnablePeerAccess" not found')
    err = (<CUresult (*)(CUcontext, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxEnablePeerAccess)(peerContext, Flags)
    return err
{{endif}}

{{if 'cuCtxDisablePeerAccess' in found_functions}}

cdef CUresult _cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxDisablePeerAccess
    cuPythonInit()
    if __cuCtxDisablePeerAccess == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxDisablePeerAccess" not found')
    err = (<CUresult (*)(CUcontext) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxDisablePeerAccess)(peerContext)
    return err
{{endif}}

{{if 'cuDeviceGetP2PAttribute' in found_functions}}

cdef CUresult _cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetP2PAttribute
    cuPythonInit()
    if __cuDeviceGetP2PAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetP2PAttribute" not found')
    err = (<CUresult (*)(int*, CUdevice_P2PAttribute, CUdevice, CUdevice) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetP2PAttribute)(value, attrib, srcDevice, dstDevice)
    return err
{{endif}}

{{if 'cuGraphicsUnregisterResource' in found_functions}}

cdef CUresult _cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsUnregisterResource
    cuPythonInit()
    if __cuGraphicsUnregisterResource == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsUnregisterResource" not found')
    err = (<CUresult (*)(CUgraphicsResource) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsUnregisterResource)(resource)
    return err
{{endif}}

{{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}}

cdef CUresult _cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsSubResourceGetMappedArray
    cuPythonInit()
    if __cuGraphicsSubResourceGetMappedArray == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsSubResourceGetMappedArray" not found')
    err = (<CUresult (*)(CUarray*, CUgraphicsResource, unsigned int, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsSubResourceGetMappedArray)(pArray, resource, arrayIndex, mipLevel)
    return err
{{endif}}

{{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}}

cdef CUresult _cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsResourceGetMappedMipmappedArray
    cuPythonInit()
    if __cuGraphicsResourceGetMappedMipmappedArray == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsResourceGetMappedMipmappedArray" not found')
    err = (<CUresult (*)(CUmipmappedArray*, CUgraphicsResource) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsResourceGetMappedMipmappedArray)(pMipmappedArray, resource)
    return err
{{endif}}

{{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}}

cdef CUresult _cuGraphicsResourceGetMappedPointer_v2(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsResourceGetMappedPointer_v2
    cuPythonInit()
    if __cuGraphicsResourceGetMappedPointer_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsResourceGetMappedPointer_v2" not found')
    err = (<CUresult (*)(CUdeviceptr*, size_t*, CUgraphicsResource) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsResourceGetMappedPointer_v2)(pDevPtr, pSize, resource)
    return err
{{endif}}

{{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}}

cdef CUresult _cuGraphicsResourceSetMapFlags_v2(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsResourceSetMapFlags_v2
    cuPythonInit()
    if __cuGraphicsResourceSetMapFlags_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsResourceSetMapFlags_v2" not found')
    err = (<CUresult (*)(CUgraphicsResource, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsResourceSetMapFlags_v2)(resource, flags)
    return err
{{endif}}

{{if 'cuGraphicsMapResources' in found_functions}}

cdef CUresult _cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsMapResources
    cuPythonInit()
    if __cuGraphicsMapResources == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsMapResources" not found')
    err = (<CUresult (*)(unsigned int, CUgraphicsResource*, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsMapResources)(count, resources, hStream)
    return err
{{endif}}

{{if 'cuGraphicsUnmapResources' in found_functions}}

cdef CUresult _cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsUnmapResources
    cuPythonInit()
    if __cuGraphicsUnmapResources == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsUnmapResources" not found')
    err = (<CUresult (*)(unsigned int, CUgraphicsResource*, CUstream) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsUnmapResources)(count, resources, hStream)
    return err
{{endif}}

{{if 'cuGetProcAddress_v2' in found_functions}}

cdef CUresult _cuGetProcAddress_v2(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGetProcAddress_v2
    cuPythonInit()
    if __cuGetProcAddress_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGetProcAddress_v2" not found')
    err = (<CUresult (*)(const char*, void**, int, cuuint64_t, CUdriverProcAddressQueryResult*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGetProcAddress_v2)(symbol, pfn, cudaVersion, flags, symbolStatus)
    return err
{{endif}}

{{if 'cuCoredumpGetAttribute' in found_functions}}

cdef CUresult _cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCoredumpGetAttribute
    cuPythonInit()
    if __cuCoredumpGetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuCoredumpGetAttribute" not found')
    err = (<CUresult (*)(CUcoredumpSettings, void*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCoredumpGetAttribute)(attrib, value, size)
    return err
{{endif}}

{{if 'cuCoredumpGetAttributeGlobal' in found_functions}}

cdef CUresult _cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCoredumpGetAttributeGlobal
    cuPythonInit()
    if __cuCoredumpGetAttributeGlobal == NULL:
        with gil:
            raise RuntimeError('Function "cuCoredumpGetAttributeGlobal" not found')
    err = (<CUresult (*)(CUcoredumpSettings, void*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCoredumpGetAttributeGlobal)(attrib, value, size)
    return err
{{endif}}

{{if 'cuCoredumpSetAttribute' in found_functions}}

cdef CUresult _cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCoredumpSetAttribute
    cuPythonInit()
    if __cuCoredumpSetAttribute == NULL:
        with gil:
            raise RuntimeError('Function "cuCoredumpSetAttribute" not found')
    err = (<CUresult (*)(CUcoredumpSettings, void*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCoredumpSetAttribute)(attrib, value, size)
    return err
{{endif}}

{{if 'cuCoredumpSetAttributeGlobal' in found_functions}}

cdef CUresult _cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCoredumpSetAttributeGlobal
    cuPythonInit()
    if __cuCoredumpSetAttributeGlobal == NULL:
        with gil:
            raise RuntimeError('Function "cuCoredumpSetAttributeGlobal" not found')
    err = (<CUresult (*)(CUcoredumpSettings, void*, size_t*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCoredumpSetAttributeGlobal)(attrib, value, size)
    return err
{{endif}}

{{if 'cuGetExportTable' in found_functions}}

cdef CUresult _cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGetExportTable
    cuPythonInit()
    if __cuGetExportTable == NULL:
        with gil:
            raise RuntimeError('Function "cuGetExportTable" not found')
    err = (<CUresult (*)(const void**, const CUuuid*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGetExportTable)(ppExportTable, pExportTableId)
    return err
{{endif}}

{{if 'cuGreenCtxCreate' in found_functions}}

cdef CUresult _cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGreenCtxCreate
    cuPythonInit()
    if __cuGreenCtxCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuGreenCtxCreate" not found')
    err = (<CUresult (*)(CUgreenCtx*, CUdevResourceDesc, CUdevice, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGreenCtxCreate)(phCtx, desc, dev, flags)
    return err
{{endif}}

{{if 'cuGreenCtxDestroy' in found_functions}}

cdef CUresult _cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGreenCtxDestroy
    cuPythonInit()
    if __cuGreenCtxDestroy == NULL:
        with gil:
            raise RuntimeError('Function "cuGreenCtxDestroy" not found')
    err = (<CUresult (*)(CUgreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGreenCtxDestroy)(hCtx)
    return err
{{endif}}

{{if 'cuCtxFromGreenCtx' in found_functions}}

cdef CUresult _cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxFromGreenCtx
    cuPythonInit()
    if __cuCtxFromGreenCtx == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxFromGreenCtx" not found')
    err = (<CUresult (*)(CUcontext*, CUgreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxFromGreenCtx)(pContext, hCtx)
    return err
{{endif}}

{{if 'cuDeviceGetDevResource' in found_functions}}

cdef CUresult _cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDeviceGetDevResource
    cuPythonInit()
    if __cuDeviceGetDevResource == NULL:
        with gil:
            raise RuntimeError('Function "cuDeviceGetDevResource" not found')
    err = (<CUresult (*)(CUdevice, CUdevResource*, CUdevResourceType) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDeviceGetDevResource)(device, resource, typename)
    return err
{{endif}}

{{if 'cuCtxGetDevResource' in found_functions}}

cdef CUresult _cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCtxGetDevResource
    cuPythonInit()
    if __cuCtxGetDevResource == NULL:
        with gil:
            raise RuntimeError('Function "cuCtxGetDevResource" not found')
    err = (<CUresult (*)(CUcontext, CUdevResource*, CUdevResourceType) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCtxGetDevResource)(hCtx, resource, typename)
    return err
{{endif}}

{{if 'cuGreenCtxGetDevResource' in found_functions}}

cdef CUresult _cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGreenCtxGetDevResource
    cuPythonInit()
    if __cuGreenCtxGetDevResource == NULL:
        with gil:
            raise RuntimeError('Function "cuGreenCtxGetDevResource" not found')
    err = (<CUresult (*)(CUgreenCtx, CUdevResource*, CUdevResourceType) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGreenCtxGetDevResource)(hCtx, resource, typename)
    return err
{{endif}}

{{if 'cuDevSmResourceSplitByCount' in found_functions}}

cdef CUresult _cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remaining, unsigned int useFlags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDevSmResourceSplitByCount
    cuPythonInit()
    if __cuDevSmResourceSplitByCount == NULL:
        with gil:
            raise RuntimeError('Function "cuDevSmResourceSplitByCount" not found')
    err = (<CUresult (*)(CUdevResource*, unsigned int*, const CUdevResource*, CUdevResource*, unsigned int, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDevSmResourceSplitByCount)(result, nbGroups, input, remaining, useFlags, minCount)
    return err
{{endif}}

{{if 'cuDevResourceGenerateDesc' in found_functions}}

cdef CUresult _cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuDevResourceGenerateDesc
    cuPythonInit()
    if __cuDevResourceGenerateDesc == NULL:
        with gil:
            raise RuntimeError('Function "cuDevResourceGenerateDesc" not found')
    err = (<CUresult (*)(CUdevResourceDesc*, CUdevResource*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuDevResourceGenerateDesc)(phDesc, resources, nbResources)
    return err
{{endif}}

{{if 'cuGreenCtxRecordEvent' in found_functions}}

cdef CUresult _cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGreenCtxRecordEvent
    cuPythonInit()
    if __cuGreenCtxRecordEvent == NULL:
        with gil:
            raise RuntimeError('Function "cuGreenCtxRecordEvent" not found')
    err = (<CUresult (*)(CUgreenCtx, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGreenCtxRecordEvent)(hCtx, hEvent)
    return err
{{endif}}

{{if 'cuGreenCtxWaitEvent' in found_functions}}

cdef CUresult _cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGreenCtxWaitEvent
    cuPythonInit()
    if __cuGreenCtxWaitEvent == NULL:
        with gil:
            raise RuntimeError('Function "cuGreenCtxWaitEvent" not found')
    err = (<CUresult (*)(CUgreenCtx, CUevent) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGreenCtxWaitEvent)(hCtx, hEvent)
    return err
{{endif}}

{{if 'cuStreamGetGreenCtx' in found_functions}}

cdef CUresult _cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuStreamGetGreenCtx
    cuPythonInit()
    if __cuStreamGetGreenCtx == NULL:
        with gil:
            raise RuntimeError('Function "cuStreamGetGreenCtx" not found')
    err = (<CUresult (*)(CUstream, CUgreenCtx*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuStreamGetGreenCtx)(hStream, phCtx)
    return err
{{endif}}

{{if 'cuGreenCtxStreamCreate' in found_functions}}

cdef CUresult _cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGreenCtxStreamCreate
    cuPythonInit()
    if __cuGreenCtxStreamCreate == NULL:
        with gil:
            raise RuntimeError('Function "cuGreenCtxStreamCreate" not found')
    err = (<CUresult (*)(CUstream*, CUgreenCtx, unsigned int, int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGreenCtxStreamCreate)(phStream, greenCtx, flags, priority)
    return err
{{endif}}

{{if 'cuLogsRegisterCallback' in found_functions}}

cdef CUresult _cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLogsRegisterCallback
    cuPythonInit()
    if __cuLogsRegisterCallback == NULL:
        with gil:
            raise RuntimeError('Function "cuLogsRegisterCallback" not found')
    err = (<CUresult (*)(CUlogsCallback, void*, CUlogsCallbackHandle*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLogsRegisterCallback)(callbackFunc, userData, callback_out)
    return err
{{endif}}

{{if 'cuLogsUnregisterCallback' in found_functions}}

cdef CUresult _cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLogsUnregisterCallback
    cuPythonInit()
    if __cuLogsUnregisterCallback == NULL:
        with gil:
            raise RuntimeError('Function "cuLogsUnregisterCallback" not found')
    err = (<CUresult (*)(CUlogsCallbackHandle) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLogsUnregisterCallback)(callback)
    return err
{{endif}}

{{if 'cuLogsCurrent' in found_functions}}

cdef CUresult _cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLogsCurrent
    cuPythonInit()
    if __cuLogsCurrent == NULL:
        with gil:
            raise RuntimeError('Function "cuLogsCurrent" not found')
    err = (<CUresult (*)(CUlogIterator*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLogsCurrent)(iterator_out, flags)
    return err
{{endif}}

{{if 'cuLogsDumpToFile' in found_functions}}

cdef CUresult _cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLogsDumpToFile
    cuPythonInit()
    if __cuLogsDumpToFile == NULL:
        with gil:
            raise RuntimeError('Function "cuLogsDumpToFile" not found')
    err = (<CUresult (*)(CUlogIterator*, const char*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLogsDumpToFile)(iterator, pathToFile, flags)
    return err
{{endif}}

{{if 'cuLogsDumpToMemory' in found_functions}}

cdef CUresult _cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuLogsDumpToMemory
    cuPythonInit()
    if __cuLogsDumpToMemory == NULL:
        with gil:
            raise RuntimeError('Function "cuLogsDumpToMemory" not found')
    err = (<CUresult (*)(CUlogIterator*, char*, size_t*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuLogsDumpToMemory)(iterator, buffer, size, flags)
    return err
{{endif}}

{{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}}

cdef CUresult _cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCheckpointProcessGetRestoreThreadId
    cuPythonInit()
    if __cuCheckpointProcessGetRestoreThreadId == NULL:
        with gil:
            raise RuntimeError('Function "cuCheckpointProcessGetRestoreThreadId" not found')
    err = (<CUresult (*)(int, int*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCheckpointProcessGetRestoreThreadId)(pid, tid)
    return err
{{endif}}

{{if 'cuCheckpointProcessGetState' in found_functions}}

cdef CUresult _cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCheckpointProcessGetState
    cuPythonInit()
    if __cuCheckpointProcessGetState == NULL:
        with gil:
            raise RuntimeError('Function "cuCheckpointProcessGetState" not found')
    err = (<CUresult (*)(int, CUprocessState*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCheckpointProcessGetState)(pid, state)
    return err
{{endif}}

{{if 'cuCheckpointProcessLock' in found_functions}}

cdef CUresult _cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCheckpointProcessLock
    cuPythonInit()
    if __cuCheckpointProcessLock == NULL:
        with gil:
            raise RuntimeError('Function "cuCheckpointProcessLock" not found')
    err = (<CUresult (*)(int, CUcheckpointLockArgs*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCheckpointProcessLock)(pid, args)
    return err
{{endif}}

{{if 'cuCheckpointProcessCheckpoint' in found_functions}}

cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCheckpointProcessCheckpoint
    cuPythonInit()
    if __cuCheckpointProcessCheckpoint == NULL:
        with gil:
            raise RuntimeError('Function "cuCheckpointProcessCheckpoint" not found')
    err = (<CUresult (*)(int, CUcheckpointCheckpointArgs*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCheckpointProcessCheckpoint)(pid, args)
    return err
{{endif}}

{{if 'cuCheckpointProcessRestore' in found_functions}}

cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCheckpointProcessRestore
    cuPythonInit()
    if __cuCheckpointProcessRestore == NULL:
        with gil:
            raise RuntimeError('Function "cuCheckpointProcessRestore" not found')
    err = (<CUresult (*)(int, CUcheckpointRestoreArgs*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCheckpointProcessRestore)(pid, args)
    return err
{{endif}}

{{if 'cuCheckpointProcessUnlock' in found_functions}}

cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuCheckpointProcessUnlock
    cuPythonInit()
    if __cuCheckpointProcessUnlock == NULL:
        with gil:
            raise RuntimeError('Function "cuCheckpointProcessUnlock" not found')
    err = (<CUresult (*)(int, CUcheckpointUnlockArgs*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCheckpointProcessUnlock)(pid, args)
    return err
{{endif}}

{{if 'cuProfilerStart' in found_functions}}

cdef CUresult _cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuProfilerStart
    cuPythonInit()
    if __cuProfilerStart == NULL:
        with gil:
            raise RuntimeError('Function "cuProfilerStart" not found')
    err = (<CUresult (*)() except ?CUDA_ERROR_NOT_FOUND nogil> __cuProfilerStart)()
    return err
{{endif}}

{{if 'cuProfilerStop' in found_functions}}

cdef CUresult _cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuProfilerStop
    cuPythonInit()
    if __cuProfilerStop == NULL:
        with gil:
            raise RuntimeError('Function "cuProfilerStop" not found')
    err = (<CUresult (*)() except ?CUDA_ERROR_NOT_FOUND nogil> __cuProfilerStop)()
    return err
{{endif}}

{{if True}}

cdef CUresult _cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsEGLRegisterImage
    cuPythonInit()
    if __cuGraphicsEGLRegisterImage == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsEGLRegisterImage" not found')
    err = (<CUresult (*)(CUgraphicsResource*, EGLImageKHR, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsEGLRegisterImage)(pCudaResource, image, flags)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEGLStreamConsumerConnect
    cuPythonInit()
    if __cuEGLStreamConsumerConnect == NULL:
        with gil:
            raise RuntimeError('Function "cuEGLStreamConsumerConnect" not found')
    err = (<CUresult (*)(CUeglStreamConnection*, EGLStreamKHR) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEGLStreamConsumerConnect)(conn, stream)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEGLStreamConsumerConnectWithFlags
    cuPythonInit()
    if __cuEGLStreamConsumerConnectWithFlags == NULL:
        with gil:
            raise RuntimeError('Function "cuEGLStreamConsumerConnectWithFlags" not found')
    err = (<CUresult (*)(CUeglStreamConnection*, EGLStreamKHR, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEGLStreamConsumerConnectWithFlags)(conn, stream, flags)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEGLStreamConsumerDisconnect
    cuPythonInit()
    if __cuEGLStreamConsumerDisconnect == NULL:
        with gil:
            raise RuntimeError('Function "cuEGLStreamConsumerDisconnect" not found')
    err = (<CUresult (*)(CUeglStreamConnection*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEGLStreamConsumerDisconnect)(conn)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEGLStreamConsumerAcquireFrame
    cuPythonInit()
    if __cuEGLStreamConsumerAcquireFrame == NULL:
        with gil:
            raise RuntimeError('Function "cuEGLStreamConsumerAcquireFrame" not found')
    err = (<CUresult (*)(CUeglStreamConnection*, CUgraphicsResource*, CUstream*, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEGLStreamConsumerAcquireFrame)(conn, pCudaResource, pStream, timeout)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEGLStreamConsumerReleaseFrame
    cuPythonInit()
    if __cuEGLStreamConsumerReleaseFrame == NULL:
        with gil:
            raise RuntimeError('Function "cuEGLStreamConsumerReleaseFrame" not found')
    err = (<CUresult (*)(CUeglStreamConnection*, CUgraphicsResource, CUstream*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEGLStreamConsumerReleaseFrame)(conn, pCudaResource, pStream)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEGLStreamProducerConnect
    cuPythonInit()
    if __cuEGLStreamProducerConnect == NULL:
        with gil:
            raise RuntimeError('Function "cuEGLStreamProducerConnect" not found')
    err = (<CUresult (*)(CUeglStreamConnection*, EGLStreamKHR, EGLint, EGLint) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEGLStreamProducerConnect)(conn, stream, width, height)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEGLStreamProducerDisconnect
    cuPythonInit()
    if __cuEGLStreamProducerDisconnect == NULL:
        with gil:
            raise RuntimeError('Function "cuEGLStreamProducerDisconnect" not found')
    err = (<CUresult (*)(CUeglStreamConnection*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEGLStreamProducerDisconnect)(conn)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEGLStreamProducerPresentFrame
    cuPythonInit()
    if __cuEGLStreamProducerPresentFrame == NULL:
        with gil:
            raise RuntimeError('Function "cuEGLStreamProducerPresentFrame" not found')
    err = (<CUresult (*)(CUeglStreamConnection*, CUeglFrame, CUstream*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEGLStreamProducerPresentFrame)(conn, eglframe, pStream)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEGLStreamProducerReturnFrame
    cuPythonInit()
    if __cuEGLStreamProducerReturnFrame == NULL:
        with gil:
            raise RuntimeError('Function "cuEGLStreamProducerReturnFrame" not found')
    err = (<CUresult (*)(CUeglStreamConnection*, CUeglFrame*, CUstream*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEGLStreamProducerReturnFrame)(conn, eglframe, pStream)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsResourceGetMappedEglFrame
    cuPythonInit()
    if __cuGraphicsResourceGetMappedEglFrame == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsResourceGetMappedEglFrame" not found')
    err = (<CUresult (*)(CUeglFrame*, CUgraphicsResource, unsigned int, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsResourceGetMappedEglFrame)(eglFrame, resource, index, mipLevel)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuEventCreateFromEGLSync
    cuPythonInit()
    if __cuEventCreateFromEGLSync == NULL:
        with gil:
            raise RuntimeError('Function "cuEventCreateFromEGLSync" not found')
    err = (<CUresult (*)(CUevent*, EGLSyncKHR, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuEventCreateFromEGLSync)(phEvent, eglSync, flags)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsGLRegisterBuffer
    cuPythonInit()
    if __cuGraphicsGLRegisterBuffer == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsGLRegisterBuffer" not found')
    err = (<CUresult (*)(CUgraphicsResource*, GLuint, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsGLRegisterBuffer)(pCudaResource, buffer, Flags)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsGLRegisterImage
    cuPythonInit()
    if __cuGraphicsGLRegisterImage == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsGLRegisterImage" not found')
    err = (<CUresult (*)(CUgraphicsResource*, GLuint, GLenum, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsGLRegisterImage)(pCudaResource, image, target, Flags)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuGLGetDevices_v2(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGLGetDevices_v2
    cuPythonInit()
    if __cuGLGetDevices_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuGLGetDevices_v2" not found')
    err = (<CUresult (*)(unsigned int*, CUdevice*, unsigned int, CUGLDeviceList) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGLGetDevices_v2)(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuVDPAUGetDevice
    cuPythonInit()
    if __cuVDPAUGetDevice == NULL:
        with gil:
            raise RuntimeError('Function "cuVDPAUGetDevice" not found')
    err = (<CUresult (*)(CUdevice*, VdpDevice, VdpGetProcAddress*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuVDPAUGetDevice)(pDevice, vdpDevice, vdpGetProcAddress)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuVDPAUCtxCreate_v2(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuVDPAUCtxCreate_v2
    cuPythonInit()
    if __cuVDPAUCtxCreate_v2 == NULL:
        with gil:
            raise RuntimeError('Function "cuVDPAUCtxCreate_v2" not found')
    err = (<CUresult (*)(CUcontext*, unsigned int, CUdevice, VdpDevice, VdpGetProcAddress*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuVDPAUCtxCreate_v2)(pCtx, flags, device, vdpDevice, vdpGetProcAddress)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsVDPAURegisterVideoSurface
    cuPythonInit()
    if __cuGraphicsVDPAURegisterVideoSurface == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsVDPAURegisterVideoSurface" not found')
    err = (<CUresult (*)(CUgraphicsResource*, VdpVideoSurface, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsVDPAURegisterVideoSurface)(pCudaResource, vdpSurface, flags)
    return err
{{endif}}

{{if True}}

cdef CUresult _cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil:
    global __cuGraphicsVDPAURegisterOutputSurface
    cuPythonInit()
    if __cuGraphicsVDPAURegisterOutputSurface == NULL:
        with gil:
            raise RuntimeError('Function "cuGraphicsVDPAURegisterOutputSurface" not found')
    err = (<CUresult (*)(CUgraphicsResource*, VdpOutputSurface, unsigned int) except ?CUDA_ERROR_NOT_FOUND nogil> __cuGraphicsVDPAURegisterOutputSurface)(pCudaResource, vdpSurface, flags)
    return err
{{endif}}

cdef dict func_ptrs = None

cpdef dict _inspect_function_pointers():
    global func_ptrs
    if func_ptrs is not None:
        return func_ptrs

    cuPythonInit()
    cdef dict data = {}

    {{if 'cuGetErrorString' in found_functions}}
    global __cuGetErrorString
    data["__cuGetErrorString"] = <intptr_t>__cuGetErrorString
    {{else}}
    data["__cuGetErrorString"] = <intptr_t>0
    {{endif}}

    {{if 'cuGetErrorName' in found_functions}}
    global __cuGetErrorName
    data["__cuGetErrorName"] = <intptr_t>__cuGetErrorName
    {{else}}
    data["__cuGetErrorName"] = <intptr_t>0
    {{endif}}

    {{if 'cuInit' in found_functions}}
    global __cuInit
    data["__cuInit"] = <intptr_t>__cuInit
    {{else}}
    data["__cuInit"] = <intptr_t>0
    {{endif}}

    {{if 'cuDriverGetVersion' in found_functions}}
    global __cuDriverGetVersion
    data["__cuDriverGetVersion"] = <intptr_t>__cuDriverGetVersion
    {{else}}
    data["__cuDriverGetVersion"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGet' in found_functions}}
    global __cuDeviceGet
    data["__cuDeviceGet"] = <intptr_t>__cuDeviceGet
    {{else}}
    data["__cuDeviceGet"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetCount' in found_functions}}
    global __cuDeviceGetCount
    data["__cuDeviceGetCount"] = <intptr_t>__cuDeviceGetCount
    {{else}}
    data["__cuDeviceGetCount"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetName' in found_functions}}
    global __cuDeviceGetName
    data["__cuDeviceGetName"] = <intptr_t>__cuDeviceGetName
    {{else}}
    data["__cuDeviceGetName"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetUuid' in found_functions}}
    global __cuDeviceGetUuid
    data["__cuDeviceGetUuid"] = <intptr_t>__cuDeviceGetUuid
    {{else}}
    data["__cuDeviceGetUuid"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetUuid_v2' in found_functions}}
    global __cuDeviceGetUuid_v2
    data["__cuDeviceGetUuid_v2"] = <intptr_t>__cuDeviceGetUuid_v2
    {{else}}
    data["__cuDeviceGetUuid_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetLuid' in found_functions}}
    global __cuDeviceGetLuid
    data["__cuDeviceGetLuid"] = <intptr_t>__cuDeviceGetLuid
    {{else}}
    data["__cuDeviceGetLuid"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceTotalMem_v2' in found_functions}}
    global __cuDeviceTotalMem_v2
    data["__cuDeviceTotalMem_v2"] = <intptr_t>__cuDeviceTotalMem_v2
    {{else}}
    data["__cuDeviceTotalMem_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}}
    global __cuDeviceGetTexture1DLinearMaxWidth
    data["__cuDeviceGetTexture1DLinearMaxWidth"] = <intptr_t>__cuDeviceGetTexture1DLinearMaxWidth
    {{else}}
    data["__cuDeviceGetTexture1DLinearMaxWidth"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetAttribute' in found_functions}}
    global __cuDeviceGetAttribute
    data["__cuDeviceGetAttribute"] = <intptr_t>__cuDeviceGetAttribute
    {{else}}
    data["__cuDeviceGetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}}
    global __cuDeviceGetNvSciSyncAttributes
    data["__cuDeviceGetNvSciSyncAttributes"] = <intptr_t>__cuDeviceGetNvSciSyncAttributes
    {{else}}
    data["__cuDeviceGetNvSciSyncAttributes"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceSetMemPool' in found_functions}}
    global __cuDeviceSetMemPool
    data["__cuDeviceSetMemPool"] = <intptr_t>__cuDeviceSetMemPool
    {{else}}
    data["__cuDeviceSetMemPool"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetMemPool' in found_functions}}
    global __cuDeviceGetMemPool
    data["__cuDeviceGetMemPool"] = <intptr_t>__cuDeviceGetMemPool
    {{else}}
    data["__cuDeviceGetMemPool"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetDefaultMemPool' in found_functions}}
    global __cuDeviceGetDefaultMemPool
    data["__cuDeviceGetDefaultMemPool"] = <intptr_t>__cuDeviceGetDefaultMemPool
    {{else}}
    data["__cuDeviceGetDefaultMemPool"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetExecAffinitySupport' in found_functions}}
    global __cuDeviceGetExecAffinitySupport
    data["__cuDeviceGetExecAffinitySupport"] = <intptr_t>__cuDeviceGetExecAffinitySupport
    {{else}}
    data["__cuDeviceGetExecAffinitySupport"] = <intptr_t>0
    {{endif}}

    {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}}
    global __cuFlushGPUDirectRDMAWrites
    data["__cuFlushGPUDirectRDMAWrites"] = <intptr_t>__cuFlushGPUDirectRDMAWrites
    {{else}}
    data["__cuFlushGPUDirectRDMAWrites"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetProperties' in found_functions}}
    global __cuDeviceGetProperties
    data["__cuDeviceGetProperties"] = <intptr_t>__cuDeviceGetProperties
    {{else}}
    data["__cuDeviceGetProperties"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceComputeCapability' in found_functions}}
    global __cuDeviceComputeCapability
    data["__cuDeviceComputeCapability"] = <intptr_t>__cuDeviceComputeCapability
    {{else}}
    data["__cuDeviceComputeCapability"] = <intptr_t>0
    {{endif}}

    {{if 'cuDevicePrimaryCtxRetain' in found_functions}}
    global __cuDevicePrimaryCtxRetain
    data["__cuDevicePrimaryCtxRetain"] = <intptr_t>__cuDevicePrimaryCtxRetain
    {{else}}
    data["__cuDevicePrimaryCtxRetain"] = <intptr_t>0
    {{endif}}

    {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}}
    global __cuDevicePrimaryCtxRelease_v2
    data["__cuDevicePrimaryCtxRelease_v2"] = <intptr_t>__cuDevicePrimaryCtxRelease_v2
    {{else}}
    data["__cuDevicePrimaryCtxRelease_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}}
    global __cuDevicePrimaryCtxSetFlags_v2
    data["__cuDevicePrimaryCtxSetFlags_v2"] = <intptr_t>__cuDevicePrimaryCtxSetFlags_v2
    {{else}}
    data["__cuDevicePrimaryCtxSetFlags_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuDevicePrimaryCtxGetState' in found_functions}}
    global __cuDevicePrimaryCtxGetState
    data["__cuDevicePrimaryCtxGetState"] = <intptr_t>__cuDevicePrimaryCtxGetState
    {{else}}
    data["__cuDevicePrimaryCtxGetState"] = <intptr_t>0
    {{endif}}

    {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}}
    global __cuDevicePrimaryCtxReset_v2
    data["__cuDevicePrimaryCtxReset_v2"] = <intptr_t>__cuDevicePrimaryCtxReset_v2
    {{else}}
    data["__cuDevicePrimaryCtxReset_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxCreate_v2' in found_functions}}
    global __cuCtxCreate_v2
    data["__cuCtxCreate_v2"] = <intptr_t>__cuCtxCreate_v2
    {{else}}
    data["__cuCtxCreate_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxCreate_v3' in found_functions}}
    global __cuCtxCreate_v3
    data["__cuCtxCreate_v3"] = <intptr_t>__cuCtxCreate_v3
    {{else}}
    data["__cuCtxCreate_v3"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxCreate_v4' in found_functions}}
    global __cuCtxCreate_v4
    data["__cuCtxCreate_v4"] = <intptr_t>__cuCtxCreate_v4
    {{else}}
    data["__cuCtxCreate_v4"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxDestroy_v2' in found_functions}}
    global __cuCtxDestroy_v2
    data["__cuCtxDestroy_v2"] = <intptr_t>__cuCtxDestroy_v2
    {{else}}
    data["__cuCtxDestroy_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxPushCurrent_v2' in found_functions}}
    global __cuCtxPushCurrent_v2
    data["__cuCtxPushCurrent_v2"] = <intptr_t>__cuCtxPushCurrent_v2
    {{else}}
    data["__cuCtxPushCurrent_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxPopCurrent_v2' in found_functions}}
    global __cuCtxPopCurrent_v2
    data["__cuCtxPopCurrent_v2"] = <intptr_t>__cuCtxPopCurrent_v2
    {{else}}
    data["__cuCtxPopCurrent_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxSetCurrent' in found_functions}}
    global __cuCtxSetCurrent
    data["__cuCtxSetCurrent"] = <intptr_t>__cuCtxSetCurrent
    {{else}}
    data["__cuCtxSetCurrent"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxGetCurrent' in found_functions}}
    global __cuCtxGetCurrent
    data["__cuCtxGetCurrent"] = <intptr_t>__cuCtxGetCurrent
    {{else}}
    data["__cuCtxGetCurrent"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxGetDevice' in found_functions}}
    global __cuCtxGetDevice
    data["__cuCtxGetDevice"] = <intptr_t>__cuCtxGetDevice
    {{else}}
    data["__cuCtxGetDevice"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxGetFlags' in found_functions}}
    global __cuCtxGetFlags
    data["__cuCtxGetFlags"] = <intptr_t>__cuCtxGetFlags
    {{else}}
    data["__cuCtxGetFlags"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxSetFlags' in found_functions}}
    global __cuCtxSetFlags
    data["__cuCtxSetFlags"] = <intptr_t>__cuCtxSetFlags
    {{else}}
    data["__cuCtxSetFlags"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxGetId' in found_functions}}
    global __cuCtxGetId
    data["__cuCtxGetId"] = <intptr_t>__cuCtxGetId
    {{else}}
    data["__cuCtxGetId"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxSynchronize' in found_functions}}
    global __cuCtxSynchronize
    data["__cuCtxSynchronize"] = <intptr_t>__cuCtxSynchronize
    {{else}}
    data["__cuCtxSynchronize"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxSetLimit' in found_functions}}
    global __cuCtxSetLimit
    data["__cuCtxSetLimit"] = <intptr_t>__cuCtxSetLimit
    {{else}}
    data["__cuCtxSetLimit"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxGetLimit' in found_functions}}
    global __cuCtxGetLimit
    data["__cuCtxGetLimit"] = <intptr_t>__cuCtxGetLimit
    {{else}}
    data["__cuCtxGetLimit"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxGetCacheConfig' in found_functions}}
    global __cuCtxGetCacheConfig
    data["__cuCtxGetCacheConfig"] = <intptr_t>__cuCtxGetCacheConfig
    {{else}}
    data["__cuCtxGetCacheConfig"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxSetCacheConfig' in found_functions}}
    global __cuCtxSetCacheConfig
    data["__cuCtxSetCacheConfig"] = <intptr_t>__cuCtxSetCacheConfig
    {{else}}
    data["__cuCtxSetCacheConfig"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxGetApiVersion' in found_functions}}
    global __cuCtxGetApiVersion
    data["__cuCtxGetApiVersion"] = <intptr_t>__cuCtxGetApiVersion
    {{else}}
    data["__cuCtxGetApiVersion"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxGetStreamPriorityRange' in found_functions}}
    global __cuCtxGetStreamPriorityRange
    data["__cuCtxGetStreamPriorityRange"] = <intptr_t>__cuCtxGetStreamPriorityRange
    {{else}}
    data["__cuCtxGetStreamPriorityRange"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxResetPersistingL2Cache' in found_functions}}
    global __cuCtxResetPersistingL2Cache
    data["__cuCtxResetPersistingL2Cache"] = <intptr_t>__cuCtxResetPersistingL2Cache
    {{else}}
    data["__cuCtxResetPersistingL2Cache"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxGetExecAffinity' in found_functions}}
    global __cuCtxGetExecAffinity
    data["__cuCtxGetExecAffinity"] = <intptr_t>__cuCtxGetExecAffinity
    {{else}}
    data["__cuCtxGetExecAffinity"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxRecordEvent' in found_functions}}
    global __cuCtxRecordEvent
    data["__cuCtxRecordEvent"] = <intptr_t>__cuCtxRecordEvent
    {{else}}
    data["__cuCtxRecordEvent"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxWaitEvent' in found_functions}}
    global __cuCtxWaitEvent
    data["__cuCtxWaitEvent"] = <intptr_t>__cuCtxWaitEvent
    {{else}}
    data["__cuCtxWaitEvent"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxAttach' in found_functions}}
    global __cuCtxAttach
    data["__cuCtxAttach"] = <intptr_t>__cuCtxAttach
    {{else}}
    data["__cuCtxAttach"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxDetach' in found_functions}}
    global __cuCtxDetach
    data["__cuCtxDetach"] = <intptr_t>__cuCtxDetach
    {{else}}
    data["__cuCtxDetach"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxGetSharedMemConfig' in found_functions}}
    global __cuCtxGetSharedMemConfig
    data["__cuCtxGetSharedMemConfig"] = <intptr_t>__cuCtxGetSharedMemConfig
    {{else}}
    data["__cuCtxGetSharedMemConfig"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxSetSharedMemConfig' in found_functions}}
    global __cuCtxSetSharedMemConfig
    data["__cuCtxSetSharedMemConfig"] = <intptr_t>__cuCtxSetSharedMemConfig
    {{else}}
    data["__cuCtxSetSharedMemConfig"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleLoad' in found_functions}}
    global __cuModuleLoad
    data["__cuModuleLoad"] = <intptr_t>__cuModuleLoad
    {{else}}
    data["__cuModuleLoad"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleLoadData' in found_functions}}
    global __cuModuleLoadData
    data["__cuModuleLoadData"] = <intptr_t>__cuModuleLoadData
    {{else}}
    data["__cuModuleLoadData"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleLoadDataEx' in found_functions}}
    global __cuModuleLoadDataEx
    data["__cuModuleLoadDataEx"] = <intptr_t>__cuModuleLoadDataEx
    {{else}}
    data["__cuModuleLoadDataEx"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleLoadFatBinary' in found_functions}}
    global __cuModuleLoadFatBinary
    data["__cuModuleLoadFatBinary"] = <intptr_t>__cuModuleLoadFatBinary
    {{else}}
    data["__cuModuleLoadFatBinary"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleUnload' in found_functions}}
    global __cuModuleUnload
    data["__cuModuleUnload"] = <intptr_t>__cuModuleUnload
    {{else}}
    data["__cuModuleUnload"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleGetLoadingMode' in found_functions}}
    global __cuModuleGetLoadingMode
    data["__cuModuleGetLoadingMode"] = <intptr_t>__cuModuleGetLoadingMode
    {{else}}
    data["__cuModuleGetLoadingMode"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleGetFunction' in found_functions}}
    global __cuModuleGetFunction
    data["__cuModuleGetFunction"] = <intptr_t>__cuModuleGetFunction
    {{else}}
    data["__cuModuleGetFunction"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleGetFunctionCount' in found_functions}}
    global __cuModuleGetFunctionCount
    data["__cuModuleGetFunctionCount"] = <intptr_t>__cuModuleGetFunctionCount
    {{else}}
    data["__cuModuleGetFunctionCount"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleEnumerateFunctions' in found_functions}}
    global __cuModuleEnumerateFunctions
    data["__cuModuleEnumerateFunctions"] = <intptr_t>__cuModuleEnumerateFunctions
    {{else}}
    data["__cuModuleEnumerateFunctions"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleGetGlobal_v2' in found_functions}}
    global __cuModuleGetGlobal_v2
    data["__cuModuleGetGlobal_v2"] = <intptr_t>__cuModuleGetGlobal_v2
    {{else}}
    data["__cuModuleGetGlobal_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuLinkCreate_v2' in found_functions}}
    global __cuLinkCreate_v2
    data["__cuLinkCreate_v2"] = <intptr_t>__cuLinkCreate_v2
    {{else}}
    data["__cuLinkCreate_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuLinkAddData_v2' in found_functions}}
    global __cuLinkAddData_v2
    data["__cuLinkAddData_v2"] = <intptr_t>__cuLinkAddData_v2
    {{else}}
    data["__cuLinkAddData_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuLinkAddFile_v2' in found_functions}}
    global __cuLinkAddFile_v2
    data["__cuLinkAddFile_v2"] = <intptr_t>__cuLinkAddFile_v2
    {{else}}
    data["__cuLinkAddFile_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuLinkComplete' in found_functions}}
    global __cuLinkComplete
    data["__cuLinkComplete"] = <intptr_t>__cuLinkComplete
    {{else}}
    data["__cuLinkComplete"] = <intptr_t>0
    {{endif}}

    {{if 'cuLinkDestroy' in found_functions}}
    global __cuLinkDestroy
    data["__cuLinkDestroy"] = <intptr_t>__cuLinkDestroy
    {{else}}
    data["__cuLinkDestroy"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleGetTexRef' in found_functions}}
    global __cuModuleGetTexRef
    data["__cuModuleGetTexRef"] = <intptr_t>__cuModuleGetTexRef
    {{else}}
    data["__cuModuleGetTexRef"] = <intptr_t>0
    {{endif}}

    {{if 'cuModuleGetSurfRef' in found_functions}}
    global __cuModuleGetSurfRef
    data["__cuModuleGetSurfRef"] = <intptr_t>__cuModuleGetSurfRef
    {{else}}
    data["__cuModuleGetSurfRef"] = <intptr_t>0
    {{endif}}

    {{if 'cuLibraryLoadData' in found_functions}}
    global __cuLibraryLoadData
    data["__cuLibraryLoadData"] = <intptr_t>__cuLibraryLoadData
    {{else}}
    data["__cuLibraryLoadData"] = <intptr_t>0
    {{endif}}

    {{if 'cuLibraryLoadFromFile' in found_functions}}
    global __cuLibraryLoadFromFile
    data["__cuLibraryLoadFromFile"] = <intptr_t>__cuLibraryLoadFromFile
    {{else}}
    data["__cuLibraryLoadFromFile"] = <intptr_t>0
    {{endif}}

    {{if 'cuLibraryUnload' in found_functions}}
    global __cuLibraryUnload
    data["__cuLibraryUnload"] = <intptr_t>__cuLibraryUnload
    {{else}}
    data["__cuLibraryUnload"] = <intptr_t>0
    {{endif}}

    {{if 'cuLibraryGetKernel' in found_functions}}
    global __cuLibraryGetKernel
    data["__cuLibraryGetKernel"] = <intptr_t>__cuLibraryGetKernel
    {{else}}
    data["__cuLibraryGetKernel"] = <intptr_t>0
    {{endif}}

    {{if 'cuLibraryGetKernelCount' in found_functions}}
    global __cuLibraryGetKernelCount
    data["__cuLibraryGetKernelCount"] = <intptr_t>__cuLibraryGetKernelCount
    {{else}}
    data["__cuLibraryGetKernelCount"] = <intptr_t>0
    {{endif}}

    {{if 'cuLibraryEnumerateKernels' in found_functions}}
    global __cuLibraryEnumerateKernels
    data["__cuLibraryEnumerateKernels"] = <intptr_t>__cuLibraryEnumerateKernels
    {{else}}
    data["__cuLibraryEnumerateKernels"] = <intptr_t>0
    {{endif}}

    {{if 'cuLibraryGetModule' in found_functions}}
    global __cuLibraryGetModule
    data["__cuLibraryGetModule"] = <intptr_t>__cuLibraryGetModule
    {{else}}
    data["__cuLibraryGetModule"] = <intptr_t>0
    {{endif}}

    {{if 'cuKernelGetFunction' in found_functions}}
    global __cuKernelGetFunction
    data["__cuKernelGetFunction"] = <intptr_t>__cuKernelGetFunction
    {{else}}
    data["__cuKernelGetFunction"] = <intptr_t>0
    {{endif}}

    {{if 'cuKernelGetLibrary' in found_functions}}
    global __cuKernelGetLibrary
    data["__cuKernelGetLibrary"] = <intptr_t>__cuKernelGetLibrary
    {{else}}
    data["__cuKernelGetLibrary"] = <intptr_t>0
    {{endif}}

    {{if 'cuLibraryGetGlobal' in found_functions}}
    global __cuLibraryGetGlobal
    data["__cuLibraryGetGlobal"] = <intptr_t>__cuLibraryGetGlobal
    {{else}}
    data["__cuLibraryGetGlobal"] = <intptr_t>0
    {{endif}}

    {{if 'cuLibraryGetManaged' in found_functions}}
    global __cuLibraryGetManaged
    data["__cuLibraryGetManaged"] = <intptr_t>__cuLibraryGetManaged
    {{else}}
    data["__cuLibraryGetManaged"] = <intptr_t>0
    {{endif}}

    {{if 'cuLibraryGetUnifiedFunction' in found_functions}}
    global __cuLibraryGetUnifiedFunction
    data["__cuLibraryGetUnifiedFunction"] = <intptr_t>__cuLibraryGetUnifiedFunction
    {{else}}
    data["__cuLibraryGetUnifiedFunction"] = <intptr_t>0
    {{endif}}

    {{if 'cuKernelGetAttribute' in found_functions}}
    global __cuKernelGetAttribute
    data["__cuKernelGetAttribute"] = <intptr_t>__cuKernelGetAttribute
    {{else}}
    data["__cuKernelGetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuKernelSetAttribute' in found_functions}}
    global __cuKernelSetAttribute
    data["__cuKernelSetAttribute"] = <intptr_t>__cuKernelSetAttribute
    {{else}}
    data["__cuKernelSetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuKernelSetCacheConfig' in found_functions}}
    global __cuKernelSetCacheConfig
    data["__cuKernelSetCacheConfig"] = <intptr_t>__cuKernelSetCacheConfig
    {{else}}
    data["__cuKernelSetCacheConfig"] = <intptr_t>0
    {{endif}}

    {{if 'cuKernelGetName' in found_functions}}
    global __cuKernelGetName
    data["__cuKernelGetName"] = <intptr_t>__cuKernelGetName
    {{else}}
    data["__cuKernelGetName"] = <intptr_t>0
    {{endif}}

    {{if 'cuKernelGetParamInfo' in found_functions}}
    global __cuKernelGetParamInfo
    data["__cuKernelGetParamInfo"] = <intptr_t>__cuKernelGetParamInfo
    {{else}}
    data["__cuKernelGetParamInfo"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemGetInfo_v2' in found_functions}}
    global __cuMemGetInfo_v2
    data["__cuMemGetInfo_v2"] = <intptr_t>__cuMemGetInfo_v2
    {{else}}
    data["__cuMemGetInfo_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemAlloc_v2' in found_functions}}
    global __cuMemAlloc_v2
    data["__cuMemAlloc_v2"] = <intptr_t>__cuMemAlloc_v2
    {{else}}
    data["__cuMemAlloc_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemAllocPitch_v2' in found_functions}}
    global __cuMemAllocPitch_v2
    data["__cuMemAllocPitch_v2"] = <intptr_t>__cuMemAllocPitch_v2
    {{else}}
    data["__cuMemAllocPitch_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemFree_v2' in found_functions}}
    global __cuMemFree_v2
    data["__cuMemFree_v2"] = <intptr_t>__cuMemFree_v2
    {{else}}
    data["__cuMemFree_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemGetAddressRange_v2' in found_functions}}
    global __cuMemGetAddressRange_v2
    data["__cuMemGetAddressRange_v2"] = <intptr_t>__cuMemGetAddressRange_v2
    {{else}}
    data["__cuMemGetAddressRange_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemAllocHost_v2' in found_functions}}
    global __cuMemAllocHost_v2
    data["__cuMemAllocHost_v2"] = <intptr_t>__cuMemAllocHost_v2
    {{else}}
    data["__cuMemAllocHost_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemFreeHost' in found_functions}}
    global __cuMemFreeHost
    data["__cuMemFreeHost"] = <intptr_t>__cuMemFreeHost
    {{else}}
    data["__cuMemFreeHost"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemHostAlloc' in found_functions}}
    global __cuMemHostAlloc
    data["__cuMemHostAlloc"] = <intptr_t>__cuMemHostAlloc
    {{else}}
    data["__cuMemHostAlloc"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemHostGetDevicePointer_v2' in found_functions}}
    global __cuMemHostGetDevicePointer_v2
    data["__cuMemHostGetDevicePointer_v2"] = <intptr_t>__cuMemHostGetDevicePointer_v2
    {{else}}
    data["__cuMemHostGetDevicePointer_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemHostGetFlags' in found_functions}}
    global __cuMemHostGetFlags
    data["__cuMemHostGetFlags"] = <intptr_t>__cuMemHostGetFlags
    {{else}}
    data["__cuMemHostGetFlags"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemAllocManaged' in found_functions}}
    global __cuMemAllocManaged
    data["__cuMemAllocManaged"] = <intptr_t>__cuMemAllocManaged
    {{else}}
    data["__cuMemAllocManaged"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceRegisterAsyncNotification' in found_functions}}
    global __cuDeviceRegisterAsyncNotification
    data["__cuDeviceRegisterAsyncNotification"] = <intptr_t>__cuDeviceRegisterAsyncNotification
    {{else}}
    data["__cuDeviceRegisterAsyncNotification"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}}
    global __cuDeviceUnregisterAsyncNotification
    data["__cuDeviceUnregisterAsyncNotification"] = <intptr_t>__cuDeviceUnregisterAsyncNotification
    {{else}}
    data["__cuDeviceUnregisterAsyncNotification"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetByPCIBusId' in found_functions}}
    global __cuDeviceGetByPCIBusId
    data["__cuDeviceGetByPCIBusId"] = <intptr_t>__cuDeviceGetByPCIBusId
    {{else}}
    data["__cuDeviceGetByPCIBusId"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetPCIBusId' in found_functions}}
    global __cuDeviceGetPCIBusId
    data["__cuDeviceGetPCIBusId"] = <intptr_t>__cuDeviceGetPCIBusId
    {{else}}
    data["__cuDeviceGetPCIBusId"] = <intptr_t>0
    {{endif}}

    {{if 'cuIpcGetEventHandle' in found_functions}}
    global __cuIpcGetEventHandle
    data["__cuIpcGetEventHandle"] = <intptr_t>__cuIpcGetEventHandle
    {{else}}
    data["__cuIpcGetEventHandle"] = <intptr_t>0
    {{endif}}

    {{if 'cuIpcOpenEventHandle' in found_functions}}
    global __cuIpcOpenEventHandle
    data["__cuIpcOpenEventHandle"] = <intptr_t>__cuIpcOpenEventHandle
    {{else}}
    data["__cuIpcOpenEventHandle"] = <intptr_t>0
    {{endif}}

    {{if 'cuIpcGetMemHandle' in found_functions}}
    global __cuIpcGetMemHandle
    data["__cuIpcGetMemHandle"] = <intptr_t>__cuIpcGetMemHandle
    {{else}}
    data["__cuIpcGetMemHandle"] = <intptr_t>0
    {{endif}}

    {{if 'cuIpcOpenMemHandle_v2' in found_functions}}
    global __cuIpcOpenMemHandle_v2
    data["__cuIpcOpenMemHandle_v2"] = <intptr_t>__cuIpcOpenMemHandle_v2
    {{else}}
    data["__cuIpcOpenMemHandle_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuIpcCloseMemHandle' in found_functions}}
    global __cuIpcCloseMemHandle
    data["__cuIpcCloseMemHandle"] = <intptr_t>__cuIpcCloseMemHandle
    {{else}}
    data["__cuIpcCloseMemHandle"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemHostRegister_v2' in found_functions}}
    global __cuMemHostRegister_v2
    data["__cuMemHostRegister_v2"] = <intptr_t>__cuMemHostRegister_v2
    {{else}}
    data["__cuMemHostRegister_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemHostUnregister' in found_functions}}
    global __cuMemHostUnregister
    data["__cuMemHostUnregister"] = <intptr_t>__cuMemHostUnregister
    {{else}}
    data["__cuMemHostUnregister"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpy' in found_functions}}
    global __cuMemcpy
    data["__cuMemcpy"] = <intptr_t>__cuMemcpy
    {{else}}
    data["__cuMemcpy"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyPeer' in found_functions}}
    global __cuMemcpyPeer
    data["__cuMemcpyPeer"] = <intptr_t>__cuMemcpyPeer
    {{else}}
    data["__cuMemcpyPeer"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyHtoD_v2' in found_functions}}
    global __cuMemcpyHtoD_v2
    data["__cuMemcpyHtoD_v2"] = <intptr_t>__cuMemcpyHtoD_v2
    {{else}}
    data["__cuMemcpyHtoD_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyDtoH_v2' in found_functions}}
    global __cuMemcpyDtoH_v2
    data["__cuMemcpyDtoH_v2"] = <intptr_t>__cuMemcpyDtoH_v2
    {{else}}
    data["__cuMemcpyDtoH_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyDtoD_v2' in found_functions}}
    global __cuMemcpyDtoD_v2
    data["__cuMemcpyDtoD_v2"] = <intptr_t>__cuMemcpyDtoD_v2
    {{else}}
    data["__cuMemcpyDtoD_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyDtoA_v2' in found_functions}}
    global __cuMemcpyDtoA_v2
    data["__cuMemcpyDtoA_v2"] = <intptr_t>__cuMemcpyDtoA_v2
    {{else}}
    data["__cuMemcpyDtoA_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyAtoD_v2' in found_functions}}
    global __cuMemcpyAtoD_v2
    data["__cuMemcpyAtoD_v2"] = <intptr_t>__cuMemcpyAtoD_v2
    {{else}}
    data["__cuMemcpyAtoD_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyHtoA_v2' in found_functions}}
    global __cuMemcpyHtoA_v2
    data["__cuMemcpyHtoA_v2"] = <intptr_t>__cuMemcpyHtoA_v2
    {{else}}
    data["__cuMemcpyHtoA_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyAtoH_v2' in found_functions}}
    global __cuMemcpyAtoH_v2
    data["__cuMemcpyAtoH_v2"] = <intptr_t>__cuMemcpyAtoH_v2
    {{else}}
    data["__cuMemcpyAtoH_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyAtoA_v2' in found_functions}}
    global __cuMemcpyAtoA_v2
    data["__cuMemcpyAtoA_v2"] = <intptr_t>__cuMemcpyAtoA_v2
    {{else}}
    data["__cuMemcpyAtoA_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpy2D_v2' in found_functions}}
    global __cuMemcpy2D_v2
    data["__cuMemcpy2D_v2"] = <intptr_t>__cuMemcpy2D_v2
    {{else}}
    data["__cuMemcpy2D_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpy2DUnaligned_v2' in found_functions}}
    global __cuMemcpy2DUnaligned_v2
    data["__cuMemcpy2DUnaligned_v2"] = <intptr_t>__cuMemcpy2DUnaligned_v2
    {{else}}
    data["__cuMemcpy2DUnaligned_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpy3D_v2' in found_functions}}
    global __cuMemcpy3D_v2
    data["__cuMemcpy3D_v2"] = <intptr_t>__cuMemcpy3D_v2
    {{else}}
    data["__cuMemcpy3D_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpy3DPeer' in found_functions}}
    global __cuMemcpy3DPeer
    data["__cuMemcpy3DPeer"] = <intptr_t>__cuMemcpy3DPeer
    {{else}}
    data["__cuMemcpy3DPeer"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyAsync' in found_functions}}
    global __cuMemcpyAsync
    data["__cuMemcpyAsync"] = <intptr_t>__cuMemcpyAsync
    {{else}}
    data["__cuMemcpyAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyPeerAsync' in found_functions}}
    global __cuMemcpyPeerAsync
    data["__cuMemcpyPeerAsync"] = <intptr_t>__cuMemcpyPeerAsync
    {{else}}
    data["__cuMemcpyPeerAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyHtoDAsync_v2' in found_functions}}
    global __cuMemcpyHtoDAsync_v2
    data["__cuMemcpyHtoDAsync_v2"] = <intptr_t>__cuMemcpyHtoDAsync_v2
    {{else}}
    data["__cuMemcpyHtoDAsync_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyDtoHAsync_v2' in found_functions}}
    global __cuMemcpyDtoHAsync_v2
    data["__cuMemcpyDtoHAsync_v2"] = <intptr_t>__cuMemcpyDtoHAsync_v2
    {{else}}
    data["__cuMemcpyDtoHAsync_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyDtoDAsync_v2' in found_functions}}
    global __cuMemcpyDtoDAsync_v2
    data["__cuMemcpyDtoDAsync_v2"] = <intptr_t>__cuMemcpyDtoDAsync_v2
    {{else}}
    data["__cuMemcpyDtoDAsync_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyHtoAAsync_v2' in found_functions}}
    global __cuMemcpyHtoAAsync_v2
    data["__cuMemcpyHtoAAsync_v2"] = <intptr_t>__cuMemcpyHtoAAsync_v2
    {{else}}
    data["__cuMemcpyHtoAAsync_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyAtoHAsync_v2' in found_functions}}
    global __cuMemcpyAtoHAsync_v2
    data["__cuMemcpyAtoHAsync_v2"] = <intptr_t>__cuMemcpyAtoHAsync_v2
    {{else}}
    data["__cuMemcpyAtoHAsync_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpy2DAsync_v2' in found_functions}}
    global __cuMemcpy2DAsync_v2
    data["__cuMemcpy2DAsync_v2"] = <intptr_t>__cuMemcpy2DAsync_v2
    {{else}}
    data["__cuMemcpy2DAsync_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpy3DAsync_v2' in found_functions}}
    global __cuMemcpy3DAsync_v2
    data["__cuMemcpy3DAsync_v2"] = <intptr_t>__cuMemcpy3DAsync_v2
    {{else}}
    data["__cuMemcpy3DAsync_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpy3DPeerAsync' in found_functions}}
    global __cuMemcpy3DPeerAsync
    data["__cuMemcpy3DPeerAsync"] = <intptr_t>__cuMemcpy3DPeerAsync
    {{else}}
    data["__cuMemcpy3DPeerAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpyBatchAsync' in found_functions}}
    global __cuMemcpyBatchAsync
    data["__cuMemcpyBatchAsync"] = <intptr_t>__cuMemcpyBatchAsync
    {{else}}
    data["__cuMemcpyBatchAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemcpy3DBatchAsync' in found_functions}}
    global __cuMemcpy3DBatchAsync
    data["__cuMemcpy3DBatchAsync"] = <intptr_t>__cuMemcpy3DBatchAsync
    {{else}}
    data["__cuMemcpy3DBatchAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD8_v2' in found_functions}}
    global __cuMemsetD8_v2
    data["__cuMemsetD8_v2"] = <intptr_t>__cuMemsetD8_v2
    {{else}}
    data["__cuMemsetD8_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD16_v2' in found_functions}}
    global __cuMemsetD16_v2
    data["__cuMemsetD16_v2"] = <intptr_t>__cuMemsetD16_v2
    {{else}}
    data["__cuMemsetD16_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD32_v2' in found_functions}}
    global __cuMemsetD32_v2
    data["__cuMemsetD32_v2"] = <intptr_t>__cuMemsetD32_v2
    {{else}}
    data["__cuMemsetD32_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD2D8_v2' in found_functions}}
    global __cuMemsetD2D8_v2
    data["__cuMemsetD2D8_v2"] = <intptr_t>__cuMemsetD2D8_v2
    {{else}}
    data["__cuMemsetD2D8_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD2D16_v2' in found_functions}}
    global __cuMemsetD2D16_v2
    data["__cuMemsetD2D16_v2"] = <intptr_t>__cuMemsetD2D16_v2
    {{else}}
    data["__cuMemsetD2D16_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD2D32_v2' in found_functions}}
    global __cuMemsetD2D32_v2
    data["__cuMemsetD2D32_v2"] = <intptr_t>__cuMemsetD2D32_v2
    {{else}}
    data["__cuMemsetD2D32_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD8Async' in found_functions}}
    global __cuMemsetD8Async
    data["__cuMemsetD8Async"] = <intptr_t>__cuMemsetD8Async
    {{else}}
    data["__cuMemsetD8Async"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD16Async' in found_functions}}
    global __cuMemsetD16Async
    data["__cuMemsetD16Async"] = <intptr_t>__cuMemsetD16Async
    {{else}}
    data["__cuMemsetD16Async"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD32Async' in found_functions}}
    global __cuMemsetD32Async
    data["__cuMemsetD32Async"] = <intptr_t>__cuMemsetD32Async
    {{else}}
    data["__cuMemsetD32Async"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD2D8Async' in found_functions}}
    global __cuMemsetD2D8Async
    data["__cuMemsetD2D8Async"] = <intptr_t>__cuMemsetD2D8Async
    {{else}}
    data["__cuMemsetD2D8Async"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD2D16Async' in found_functions}}
    global __cuMemsetD2D16Async
    data["__cuMemsetD2D16Async"] = <intptr_t>__cuMemsetD2D16Async
    {{else}}
    data["__cuMemsetD2D16Async"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemsetD2D32Async' in found_functions}}
    global __cuMemsetD2D32Async
    data["__cuMemsetD2D32Async"] = <intptr_t>__cuMemsetD2D32Async
    {{else}}
    data["__cuMemsetD2D32Async"] = <intptr_t>0
    {{endif}}

    {{if 'cuArrayCreate_v2' in found_functions}}
    global __cuArrayCreate_v2
    data["__cuArrayCreate_v2"] = <intptr_t>__cuArrayCreate_v2
    {{else}}
    data["__cuArrayCreate_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuArrayGetDescriptor_v2' in found_functions}}
    global __cuArrayGetDescriptor_v2
    data["__cuArrayGetDescriptor_v2"] = <intptr_t>__cuArrayGetDescriptor_v2
    {{else}}
    data["__cuArrayGetDescriptor_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuArrayGetSparseProperties' in found_functions}}
    global __cuArrayGetSparseProperties
    data["__cuArrayGetSparseProperties"] = <intptr_t>__cuArrayGetSparseProperties
    {{else}}
    data["__cuArrayGetSparseProperties"] = <intptr_t>0
    {{endif}}

    {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}}
    global __cuMipmappedArrayGetSparseProperties
    data["__cuMipmappedArrayGetSparseProperties"] = <intptr_t>__cuMipmappedArrayGetSparseProperties
    {{else}}
    data["__cuMipmappedArrayGetSparseProperties"] = <intptr_t>0
    {{endif}}

    {{if 'cuArrayGetMemoryRequirements' in found_functions}}
    global __cuArrayGetMemoryRequirements
    data["__cuArrayGetMemoryRequirements"] = <intptr_t>__cuArrayGetMemoryRequirements
    {{else}}
    data["__cuArrayGetMemoryRequirements"] = <intptr_t>0
    {{endif}}

    {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}}
    global __cuMipmappedArrayGetMemoryRequirements
    data["__cuMipmappedArrayGetMemoryRequirements"] = <intptr_t>__cuMipmappedArrayGetMemoryRequirements
    {{else}}
    data["__cuMipmappedArrayGetMemoryRequirements"] = <intptr_t>0
    {{endif}}

    {{if 'cuArrayGetPlane' in found_functions}}
    global __cuArrayGetPlane
    data["__cuArrayGetPlane"] = <intptr_t>__cuArrayGetPlane
    {{else}}
    data["__cuArrayGetPlane"] = <intptr_t>0
    {{endif}}

    {{if 'cuArrayDestroy' in found_functions}}
    global __cuArrayDestroy
    data["__cuArrayDestroy"] = <intptr_t>__cuArrayDestroy
    {{else}}
    data["__cuArrayDestroy"] = <intptr_t>0
    {{endif}}

    {{if 'cuArray3DCreate_v2' in found_functions}}
    global __cuArray3DCreate_v2
    data["__cuArray3DCreate_v2"] = <intptr_t>__cuArray3DCreate_v2
    {{else}}
    data["__cuArray3DCreate_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuArray3DGetDescriptor_v2' in found_functions}}
    global __cuArray3DGetDescriptor_v2
    data["__cuArray3DGetDescriptor_v2"] = <intptr_t>__cuArray3DGetDescriptor_v2
    {{else}}
    data["__cuArray3DGetDescriptor_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMipmappedArrayCreate' in found_functions}}
    global __cuMipmappedArrayCreate
    data["__cuMipmappedArrayCreate"] = <intptr_t>__cuMipmappedArrayCreate
    {{else}}
    data["__cuMipmappedArrayCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuMipmappedArrayGetLevel' in found_functions}}
    global __cuMipmappedArrayGetLevel
    data["__cuMipmappedArrayGetLevel"] = <intptr_t>__cuMipmappedArrayGetLevel
    {{else}}
    data["__cuMipmappedArrayGetLevel"] = <intptr_t>0
    {{endif}}

    {{if 'cuMipmappedArrayDestroy' in found_functions}}
    global __cuMipmappedArrayDestroy
    data["__cuMipmappedArrayDestroy"] = <intptr_t>__cuMipmappedArrayDestroy
    {{else}}
    data["__cuMipmappedArrayDestroy"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemGetHandleForAddressRange' in found_functions}}
    global __cuMemGetHandleForAddressRange
    data["__cuMemGetHandleForAddressRange"] = <intptr_t>__cuMemGetHandleForAddressRange
    {{else}}
    data["__cuMemGetHandleForAddressRange"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemBatchDecompressAsync' in found_functions}}
    global __cuMemBatchDecompressAsync
    data["__cuMemBatchDecompressAsync"] = <intptr_t>__cuMemBatchDecompressAsync
    {{else}}
    data["__cuMemBatchDecompressAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemAddressReserve' in found_functions}}
    global __cuMemAddressReserve
    data["__cuMemAddressReserve"] = <intptr_t>__cuMemAddressReserve
    {{else}}
    data["__cuMemAddressReserve"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemAddressFree' in found_functions}}
    global __cuMemAddressFree
    data["__cuMemAddressFree"] = <intptr_t>__cuMemAddressFree
    {{else}}
    data["__cuMemAddressFree"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemCreate' in found_functions}}
    global __cuMemCreate
    data["__cuMemCreate"] = <intptr_t>__cuMemCreate
    {{else}}
    data["__cuMemCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemRelease' in found_functions}}
    global __cuMemRelease
    data["__cuMemRelease"] = <intptr_t>__cuMemRelease
    {{else}}
    data["__cuMemRelease"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemMap' in found_functions}}
    global __cuMemMap
    data["__cuMemMap"] = <intptr_t>__cuMemMap
    {{else}}
    data["__cuMemMap"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemMapArrayAsync' in found_functions}}
    global __cuMemMapArrayAsync
    data["__cuMemMapArrayAsync"] = <intptr_t>__cuMemMapArrayAsync
    {{else}}
    data["__cuMemMapArrayAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemUnmap' in found_functions}}
    global __cuMemUnmap
    data["__cuMemUnmap"] = <intptr_t>__cuMemUnmap
    {{else}}
    data["__cuMemUnmap"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemSetAccess' in found_functions}}
    global __cuMemSetAccess
    data["__cuMemSetAccess"] = <intptr_t>__cuMemSetAccess
    {{else}}
    data["__cuMemSetAccess"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemGetAccess' in found_functions}}
    global __cuMemGetAccess
    data["__cuMemGetAccess"] = <intptr_t>__cuMemGetAccess
    {{else}}
    data["__cuMemGetAccess"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemExportToShareableHandle' in found_functions}}
    global __cuMemExportToShareableHandle
    data["__cuMemExportToShareableHandle"] = <intptr_t>__cuMemExportToShareableHandle
    {{else}}
    data["__cuMemExportToShareableHandle"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemImportFromShareableHandle' in found_functions}}
    global __cuMemImportFromShareableHandle
    data["__cuMemImportFromShareableHandle"] = <intptr_t>__cuMemImportFromShareableHandle
    {{else}}
    data["__cuMemImportFromShareableHandle"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemGetAllocationGranularity' in found_functions}}
    global __cuMemGetAllocationGranularity
    data["__cuMemGetAllocationGranularity"] = <intptr_t>__cuMemGetAllocationGranularity
    {{else}}
    data["__cuMemGetAllocationGranularity"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}}
    global __cuMemGetAllocationPropertiesFromHandle
    data["__cuMemGetAllocationPropertiesFromHandle"] = <intptr_t>__cuMemGetAllocationPropertiesFromHandle
    {{else}}
    data["__cuMemGetAllocationPropertiesFromHandle"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemRetainAllocationHandle' in found_functions}}
    global __cuMemRetainAllocationHandle
    data["__cuMemRetainAllocationHandle"] = <intptr_t>__cuMemRetainAllocationHandle
    {{else}}
    data["__cuMemRetainAllocationHandle"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemFreeAsync' in found_functions}}
    global __cuMemFreeAsync
    data["__cuMemFreeAsync"] = <intptr_t>__cuMemFreeAsync
    {{else}}
    data["__cuMemFreeAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemAllocAsync' in found_functions}}
    global __cuMemAllocAsync
    data["__cuMemAllocAsync"] = <intptr_t>__cuMemAllocAsync
    {{else}}
    data["__cuMemAllocAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPoolTrimTo' in found_functions}}
    global __cuMemPoolTrimTo
    data["__cuMemPoolTrimTo"] = <intptr_t>__cuMemPoolTrimTo
    {{else}}
    data["__cuMemPoolTrimTo"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPoolSetAttribute' in found_functions}}
    global __cuMemPoolSetAttribute
    data["__cuMemPoolSetAttribute"] = <intptr_t>__cuMemPoolSetAttribute
    {{else}}
    data["__cuMemPoolSetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPoolGetAttribute' in found_functions}}
    global __cuMemPoolGetAttribute
    data["__cuMemPoolGetAttribute"] = <intptr_t>__cuMemPoolGetAttribute
    {{else}}
    data["__cuMemPoolGetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPoolSetAccess' in found_functions}}
    global __cuMemPoolSetAccess
    data["__cuMemPoolSetAccess"] = <intptr_t>__cuMemPoolSetAccess
    {{else}}
    data["__cuMemPoolSetAccess"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPoolGetAccess' in found_functions}}
    global __cuMemPoolGetAccess
    data["__cuMemPoolGetAccess"] = <intptr_t>__cuMemPoolGetAccess
    {{else}}
    data["__cuMemPoolGetAccess"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPoolCreate' in found_functions}}
    global __cuMemPoolCreate
    data["__cuMemPoolCreate"] = <intptr_t>__cuMemPoolCreate
    {{else}}
    data["__cuMemPoolCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPoolDestroy' in found_functions}}
    global __cuMemPoolDestroy
    data["__cuMemPoolDestroy"] = <intptr_t>__cuMemPoolDestroy
    {{else}}
    data["__cuMemPoolDestroy"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemAllocFromPoolAsync' in found_functions}}
    global __cuMemAllocFromPoolAsync
    data["__cuMemAllocFromPoolAsync"] = <intptr_t>__cuMemAllocFromPoolAsync
    {{else}}
    data["__cuMemAllocFromPoolAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPoolExportToShareableHandle' in found_functions}}
    global __cuMemPoolExportToShareableHandle
    data["__cuMemPoolExportToShareableHandle"] = <intptr_t>__cuMemPoolExportToShareableHandle
    {{else}}
    data["__cuMemPoolExportToShareableHandle"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPoolImportFromShareableHandle' in found_functions}}
    global __cuMemPoolImportFromShareableHandle
    data["__cuMemPoolImportFromShareableHandle"] = <intptr_t>__cuMemPoolImportFromShareableHandle
    {{else}}
    data["__cuMemPoolImportFromShareableHandle"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPoolExportPointer' in found_functions}}
    global __cuMemPoolExportPointer
    data["__cuMemPoolExportPointer"] = <intptr_t>__cuMemPoolExportPointer
    {{else}}
    data["__cuMemPoolExportPointer"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPoolImportPointer' in found_functions}}
    global __cuMemPoolImportPointer
    data["__cuMemPoolImportPointer"] = <intptr_t>__cuMemPoolImportPointer
    {{else}}
    data["__cuMemPoolImportPointer"] = <intptr_t>0
    {{endif}}

    {{if 'cuMulticastCreate' in found_functions}}
    global __cuMulticastCreate
    data["__cuMulticastCreate"] = <intptr_t>__cuMulticastCreate
    {{else}}
    data["__cuMulticastCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuMulticastAddDevice' in found_functions}}
    global __cuMulticastAddDevice
    data["__cuMulticastAddDevice"] = <intptr_t>__cuMulticastAddDevice
    {{else}}
    data["__cuMulticastAddDevice"] = <intptr_t>0
    {{endif}}

    {{if 'cuMulticastBindMem' in found_functions}}
    global __cuMulticastBindMem
    data["__cuMulticastBindMem"] = <intptr_t>__cuMulticastBindMem
    {{else}}
    data["__cuMulticastBindMem"] = <intptr_t>0
    {{endif}}

    {{if 'cuMulticastBindAddr' in found_functions}}
    global __cuMulticastBindAddr
    data["__cuMulticastBindAddr"] = <intptr_t>__cuMulticastBindAddr
    {{else}}
    data["__cuMulticastBindAddr"] = <intptr_t>0
    {{endif}}

    {{if 'cuMulticastUnbind' in found_functions}}
    global __cuMulticastUnbind
    data["__cuMulticastUnbind"] = <intptr_t>__cuMulticastUnbind
    {{else}}
    data["__cuMulticastUnbind"] = <intptr_t>0
    {{endif}}

    {{if 'cuMulticastGetGranularity' in found_functions}}
    global __cuMulticastGetGranularity
    data["__cuMulticastGetGranularity"] = <intptr_t>__cuMulticastGetGranularity
    {{else}}
    data["__cuMulticastGetGranularity"] = <intptr_t>0
    {{endif}}

    {{if 'cuPointerGetAttribute' in found_functions}}
    global __cuPointerGetAttribute
    data["__cuPointerGetAttribute"] = <intptr_t>__cuPointerGetAttribute
    {{else}}
    data["__cuPointerGetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPrefetchAsync' in found_functions}}
    global __cuMemPrefetchAsync
    data["__cuMemPrefetchAsync"] = <intptr_t>__cuMemPrefetchAsync
    {{else}}
    data["__cuMemPrefetchAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemPrefetchAsync_v2' in found_functions}}
    global __cuMemPrefetchAsync_v2
    data["__cuMemPrefetchAsync_v2"] = <intptr_t>__cuMemPrefetchAsync_v2
    {{else}}
    data["__cuMemPrefetchAsync_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemAdvise' in found_functions}}
    global __cuMemAdvise
    data["__cuMemAdvise"] = <intptr_t>__cuMemAdvise
    {{else}}
    data["__cuMemAdvise"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemAdvise_v2' in found_functions}}
    global __cuMemAdvise_v2
    data["__cuMemAdvise_v2"] = <intptr_t>__cuMemAdvise_v2
    {{else}}
    data["__cuMemAdvise_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemRangeGetAttribute' in found_functions}}
    global __cuMemRangeGetAttribute
    data["__cuMemRangeGetAttribute"] = <intptr_t>__cuMemRangeGetAttribute
    {{else}}
    data["__cuMemRangeGetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuMemRangeGetAttributes' in found_functions}}
    global __cuMemRangeGetAttributes
    data["__cuMemRangeGetAttributes"] = <intptr_t>__cuMemRangeGetAttributes
    {{else}}
    data["__cuMemRangeGetAttributes"] = <intptr_t>0
    {{endif}}

    {{if 'cuPointerSetAttribute' in found_functions}}
    global __cuPointerSetAttribute
    data["__cuPointerSetAttribute"] = <intptr_t>__cuPointerSetAttribute
    {{else}}
    data["__cuPointerSetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuPointerGetAttributes' in found_functions}}
    global __cuPointerGetAttributes
    data["__cuPointerGetAttributes"] = <intptr_t>__cuPointerGetAttributes
    {{else}}
    data["__cuPointerGetAttributes"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamCreate' in found_functions}}
    global __cuStreamCreate
    data["__cuStreamCreate"] = <intptr_t>__cuStreamCreate
    {{else}}
    data["__cuStreamCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamCreateWithPriority' in found_functions}}
    global __cuStreamCreateWithPriority
    data["__cuStreamCreateWithPriority"] = <intptr_t>__cuStreamCreateWithPriority
    {{else}}
    data["__cuStreamCreateWithPriority"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamGetPriority' in found_functions}}
    global __cuStreamGetPriority
    data["__cuStreamGetPriority"] = <intptr_t>__cuStreamGetPriority
    {{else}}
    data["__cuStreamGetPriority"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamGetDevice' in found_functions}}
    global __cuStreamGetDevice
    data["__cuStreamGetDevice"] = <intptr_t>__cuStreamGetDevice
    {{else}}
    data["__cuStreamGetDevice"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamGetFlags' in found_functions}}
    global __cuStreamGetFlags
    data["__cuStreamGetFlags"] = <intptr_t>__cuStreamGetFlags
    {{else}}
    data["__cuStreamGetFlags"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamGetId' in found_functions}}
    global __cuStreamGetId
    data["__cuStreamGetId"] = <intptr_t>__cuStreamGetId
    {{else}}
    data["__cuStreamGetId"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamGetCtx' in found_functions}}
    global __cuStreamGetCtx
    data["__cuStreamGetCtx"] = <intptr_t>__cuStreamGetCtx
    {{else}}
    data["__cuStreamGetCtx"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamGetCtx_v2' in found_functions}}
    global __cuStreamGetCtx_v2
    data["__cuStreamGetCtx_v2"] = <intptr_t>__cuStreamGetCtx_v2
    {{else}}
    data["__cuStreamGetCtx_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamWaitEvent' in found_functions}}
    global __cuStreamWaitEvent
    data["__cuStreamWaitEvent"] = <intptr_t>__cuStreamWaitEvent
    {{else}}
    data["__cuStreamWaitEvent"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamAddCallback' in found_functions}}
    global __cuStreamAddCallback
    data["__cuStreamAddCallback"] = <intptr_t>__cuStreamAddCallback
    {{else}}
    data["__cuStreamAddCallback"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamBeginCapture_v2' in found_functions}}
    global __cuStreamBeginCapture_v2
    data["__cuStreamBeginCapture_v2"] = <intptr_t>__cuStreamBeginCapture_v2
    {{else}}
    data["__cuStreamBeginCapture_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamBeginCaptureToGraph' in found_functions}}
    global __cuStreamBeginCaptureToGraph
    data["__cuStreamBeginCaptureToGraph"] = <intptr_t>__cuStreamBeginCaptureToGraph
    {{else}}
    data["__cuStreamBeginCaptureToGraph"] = <intptr_t>0
    {{endif}}

    {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}}
    global __cuThreadExchangeStreamCaptureMode
    data["__cuThreadExchangeStreamCaptureMode"] = <intptr_t>__cuThreadExchangeStreamCaptureMode
    {{else}}
    data["__cuThreadExchangeStreamCaptureMode"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamEndCapture' in found_functions}}
    global __cuStreamEndCapture
    data["__cuStreamEndCapture"] = <intptr_t>__cuStreamEndCapture
    {{else}}
    data["__cuStreamEndCapture"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamIsCapturing' in found_functions}}
    global __cuStreamIsCapturing
    data["__cuStreamIsCapturing"] = <intptr_t>__cuStreamIsCapturing
    {{else}}
    data["__cuStreamIsCapturing"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamGetCaptureInfo_v2' in found_functions}}
    global __cuStreamGetCaptureInfo_v2
    data["__cuStreamGetCaptureInfo_v2"] = <intptr_t>__cuStreamGetCaptureInfo_v2
    {{else}}
    data["__cuStreamGetCaptureInfo_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamGetCaptureInfo_v3' in found_functions}}
    global __cuStreamGetCaptureInfo_v3
    data["__cuStreamGetCaptureInfo_v3"] = <intptr_t>__cuStreamGetCaptureInfo_v3
    {{else}}
    data["__cuStreamGetCaptureInfo_v3"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamUpdateCaptureDependencies' in found_functions}}
    global __cuStreamUpdateCaptureDependencies
    data["__cuStreamUpdateCaptureDependencies"] = <intptr_t>__cuStreamUpdateCaptureDependencies
    {{else}}
    data["__cuStreamUpdateCaptureDependencies"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}}
    global __cuStreamUpdateCaptureDependencies_v2
    data["__cuStreamUpdateCaptureDependencies_v2"] = <intptr_t>__cuStreamUpdateCaptureDependencies_v2
    {{else}}
    data["__cuStreamUpdateCaptureDependencies_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamAttachMemAsync' in found_functions}}
    global __cuStreamAttachMemAsync
    data["__cuStreamAttachMemAsync"] = <intptr_t>__cuStreamAttachMemAsync
    {{else}}
    data["__cuStreamAttachMemAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamQuery' in found_functions}}
    global __cuStreamQuery
    data["__cuStreamQuery"] = <intptr_t>__cuStreamQuery
    {{else}}
    data["__cuStreamQuery"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamSynchronize' in found_functions}}
    global __cuStreamSynchronize
    data["__cuStreamSynchronize"] = <intptr_t>__cuStreamSynchronize
    {{else}}
    data["__cuStreamSynchronize"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamDestroy_v2' in found_functions}}
    global __cuStreamDestroy_v2
    data["__cuStreamDestroy_v2"] = <intptr_t>__cuStreamDestroy_v2
    {{else}}
    data["__cuStreamDestroy_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamCopyAttributes' in found_functions}}
    global __cuStreamCopyAttributes
    data["__cuStreamCopyAttributes"] = <intptr_t>__cuStreamCopyAttributes
    {{else}}
    data["__cuStreamCopyAttributes"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamGetAttribute' in found_functions}}
    global __cuStreamGetAttribute
    data["__cuStreamGetAttribute"] = <intptr_t>__cuStreamGetAttribute
    {{else}}
    data["__cuStreamGetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamSetAttribute' in found_functions}}
    global __cuStreamSetAttribute
    data["__cuStreamSetAttribute"] = <intptr_t>__cuStreamSetAttribute
    {{else}}
    data["__cuStreamSetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuEventCreate' in found_functions}}
    global __cuEventCreate
    data["__cuEventCreate"] = <intptr_t>__cuEventCreate
    {{else}}
    data["__cuEventCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuEventRecord' in found_functions}}
    global __cuEventRecord
    data["__cuEventRecord"] = <intptr_t>__cuEventRecord
    {{else}}
    data["__cuEventRecord"] = <intptr_t>0
    {{endif}}

    {{if 'cuEventRecordWithFlags' in found_functions}}
    global __cuEventRecordWithFlags
    data["__cuEventRecordWithFlags"] = <intptr_t>__cuEventRecordWithFlags
    {{else}}
    data["__cuEventRecordWithFlags"] = <intptr_t>0
    {{endif}}

    {{if 'cuEventQuery' in found_functions}}
    global __cuEventQuery
    data["__cuEventQuery"] = <intptr_t>__cuEventQuery
    {{else}}
    data["__cuEventQuery"] = <intptr_t>0
    {{endif}}

    {{if 'cuEventSynchronize' in found_functions}}
    global __cuEventSynchronize
    data["__cuEventSynchronize"] = <intptr_t>__cuEventSynchronize
    {{else}}
    data["__cuEventSynchronize"] = <intptr_t>0
    {{endif}}

    {{if 'cuEventDestroy_v2' in found_functions}}
    global __cuEventDestroy_v2
    data["__cuEventDestroy_v2"] = <intptr_t>__cuEventDestroy_v2
    {{else}}
    data["__cuEventDestroy_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuEventElapsedTime' in found_functions}}
    global __cuEventElapsedTime
    data["__cuEventElapsedTime"] = <intptr_t>__cuEventElapsedTime
    {{else}}
    data["__cuEventElapsedTime"] = <intptr_t>0
    {{endif}}

    {{if 'cuEventElapsedTime_v2' in found_functions}}
    global __cuEventElapsedTime_v2
    data["__cuEventElapsedTime_v2"] = <intptr_t>__cuEventElapsedTime_v2
    {{else}}
    data["__cuEventElapsedTime_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuImportExternalMemory' in found_functions}}
    global __cuImportExternalMemory
    data["__cuImportExternalMemory"] = <intptr_t>__cuImportExternalMemory
    {{else}}
    data["__cuImportExternalMemory"] = <intptr_t>0
    {{endif}}

    {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}}
    global __cuExternalMemoryGetMappedBuffer
    data["__cuExternalMemoryGetMappedBuffer"] = <intptr_t>__cuExternalMemoryGetMappedBuffer
    {{else}}
    data["__cuExternalMemoryGetMappedBuffer"] = <intptr_t>0
    {{endif}}

    {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}}
    global __cuExternalMemoryGetMappedMipmappedArray
    data["__cuExternalMemoryGetMappedMipmappedArray"] = <intptr_t>__cuExternalMemoryGetMappedMipmappedArray
    {{else}}
    data["__cuExternalMemoryGetMappedMipmappedArray"] = <intptr_t>0
    {{endif}}

    {{if 'cuDestroyExternalMemory' in found_functions}}
    global __cuDestroyExternalMemory
    data["__cuDestroyExternalMemory"] = <intptr_t>__cuDestroyExternalMemory
    {{else}}
    data["__cuDestroyExternalMemory"] = <intptr_t>0
    {{endif}}

    {{if 'cuImportExternalSemaphore' in found_functions}}
    global __cuImportExternalSemaphore
    data["__cuImportExternalSemaphore"] = <intptr_t>__cuImportExternalSemaphore
    {{else}}
    data["__cuImportExternalSemaphore"] = <intptr_t>0
    {{endif}}

    {{if 'cuSignalExternalSemaphoresAsync' in found_functions}}
    global __cuSignalExternalSemaphoresAsync
    data["__cuSignalExternalSemaphoresAsync"] = <intptr_t>__cuSignalExternalSemaphoresAsync
    {{else}}
    data["__cuSignalExternalSemaphoresAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuWaitExternalSemaphoresAsync' in found_functions}}
    global __cuWaitExternalSemaphoresAsync
    data["__cuWaitExternalSemaphoresAsync"] = <intptr_t>__cuWaitExternalSemaphoresAsync
    {{else}}
    data["__cuWaitExternalSemaphoresAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuDestroyExternalSemaphore' in found_functions}}
    global __cuDestroyExternalSemaphore
    data["__cuDestroyExternalSemaphore"] = <intptr_t>__cuDestroyExternalSemaphore
    {{else}}
    data["__cuDestroyExternalSemaphore"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamWaitValue32_v2' in found_functions}}
    global __cuStreamWaitValue32_v2
    data["__cuStreamWaitValue32_v2"] = <intptr_t>__cuStreamWaitValue32_v2
    {{else}}
    data["__cuStreamWaitValue32_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamWaitValue64_v2' in found_functions}}
    global __cuStreamWaitValue64_v2
    data["__cuStreamWaitValue64_v2"] = <intptr_t>__cuStreamWaitValue64_v2
    {{else}}
    data["__cuStreamWaitValue64_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamWriteValue32_v2' in found_functions}}
    global __cuStreamWriteValue32_v2
    data["__cuStreamWriteValue32_v2"] = <intptr_t>__cuStreamWriteValue32_v2
    {{else}}
    data["__cuStreamWriteValue32_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamWriteValue64_v2' in found_functions}}
    global __cuStreamWriteValue64_v2
    data["__cuStreamWriteValue64_v2"] = <intptr_t>__cuStreamWriteValue64_v2
    {{else}}
    data["__cuStreamWriteValue64_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamBatchMemOp_v2' in found_functions}}
    global __cuStreamBatchMemOp_v2
    data["__cuStreamBatchMemOp_v2"] = <intptr_t>__cuStreamBatchMemOp_v2
    {{else}}
    data["__cuStreamBatchMemOp_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuFuncGetAttribute' in found_functions}}
    global __cuFuncGetAttribute
    data["__cuFuncGetAttribute"] = <intptr_t>__cuFuncGetAttribute
    {{else}}
    data["__cuFuncGetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuFuncSetAttribute' in found_functions}}
    global __cuFuncSetAttribute
    data["__cuFuncSetAttribute"] = <intptr_t>__cuFuncSetAttribute
    {{else}}
    data["__cuFuncSetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuFuncSetCacheConfig' in found_functions}}
    global __cuFuncSetCacheConfig
    data["__cuFuncSetCacheConfig"] = <intptr_t>__cuFuncSetCacheConfig
    {{else}}
    data["__cuFuncSetCacheConfig"] = <intptr_t>0
    {{endif}}

    {{if 'cuFuncGetModule' in found_functions}}
    global __cuFuncGetModule
    data["__cuFuncGetModule"] = <intptr_t>__cuFuncGetModule
    {{else}}
    data["__cuFuncGetModule"] = <intptr_t>0
    {{endif}}

    {{if 'cuFuncGetName' in found_functions}}
    global __cuFuncGetName
    data["__cuFuncGetName"] = <intptr_t>__cuFuncGetName
    {{else}}
    data["__cuFuncGetName"] = <intptr_t>0
    {{endif}}

    {{if 'cuFuncGetParamInfo' in found_functions}}
    global __cuFuncGetParamInfo
    data["__cuFuncGetParamInfo"] = <intptr_t>__cuFuncGetParamInfo
    {{else}}
    data["__cuFuncGetParamInfo"] = <intptr_t>0
    {{endif}}

    {{if 'cuFuncIsLoaded' in found_functions}}
    global __cuFuncIsLoaded
    data["__cuFuncIsLoaded"] = <intptr_t>__cuFuncIsLoaded
    {{else}}
    data["__cuFuncIsLoaded"] = <intptr_t>0
    {{endif}}

    {{if 'cuFuncLoad' in found_functions}}
    global __cuFuncLoad
    data["__cuFuncLoad"] = <intptr_t>__cuFuncLoad
    {{else}}
    data["__cuFuncLoad"] = <intptr_t>0
    {{endif}}

    {{if 'cuLaunchKernel' in found_functions}}
    global __cuLaunchKernel
    data["__cuLaunchKernel"] = <intptr_t>__cuLaunchKernel
    {{else}}
    data["__cuLaunchKernel"] = <intptr_t>0
    {{endif}}

    {{if 'cuLaunchKernelEx' in found_functions}}
    global __cuLaunchKernelEx
    data["__cuLaunchKernelEx"] = <intptr_t>__cuLaunchKernelEx
    {{else}}
    data["__cuLaunchKernelEx"] = <intptr_t>0
    {{endif}}

    {{if 'cuLaunchCooperativeKernel' in found_functions}}
    global __cuLaunchCooperativeKernel
    data["__cuLaunchCooperativeKernel"] = <intptr_t>__cuLaunchCooperativeKernel
    {{else}}
    data["__cuLaunchCooperativeKernel"] = <intptr_t>0
    {{endif}}

    {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}}
    global __cuLaunchCooperativeKernelMultiDevice
    data["__cuLaunchCooperativeKernelMultiDevice"] = <intptr_t>__cuLaunchCooperativeKernelMultiDevice
    {{else}}
    data["__cuLaunchCooperativeKernelMultiDevice"] = <intptr_t>0
    {{endif}}

    {{if 'cuLaunchHostFunc' in found_functions}}
    global __cuLaunchHostFunc
    data["__cuLaunchHostFunc"] = <intptr_t>__cuLaunchHostFunc
    {{else}}
    data["__cuLaunchHostFunc"] = <intptr_t>0
    {{endif}}

    {{if 'cuFuncSetBlockShape' in found_functions}}
    global __cuFuncSetBlockShape
    data["__cuFuncSetBlockShape"] = <intptr_t>__cuFuncSetBlockShape
    {{else}}
    data["__cuFuncSetBlockShape"] = <intptr_t>0
    {{endif}}

    {{if 'cuFuncSetSharedSize' in found_functions}}
    global __cuFuncSetSharedSize
    data["__cuFuncSetSharedSize"] = <intptr_t>__cuFuncSetSharedSize
    {{else}}
    data["__cuFuncSetSharedSize"] = <intptr_t>0
    {{endif}}

    {{if 'cuParamSetSize' in found_functions}}
    global __cuParamSetSize
    data["__cuParamSetSize"] = <intptr_t>__cuParamSetSize
    {{else}}
    data["__cuParamSetSize"] = <intptr_t>0
    {{endif}}

    {{if 'cuParamSeti' in found_functions}}
    global __cuParamSeti
    data["__cuParamSeti"] = <intptr_t>__cuParamSeti
    {{else}}
    data["__cuParamSeti"] = <intptr_t>0
    {{endif}}

    {{if 'cuParamSetf' in found_functions}}
    global __cuParamSetf
    data["__cuParamSetf"] = <intptr_t>__cuParamSetf
    {{else}}
    data["__cuParamSetf"] = <intptr_t>0
    {{endif}}

    {{if 'cuParamSetv' in found_functions}}
    global __cuParamSetv
    data["__cuParamSetv"] = <intptr_t>__cuParamSetv
    {{else}}
    data["__cuParamSetv"] = <intptr_t>0
    {{endif}}

    {{if 'cuLaunch' in found_functions}}
    global __cuLaunch
    data["__cuLaunch"] = <intptr_t>__cuLaunch
    {{else}}
    data["__cuLaunch"] = <intptr_t>0
    {{endif}}

    {{if 'cuLaunchGrid' in found_functions}}
    global __cuLaunchGrid
    data["__cuLaunchGrid"] = <intptr_t>__cuLaunchGrid
    {{else}}
    data["__cuLaunchGrid"] = <intptr_t>0
    {{endif}}

    {{if 'cuLaunchGridAsync' in found_functions}}
    global __cuLaunchGridAsync
    data["__cuLaunchGridAsync"] = <intptr_t>__cuLaunchGridAsync
    {{else}}
    data["__cuLaunchGridAsync"] = <intptr_t>0
    {{endif}}

    {{if 'cuParamSetTexRef' in found_functions}}
    global __cuParamSetTexRef
    data["__cuParamSetTexRef"] = <intptr_t>__cuParamSetTexRef
    {{else}}
    data["__cuParamSetTexRef"] = <intptr_t>0
    {{endif}}

    {{if 'cuFuncSetSharedMemConfig' in found_functions}}
    global __cuFuncSetSharedMemConfig
    data["__cuFuncSetSharedMemConfig"] = <intptr_t>__cuFuncSetSharedMemConfig
    {{else}}
    data["__cuFuncSetSharedMemConfig"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphCreate' in found_functions}}
    global __cuGraphCreate
    data["__cuGraphCreate"] = <intptr_t>__cuGraphCreate
    {{else}}
    data["__cuGraphCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddKernelNode_v2' in found_functions}}
    global __cuGraphAddKernelNode_v2
    data["__cuGraphAddKernelNode_v2"] = <intptr_t>__cuGraphAddKernelNode_v2
    {{else}}
    data["__cuGraphAddKernelNode_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}}
    global __cuGraphKernelNodeGetParams_v2
    data["__cuGraphKernelNodeGetParams_v2"] = <intptr_t>__cuGraphKernelNodeGetParams_v2
    {{else}}
    data["__cuGraphKernelNodeGetParams_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}}
    global __cuGraphKernelNodeSetParams_v2
    data["__cuGraphKernelNodeSetParams_v2"] = <intptr_t>__cuGraphKernelNodeSetParams_v2
    {{else}}
    data["__cuGraphKernelNodeSetParams_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddMemcpyNode' in found_functions}}
    global __cuGraphAddMemcpyNode
    data["__cuGraphAddMemcpyNode"] = <intptr_t>__cuGraphAddMemcpyNode
    {{else}}
    data["__cuGraphAddMemcpyNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphMemcpyNodeGetParams' in found_functions}}
    global __cuGraphMemcpyNodeGetParams
    data["__cuGraphMemcpyNodeGetParams"] = <intptr_t>__cuGraphMemcpyNodeGetParams
    {{else}}
    data["__cuGraphMemcpyNodeGetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphMemcpyNodeSetParams' in found_functions}}
    global __cuGraphMemcpyNodeSetParams
    data["__cuGraphMemcpyNodeSetParams"] = <intptr_t>__cuGraphMemcpyNodeSetParams
    {{else}}
    data["__cuGraphMemcpyNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddMemsetNode' in found_functions}}
    global __cuGraphAddMemsetNode
    data["__cuGraphAddMemsetNode"] = <intptr_t>__cuGraphAddMemsetNode
    {{else}}
    data["__cuGraphAddMemsetNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphMemsetNodeGetParams' in found_functions}}
    global __cuGraphMemsetNodeGetParams
    data["__cuGraphMemsetNodeGetParams"] = <intptr_t>__cuGraphMemsetNodeGetParams
    {{else}}
    data["__cuGraphMemsetNodeGetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphMemsetNodeSetParams' in found_functions}}
    global __cuGraphMemsetNodeSetParams
    data["__cuGraphMemsetNodeSetParams"] = <intptr_t>__cuGraphMemsetNodeSetParams
    {{else}}
    data["__cuGraphMemsetNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddHostNode' in found_functions}}
    global __cuGraphAddHostNode
    data["__cuGraphAddHostNode"] = <intptr_t>__cuGraphAddHostNode
    {{else}}
    data["__cuGraphAddHostNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphHostNodeGetParams' in found_functions}}
    global __cuGraphHostNodeGetParams
    data["__cuGraphHostNodeGetParams"] = <intptr_t>__cuGraphHostNodeGetParams
    {{else}}
    data["__cuGraphHostNodeGetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphHostNodeSetParams' in found_functions}}
    global __cuGraphHostNodeSetParams
    data["__cuGraphHostNodeSetParams"] = <intptr_t>__cuGraphHostNodeSetParams
    {{else}}
    data["__cuGraphHostNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddChildGraphNode' in found_functions}}
    global __cuGraphAddChildGraphNode
    data["__cuGraphAddChildGraphNode"] = <intptr_t>__cuGraphAddChildGraphNode
    {{else}}
    data["__cuGraphAddChildGraphNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}}
    global __cuGraphChildGraphNodeGetGraph
    data["__cuGraphChildGraphNodeGetGraph"] = <intptr_t>__cuGraphChildGraphNodeGetGraph
    {{else}}
    data["__cuGraphChildGraphNodeGetGraph"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddEmptyNode' in found_functions}}
    global __cuGraphAddEmptyNode
    data["__cuGraphAddEmptyNode"] = <intptr_t>__cuGraphAddEmptyNode
    {{else}}
    data["__cuGraphAddEmptyNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddEventRecordNode' in found_functions}}
    global __cuGraphAddEventRecordNode
    data["__cuGraphAddEventRecordNode"] = <intptr_t>__cuGraphAddEventRecordNode
    {{else}}
    data["__cuGraphAddEventRecordNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}}
    global __cuGraphEventRecordNodeGetEvent
    data["__cuGraphEventRecordNodeGetEvent"] = <intptr_t>__cuGraphEventRecordNodeGetEvent
    {{else}}
    data["__cuGraphEventRecordNodeGetEvent"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}}
    global __cuGraphEventRecordNodeSetEvent
    data["__cuGraphEventRecordNodeSetEvent"] = <intptr_t>__cuGraphEventRecordNodeSetEvent
    {{else}}
    data["__cuGraphEventRecordNodeSetEvent"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddEventWaitNode' in found_functions}}
    global __cuGraphAddEventWaitNode
    data["__cuGraphAddEventWaitNode"] = <intptr_t>__cuGraphAddEventWaitNode
    {{else}}
    data["__cuGraphAddEventWaitNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}}
    global __cuGraphEventWaitNodeGetEvent
    data["__cuGraphEventWaitNodeGetEvent"] = <intptr_t>__cuGraphEventWaitNodeGetEvent
    {{else}}
    data["__cuGraphEventWaitNodeGetEvent"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}}
    global __cuGraphEventWaitNodeSetEvent
    data["__cuGraphEventWaitNodeSetEvent"] = <intptr_t>__cuGraphEventWaitNodeSetEvent
    {{else}}
    data["__cuGraphEventWaitNodeSetEvent"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}}
    global __cuGraphAddExternalSemaphoresSignalNode
    data["__cuGraphAddExternalSemaphoresSignalNode"] = <intptr_t>__cuGraphAddExternalSemaphoresSignalNode
    {{else}}
    data["__cuGraphAddExternalSemaphoresSignalNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}}
    global __cuGraphExternalSemaphoresSignalNodeGetParams
    data["__cuGraphExternalSemaphoresSignalNodeGetParams"] = <intptr_t>__cuGraphExternalSemaphoresSignalNodeGetParams
    {{else}}
    data["__cuGraphExternalSemaphoresSignalNodeGetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}}
    global __cuGraphExternalSemaphoresSignalNodeSetParams
    data["__cuGraphExternalSemaphoresSignalNodeSetParams"] = <intptr_t>__cuGraphExternalSemaphoresSignalNodeSetParams
    {{else}}
    data["__cuGraphExternalSemaphoresSignalNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}}
    global __cuGraphAddExternalSemaphoresWaitNode
    data["__cuGraphAddExternalSemaphoresWaitNode"] = <intptr_t>__cuGraphAddExternalSemaphoresWaitNode
    {{else}}
    data["__cuGraphAddExternalSemaphoresWaitNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}}
    global __cuGraphExternalSemaphoresWaitNodeGetParams
    data["__cuGraphExternalSemaphoresWaitNodeGetParams"] = <intptr_t>__cuGraphExternalSemaphoresWaitNodeGetParams
    {{else}}
    data["__cuGraphExternalSemaphoresWaitNodeGetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}}
    global __cuGraphExternalSemaphoresWaitNodeSetParams
    data["__cuGraphExternalSemaphoresWaitNodeSetParams"] = <intptr_t>__cuGraphExternalSemaphoresWaitNodeSetParams
    {{else}}
    data["__cuGraphExternalSemaphoresWaitNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddBatchMemOpNode' in found_functions}}
    global __cuGraphAddBatchMemOpNode
    data["__cuGraphAddBatchMemOpNode"] = <intptr_t>__cuGraphAddBatchMemOpNode
    {{else}}
    data["__cuGraphAddBatchMemOpNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}}
    global __cuGraphBatchMemOpNodeGetParams
    data["__cuGraphBatchMemOpNodeGetParams"] = <intptr_t>__cuGraphBatchMemOpNodeGetParams
    {{else}}
    data["__cuGraphBatchMemOpNodeGetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}}
    global __cuGraphBatchMemOpNodeSetParams
    data["__cuGraphBatchMemOpNodeSetParams"] = <intptr_t>__cuGraphBatchMemOpNodeSetParams
    {{else}}
    data["__cuGraphBatchMemOpNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}}
    global __cuGraphExecBatchMemOpNodeSetParams
    data["__cuGraphExecBatchMemOpNodeSetParams"] = <intptr_t>__cuGraphExecBatchMemOpNodeSetParams
    {{else}}
    data["__cuGraphExecBatchMemOpNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddMemAllocNode' in found_functions}}
    global __cuGraphAddMemAllocNode
    data["__cuGraphAddMemAllocNode"] = <intptr_t>__cuGraphAddMemAllocNode
    {{else}}
    data["__cuGraphAddMemAllocNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphMemAllocNodeGetParams' in found_functions}}
    global __cuGraphMemAllocNodeGetParams
    data["__cuGraphMemAllocNodeGetParams"] = <intptr_t>__cuGraphMemAllocNodeGetParams
    {{else}}
    data["__cuGraphMemAllocNodeGetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddMemFreeNode' in found_functions}}
    global __cuGraphAddMemFreeNode
    data["__cuGraphAddMemFreeNode"] = <intptr_t>__cuGraphAddMemFreeNode
    {{else}}
    data["__cuGraphAddMemFreeNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphMemFreeNodeGetParams' in found_functions}}
    global __cuGraphMemFreeNodeGetParams
    data["__cuGraphMemFreeNodeGetParams"] = <intptr_t>__cuGraphMemFreeNodeGetParams
    {{else}}
    data["__cuGraphMemFreeNodeGetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGraphMemTrim' in found_functions}}
    global __cuDeviceGraphMemTrim
    data["__cuDeviceGraphMemTrim"] = <intptr_t>__cuDeviceGraphMemTrim
    {{else}}
    data["__cuDeviceGraphMemTrim"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetGraphMemAttribute' in found_functions}}
    global __cuDeviceGetGraphMemAttribute
    data["__cuDeviceGetGraphMemAttribute"] = <intptr_t>__cuDeviceGetGraphMemAttribute
    {{else}}
    data["__cuDeviceGetGraphMemAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceSetGraphMemAttribute' in found_functions}}
    global __cuDeviceSetGraphMemAttribute
    data["__cuDeviceSetGraphMemAttribute"] = <intptr_t>__cuDeviceSetGraphMemAttribute
    {{else}}
    data["__cuDeviceSetGraphMemAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphClone' in found_functions}}
    global __cuGraphClone
    data["__cuGraphClone"] = <intptr_t>__cuGraphClone
    {{else}}
    data["__cuGraphClone"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphNodeFindInClone' in found_functions}}
    global __cuGraphNodeFindInClone
    data["__cuGraphNodeFindInClone"] = <intptr_t>__cuGraphNodeFindInClone
    {{else}}
    data["__cuGraphNodeFindInClone"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphNodeGetType' in found_functions}}
    global __cuGraphNodeGetType
    data["__cuGraphNodeGetType"] = <intptr_t>__cuGraphNodeGetType
    {{else}}
    data["__cuGraphNodeGetType"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphGetNodes' in found_functions}}
    global __cuGraphGetNodes
    data["__cuGraphGetNodes"] = <intptr_t>__cuGraphGetNodes
    {{else}}
    data["__cuGraphGetNodes"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphGetRootNodes' in found_functions}}
    global __cuGraphGetRootNodes
    data["__cuGraphGetRootNodes"] = <intptr_t>__cuGraphGetRootNodes
    {{else}}
    data["__cuGraphGetRootNodes"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphGetEdges' in found_functions}}
    global __cuGraphGetEdges
    data["__cuGraphGetEdges"] = <intptr_t>__cuGraphGetEdges
    {{else}}
    data["__cuGraphGetEdges"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphGetEdges_v2' in found_functions}}
    global __cuGraphGetEdges_v2
    data["__cuGraphGetEdges_v2"] = <intptr_t>__cuGraphGetEdges_v2
    {{else}}
    data["__cuGraphGetEdges_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphNodeGetDependencies' in found_functions}}
    global __cuGraphNodeGetDependencies
    data["__cuGraphNodeGetDependencies"] = <intptr_t>__cuGraphNodeGetDependencies
    {{else}}
    data["__cuGraphNodeGetDependencies"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphNodeGetDependencies_v2' in found_functions}}
    global __cuGraphNodeGetDependencies_v2
    data["__cuGraphNodeGetDependencies_v2"] = <intptr_t>__cuGraphNodeGetDependencies_v2
    {{else}}
    data["__cuGraphNodeGetDependencies_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphNodeGetDependentNodes' in found_functions}}
    global __cuGraphNodeGetDependentNodes
    data["__cuGraphNodeGetDependentNodes"] = <intptr_t>__cuGraphNodeGetDependentNodes
    {{else}}
    data["__cuGraphNodeGetDependentNodes"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}}
    global __cuGraphNodeGetDependentNodes_v2
    data["__cuGraphNodeGetDependentNodes_v2"] = <intptr_t>__cuGraphNodeGetDependentNodes_v2
    {{else}}
    data["__cuGraphNodeGetDependentNodes_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddDependencies' in found_functions}}
    global __cuGraphAddDependencies
    data["__cuGraphAddDependencies"] = <intptr_t>__cuGraphAddDependencies
    {{else}}
    data["__cuGraphAddDependencies"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddDependencies_v2' in found_functions}}
    global __cuGraphAddDependencies_v2
    data["__cuGraphAddDependencies_v2"] = <intptr_t>__cuGraphAddDependencies_v2
    {{else}}
    data["__cuGraphAddDependencies_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphRemoveDependencies' in found_functions}}
    global __cuGraphRemoveDependencies
    data["__cuGraphRemoveDependencies"] = <intptr_t>__cuGraphRemoveDependencies
    {{else}}
    data["__cuGraphRemoveDependencies"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphRemoveDependencies_v2' in found_functions}}
    global __cuGraphRemoveDependencies_v2
    data["__cuGraphRemoveDependencies_v2"] = <intptr_t>__cuGraphRemoveDependencies_v2
    {{else}}
    data["__cuGraphRemoveDependencies_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphDestroyNode' in found_functions}}
    global __cuGraphDestroyNode
    data["__cuGraphDestroyNode"] = <intptr_t>__cuGraphDestroyNode
    {{else}}
    data["__cuGraphDestroyNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphInstantiateWithFlags' in found_functions}}
    global __cuGraphInstantiateWithFlags
    data["__cuGraphInstantiateWithFlags"] = <intptr_t>__cuGraphInstantiateWithFlags
    {{else}}
    data["__cuGraphInstantiateWithFlags"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphInstantiateWithParams' in found_functions}}
    global __cuGraphInstantiateWithParams
    data["__cuGraphInstantiateWithParams"] = <intptr_t>__cuGraphInstantiateWithParams
    {{else}}
    data["__cuGraphInstantiateWithParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecGetFlags' in found_functions}}
    global __cuGraphExecGetFlags
    data["__cuGraphExecGetFlags"] = <intptr_t>__cuGraphExecGetFlags
    {{else}}
    data["__cuGraphExecGetFlags"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}}
    global __cuGraphExecKernelNodeSetParams_v2
    data["__cuGraphExecKernelNodeSetParams_v2"] = <intptr_t>__cuGraphExecKernelNodeSetParams_v2
    {{else}}
    data["__cuGraphExecKernelNodeSetParams_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}}
    global __cuGraphExecMemcpyNodeSetParams
    data["__cuGraphExecMemcpyNodeSetParams"] = <intptr_t>__cuGraphExecMemcpyNodeSetParams
    {{else}}
    data["__cuGraphExecMemcpyNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}}
    global __cuGraphExecMemsetNodeSetParams
    data["__cuGraphExecMemsetNodeSetParams"] = <intptr_t>__cuGraphExecMemsetNodeSetParams
    {{else}}
    data["__cuGraphExecMemsetNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecHostNodeSetParams' in found_functions}}
    global __cuGraphExecHostNodeSetParams
    data["__cuGraphExecHostNodeSetParams"] = <intptr_t>__cuGraphExecHostNodeSetParams
    {{else}}
    data["__cuGraphExecHostNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}}
    global __cuGraphExecChildGraphNodeSetParams
    data["__cuGraphExecChildGraphNodeSetParams"] = <intptr_t>__cuGraphExecChildGraphNodeSetParams
    {{else}}
    data["__cuGraphExecChildGraphNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}}
    global __cuGraphExecEventRecordNodeSetEvent
    data["__cuGraphExecEventRecordNodeSetEvent"] = <intptr_t>__cuGraphExecEventRecordNodeSetEvent
    {{else}}
    data["__cuGraphExecEventRecordNodeSetEvent"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}}
    global __cuGraphExecEventWaitNodeSetEvent
    data["__cuGraphExecEventWaitNodeSetEvent"] = <intptr_t>__cuGraphExecEventWaitNodeSetEvent
    {{else}}
    data["__cuGraphExecEventWaitNodeSetEvent"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}}
    global __cuGraphExecExternalSemaphoresSignalNodeSetParams
    data["__cuGraphExecExternalSemaphoresSignalNodeSetParams"] = <intptr_t>__cuGraphExecExternalSemaphoresSignalNodeSetParams
    {{else}}
    data["__cuGraphExecExternalSemaphoresSignalNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}}
    global __cuGraphExecExternalSemaphoresWaitNodeSetParams
    data["__cuGraphExecExternalSemaphoresWaitNodeSetParams"] = <intptr_t>__cuGraphExecExternalSemaphoresWaitNodeSetParams
    {{else}}
    data["__cuGraphExecExternalSemaphoresWaitNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphNodeSetEnabled' in found_functions}}
    global __cuGraphNodeSetEnabled
    data["__cuGraphNodeSetEnabled"] = <intptr_t>__cuGraphNodeSetEnabled
    {{else}}
    data["__cuGraphNodeSetEnabled"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphNodeGetEnabled' in found_functions}}
    global __cuGraphNodeGetEnabled
    data["__cuGraphNodeGetEnabled"] = <intptr_t>__cuGraphNodeGetEnabled
    {{else}}
    data["__cuGraphNodeGetEnabled"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphUpload' in found_functions}}
    global __cuGraphUpload
    data["__cuGraphUpload"] = <intptr_t>__cuGraphUpload
    {{else}}
    data["__cuGraphUpload"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphLaunch' in found_functions}}
    global __cuGraphLaunch
    data["__cuGraphLaunch"] = <intptr_t>__cuGraphLaunch
    {{else}}
    data["__cuGraphLaunch"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecDestroy' in found_functions}}
    global __cuGraphExecDestroy
    data["__cuGraphExecDestroy"] = <intptr_t>__cuGraphExecDestroy
    {{else}}
    data["__cuGraphExecDestroy"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphDestroy' in found_functions}}
    global __cuGraphDestroy
    data["__cuGraphDestroy"] = <intptr_t>__cuGraphDestroy
    {{else}}
    data["__cuGraphDestroy"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecUpdate_v2' in found_functions}}
    global __cuGraphExecUpdate_v2
    data["__cuGraphExecUpdate_v2"] = <intptr_t>__cuGraphExecUpdate_v2
    {{else}}
    data["__cuGraphExecUpdate_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}}
    global __cuGraphKernelNodeCopyAttributes
    data["__cuGraphKernelNodeCopyAttributes"] = <intptr_t>__cuGraphKernelNodeCopyAttributes
    {{else}}
    data["__cuGraphKernelNodeCopyAttributes"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphKernelNodeGetAttribute' in found_functions}}
    global __cuGraphKernelNodeGetAttribute
    data["__cuGraphKernelNodeGetAttribute"] = <intptr_t>__cuGraphKernelNodeGetAttribute
    {{else}}
    data["__cuGraphKernelNodeGetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphKernelNodeSetAttribute' in found_functions}}
    global __cuGraphKernelNodeSetAttribute
    data["__cuGraphKernelNodeSetAttribute"] = <intptr_t>__cuGraphKernelNodeSetAttribute
    {{else}}
    data["__cuGraphKernelNodeSetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphDebugDotPrint' in found_functions}}
    global __cuGraphDebugDotPrint
    data["__cuGraphDebugDotPrint"] = <intptr_t>__cuGraphDebugDotPrint
    {{else}}
    data["__cuGraphDebugDotPrint"] = <intptr_t>0
    {{endif}}

    {{if 'cuUserObjectCreate' in found_functions}}
    global __cuUserObjectCreate
    data["__cuUserObjectCreate"] = <intptr_t>__cuUserObjectCreate
    {{else}}
    data["__cuUserObjectCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuUserObjectRetain' in found_functions}}
    global __cuUserObjectRetain
    data["__cuUserObjectRetain"] = <intptr_t>__cuUserObjectRetain
    {{else}}
    data["__cuUserObjectRetain"] = <intptr_t>0
    {{endif}}

    {{if 'cuUserObjectRelease' in found_functions}}
    global __cuUserObjectRelease
    data["__cuUserObjectRelease"] = <intptr_t>__cuUserObjectRelease
    {{else}}
    data["__cuUserObjectRelease"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphRetainUserObject' in found_functions}}
    global __cuGraphRetainUserObject
    data["__cuGraphRetainUserObject"] = <intptr_t>__cuGraphRetainUserObject
    {{else}}
    data["__cuGraphRetainUserObject"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphReleaseUserObject' in found_functions}}
    global __cuGraphReleaseUserObject
    data["__cuGraphReleaseUserObject"] = <intptr_t>__cuGraphReleaseUserObject
    {{else}}
    data["__cuGraphReleaseUserObject"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddNode' in found_functions}}
    global __cuGraphAddNode
    data["__cuGraphAddNode"] = <intptr_t>__cuGraphAddNode
    {{else}}
    data["__cuGraphAddNode"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphAddNode_v2' in found_functions}}
    global __cuGraphAddNode_v2
    data["__cuGraphAddNode_v2"] = <intptr_t>__cuGraphAddNode_v2
    {{else}}
    data["__cuGraphAddNode_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphNodeSetParams' in found_functions}}
    global __cuGraphNodeSetParams
    data["__cuGraphNodeSetParams"] = <intptr_t>__cuGraphNodeSetParams
    {{else}}
    data["__cuGraphNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphExecNodeSetParams' in found_functions}}
    global __cuGraphExecNodeSetParams
    data["__cuGraphExecNodeSetParams"] = <intptr_t>__cuGraphExecNodeSetParams
    {{else}}
    data["__cuGraphExecNodeSetParams"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphConditionalHandleCreate' in found_functions}}
    global __cuGraphConditionalHandleCreate
    data["__cuGraphConditionalHandleCreate"] = <intptr_t>__cuGraphConditionalHandleCreate
    {{else}}
    data["__cuGraphConditionalHandleCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}}
    global __cuOccupancyMaxActiveBlocksPerMultiprocessor
    data["__cuOccupancyMaxActiveBlocksPerMultiprocessor"] = <intptr_t>__cuOccupancyMaxActiveBlocksPerMultiprocessor
    {{else}}
    data["__cuOccupancyMaxActiveBlocksPerMultiprocessor"] = <intptr_t>0
    {{endif}}

    {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}}
    global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
    data["__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"] = <intptr_t>__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
    {{else}}
    data["__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"] = <intptr_t>0
    {{endif}}

    {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}}
    global __cuOccupancyMaxPotentialBlockSize
    data["__cuOccupancyMaxPotentialBlockSize"] = <intptr_t>__cuOccupancyMaxPotentialBlockSize
    {{else}}
    data["__cuOccupancyMaxPotentialBlockSize"] = <intptr_t>0
    {{endif}}

    {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}}
    global __cuOccupancyMaxPotentialBlockSizeWithFlags
    data["__cuOccupancyMaxPotentialBlockSizeWithFlags"] = <intptr_t>__cuOccupancyMaxPotentialBlockSizeWithFlags
    {{else}}
    data["__cuOccupancyMaxPotentialBlockSizeWithFlags"] = <intptr_t>0
    {{endif}}

    {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}}
    global __cuOccupancyAvailableDynamicSMemPerBlock
    data["__cuOccupancyAvailableDynamicSMemPerBlock"] = <intptr_t>__cuOccupancyAvailableDynamicSMemPerBlock
    {{else}}
    data["__cuOccupancyAvailableDynamicSMemPerBlock"] = <intptr_t>0
    {{endif}}

    {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}}
    global __cuOccupancyMaxPotentialClusterSize
    data["__cuOccupancyMaxPotentialClusterSize"] = <intptr_t>__cuOccupancyMaxPotentialClusterSize
    {{else}}
    data["__cuOccupancyMaxPotentialClusterSize"] = <intptr_t>0
    {{endif}}

    {{if 'cuOccupancyMaxActiveClusters' in found_functions}}
    global __cuOccupancyMaxActiveClusters
    data["__cuOccupancyMaxActiveClusters"] = <intptr_t>__cuOccupancyMaxActiveClusters
    {{else}}
    data["__cuOccupancyMaxActiveClusters"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetArray' in found_functions}}
    global __cuTexRefSetArray
    data["__cuTexRefSetArray"] = <intptr_t>__cuTexRefSetArray
    {{else}}
    data["__cuTexRefSetArray"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetMipmappedArray' in found_functions}}
    global __cuTexRefSetMipmappedArray
    data["__cuTexRefSetMipmappedArray"] = <intptr_t>__cuTexRefSetMipmappedArray
    {{else}}
    data["__cuTexRefSetMipmappedArray"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetAddress_v2' in found_functions}}
    global __cuTexRefSetAddress_v2
    data["__cuTexRefSetAddress_v2"] = <intptr_t>__cuTexRefSetAddress_v2
    {{else}}
    data["__cuTexRefSetAddress_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetAddress2D_v3' in found_functions}}
    global __cuTexRefSetAddress2D_v3
    data["__cuTexRefSetAddress2D_v3"] = <intptr_t>__cuTexRefSetAddress2D_v3
    {{else}}
    data["__cuTexRefSetAddress2D_v3"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetFormat' in found_functions}}
    global __cuTexRefSetFormat
    data["__cuTexRefSetFormat"] = <intptr_t>__cuTexRefSetFormat
    {{else}}
    data["__cuTexRefSetFormat"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetAddressMode' in found_functions}}
    global __cuTexRefSetAddressMode
    data["__cuTexRefSetAddressMode"] = <intptr_t>__cuTexRefSetAddressMode
    {{else}}
    data["__cuTexRefSetAddressMode"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetFilterMode' in found_functions}}
    global __cuTexRefSetFilterMode
    data["__cuTexRefSetFilterMode"] = <intptr_t>__cuTexRefSetFilterMode
    {{else}}
    data["__cuTexRefSetFilterMode"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetMipmapFilterMode' in found_functions}}
    global __cuTexRefSetMipmapFilterMode
    data["__cuTexRefSetMipmapFilterMode"] = <intptr_t>__cuTexRefSetMipmapFilterMode
    {{else}}
    data["__cuTexRefSetMipmapFilterMode"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetMipmapLevelBias' in found_functions}}
    global __cuTexRefSetMipmapLevelBias
    data["__cuTexRefSetMipmapLevelBias"] = <intptr_t>__cuTexRefSetMipmapLevelBias
    {{else}}
    data["__cuTexRefSetMipmapLevelBias"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}}
    global __cuTexRefSetMipmapLevelClamp
    data["__cuTexRefSetMipmapLevelClamp"] = <intptr_t>__cuTexRefSetMipmapLevelClamp
    {{else}}
    data["__cuTexRefSetMipmapLevelClamp"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetMaxAnisotropy' in found_functions}}
    global __cuTexRefSetMaxAnisotropy
    data["__cuTexRefSetMaxAnisotropy"] = <intptr_t>__cuTexRefSetMaxAnisotropy
    {{else}}
    data["__cuTexRefSetMaxAnisotropy"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetBorderColor' in found_functions}}
    global __cuTexRefSetBorderColor
    data["__cuTexRefSetBorderColor"] = <intptr_t>__cuTexRefSetBorderColor
    {{else}}
    data["__cuTexRefSetBorderColor"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefSetFlags' in found_functions}}
    global __cuTexRefSetFlags
    data["__cuTexRefSetFlags"] = <intptr_t>__cuTexRefSetFlags
    {{else}}
    data["__cuTexRefSetFlags"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetAddress_v2' in found_functions}}
    global __cuTexRefGetAddress_v2
    data["__cuTexRefGetAddress_v2"] = <intptr_t>__cuTexRefGetAddress_v2
    {{else}}
    data["__cuTexRefGetAddress_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetArray' in found_functions}}
    global __cuTexRefGetArray
    data["__cuTexRefGetArray"] = <intptr_t>__cuTexRefGetArray
    {{else}}
    data["__cuTexRefGetArray"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetMipmappedArray' in found_functions}}
    global __cuTexRefGetMipmappedArray
    data["__cuTexRefGetMipmappedArray"] = <intptr_t>__cuTexRefGetMipmappedArray
    {{else}}
    data["__cuTexRefGetMipmappedArray"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetAddressMode' in found_functions}}
    global __cuTexRefGetAddressMode
    data["__cuTexRefGetAddressMode"] = <intptr_t>__cuTexRefGetAddressMode
    {{else}}
    data["__cuTexRefGetAddressMode"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetFilterMode' in found_functions}}
    global __cuTexRefGetFilterMode
    data["__cuTexRefGetFilterMode"] = <intptr_t>__cuTexRefGetFilterMode
    {{else}}
    data["__cuTexRefGetFilterMode"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetFormat' in found_functions}}
    global __cuTexRefGetFormat
    data["__cuTexRefGetFormat"] = <intptr_t>__cuTexRefGetFormat
    {{else}}
    data["__cuTexRefGetFormat"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetMipmapFilterMode' in found_functions}}
    global __cuTexRefGetMipmapFilterMode
    data["__cuTexRefGetMipmapFilterMode"] = <intptr_t>__cuTexRefGetMipmapFilterMode
    {{else}}
    data["__cuTexRefGetMipmapFilterMode"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetMipmapLevelBias' in found_functions}}
    global __cuTexRefGetMipmapLevelBias
    data["__cuTexRefGetMipmapLevelBias"] = <intptr_t>__cuTexRefGetMipmapLevelBias
    {{else}}
    data["__cuTexRefGetMipmapLevelBias"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}}
    global __cuTexRefGetMipmapLevelClamp
    data["__cuTexRefGetMipmapLevelClamp"] = <intptr_t>__cuTexRefGetMipmapLevelClamp
    {{else}}
    data["__cuTexRefGetMipmapLevelClamp"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetMaxAnisotropy' in found_functions}}
    global __cuTexRefGetMaxAnisotropy
    data["__cuTexRefGetMaxAnisotropy"] = <intptr_t>__cuTexRefGetMaxAnisotropy
    {{else}}
    data["__cuTexRefGetMaxAnisotropy"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetBorderColor' in found_functions}}
    global __cuTexRefGetBorderColor
    data["__cuTexRefGetBorderColor"] = <intptr_t>__cuTexRefGetBorderColor
    {{else}}
    data["__cuTexRefGetBorderColor"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefGetFlags' in found_functions}}
    global __cuTexRefGetFlags
    data["__cuTexRefGetFlags"] = <intptr_t>__cuTexRefGetFlags
    {{else}}
    data["__cuTexRefGetFlags"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefCreate' in found_functions}}
    global __cuTexRefCreate
    data["__cuTexRefCreate"] = <intptr_t>__cuTexRefCreate
    {{else}}
    data["__cuTexRefCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexRefDestroy' in found_functions}}
    global __cuTexRefDestroy
    data["__cuTexRefDestroy"] = <intptr_t>__cuTexRefDestroy
    {{else}}
    data["__cuTexRefDestroy"] = <intptr_t>0
    {{endif}}

    {{if 'cuSurfRefSetArray' in found_functions}}
    global __cuSurfRefSetArray
    data["__cuSurfRefSetArray"] = <intptr_t>__cuSurfRefSetArray
    {{else}}
    data["__cuSurfRefSetArray"] = <intptr_t>0
    {{endif}}

    {{if 'cuSurfRefGetArray' in found_functions}}
    global __cuSurfRefGetArray
    data["__cuSurfRefGetArray"] = <intptr_t>__cuSurfRefGetArray
    {{else}}
    data["__cuSurfRefGetArray"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexObjectCreate' in found_functions}}
    global __cuTexObjectCreate
    data["__cuTexObjectCreate"] = <intptr_t>__cuTexObjectCreate
    {{else}}
    data["__cuTexObjectCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexObjectDestroy' in found_functions}}
    global __cuTexObjectDestroy
    data["__cuTexObjectDestroy"] = <intptr_t>__cuTexObjectDestroy
    {{else}}
    data["__cuTexObjectDestroy"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexObjectGetResourceDesc' in found_functions}}
    global __cuTexObjectGetResourceDesc
    data["__cuTexObjectGetResourceDesc"] = <intptr_t>__cuTexObjectGetResourceDesc
    {{else}}
    data["__cuTexObjectGetResourceDesc"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexObjectGetTextureDesc' in found_functions}}
    global __cuTexObjectGetTextureDesc
    data["__cuTexObjectGetTextureDesc"] = <intptr_t>__cuTexObjectGetTextureDesc
    {{else}}
    data["__cuTexObjectGetTextureDesc"] = <intptr_t>0
    {{endif}}

    {{if 'cuTexObjectGetResourceViewDesc' in found_functions}}
    global __cuTexObjectGetResourceViewDesc
    data["__cuTexObjectGetResourceViewDesc"] = <intptr_t>__cuTexObjectGetResourceViewDesc
    {{else}}
    data["__cuTexObjectGetResourceViewDesc"] = <intptr_t>0
    {{endif}}

    {{if 'cuSurfObjectCreate' in found_functions}}
    global __cuSurfObjectCreate
    data["__cuSurfObjectCreate"] = <intptr_t>__cuSurfObjectCreate
    {{else}}
    data["__cuSurfObjectCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuSurfObjectDestroy' in found_functions}}
    global __cuSurfObjectDestroy
    data["__cuSurfObjectDestroy"] = <intptr_t>__cuSurfObjectDestroy
    {{else}}
    data["__cuSurfObjectDestroy"] = <intptr_t>0
    {{endif}}

    {{if 'cuSurfObjectGetResourceDesc' in found_functions}}
    global __cuSurfObjectGetResourceDesc
    data["__cuSurfObjectGetResourceDesc"] = <intptr_t>__cuSurfObjectGetResourceDesc
    {{else}}
    data["__cuSurfObjectGetResourceDesc"] = <intptr_t>0
    {{endif}}

    {{if 'cuTensorMapEncodeTiled' in found_functions}}
    global __cuTensorMapEncodeTiled
    data["__cuTensorMapEncodeTiled"] = <intptr_t>__cuTensorMapEncodeTiled
    {{else}}
    data["__cuTensorMapEncodeTiled"] = <intptr_t>0
    {{endif}}

    {{if 'cuTensorMapEncodeIm2col' in found_functions}}
    global __cuTensorMapEncodeIm2col
    data["__cuTensorMapEncodeIm2col"] = <intptr_t>__cuTensorMapEncodeIm2col
    {{else}}
    data["__cuTensorMapEncodeIm2col"] = <intptr_t>0
    {{endif}}

    {{if 'cuTensorMapEncodeIm2colWide' in found_functions}}
    global __cuTensorMapEncodeIm2colWide
    data["__cuTensorMapEncodeIm2colWide"] = <intptr_t>__cuTensorMapEncodeIm2colWide
    {{else}}
    data["__cuTensorMapEncodeIm2colWide"] = <intptr_t>0
    {{endif}}

    {{if 'cuTensorMapReplaceAddress' in found_functions}}
    global __cuTensorMapReplaceAddress
    data["__cuTensorMapReplaceAddress"] = <intptr_t>__cuTensorMapReplaceAddress
    {{else}}
    data["__cuTensorMapReplaceAddress"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceCanAccessPeer' in found_functions}}
    global __cuDeviceCanAccessPeer
    data["__cuDeviceCanAccessPeer"] = <intptr_t>__cuDeviceCanAccessPeer
    {{else}}
    data["__cuDeviceCanAccessPeer"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxEnablePeerAccess' in found_functions}}
    global __cuCtxEnablePeerAccess
    data["__cuCtxEnablePeerAccess"] = <intptr_t>__cuCtxEnablePeerAccess
    {{else}}
    data["__cuCtxEnablePeerAccess"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxDisablePeerAccess' in found_functions}}
    global __cuCtxDisablePeerAccess
    data["__cuCtxDisablePeerAccess"] = <intptr_t>__cuCtxDisablePeerAccess
    {{else}}
    data["__cuCtxDisablePeerAccess"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetP2PAttribute' in found_functions}}
    global __cuDeviceGetP2PAttribute
    data["__cuDeviceGetP2PAttribute"] = <intptr_t>__cuDeviceGetP2PAttribute
    {{else}}
    data["__cuDeviceGetP2PAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphicsUnregisterResource' in found_functions}}
    global __cuGraphicsUnregisterResource
    data["__cuGraphicsUnregisterResource"] = <intptr_t>__cuGraphicsUnregisterResource
    {{else}}
    data["__cuGraphicsUnregisterResource"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}}
    global __cuGraphicsSubResourceGetMappedArray
    data["__cuGraphicsSubResourceGetMappedArray"] = <intptr_t>__cuGraphicsSubResourceGetMappedArray
    {{else}}
    data["__cuGraphicsSubResourceGetMappedArray"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}}
    global __cuGraphicsResourceGetMappedMipmappedArray
    data["__cuGraphicsResourceGetMappedMipmappedArray"] = <intptr_t>__cuGraphicsResourceGetMappedMipmappedArray
    {{else}}
    data["__cuGraphicsResourceGetMappedMipmappedArray"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}}
    global __cuGraphicsResourceGetMappedPointer_v2
    data["__cuGraphicsResourceGetMappedPointer_v2"] = <intptr_t>__cuGraphicsResourceGetMappedPointer_v2
    {{else}}
    data["__cuGraphicsResourceGetMappedPointer_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}}
    global __cuGraphicsResourceSetMapFlags_v2
    data["__cuGraphicsResourceSetMapFlags_v2"] = <intptr_t>__cuGraphicsResourceSetMapFlags_v2
    {{else}}
    data["__cuGraphicsResourceSetMapFlags_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphicsMapResources' in found_functions}}
    global __cuGraphicsMapResources
    data["__cuGraphicsMapResources"] = <intptr_t>__cuGraphicsMapResources
    {{else}}
    data["__cuGraphicsMapResources"] = <intptr_t>0
    {{endif}}

    {{if 'cuGraphicsUnmapResources' in found_functions}}
    global __cuGraphicsUnmapResources
    data["__cuGraphicsUnmapResources"] = <intptr_t>__cuGraphicsUnmapResources
    {{else}}
    data["__cuGraphicsUnmapResources"] = <intptr_t>0
    {{endif}}

    {{if 'cuGetProcAddress_v2' in found_functions}}
    global __cuGetProcAddress_v2
    data["__cuGetProcAddress_v2"] = <intptr_t>__cuGetProcAddress_v2
    {{else}}
    data["__cuGetProcAddress_v2"] = <intptr_t>0
    {{endif}}

    {{if 'cuCoredumpGetAttribute' in found_functions}}
    global __cuCoredumpGetAttribute
    data["__cuCoredumpGetAttribute"] = <intptr_t>__cuCoredumpGetAttribute
    {{else}}
    data["__cuCoredumpGetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuCoredumpGetAttributeGlobal' in found_functions}}
    global __cuCoredumpGetAttributeGlobal
    data["__cuCoredumpGetAttributeGlobal"] = <intptr_t>__cuCoredumpGetAttributeGlobal
    {{else}}
    data["__cuCoredumpGetAttributeGlobal"] = <intptr_t>0
    {{endif}}

    {{if 'cuCoredumpSetAttribute' in found_functions}}
    global __cuCoredumpSetAttribute
    data["__cuCoredumpSetAttribute"] = <intptr_t>__cuCoredumpSetAttribute
    {{else}}
    data["__cuCoredumpSetAttribute"] = <intptr_t>0
    {{endif}}

    {{if 'cuCoredumpSetAttributeGlobal' in found_functions}}
    global __cuCoredumpSetAttributeGlobal
    data["__cuCoredumpSetAttributeGlobal"] = <intptr_t>__cuCoredumpSetAttributeGlobal
    {{else}}
    data["__cuCoredumpSetAttributeGlobal"] = <intptr_t>0
    {{endif}}

    {{if 'cuGetExportTable' in found_functions}}
    global __cuGetExportTable
    data["__cuGetExportTable"] = <intptr_t>__cuGetExportTable
    {{else}}
    data["__cuGetExportTable"] = <intptr_t>0
    {{endif}}

    {{if 'cuGreenCtxCreate' in found_functions}}
    global __cuGreenCtxCreate
    data["__cuGreenCtxCreate"] = <intptr_t>__cuGreenCtxCreate
    {{else}}
    data["__cuGreenCtxCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuGreenCtxDestroy' in found_functions}}
    global __cuGreenCtxDestroy
    data["__cuGreenCtxDestroy"] = <intptr_t>__cuGreenCtxDestroy
    {{else}}
    data["__cuGreenCtxDestroy"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxFromGreenCtx' in found_functions}}
    global __cuCtxFromGreenCtx
    data["__cuCtxFromGreenCtx"] = <intptr_t>__cuCtxFromGreenCtx
    {{else}}
    data["__cuCtxFromGreenCtx"] = <intptr_t>0
    {{endif}}

    {{if 'cuDeviceGetDevResource' in found_functions}}
    global __cuDeviceGetDevResource
    data["__cuDeviceGetDevResource"] = <intptr_t>__cuDeviceGetDevResource
    {{else}}
    data["__cuDeviceGetDevResource"] = <intptr_t>0
    {{endif}}

    {{if 'cuCtxGetDevResource' in found_functions}}
    global __cuCtxGetDevResource
    data["__cuCtxGetDevResource"] = <intptr_t>__cuCtxGetDevResource
    {{else}}
    data["__cuCtxGetDevResource"] = <intptr_t>0
    {{endif}}

    {{if 'cuGreenCtxGetDevResource' in found_functions}}
    global __cuGreenCtxGetDevResource
    data["__cuGreenCtxGetDevResource"] = <intptr_t>__cuGreenCtxGetDevResource
    {{else}}
    data["__cuGreenCtxGetDevResource"] = <intptr_t>0
    {{endif}}

    {{if 'cuDevSmResourceSplitByCount' in found_functions}}
    global __cuDevSmResourceSplitByCount
    data["__cuDevSmResourceSplitByCount"] = <intptr_t>__cuDevSmResourceSplitByCount
    {{else}}
    data["__cuDevSmResourceSplitByCount"] = <intptr_t>0
    {{endif}}

    {{if 'cuDevResourceGenerateDesc' in found_functions}}
    global __cuDevResourceGenerateDesc
    data["__cuDevResourceGenerateDesc"] = <intptr_t>__cuDevResourceGenerateDesc
    {{else}}
    data["__cuDevResourceGenerateDesc"] = <intptr_t>0
    {{endif}}

    {{if 'cuGreenCtxRecordEvent' in found_functions}}
    global __cuGreenCtxRecordEvent
    data["__cuGreenCtxRecordEvent"] = <intptr_t>__cuGreenCtxRecordEvent
    {{else}}
    data["__cuGreenCtxRecordEvent"] = <intptr_t>0
    {{endif}}

    {{if 'cuGreenCtxWaitEvent' in found_functions}}
    global __cuGreenCtxWaitEvent
    data["__cuGreenCtxWaitEvent"] = <intptr_t>__cuGreenCtxWaitEvent
    {{else}}
    data["__cuGreenCtxWaitEvent"] = <intptr_t>0
    {{endif}}

    {{if 'cuStreamGetGreenCtx' in found_functions}}
    global __cuStreamGetGreenCtx
    data["__cuStreamGetGreenCtx"] = <intptr_t>__cuStreamGetGreenCtx
    {{else}}
    data["__cuStreamGetGreenCtx"] = <intptr_t>0
    {{endif}}

    {{if 'cuGreenCtxStreamCreate' in found_functions}}
    global __cuGreenCtxStreamCreate
    data["__cuGreenCtxStreamCreate"] = <intptr_t>__cuGreenCtxStreamCreate
    {{else}}
    data["__cuGreenCtxStreamCreate"] = <intptr_t>0
    {{endif}}

    {{if 'cuLogsRegisterCallback' in found_functions}}
    global __cuLogsRegisterCallback
    data["__cuLogsRegisterCallback"] = <intptr_t>__cuLogsRegisterCallback
    {{else}}
    data["__cuLogsRegisterCallback"] = <intptr_t>0
    {{endif}}

    {{if 'cuLogsUnregisterCallback' in found_functions}}
    global __cuLogsUnregisterCallback
    data["__cuLogsUnregisterCallback"] = <intptr_t>__cuLogsUnregisterCallback
    {{else}}
    data["__cuLogsUnregisterCallback"] = <intptr_t>0
    {{endif}}

    {{if 'cuLogsCurrent' in found_functions}}
    global __cuLogsCurrent
    data["__cuLogsCurrent"] = <intptr_t>__cuLogsCurrent
    {{else}}
    data["__cuLogsCurrent"] = <intptr_t>0
    {{endif}}

    {{if 'cuLogsDumpToFile' in found_functions}}
    global __cuLogsDumpToFile
    data["__cuLogsDumpToFile"] = <intptr_t>__cuLogsDumpToFile
    {{else}}
    data["__cuLogsDumpToFile"] = <intptr_t>0
    {{endif}}

    {{if 'cuLogsDumpToMemory' in found_functions}}
    global __cuLogsDumpToMemory
    data["__cuLogsDumpToMemory"] = <intptr_t>__cuLogsDumpToMemory
    {{else}}
    data["__cuLogsDumpToMemory"] = <intptr_t>0
    {{endif}}

    {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}}
    global __cuCheckpointProcessGetRestoreThreadId
    data["__cuCheckpointProcessGetRestoreThreadId"] = <intptr_t>__cuCheckpointProcessGetRestoreThreadId
    {{else}}
    data["__cuCheckpointProcessGetRestoreThreadId"] = <intptr_t>0
    {{endif}}

    {{if 'cuCheckpointProcessGetState' in found_functions}}
    global __cuCheckpointProcessGetState
    data["__cuCheckpointProcessGetState"] = <intptr_t>__cuCheckpointProcessGetState
    {{else}}
    data["__cuCheckpointProcessGetState"] = <intptr_t>0
    {{endif}}

    {{if 'cuCheckpointProcessLock' in found_functions}}
    global __cuCheckpointProcessLock
    data["__cuCheckpointProcessLock"] = <intptr_t>__cuCheckpointProcessLock
    {{else}}
    data["__cuCheckpointProcessLock"] = <intptr_t>0
    {{endif}}

    {{if 'cuCheckpointProcessCheckpoint' in found_functions}}
    global __cuCheckpointProcessCheckpoint
    data["__cuCheckpointProcessCheckpoint"] = <intptr_t>__cuCheckpointProcessCheckpoint
    {{else}}
    data["__cuCheckpointProcessCheckpoint"] = <intptr_t>0
    {{endif}}

    {{if 'cuCheckpointProcessRestore' in found_functions}}
    global __cuCheckpointProcessRestore
    data["__cuCheckpointProcessRestore"] = <intptr_t>__cuCheckpointProcessRestore
    {{else}}
    data["__cuCheckpointProcessRestore"] = <intptr_t>0
    {{endif}}

    {{if 'cuCheckpointProcessUnlock' in found_functions}}
    global __cuCheckpointProcessUnlock
    data["__cuCheckpointProcessUnlock"] = <intptr_t>__cuCheckpointProcessUnlock
    {{else}}
    data["__cuCheckpointProcessUnlock"] = <intptr_t>0
    {{endif}}

    {{if 'cuProfilerStart' in found_functions}}
    global __cuProfilerStart
    data["__cuProfilerStart"] = <intptr_t>__cuProfilerStart
    {{else}}
    data["__cuProfilerStart"] = <intptr_t>0
    {{endif}}

    {{if 'cuProfilerStop' in found_functions}}
    global __cuProfilerStop
    data["__cuProfilerStop"] = <intptr_t>__cuProfilerStop
    {{else}}
    data["__cuProfilerStop"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuGraphicsEGLRegisterImage
    data["__cuGraphicsEGLRegisterImage"] = <intptr_t>__cuGraphicsEGLRegisterImage
    {{else}}
    data["__cuGraphicsEGLRegisterImage"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuEGLStreamConsumerConnect
    data["__cuEGLStreamConsumerConnect"] = <intptr_t>__cuEGLStreamConsumerConnect
    {{else}}
    data["__cuEGLStreamConsumerConnect"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuEGLStreamConsumerConnectWithFlags
    data["__cuEGLStreamConsumerConnectWithFlags"] = <intptr_t>__cuEGLStreamConsumerConnectWithFlags
    {{else}}
    data["__cuEGLStreamConsumerConnectWithFlags"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuEGLStreamConsumerDisconnect
    data["__cuEGLStreamConsumerDisconnect"] = <intptr_t>__cuEGLStreamConsumerDisconnect
    {{else}}
    data["__cuEGLStreamConsumerDisconnect"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuEGLStreamConsumerAcquireFrame
    data["__cuEGLStreamConsumerAcquireFrame"] = <intptr_t>__cuEGLStreamConsumerAcquireFrame
    {{else}}
    data["__cuEGLStreamConsumerAcquireFrame"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuEGLStreamConsumerReleaseFrame
    data["__cuEGLStreamConsumerReleaseFrame"] = <intptr_t>__cuEGLStreamConsumerReleaseFrame
    {{else}}
    data["__cuEGLStreamConsumerReleaseFrame"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuEGLStreamProducerConnect
    data["__cuEGLStreamProducerConnect"] = <intptr_t>__cuEGLStreamProducerConnect
    {{else}}
    data["__cuEGLStreamProducerConnect"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuEGLStreamProducerDisconnect
    data["__cuEGLStreamProducerDisconnect"] = <intptr_t>__cuEGLStreamProducerDisconnect
    {{else}}
    data["__cuEGLStreamProducerDisconnect"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuEGLStreamProducerPresentFrame
    data["__cuEGLStreamProducerPresentFrame"] = <intptr_t>__cuEGLStreamProducerPresentFrame
    {{else}}
    data["__cuEGLStreamProducerPresentFrame"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuEGLStreamProducerReturnFrame
    data["__cuEGLStreamProducerReturnFrame"] = <intptr_t>__cuEGLStreamProducerReturnFrame
    {{else}}
    data["__cuEGLStreamProducerReturnFrame"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuGraphicsResourceGetMappedEglFrame
    data["__cuGraphicsResourceGetMappedEglFrame"] = <intptr_t>__cuGraphicsResourceGetMappedEglFrame
    {{else}}
    data["__cuGraphicsResourceGetMappedEglFrame"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuEventCreateFromEGLSync
    data["__cuEventCreateFromEGLSync"] = <intptr_t>__cuEventCreateFromEGLSync
    {{else}}
    data["__cuEventCreateFromEGLSync"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuGraphicsGLRegisterBuffer
    data["__cuGraphicsGLRegisterBuffer"] = <intptr_t>__cuGraphicsGLRegisterBuffer
    {{else}}
    data["__cuGraphicsGLRegisterBuffer"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuGraphicsGLRegisterImage
    data["__cuGraphicsGLRegisterImage"] = <intptr_t>__cuGraphicsGLRegisterImage
    {{else}}
    data["__cuGraphicsGLRegisterImage"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuGLGetDevices_v2
    data["__cuGLGetDevices_v2"] = <intptr_t>__cuGLGetDevices_v2
    {{else}}
    data["__cuGLGetDevices_v2"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuVDPAUGetDevice
    data["__cuVDPAUGetDevice"] = <intptr_t>__cuVDPAUGetDevice
    {{else}}
    data["__cuVDPAUGetDevice"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuVDPAUCtxCreate_v2
    data["__cuVDPAUCtxCreate_v2"] = <intptr_t>__cuVDPAUCtxCreate_v2
    {{else}}
    data["__cuVDPAUCtxCreate_v2"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuGraphicsVDPAURegisterVideoSurface
    data["__cuGraphicsVDPAURegisterVideoSurface"] = <intptr_t>__cuGraphicsVDPAURegisterVideoSurface
    {{else}}
    data["__cuGraphicsVDPAURegisterVideoSurface"] = <intptr_t>0
    {{endif}}

    {{if True}}
    global __cuGraphicsVDPAURegisterOutputSurface
    data["__cuGraphicsVDPAURegisterOutputSurface"] = <intptr_t>__cuGraphicsVDPAURegisterOutputSurface
    {{else}}
    data["__cuGraphicsVDPAURegisterOutputSurface"] = <intptr_t>0
    {{endif}}

    func_ptrs = data
    return data

cpdef _inspect_function_pointer(str name):
    global func_ptrs
    if func_ptrs is None:
        func_ptrs = _inspect_function_pointers()
    return func_ptrs[name]
