diff --git a/.gitattributes b/.gitattributes index 094fc58705c09d46cce8e36cc2568b92e8808258..41582b369c2d42194f4767ebcd46566eafab0b4d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -40,3 +40,21 @@ venv/lib/python3.12/site-packages/__pycache__/typing_extensions.cpython-312.pyc venv/lib/python3.12/site-packages/ada92cb5d92a588d1b93__mypyc.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text venv/lib/python3.12/site-packages/anyio/_backends/__pycache__/_asyncio.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text venv/lib/python3.12/site-packages/click/__pycache__/core.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cydriver.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime_ptds.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/_internal/cufile.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvml.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/_internal/utils.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/cudla.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/cufile.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/cydriver.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/cynvml.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/cyruntime.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/driver.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/nvfatbin.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/nvjitlink.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/nvml.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/nvrtc.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/nvvm.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +venv/lib/python3.12/site-packages/cuda/bindings/runtime.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text diff --git a/venv/lib/python3.12/site-packages/click-8.4.2.dist-info/licenses/LICENSE.txt b/venv/lib/python3.12/site-packages/click-8.4.2.dist-info/licenses/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..d12a849186982399c537c5b9a8fd77bf2edd5eab --- /dev/null +++ b/venv/lib/python3.12/site-packages/click-8.4.2.dist-info/licenses/LICENSE.txt @@ -0,0 +1,28 @@ +Copyright 2014 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/__init__.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/__init__.pxd new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/__init__.py b/venv/lib/python3.12/site-packages/cuda/bindings/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d71fcfde45b03afb9df9a9e3afa940d14557ae --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/__init__.py @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +from cuda.bindings import utils +from cuda.bindings._version import __version__ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49d5c00143e726c22e388ae9374e35a0b9fac110 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/__pycache__/_version.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/__pycache__/_version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c43685cf7fe6498594707c04d21ffcaf1f8b63c8 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/__pycache__/_version.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/__init__.py b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70ce01aca999a584b81d468c815c164b5f02676c Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cydriver.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cydriver.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..e0bba45d5c3dd9abf46e838ff0d325b7c53b081b --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cydriver.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1fcae816fa40bbf94ecbd783b58e5ac6987094b9b022aa0aeb5db1c740343a2 +size 483944 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cydriver.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cydriver.pxd new file mode 100644 index 0000000000000000000000000000000000000000..243874dda24940ecee0982bda0203b05abcfd433 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cydriver.pxd @@ -0,0 +1,1013 @@ +# 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 13.3.0, generator version 0.3.1.dev1711+g875fec45. Do not modify it directly. +from cuda.bindings.cydriver cimport * + +cdef CUresult _cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceTotalMem_v2(size_t* numbytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format pformat, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType typename, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDevicePrimaryCtxRelease_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDevicePrimaryCtxSetFlags_v2(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxDestroy_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxPushCurrent_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxPopCurrent_v2(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxSynchronize_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleGetGlobal_v2(CUdeviceptr* dptr, size_t* numbytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLinkCreate_v2(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +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 + +cdef CUresult _cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +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 + +cdef CUresult _cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLibraryGetManaged(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemGetInfo_v2(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemAlloc_v2(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemAllocPitch_v2(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemFree_v2(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemGetAddressRange_v2(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemAllocHost_v2(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemHostGetDevicePointer_v2(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetPCIBusId(char* pciBusId, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuIpcOpenMemHandle_v2(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemHostRegister_v2(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyHtoD_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyDtoH_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyDtoD_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyDtoA_v2(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyAtoD_v2(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyHtoA_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyAtoH_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyAtoA_v2(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpy2D_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpy2DUnaligned_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpy3D_v2(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyHtoDAsync_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyDtoHAsync_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyDtoDAsync_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyHtoAAsync_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyAtoHAsync_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpy2DAsync_v2(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpy3DAsync_v2(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyBatchAsync_v2(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpy3DBatchAsync_v2(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemsetD8_v2(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemsetD16_v2(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemsetD32_v2(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemsetD2D8_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemsetD2D16_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemsetD2D32_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +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 + +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 + +cdef CUresult _cuArrayCreate_v2(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuArrayGetDescriptor_v2(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuArray3DCreate_v2(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuArray3DGetDescriptor_v2(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType typename, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointIdReserve(CUlogicalEndpointId* baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointIdRelease(CUlogicalEndpointId baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointCreate(CUlogicalEndpointId leId, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointAddDevice(CUlogicalEndpointId leId, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointDestroy(CUlogicalEndpointId leId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointBindAddr(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, void* ptr, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointBindMem(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, CUmemGenericAllocationHandle memHandle, cuuint64_t memOffset, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointUnbind(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, cuuint64_t size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointExport(void* handle, CUlogicalEndpointId leId, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointImport(CUlogicalEndpointId leId, const void* handle, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointGetLimits(cuuint64_t* bindAlignment, cuuint64_t* maxSize, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogicalEndpointQuery(CUlogicalEndpointId leId, cuuint32_t count, int* queryStatus) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemPrefetchBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, CUmemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemDiscardBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemDiscardAndPrefetchBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, CUmemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamBeginCapture_v2(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMode mode, CUgraph hGraph, CUgraphRecaptureCallback callbackFunc, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamDestroy_v2(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEventDestroy_v2(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamWaitValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamWaitValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamWriteValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamWriteValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamBatchMemOp_v2(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncSetSharedSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuGraphKernelNodeGetParams_v2(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphKernelNodeSetParams_v2(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphRemoveDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphInstantiateWithFlags(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecKernelNodeSetParams_v2(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecUpdate_v2(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetAddress_v2(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t numbytes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetAddress2D_v3(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetAddress_v2(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult _cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +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 + +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 + +cdef CUresult _cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsResourceGetMappedPointer_v2(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsResourceSetMapFlags_v2(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGetProcAddress_v2(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGLGetDevices_v2(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuVDPAUCtxCreate_v2(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult _cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..83d0a77f9098cedbdbf00222a890e3b15ca6e70f --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6af92cc8fc13a38d95addf8f9ebf0de0389d1e1bad6cc28521b26e0be7db3ea8 +size 941968 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime.pxd new file mode 100644 index 0000000000000000000000000000000000000000..8afbc7b351a766a2791a1dbe8c2b56c81297ca89 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime.pxd @@ -0,0 +1,649 @@ +# 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 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. +include "../cyruntime_types.pxi" + +include "../_lib/cyruntime/cyruntime.pxd" + +cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef const char* _cudaGetErrorName(cudaError_t error) except ?NULL nogil + +cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil + +cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFuncGetParamCount(const void* func, size_t* paramCount) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLaunchHostFunc_v2(cudaStream_t stream, cudaHostFn_t fn, void* userData, unsigned int syncMode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyBatchAsync(const void** dsts, const void** srcs, const size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyWithAttributesAsync(void* dst, const void* src, size_t size, cudaMemcpyAttributes* attr, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3DWithAttributesAsync(cudaMemcpy3DBatchOp* op, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemDiscardBatchAsync(void** dptrs, size_t* sizes, size_t count, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemDiscardAndPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemGetDefaultMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemGetMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemSetMemPool(cudaMemLocation* location, cudaMemAllocationType typename, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil + +cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLogsRegisterCallback(cudaLogsCallback_t callbackFunc, void* userData, cudaLogsCallbackHandle* callback_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLogsUnregisterCallback(cudaLogsCallbackHandle callback) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLogsCurrent(cudaLogIterator* iterator_out, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLogsDumpToFile(cudaLogIterator* iterator, const char* pathToFile, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLogsDumpToMemory(cudaLogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hDst, cudaGraphNode_t hSrc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetContainingGraph(cudaGraphNode_t hNode, cudaGraph_t* phGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetLocalId(cudaGraphNode_t hNode, unsigned int* nodeId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetToolsId(cudaGraphNode_t hNode, unsigned long long* toolsNodeId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphGetId(cudaGraph_t hGraph, unsigned int* graphID) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecGetId(cudaGraphExec_t hGraphExec, unsigned int* graphID) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphConditionalHandleCreate_v2(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, cudaExecutionContext_t ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetDevResource(int device, cudaDevResource* resource, cudaDevResourceType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDevSmResourceSplitByCount(cudaDevResource* result, unsigned int* nbGroups, const cudaDevResource* input, cudaDevResource* remaining, unsigned int flags, unsigned int minCount) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDevSmResourceSplit(cudaDevResource* result, unsigned int nbGroups, const cudaDevResource* input, cudaDevResource* remainder, unsigned int flags, cudaDevSmResourceGroupParams* groupParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDevResourceGenerateDesc(cudaDevResourceDesc_t* phDesc, cudaDevResource* resources, unsigned int nbResources) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGreenCtxCreate(cudaExecutionContext_t* phCtx, cudaDevResourceDesc_t desc, int device, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxDestroy(cudaExecutionContext_t ctx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxGetDevResource(cudaExecutionContext_t ctx, cudaDevResource* resource, cudaDevResourceType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxGetDevice(int* device, cudaExecutionContext_t ctx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxGetId(cudaExecutionContext_t ctx, unsigned long long* ctxId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxStreamCreate(cudaStream_t* phStream, cudaExecutionContext_t ctx, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxSynchronize(cudaExecutionContext_t ctx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetDevResource(cudaStream_t hStream, cudaDevResource* resource, cudaDevResourceType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxRecordEvent(cudaExecutionContext_t ctx, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxWaitEvent(cudaExecutionContext_t ctx, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetExecutionCtx(cudaExecutionContext_t* ctx, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil + +cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) except* nogil + +cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) except* nogil + +cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime_ptds.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime_ptds.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..d7e06782b604fc9a6681da6aecdc1ab5b10f5882 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime_ptds.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:366386a44eaff8736feda63c4873e32a9a30475b3abf81459b281225d58cd870 +size 799824 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime_ptds.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime_ptds.pxd new file mode 100644 index 0000000000000000000000000000000000000000..a9cbe15e77a970ad64d43573123b11d2f43aca8c --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/cyruntime_ptds.pxd @@ -0,0 +1,652 @@ +# 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 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. +cdef extern from "": + """ + #define CUDA_API_PER_THREAD_DEFAULT_STREAM + """ + +include "../cyruntime_types.pxi" + +cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef const char* _cudaGetErrorName(cudaError_t error) except ?NULL nogil + +cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil + +cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetDeviceProperties(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFuncGetParamCount(const void* func, size_t* paramCount) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLaunchHostFunc_v2(cudaStream_t stream, cudaHostFn_t fn, void* userData, unsigned int syncMode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyBatchAsync(const void** dsts, const void** srcs, const size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyWithAttributesAsync(void* dst, const void* src, size_t size, cudaMemcpyAttributes* attr, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy3DWithAttributesAsync(cudaMemcpy3DBatchOp* op, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemDiscardBatchAsync(void** dptrs, size_t* sizes, size_t count, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemDiscardAndPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemGetDefaultMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemGetMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemSetMemPool(cudaMemLocation* location, cudaMemAllocationType typename, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil + +cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLogsRegisterCallback(cudaLogsCallback_t callbackFunc, void* userData, cudaLogsCallbackHandle* callback_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLogsUnregisterCallback(cudaLogsCallbackHandle callback) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLogsCurrent(cudaLogIterator* iterator_out, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLogsDumpToFile(cudaLogIterator* iterator, const char* pathToFile, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLogsDumpToMemory(cudaLogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hDst, cudaGraphNode_t hSrc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetContainingGraph(cudaGraphNode_t hNode, cudaGraph_t* phGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetLocalId(cudaGraphNode_t hNode, unsigned int* nodeId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetToolsId(cudaGraphNode_t hNode, unsigned long long* toolsNodeId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphGetId(cudaGraph_t hGraph, unsigned int* graphID) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecGetId(cudaGraphExec_t hGraphExec, unsigned int* graphID) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphNodeGetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGraphConditionalHandleCreate_v2(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, cudaExecutionContext_t ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetDevResource(int device, cudaDevResource* resource, cudaDevResourceType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDevSmResourceSplitByCount(cudaDevResource* result, unsigned int* nbGroups, const cudaDevResource* input, cudaDevResource* remaining, unsigned int flags, unsigned int minCount) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDevSmResourceSplit(cudaDevResource* result, unsigned int nbGroups, const cudaDevResource* input, cudaDevResource* remainder, unsigned int flags, cudaDevSmResourceGroupParams* groupParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDevResourceGenerateDesc(cudaDevResourceDesc_t* phDesc, cudaDevResource* resources, unsigned int nbResources) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGreenCtxCreate(cudaExecutionContext_t* phCtx, cudaDevResourceDesc_t desc, int device, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxDestroy(cudaExecutionContext_t ctx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxGetDevResource(cudaExecutionContext_t ctx, cudaDevResource* resource, cudaDevResourceType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxGetDevice(int* device, cudaExecutionContext_t ctx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxGetId(cudaExecutionContext_t ctx, unsigned long long* ctxId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxStreamCreate(cudaStream_t* phStream, cudaExecutionContext_t ctx, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxSynchronize(cudaExecutionContext_t ctx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaStreamGetDevResource(cudaStream_t hStream, cudaDevResource* resource, cudaDevResourceType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxRecordEvent(cudaExecutionContext_t ctx, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaExecutionCtxWaitEvent(cudaExecutionContext_t ctx, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaDeviceGetExecutionCtx(cudaExecutionContext_t* ctx, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil + +cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) except* nogil + +cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) except* nogil + +cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/loader.h b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/loader.h new file mode 100644 index 0000000000000000000000000000000000000000..2411037b03256b70ca6e260fc140d94b64b16e00 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/loader.h @@ -0,0 +1,9 @@ +// SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +// +// Please refer to the NVIDIA end user license agreement (EULA) associated +// with this source code for terms and conditions that govern your use of +// this software. Any use, reproduction, disclosure, or distribution of +// this software and related documentation outside the terms of the EULA +// is strictly prohibited. +int getCUDALibraryPath(char *libPath, bool isBit64); diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/loader.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/loader.pxd new file mode 100644 index 0000000000000000000000000000000000000000..805b849cc660295d97cba986c55444db5f21fc47 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_bindings/loader.pxd @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +cdef extern from "loader.h": + int getCUDALibraryPath(char *libPath, bint isBit64) diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__init__.py b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fa061cc3461fe6cbc37b3eb2c264ab286398d9b8 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__init__.py @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +from .common import KernelHelper, check_compute_capability_too_low, requirement_not_met +from .helper_cuda import check_cuda_errors, find_cuda_device, find_cuda_device_drv +from .helper_string import check_cmd_line_flag, get_cmd_line_argument_int + +__all__ = [ + "KernelHelper", + "check_cmd_line_flag", + "check_compute_capability_too_low", + "check_cuda_errors", + "find_cuda_device", + "find_cuda_device_drv", + "get_cmd_line_argument_int", + "requirement_not_met", +] diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6a521df6cd329a0038b3110cb061cf1f8f86bc41 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/common.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/common.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c12e145307ce2877791e9b0bb08c195cf1c1305c Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/common.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/helper_cuda.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/helper_cuda.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ae0e2975b7f332d64a8be54bc1b64d3e71e95be Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/helper_cuda.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/helper_string.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/helper_string.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..789ca6e22a7f12f5c3c7997c9199c796bc23b7ff Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/__pycache__/helper_string.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/common.py b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/common.py new file mode 100644 index 0000000000000000000000000000000000000000..15317ace29cf4620e6633039dff91c19e15f1bd3 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/common.py @@ -0,0 +1,96 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + + +import os +import sys + +import numpy as np + +from cuda import pathfinder +from cuda.bindings import driver as cuda +from cuda.bindings import nvrtc +from cuda.bindings import runtime as cudart + +from .helper_cuda import check_cuda_errors + + +def requirement_not_met(message): + print(message, file=sys.stderr) # noqa: T201 + exitcode = os.environ.get("CUDA_BINDINGS_SKIP_EXAMPLE", "1") + return sys.exit(int(exitcode)) + + +def check_compute_capability_too_low(dev_id, required_cc_major_minor): + cc_major = check_cuda_errors( + cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor, dev_id) + ) + cc_minor = check_cuda_errors( + cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeCapabilityMinor, dev_id) + ) + have_cc_major_minor = (cc_major, cc_minor) + if have_cc_major_minor < required_cc_major_minor: + requirement_not_met( + f"CUDA device compute capability too low: {have_cc_major_minor=!r}, {required_cc_major_minor=!r}" + ) + + +class KernelHelper: + def __init__(self, code, dev_id): + include_dirs = [] + for libname in ("cudart", "cccl"): + hdr_dir = pathfinder.find_nvidia_header_directory(libname) + if hdr_dir is None: + requirement_not_met(f'pathfinder.find_nvidia_header_directory("{libname}") returned None') + include_dirs.append(hdr_dir) + + prog = check_cuda_errors(nvrtc.nvrtcCreateProgram(str.encode(code), b"sourceCode.cu", 0, None, None)) + + # Initialize CUDA + check_cuda_errors(cudart.cudaFree(0)) + + major = check_cuda_errors( + cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor, dev_id) + ) + minor = check_cuda_errors( + cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeCapabilityMinor, dev_id) + ) + _, nvrtc_minor = check_cuda_errors(nvrtc.nvrtcVersion()) + use_cubin = nvrtc_minor >= 1 + prefix = "sm" if use_cubin else "compute" + arch_arg = bytes(f"--gpu-architecture={prefix}_{major}{minor}", "ascii") + + opts = [ + b"--fmad=true", + arch_arg, + b"--std=c++17", + b"-default-device", + ] + for inc_dir in include_dirs: + opts.append(f"--include-path={inc_dir}".encode()) + + try: + check_cuda_errors(nvrtc.nvrtcCompileProgram(prog, len(opts), opts)) + except RuntimeError as err: + log_size = check_cuda_errors(nvrtc.nvrtcGetProgramLogSize(prog)) + log = b" " * log_size + check_cuda_errors(nvrtc.nvrtcGetProgramLog(prog, log)) + import sys + + print(log.decode(), file=sys.stderr) # noqa: T201 + print(err, file=sys.stderr) # noqa: T201 + sys.exit(1) + + if use_cubin: + data_size = check_cuda_errors(nvrtc.nvrtcGetCUBINSize(prog)) + data = b" " * data_size + check_cuda_errors(nvrtc.nvrtcGetCUBIN(prog, data)) + else: + data_size = check_cuda_errors(nvrtc.nvrtcGetPTXSize(prog)) + data = b" " * data_size + check_cuda_errors(nvrtc.nvrtcGetPTX(prog, data)) + + self.module = check_cuda_errors(cuda.cuModuleLoadData(np.char.array(data))) + + def get_function(self, name): + return check_cuda_errors(cuda.cuModuleGetFunction(self.module, name)) diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/helper_cuda.py b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/helper_cuda.py new file mode 100644 index 0000000000000000000000000000000000000000..0e56fa8fd101711be6706bd73109c185e6e4bf93 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/helper_cuda.py @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +from cuda.bindings import driver as cuda +from cuda.bindings import nvrtc +from cuda.bindings import runtime as cudart + +from .helper_string import check_cmd_line_flag, get_cmd_line_argument_int + + +def _cuda_get_error_enum(error): + if isinstance(error, cuda.CUresult): + err, name = cuda.cuGetErrorName(error) + return name if err == cuda.CUresult.CUDA_SUCCESS else "" + elif isinstance(error, cudart.cudaError_t): + return cudart.cudaGetErrorName(error)[1] + elif isinstance(error, nvrtc.nvrtcResult): + return nvrtc.nvrtcGetErrorString(error)[1] + else: + raise RuntimeError(f"Unknown error type: {error}") + + +def check_cuda_errors(result): + if result[0].value: + raise RuntimeError(f"CUDA error code={result[0].value}({_cuda_get_error_enum(result[0])})") + if len(result) == 1: + return None + elif len(result) == 2: + return result[1] + else: + return result[1:] + + +def find_cuda_device(): + dev_id = 0 + if check_cmd_line_flag("device="): + dev_id = get_cmd_line_argument_int("device=") + check_cuda_errors(cudart.cudaSetDevice(dev_id)) + return dev_id + + +def find_cuda_device_drv(): + dev_id = 0 + if check_cmd_line_flag("device="): + dev_id = get_cmd_line_argument_int("device=") + check_cuda_errors(cuda.cuInit(0)) + cu_device = check_cuda_errors(cuda.cuDeviceGet(dev_id)) + return cu_device diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/helper_string.py b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/helper_string.py new file mode 100644 index 0000000000000000000000000000000000000000..1540db447a9fd9cf623e75446fc27afef21f84cb --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_example_helpers/helper_string.py @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +import sys + + +def check_cmd_line_flag(string_ref): + return any(string_ref == i and k < len(sys.argv) - 1 for i, k in enumerate(sys.argv)) + + +def get_cmd_line_argument_int(string_ref): + for i, k in enumerate(sys.argv): + if string_ref == i and k < len(sys.argv) - 1: + return sys.argv[k + 1] + return 0 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/__init__.py b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10c7e7d6146fc3a1d7c780785a754ba07fc79ed9 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/__pycache__/_fast_enum.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/__pycache__/_fast_enum.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c5a3b676ab7f88b85d085776d016222753315fb Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/__pycache__/_fast_enum.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/_fast_enum.py b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/_fast_enum.py new file mode 100644 index 0000000000000000000000000000000000000000..cd0a8e5610efb55f98f850ee46bf8e65c4cb2a50 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/_fast_enum.py @@ -0,0 +1,75 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.9.1 to 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + + +""" +This is a replacement for the stdlib enum.IntEnum. + +Notably, it has much better import time performance, since it doesn't generate +and evaluate Python code at startup time. + +It supports the most important subset of the IntEnum API. See `test_enum` in +`cuda_bindings/tests/test_basics.py` for details. +""" + +from typing import Any, Iterator + + +class FastEnumMetaclass(type): + def __init__(cls, name, bases, namespace): + super().__init__(name, bases, namespace) + + cls.__singletons__ = {} + cls.__members__ = {} + for name, value in cls.__dict__.items(): + if name.startswith("__") and name.endswith("__"): + continue + + if isinstance(value, tuple): + value, doc = value + elif isinstance(value, int): + doc = None + else: + continue + + singleton = int.__new__(cls, value) + singleton.__doc__ = doc + singleton._name = name + cls.__singletons__[value] = singleton + cls.__members__[name] = singleton + + for name, member in cls.__members__.items(): + setattr(cls, name, member) + + def __repr__(cls) -> str: + return f"" + + def __len__(cls) -> int: + return len(cls.__members__) + + def __iter__(cls) -> Iterator["FastEnum"]: + return iter(cls.__members__.values()) + + def __contains__(cls, item: Any) -> bool: + return item in cls.__singletons__ + + +class FastEnum(int, metaclass=FastEnumMetaclass): + def __new__(cls, value: int) -> "FastEnum": + singleton: FastEnum = cls.__singletons__.get(value) + if singleton is None: + raise ValueError(f"{value} is not a valid {cls.__name__}") + return singleton + + def __repr__(self) -> str: + return f"<{self.__class__.__name__}.{self._name}: {int(self)}>" + + @property + def name(self) -> str: + return self._name + + @property + def value(self) -> int: + return int(self) diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cudla.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cudla.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..0acc205266811328c5d46421249cc8eb101a37c3 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cudla.cpython-312-x86_64-linux-gnu.so differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cudla.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cudla.pxd new file mode 100644 index 0000000000000000000000000000000000000000..e4c479673de8f53b0edf44f689ef5f4dd90c15b5 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cudla.pxd @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +# This code was automatically generated across versions from 1.5.0 to 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + +from ..cycudla cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef cudlaStatus _cudlaGetVersion(uint64_t* const version) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaDeviceGetCount(uint64_t* const pNumDevices) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaCreateDevice(const uint64_t device, cudlaDevHandle* const devHandle, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaMemRegister(const cudlaDevHandle devHandle, const uint64_t* const ptr, const size_t size, uint64_t** const devPtr, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaModuleLoadFromMemory(const cudlaDevHandle devHandle, const uint8_t* const pModule, const size_t moduleSize, cudlaModule* const hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaModuleGetAttributes(const cudlaModule hModule, const cudlaModuleAttributeType attrType, cudlaModuleAttribute* const attribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaModuleUnload(const cudlaModule hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaSubmitTask(const cudlaDevHandle devHandle, const cudlaTask* const ptrToTasks, const uint32_t numTasks, void* const stream, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaDeviceGetAttribute(const cudlaDevHandle devHandle, const cudlaDevAttributeType attrib, cudlaDevAttribute* const pAttribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaMemUnregister(const cudlaDevHandle devHandle, const uint64_t* const devPtr) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaGetLastError(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaDestroyDevice(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaSetTaskTimeoutInMs(const cudlaDevHandle devHandle, const uint32_t timeout) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cufile.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cufile.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..5fb0a7d4e399c91e13169f1b13db9552537a1825 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cufile.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8761e3131f9c8aa08a78562ff68f7997faa85b83fab542c7a977f0c94dd63200 +size 103368 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cufile.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cufile.pxd new file mode 100644 index 0000000000000000000000000000000000000000..e642486af16ab140d968e2dae6070d2823990b8d --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/cufile.pxd @@ -0,0 +1,56 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. + +from ..cycufile cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef CUfileError_t _cuFileHandleRegister(CUfileHandle_t* fh, CUfileDescr_t* descr) except?CUFILE_LOADING_ERROR nogil +cdef void _cuFileHandleDeregister(CUfileHandle_t fh) except* nogil +cdef CUfileError_t _cuFileBufRegister(const void* bufPtr_base, size_t length, int flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileBufDeregister(const void* bufPtr_base) except?CUFILE_LOADING_ERROR nogil +cdef ssize_t _cuFileRead(CUfileHandle_t fh, void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil +cdef ssize_t _cuFileWrite(CUfileHandle_t fh, const void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil +cdef CUfileError_t _cuFileDriverOpen() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverClose_v2() except?CUFILE_LOADING_ERROR nogil +cdef long _cuFileUseCount() except* nogil +cdef CUfileError_t _cuFileDriverGetProperties(CUfileDrvProps_t* props) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverSetPollMode(cpp_bool poll, size_t poll_threshold_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverSetMaxCacheSize(size_t max_cache_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileBatchIOSetUp(CUfileBatchHandle_t* batch_idp, unsigned nr) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileBatchIOSubmit(CUfileBatchHandle_t batch_idp, unsigned nr, CUfileIOParams_t* iocbp, unsigned int flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileBatchIOGetStatus(CUfileBatchHandle_t batch_idp, unsigned min_nr, unsigned* nr, CUfileIOEvents_t* iocbp, timespec* timeout) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileBatchIOCancel(CUfileBatchHandle_t batch_idp) except?CUFILE_LOADING_ERROR nogil +cdef void _cuFileBatchIODestroy(CUfileBatchHandle_t batch_idp) except* nogil +cdef CUfileError_t _cuFileReadAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_read_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileWriteAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_written_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileStreamRegister(CUstream stream, unsigned flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileStreamDeregister(CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetVersion(int* version) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t* value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool* value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetParameterString(CUFileStringConfigParameter_t param, char* desc_str, int len) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileSetStatsLevel(int level) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetStatsLevel(int* level) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileStatsStart() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileStatsStop() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileStatsReset() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetStatsL1(CUfileStatsLevel1_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetStatsL2(CUfileStatsLevel2_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetStatsL3(CUfileStatsLevel3_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetBARSizeInKB(int gpuIndex, size_t* barSize) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileSetParameterPosixPoolSlabArray(const size_t* size_values, const size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetParameterPosixPoolSlabArray(size_t* size_values, size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvfatbin.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvfatbin.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..f407d789f94b49c802d739ea729b7263882b9c62 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvfatbin.cpython-312-x86_64-linux-gnu.so differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvfatbin.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvfatbin.pxd new file mode 100644 index 0000000000000000000000000000000000000000..2358e1220c960fb04d668f8305339368a872252c --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvfatbin.pxd @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.4.1 to 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + +from ..cynvfatbin cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvFatbinGetErrorString(nvFatbinResult result) except?NULL nogil +cdef nvFatbinResult _nvFatbinCreate(nvFatbinHandle* handle_indirect, const char** options, size_t optionsCount) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinDestroy(nvFatbinHandle* handle_indirect) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinAddPTX(nvFatbinHandle handle, const char* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinAddCubin(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinAddLTOIR(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinSize(nvFatbinHandle handle, size_t* size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinGet(nvFatbinHandle handle, void* buffer) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinVersion(unsigned int* major, unsigned int* minor) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinAddIndex(nvFatbinHandle handle, const void* code, size_t size, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinAddReloc(nvFatbinHandle handle, const void* code, size_t size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinAddTileIR(nvFatbinHandle handle, const void* code, size_t size, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvjitlink.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvjitlink.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..88aab72324be1c672358e1ff3dec770d4896ddf1 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvjitlink.cpython-312-x86_64-linux-gnu.so differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvjitlink.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvjitlink.pxd new file mode 100644 index 0000000000000000000000000000000000000000..2d3f432eeb2793b84be0e6304d49f1a5c2ee7a40 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvjitlink.pxd @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. + +from ..cynvjitlink cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef nvJitLinkResult _nvJitLinkCreate(nvJitLinkHandle* handle, uint32_t numOptions, const char** options) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkDestroy(nvJitLinkHandle* handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkAddData(nvJitLinkHandle handle, nvJitLinkInputType inputType, const void* data, size_t size, const char* name) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkAddFile(nvJitLinkHandle handle, nvJitLinkInputType inputType, const char* fileName) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkComplete(nvJitLinkHandle handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetLinkedCubinSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetLinkedCubin(nvJitLinkHandle handle, void* cubin) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetLinkedPtxSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetLinkedPtx(nvJitLinkHandle handle, char* ptx) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetErrorLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetErrorLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetInfoLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetInfoLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkVersion(unsigned int* major, unsigned int* minor) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvml.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvml.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..1c6d3c76725d3bc7a0fe14a45ae402fbaccc3052 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvml.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d613aaaa858129428fd5e99054d3f2c0cfafa729bca2db3536e463c74772a68b +size 437608 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvml.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvml.pxd new file mode 100644 index 0000000000000000000000000000000000000000..1664d4cc01e19408bfd90185429d51bd39657972 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvml.pxd @@ -0,0 +1,364 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. + +from ..cynvml cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef nvmlReturn_t _nvmlInit_v2() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlInitWithFlags(unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlShutdown() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef const char* _nvmlErrorString(nvmlReturn_t result) except?NULL nogil +cdef nvmlReturn_t _nvmlSystemGetDriverVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetNVMLVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetCudaDriverVersion(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetCudaDriverVersion_v2(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetProcessName(unsigned int pid, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetHicVersion(unsigned int* hwbcCount, nvmlHwbcEntry_t* hwbcEntries) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetTopologyGpuSet(unsigned int cpuNumber, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetDriverBranch(nvmlSystemDriverBranchInfo_t* branchInfo, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetCount(unsigned int* unitCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetHandleByIndex(unsigned int index, nvmlUnit_t* unit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetUnitInfo(nvmlUnit_t unit, nvmlUnitInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetLedState(nvmlUnit_t unit, nvmlLedState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetPsuInfo(nvmlUnit_t unit, nvmlPSUInfo_t* psu) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetTemperature(nvmlUnit_t unit, unsigned int type, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetFanSpeedInfo(nvmlUnit_t unit, nvmlUnitFanSpeeds_t* fanSpeeds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetDevices(nvmlUnit_t unit, unsigned int* deviceCount, nvmlDevice_t* devices) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCount_v2(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAttributes_v2(nvmlDevice_t device, nvmlDeviceAttributes_t* attributes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHandleByIndex_v2(unsigned int index, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHandleBySerial(const char* serial, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHandleByUUID(const char* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHandleByUUIDV(const nvmlUUID_t* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHandleByPciBusId_v2(const char* pciBusId, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetName(nvmlDevice_t device, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBrand(nvmlDevice_t device, nvmlBrandType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetIndex(nvmlDevice_t device, unsigned int* index) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSerial(nvmlDevice_t device, char* serial, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetModuleId(nvmlDevice_t device, unsigned int* moduleId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetC2cModeInfoV(nvmlDevice_t device, nvmlC2cModeInfo_v1_t* c2cModeInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemoryAffinity(nvmlDevice_t device, unsigned int nodeSetSize, unsigned long* nodeSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCpuAffinityWithinScope(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCpuAffinity(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceClearCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNumaNodeId(nvmlDevice_t device, unsigned int* node) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuTopologyLevel_t* pathInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTopologyNearestGpus(nvmlDevice_t device, nvmlGpuTopologyLevel_t level, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetP2PStatus(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuP2PCapsIndex_t p2pIndex, nvmlGpuP2PStatus_t* p2pStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetUUID(nvmlDevice_t device, char* uuid, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMinorNumber(nvmlDevice_t device, unsigned int* minorNumber) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBoardPartNumber(nvmlDevice_t device, char* partNumber, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetInforomVersion(nvmlDevice_t device, nvmlInforomObject_t object, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetInforomImageVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_t device, unsigned int* checksum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceValidateInforom(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetLastBBXFlushTime(nvmlDevice_t device, unsigned long long* timestamp, unsigned long* durationUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDisplayMode(nvmlDevice_t device, nvmlEnableState_t* display) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDisplayActive(nvmlDevice_t device, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPciInfoExt(nvmlDevice_t device, nvmlPciInfoExt_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPciInfo_v3(nvmlDevice_t device, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGenDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_t device, unsigned int* maxLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_t device, unsigned int* currLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_t device, unsigned int* currLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPcieThroughput(nvmlDevice_t device, nvmlPcieUtilCounter_t counter, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPcieReplayCounter(nvmlDevice_t device, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMaxClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpcClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetClock(nvmlDevice_t device, nvmlClockType_t clockType, nvmlClockId_t clockId, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_t device, nvmlClockType_t clockType, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_t device, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_t device, unsigned int memoryClockMHz, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t* isEnabled, nvmlEnableState_t* defaultIsEnabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFanSpeed(nvmlDevice_t device, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFanSpeedRPM(nvmlDevice_t device, nvmlFanSpeedInfo_t* fanSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTargetFanSpeed(nvmlDevice_t device, unsigned int fan, unsigned int* targetSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMinMaxFanSpeed(nvmlDevice_t device, unsigned int* minSpeed, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFanControlPolicy_v2(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t* policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNumFans(nvmlDevice_t device, unsigned int* numFans) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCoolerInfo(nvmlDevice_t device, nvmlCoolerInfo_t* coolerInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTemperatureV(nvmlDevice_t device, nvmlTemperature_t* temperature) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMarginTemperature(nvmlDevice_t device, nvmlMarginTemperature_t* marginTempInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetThermalSettings(nvmlDevice_t device, unsigned int sensorIndex, nvmlGpuThermalSettings_t* pThermalSettings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCurrentClocksEventReasons(nvmlDevice_t device, unsigned long long* clocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedClocksEventReasons(nvmlDevice_t device, unsigned long long* supportedClocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDynamicPstatesInfo(nvmlDevice_t device, nvmlGpuDynamicPstatesInfo_t* pDynamicPstatesInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMinMaxClockOfPState(nvmlDevice_t device, nvmlClockType_t type, nvmlPstates_t pstate, unsigned int* minClockMHz, unsigned int* maxClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedPerformanceStates(nvmlDevice_t device, nvmlPstates_t* pstates, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpcClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPerformanceModes(nvmlDevice_t device, nvmlDevicePerfModes_t* perfModes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCurrentClockFreqs(nvmlDevice_t device, nvmlDeviceCurrentClockFreqs_t* currentClockFreqs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_t device, unsigned int* minLimit, unsigned int* maxLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_t device, unsigned int* defaultLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerUsage(nvmlDevice_t device, unsigned int* power) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTotalEnergyConsumption(nvmlDevice_t device, unsigned long long* energy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t* current, nvmlGpuOperationMode_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemoryInfo_v2(nvmlDevice_t device, nvmlMemory_v2_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetComputeMode(nvmlDevice_t device, nvmlComputeMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCudaComputeCapability(nvmlDevice_t device, int* major, int* minor) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDramEncryptionMode(nvmlDevice_t device, nvmlDramEncryptionInfo_t* current, nvmlDramEncryptionInfo_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetDramEncryptionMode(nvmlDevice_t device, const nvmlDramEncryptionInfo_t* dramEncryption) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEccMode(nvmlDevice_t device, nvmlEnableState_t* current, nvmlEnableState_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDefaultEccMode(nvmlDevice_t device, nvmlEnableState_t* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBoardId(nvmlDevice_t device, unsigned int* boardId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMultiGpuBoard(nvmlDevice_t device, unsigned int* multiGpuBool) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTotalEccErrors(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, unsigned long long* eccCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemoryErrorCounter(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, nvmlMemoryLocation_t locationType, unsigned long long* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t* utilization) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEncoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEncoderCapacity(nvmlDevice_t device, nvmlEncoderType_t encoderQueryType, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEncoderStats(nvmlDevice_t device, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEncoderSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDecoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetJpgUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetOfaUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFBCStats(nvmlDevice_t device, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFBCSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverModel_t* current, nvmlDriverModel_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVbiosVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBridgeChipInfo(nvmlDevice_t device, nvmlBridgeChipHierarchy_t* bridgeHierarchy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRunningProcessDetailList(nvmlDevice_t device, nvmlProcessDetailList_t* plist) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceOnSameBoard(nvmlDevice_t device1, nvmlDevice_t device2, int* onSameBoard) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t* isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSamples(nvmlDevice_t device, nvmlSamplingType_t type, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* sampleCount, nvmlSample_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBAR1MemoryInfo(nvmlDevice_t device, nvmlBAR1Memory_t* bar1Memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetIrqNum(nvmlDevice_t device, unsigned int* irqNum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNumGpuCores(nvmlDevice_t device, unsigned int* numCores) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerSource(nvmlDevice_t device, nvmlPowerSource_t* powerSource) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemoryBusWidth(nvmlDevice_t device, unsigned int* busWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPcieLinkMaxSpeed(nvmlDevice_t device, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPcieSpeed(nvmlDevice_t device, unsigned int* pcieSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAdaptiveClockInfoStatus(nvmlDevice_t device, unsigned int* adaptiveClockStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBusType(nvmlDevice_t device, nvmlBusType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuFabricInfoV(nvmlDevice_t device, nvmlGpuFabricInfoV_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetConfComputeCapabilities(nvmlConfComputeSystemCaps_t* capabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetConfComputeState(nvmlConfComputeSystemState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetConfComputeMemSizeInfo(nvmlDevice_t device, nvmlConfComputeMemSizeInfo_t* memInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetConfComputeGpusReadyState(unsigned int* isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetConfComputeProtectedMemoryUsage(nvmlDevice_t device, nvmlMemory_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetConfComputeGpuCertificate(nvmlDevice_t device, nvmlConfComputeGpuCertificate_t* gpuCert) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetConfComputeGpuAttestationReport(nvmlDevice_t device, nvmlConfComputeGpuAttestationReport_t* gpuAtstReport) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetConfComputeKeyRotationThresholdInfo(nvmlConfComputeGetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetConfComputeUnprotectedMemSize(nvmlDevice_t device, unsigned long long sizeKiB) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemSetConfComputeGpusReadyState(unsigned int isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemSetConfComputeKeyRotationThresholdInfo(nvmlConfComputeSetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetConfComputeSettings(nvmlSystemConfComputeSettings_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGspFirmwareVersion(nvmlDevice_t device, char* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGspFirmwareMode(nvmlDevice_t device, unsigned int* isEnabled, unsigned int* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSramEccErrorStatus(nvmlDevice_t device, nvmlEccSramErrorStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAccountingMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAccountingStats(nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAccountingPids(nvmlDevice_t device, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAccountingBufferSize(nvmlDevice_t device, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRetiredPages(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRetiredPages_v2(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses, unsigned long long* timestamps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_t device, nvmlEnableState_t* isPending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRemappedRows(nvmlDevice_t device, unsigned int* corrRows, unsigned int* uncRows, unsigned int* isPending, unsigned int* failureOccurred) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRowRemapperHistogram(nvmlDevice_t device, nvmlRowRemapperHistogramValues_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetArchitecture(nvmlDevice_t device, nvmlDeviceArchitecture_t* arch) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetClkMonStatus(nvmlDevice_t device, nvmlClkMonStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetProcessUtilization(nvmlDevice_t device, nvmlProcessUtilizationSample_t* utilization, unsigned int* processSamplesCount, unsigned long long lastSeenTimeStamp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetProcessesUtilizationInfo(nvmlDevice_t device, nvmlProcessesUtilizationInfo_t* procesesUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPlatformInfo(nvmlDevice_t device, nvmlPlatformInfo_t* platformInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitSetLedState(nvmlUnit_t unit, nvmlLedColor_t color) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetComputeMode(nvmlDevice_t device, nvmlComputeMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetEccMode(nvmlDevice_t device, nvmlEnableState_t ecc) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceClearEccErrorCounts(nvmlDevice_t device, nvmlEccCounterType_t counterType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetDriverModel(nvmlDevice_t device, nvmlDriverModel_t driverModel, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetGpuLockedClocks(nvmlDevice_t device, unsigned int minGpuClockMHz, unsigned int maxGpuClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceResetGpuLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetMemoryLockedClocks(nvmlDevice_t device, unsigned int minMemClockMHz, unsigned int maxMemClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceResetMemoryLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetDefaultFanSpeed_v2(nvmlDevice_t device, unsigned int fan) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetFanControlPolicy(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetAccountingMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceClearAccountingPids(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetPowerManagementLimit_v2(nvmlDevice_t device, nvmlPowerValue_v2_t* powerValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkState(nvmlDevice_t device, unsigned int link, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkVersion(nvmlDevice_t device, unsigned int link, unsigned int* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkCapability(nvmlDevice_t device, unsigned int link, nvmlNvLinkCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice_t device, unsigned int link, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_t device, unsigned int link, nvmlNvLinkErrorCounter_t counter, unsigned long long* counterValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceResetNvLinkErrorCounters(nvmlDevice_t device, unsigned int link) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice_t device, unsigned int link, nvmlIntNvLinkDeviceType_t* pNvLinkDeviceType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetNvLinkDeviceLowPowerThreshold(nvmlDevice_t device, nvmlNvLinkPowerThres_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemSetNvlinkBwMode(unsigned int nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetNvlinkBwMode(unsigned int* nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvlinkSupportedBwModes(nvmlDevice_t device, nvmlNvlinkSupportedBwModes_t* supportedBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkGetBwMode_t* getBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkSetBwMode_t* setBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetCreate(nvmlEventSet_t* set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceRegisterEvents(nvmlDevice_t device, unsigned long long eventTypes, nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedEventTypes(nvmlDevice_t device, unsigned long long* eventTypes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetWait_v2(nvmlEventSet_t set, nvmlEventData_t* data, unsigned int timeoutms) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetFree(nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemEventSetCreate(nvmlSystemEventSetCreateRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemEventSetFree(nvmlSystemEventSetFreeRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemRegisterEvents(nvmlSystemRegisterEventRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemEventSetWait(nvmlSystemEventSetWaitRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceModifyDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t newState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceQueryDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t* currentState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceRemoveGpu_v2(nvmlPciInfo_t* pciInfo, nvmlDetachGpuState_t gpuState, nvmlPcieLinkState_t linkState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceDiscoverGpus(nvmlPciInfo_t* pciInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceClearFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t* pVirtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHostVgpuMode(nvmlDevice_t device, nvmlHostVgpuMode_t* pHostVgpuMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t virtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuHeterogeneousMode(nvmlDevice_t device, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetVgpuHeterogeneousMode(nvmlDevice_t device, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetPlacementId(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuPlacementId_t* pPlacement) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuTypeSupportedPlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuTypeCreatablePlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetGspHeapSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* gspHeapSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetFbReservation(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbReservation) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetRuntimeStateSize(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuRuntimeState_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, nvmlEnableState_t state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGridLicensableFeatures_v4(nvmlDevice_t device, nvmlGridLicensableFeatures_t* pGridLicensableFeatures) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGetVgpuDriverCapabilities(nvmlVgpuDriverCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCreatableVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetClass(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeClass, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetName(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeName, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetGpuInstanceProfileId(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* gpuInstanceProfileId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetDeviceID(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* deviceID, unsigned long long* subsystemID) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetFramebufferSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetNumDisplayHeads(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* numDisplayHeads) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetResolution(nvmlVgpuTypeId_t vgpuTypeId, unsigned int displayIndex, unsigned int* xdim, unsigned int* ydim) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetLicense(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeLicenseString, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetFrameRateLimit(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstances(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstancesPerVm(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCountPerVm) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetBAR1Info(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuTypeBar1Info_t* bar1Info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetActiveVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuInstance_t* vgpuInstances) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetVmID(nvmlVgpuInstance_t vgpuInstance, char* vmId, unsigned int size, nvmlVgpuVmIdType_t* vmIdType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetUUID(nvmlVgpuInstance_t vgpuInstance, char* uuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetVmDriverVersion(nvmlVgpuInstance_t vgpuInstance, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetFbUsage(nvmlVgpuInstance_t vgpuInstance, unsigned long long* fbUsage) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetLicenseStatus(nvmlVgpuInstance_t vgpuInstance, unsigned int* licensed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetType(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuTypeId_t* vgpuTypeId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetFrameRateLimit(nvmlVgpuInstance_t vgpuInstance, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetEccMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* eccMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceSetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderStats(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetFBCStats(nvmlVgpuInstance_t vgpuInstance, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetFBCSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetGpuInstanceId(nvmlVgpuInstance_t vgpuInstance, unsigned int* gpuInstanceId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetGpuPciId(nvmlVgpuInstance_t vgpuInstance, char* vgpuPciId, unsigned int* length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetCapabilities(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetMdevUUID(nvmlVgpuInstance_t vgpuInstance, char* mdevUuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetCreatableVgpus(nvmlGpuInstance_t gpuInstance, nvmlVgpuTypeIdInfo_t* pVgpus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstancesPerGpuInstance(nvmlVgpuTypeMaxInstance_t* pMaxInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetActiveVgpus(nvmlGpuInstance_t gpuInstance, nvmlActiveVgpuInstanceInfo_t* pVgpuInstanceInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_t* pScheduler) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuTypeCreatablePlacements(nvmlGpuInstance_t gpuInstance, nvmlVgpuCreatablePlacementInfo_t* pCreatablePlacementInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetMetadata(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuMetadata_t* vgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuMetadata(nvmlDevice_t device, nvmlVgpuPgpuMetadata_t* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGetVgpuCompatibility(nvmlVgpuMetadata_t* vgpuMetadata, nvmlVgpuPgpuMetadata_t* pgpuMetadata, nvmlVgpuPgpuCompatibility_t* compatibilityInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPgpuMetadataString(nvmlDevice_t device, char* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog(nvmlDevice_t device, nvmlVgpuSchedulerLog_t* pSchedulerLog) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerGetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerCapabilities(nvmlDevice_t device, nvmlVgpuSchedulerCapabilities_t* pCapabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerSetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGetVgpuVersion(nvmlVgpuVersion_t* supported, nvmlVgpuVersion_t* current) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSetVgpuVersion(nvmlVgpuVersion_t* vgpuVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* vgpuInstanceSamplesCount, nvmlVgpuInstanceUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuInstancesUtilizationInfo(nvmlDevice_t device, nvmlVgpuInstancesUtilizationInfo_t* vgpuUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, unsigned int* vgpuProcessSamplesCount, nvmlVgpuProcessUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuProcessesUtilizationInfo(nvmlDevice_t device, nvmlVgpuProcessesUtilizationInfo_t* vgpuProcUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingPids(nvmlVgpuInstance_t vgpuInstance, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingStats(nvmlVgpuInstance_t vgpuInstance, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceClearAccountingPids(nvmlVgpuInstance_t vgpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetLicenseInfo_v2(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuLicenseInfo_t* licenseInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGetExcludedDeviceCount(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGetExcludedDeviceInfoByIndex(unsigned int index, nvmlExcludedDeviceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetMigMode(nvmlDevice_t device, unsigned int mode, nvmlReturn_t* activationStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMigMode(nvmlDevice_t device, unsigned int* currentMode, unsigned int* pendingMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice_t device, unsigned int profile, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstancePossiblePlacements_v2(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceRemainingCapacity(nvmlDevice_t device, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceCreateGpuInstance(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceCreateGpuInstanceWithPlacement(nvmlDevice_t device, unsigned int profileId, const nvmlGpuInstancePlacement_t* placement, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceDestroy(nvmlGpuInstance_t gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstances(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceById(nvmlDevice_t device, unsigned int id, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetInfo(nvmlGpuInstance_t gpuInstance, nvmlGpuInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceProfileInfoV(nvmlGpuInstance_t gpuInstance, unsigned int profile, unsigned int engProfile, nvmlComputeInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceRemainingCapacity(nvmlGpuInstance_t gpuInstance, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstancePossiblePlacements(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceCreateComputeInstance(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceCreateComputeInstanceWithPlacement(nvmlGpuInstance_t gpuInstance, unsigned int profileId, const nvmlComputeInstancePlacement_t* placement, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlComputeInstanceDestroy(nvmlComputeInstance_t computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstances(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance_t gpuInstance, unsigned int id, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlComputeInstanceGetInfo_v2(nvmlComputeInstance_t computeInstance, nvmlComputeInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceIsMigDeviceHandle(nvmlDevice_t device, unsigned int* isMigDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetComputeInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMaxMigDeviceCount(nvmlDevice_t device, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMigDeviceHandleByIndex(nvmlDevice_t device, unsigned int index, nvmlDevice_t* migDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDeviceHandleFromMigDeviceHandle(nvmlDevice_t migDevice, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCapabilities(nvmlDevice_t device, nvmlDeviceCapabilities_t* caps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDevicePowerSmoothingActivatePresetProfile(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDevicePowerSmoothingUpdatePresetProfileParam(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDevicePowerSmoothingSetState(nvmlDevice_t device, nvmlPowerSmoothingState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAddressingMode(nvmlDevice_t device, nvmlDeviceAddressingMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRepairStatus(nvmlDevice_t device, nvmlRepairStatus_t* repairStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPdi(nvmlDevice_t device, nvmlPdi_t* pdi) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkInfo(nvmlDevice_t device, nvmlNvLinkInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceReadWritePRM_v1(nvmlDevice_t device, nvmlPRMTLV_v1_t* buffer) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceProfileInfoByIdV(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t device, nvmlEccSramUniqueUncorrectedErrorCounts_t* errorCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetUnrepairableMemoryFlag_v1(nvmlDevice_t device, nvmlUnrepairableMemoryStatus_v1_t* unrepairableMemoryStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceReadPRMCounters_v1(nvmlDevice_t device, nvmlPRMCounterList_v1_t* counterList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSettings_v1_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvrtc.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvrtc.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..a686eb2ca45f45c006f5ec8d63295a974f05c649 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvrtc.cpython-312-x86_64-linux-gnu.so differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvrtc.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvrtc.pxd new file mode 100644 index 0000000000000000000000000000000000000000..e27ff2c08da385188faf496c806bc35b01ad848c --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvrtc.pxd @@ -0,0 +1,69 @@ +# 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 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + +from ..cynvrtc cimport * + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvrtcGetErrorString(nvrtcResult result) except ?NULL nogil + +cdef nvrtcResult _nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcCreateProgram(nvrtcProgram* prog, const char* src, const char* name, int numHeaders, const char** headers, const char** includeNames) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcSetFlowCallback(nvrtcProgram prog, void* callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcInstallBundledHeaders(const char* installPath, unsigned int flags, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcGetBundledHeadersInfo(nvrtcBundledHeadersInfo* info, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult _nvrtcRemoveBundledHeaders(const char* installPath, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvvm.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvvm.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..d0c2c7c07ca005d5c5e5c89c05d30b1ece0e12f3 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvvm.cpython-312-x86_64-linux-gnu.so differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvvm.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvvm.pxd new file mode 100644 index 0000000000000000000000000000000000000000..4d9ff45e701e7f3f9bde666b89c697af3b9d0966 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/nvvm.pxd @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. + +from ..cynvvm cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvvmGetErrorString(nvvmResult result) except?NULL nogil +cdef nvvmResult _nvvmVersion(int* major, int* minor) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmIRVersion(int* majorIR, int* minorIR, int* majorDbg, int* minorDbg) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmCreateProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmDestroyProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmLazyAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmCompileProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmVerifyProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmGetCompiledResultSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmGetCompiledResult(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmGetProgramLogSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmGetProgramLog(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmLLVMVersion(const char* arch, int* major) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/utils.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/utils.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..a9c9beeaa989a606971b1adbf49657bda02172c6 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/utils.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6e9f963a4eb07513c548160e9e46c075e9a8471cb8ea777de41cdc8b77495d0 +size 127936 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_internal/utils.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/utils.pxd new file mode 100644 index 0000000000000000000000000000000000000000..50484727b7ade126a6af539241bd1a2365bad4b8 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_internal/utils.pxd @@ -0,0 +1,167 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +from libc.stdint cimport int32_t, int64_t, intptr_t +from libcpp.vector cimport vector +from libcpp cimport bool as cppbool +from libcpp cimport nullptr_t, nullptr +from libcpp.memory cimport unique_ptr + + +cdef extern from * nogil: + """ + template + class nullable_unique_ptr { + public: + nullable_unique_ptr() noexcept = default; + + nullable_unique_ptr(std::nullptr_t) noexcept = delete; + + explicit nullable_unique_ptr(T* data, bool own_data): + own_data_(own_data) + { + if (own_data) + manager_.reset(data); + else + raw_data_ = data; + } + + nullable_unique_ptr(const nullable_unique_ptr&) = delete; + + nullable_unique_ptr& operator=(const nullable_unique_ptr&) = delete; + + nullable_unique_ptr(nullable_unique_ptr&& other) noexcept + { + own_data_ = other.own_data_; + other.own_data_ = false; // ownership is transferred + if (own_data_) + { + manager_ = std::move(other.manager_); + raw_data_ = nullptr; // just in case + } + else + { + manager_.reset(nullptr); // just in case + raw_data_ = other.raw_data_; + } + } + + nullable_unique_ptr& operator=(nullable_unique_ptr&& other) noexcept + { + own_data_ = other.own_data_; + other.own_data_ = false; // ownership is transferred + if (own_data_) + { + manager_ = std::move(other.manager_); + raw_data_ = nullptr; // just in case + } + else + { + manager_.reset(nullptr); // just in case + raw_data_ = other.raw_data_; + } + return *this; + } + + ~nullable_unique_ptr() = default; + + void reset(T* data, bool own_data) + { + own_data_ = own_data; + if (own_data_) + { + manager_.reset(data); + raw_data_ = nullptr; + } + else + { + manager_.reset(nullptr); + raw_data_ = data; + } + } + + void swap(nullable_unique_ptr& other) noexcept + { + std::swap(manager_, other.manager_); + std::swap(raw_data_, other.raw_data_); + std::swap(own_data_, other.own_data_); + } + + /* + * Get the pointer to the underlying object (this is different from data()!). + */ + T* get() const noexcept + { + if (own_data_) + return manager_.get(); + else + return raw_data_; + } + + /* + * Get the pointer to the underlying buffer (this is different from get()!). + */ + void* data() noexcept + { + if (own_data_) + return manager_.get()->data(); + else + return raw_data_; + } + + T& operator*() + { + if (own_data_) + return *manager_; + else + return *raw_data_; + } + + private: + std::unique_ptr manager_{}; + T* raw_data_{nullptr}; + bool own_data_{false}; + }; + """ + # xref: cython/Cython/Includes/libcpp/memory.pxd + cdef cppclass nullable_unique_ptr[T]: + nullable_unique_ptr() + nullable_unique_ptr(T*, cppbool) + nullable_unique_ptr(nullable_unique_ptr[T]&) + + # Modifiers + void reset(T*, cppbool) + void swap(nullable_unique_ptr&) + + # Observers + T* get() + T& operator*() + void* data() + + +ctypedef fused ResT: + int + int32_t + int64_t + char + float + double + + +ctypedef fused PtrT: + void + + +cdef cppclass nested_resource[T]: + nullable_unique_ptr[ vector[intptr_t] ] ptrs + nullable_unique_ptr[ vector[vector[T]] ] nested_resource_ptr + + +# accepts the output pointer as input to use the return value for exception propagation +cdef int get_resource_ptr(nullable_unique_ptr[vector[ResT]] &in_out_ptr, object obj, ResT* __unused) except 1 +cdef int get_resource_ptrs(nullable_unique_ptr[ vector[PtrT*] ] &in_out_ptr, object obj, PtrT* __unused) except 1 +cdef int get_nested_resource_ptr(nested_resource[ResT] &in_out_ptr, object obj, ResT* __unused) except 1 + +cdef bint is_nested_sequence(data) +cdef void* get_buffer_pointer(buf, Py_ssize_t size, readonly=*) except* diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_lib/__init__.py b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_lib/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a42c299552b35f8b1c53541f0bfbd92033fee32 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_lib/cyruntime/cyruntime.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/cyruntime/cyruntime.pxd new file mode 100644 index 0000000000000000000000000000000000000000..48f87f29caf4e93aef95c2d197c48064d7f4da19 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/cyruntime/cyruntime.pxd @@ -0,0 +1,43 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +cimport cuda.bindings.cyruntime as cyruntime +cimport cuda.bindings._bindings.cydriver as _cydriver + +# These graphics API are the reimplemented version of what's supported by CUDA Runtime. +# Issue https://github.com/NVIDIA/cuda-python/issues/488 will remove them by letting us +# use call into the static library directly. +# +# This is an ABI breaking change which can only happen in a major version bump. + +# This file is included from cuda/bindings/_bindings/cyruntime.pxd.in but kept in a +# separate file to keep it separated from the auto-generated code there. + +# Prior to https://github.com/NVIDIA/cuda-python/pull/914, this was two +# independent modules (c.b._lib.cyruntime.cyruntime and +# c.b._lib.cyruntime.utils), but was merged into one. + +cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cyruntime.cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaVDPAUGetDevice(int* device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, cyruntime.VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, cyruntime.VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cyruntime.cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, cyruntime.GLuint image, cyruntime.GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, cyruntime.GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, cyruntime.EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, cyruntime.EGLint width, cyruntime.EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, cyruntime.EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +# utility functions + +cdef cudaError_t getDriverEglFrame(_cydriver.CUeglFrame *cuEglFrame, cyruntime.cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t getRuntimeEglFrame(cyruntime.cudaEglFrame *eglFrame, _cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_lib/cyruntime/cyruntime.pxi b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/cyruntime/cyruntime.pxi new file mode 100644 index 0000000000000000000000000000000000000000..c18bd1ca2ea4427e3dfc859bceae6e794b307277 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/cyruntime/cyruntime.pxi @@ -0,0 +1,1176 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +# These graphics API are the reimplemented version of what's supported by CUDA Runtime. +# Issue https://github.com/NVIDIA/cuda-python/issues/488 will remove them by letting us +# use call into the static library directly. + +# This file is included from cuda/bindings/_bindings/cyruntime.pyx.in but kept in a +# separate file to keep it separated from the auto-generated code there. + +# Prior to https://github.com/NVIDIA/cuda-python/pull/914, this was two +# independent modules (c.b._lib.cyruntime.cyruntime and +# c.b._lib.cyruntime.utils), but was merged into one. + +from libc.string cimport memset +cimport cuda.bindings._bindings.cydriver as cydriver + +cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + cdef cydriver.CUeglFrame cueglFrame + err = getDriverEglFrame(&cueglFrame, eglframe) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamProducerPresentFrame(conn, cueglFrame, pStream) + return err + +cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + if eglframe == NULL: + err = cudaErrorInvalidResourceHandle + return err + cdef cydriver.CUeglFrame cueglFrame + err = cydriver._cuEGLStreamProducerReturnFrame(conn, &cueglFrame, pStream) + if err != cudaSuccess: + return err + err = getRuntimeEglFrame(eglframe, cueglFrame) + return err + +cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cyruntime.cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + cdef cydriver.CUeglFrame cueglFrame + memset(&cueglFrame, 0, sizeof(cueglFrame)) + err = cydriver._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, resource, index, mipLevel) + if err != cudaSuccess: + return err + err = getRuntimeEglFrame(eglFrame, cueglFrame) + return err + +cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaErrorNotSupported + +cdef cudaError_t _cudaVDPAUGetDevice(int* device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuVDPAUGetDevice(device, vdpDevice, vdpGetProcAddress) + return err + +cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, cyruntime.VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGraphicsVDPAURegisterVideoSurface(resource, vdpSurface, flags) + return err + +cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, cyruntime.VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGraphicsVDPAURegisterOutputSurface(resource, vdpSurface, flags) + return err + +cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cyruntime.cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGLGetDevices_v2(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) + return err + +cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, cyruntime.GLuint image, cyruntime.GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGraphicsGLRegisterImage(resource, image, target, flags) + return err + +cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, cyruntime.GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGraphicsGLRegisterBuffer(resource, buffer, flags) + return err + +cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, cyruntime.EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGraphicsEGLRegisterImage(pCudaResource, image, flags) + return err + +cdef cudaError_t _cudaEGLStreamConsumerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamConsumerConnect(conn, eglStream) + return err + +cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamConsumerConnectWithFlags(conn, eglStream, flags) + return err + +cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamConsumerDisconnect(conn) + return err + +cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) + return err + +cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) + return err + +cdef cudaError_t _cudaEGLStreamProducerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, cyruntime.EGLint width, cyruntime.EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamProducerConnect(conn, eglStream, width, height) + return err + +cdef cudaError_t _cudaEGLStreamProducerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamProducerDisconnect(conn) + return err + +cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, cyruntime.EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEventCreateFromEGLSync(phEvent, eglSync, flags) + return err + +## utility functions + +cdef int case_desc(const cudaChannelFormatDesc* d, int x, int y, int z, int w, int f) except ?cudaErrorCallRequiresNewerDriver nogil: + return d[0].x == x and d[0].y == y and d[0].z == z and d[0].w == w and d[0].f == f + + +cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, cydriver.CUarray_format *format) except ?cudaErrorCallRequiresNewerDriver nogil: + # Check validity + if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned, + cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindFloat,): + if (d[0].x != 16) and (d[0].x != 32): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,): + if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1, + cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2, + cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4,): + if (d[0].x != 8): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1, + cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2, + cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4,): + if (d[0].x != 16): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4, + cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5, + cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB,): + if (d[0].x != 8): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H, + cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,): + if (d[0].x != 16) or (d[0].y != 16) or (d[0].z != 16) or (d[0].w != 0): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102,): + if (d[0].x != 10) or (d[0].y != 10) or (d[0].z != 10) or (d[0].w != 2): + return cudaErrorInvalidChannelDescriptor + else: + return cudaErrorInvalidChannelDescriptor + + # If Y is non-zero, it must match X + # If Z is non-zero, it must match Y + # If W is non-zero, it must match Z + if (((d[0].y != 0) and (d[0].y != d[0].x)) or + ((d[0].z != 0) and (d[0].z != d[0].y)) or + ((d[0].w != 0) and (d[0].w != d[0].z))): + if d[0].f != cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102: + return cudaErrorInvalidChannelDescriptor + if case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 + elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 + elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 + elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 + elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 + elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 + elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 + elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 + elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 + elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 + elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 + elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 + elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 + elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 + elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 + elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 + elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 + elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 + elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 + elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 + elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 + elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 + elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF + elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF + elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF + elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF + elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT + elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT + elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT + elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT + elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindNV12): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_NV12 + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM_SRGB + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM_SRGB + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM_SRGB + elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM + elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM + elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM + elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM + elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC6H_UF16 + elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC6H_SF16 + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM_SRGB + elif case_desc(d, 10, 10, 10, 2, cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT_101010_2 + else: + return cudaErrorInvalidChannelDescriptor + + if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H, + cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,): + if numberOfChannels[0] != 3: + return cudaErrorInvalidChannelDescriptor + else: + if (numberOfChannels[0] != 1) and (numberOfChannels[0] != 2) and (numberOfChannels[0] != 4): + return cudaErrorInvalidChannelDescriptor + return cudaSuccess + +cdef cudaError_t getChannelFormatDescFromDriverDesc(cudaChannelFormatDesc* pRuntimeDesc, size_t* pDepth, size_t* pHeight, size_t* pWidth, const cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2* pDriverDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef int channel_size = 0 + if pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNSIGNED_INT8: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNSIGNED_INT16: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNSIGNED_INT32: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned + channel_size = 32 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SIGNED_INT8: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SIGNED_INT16: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SIGNED_INT32: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned + channel_size = 32 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_HALF: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_FLOAT: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat + channel_size = 32 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_NV12: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindNV12 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT8X1: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT8X2: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT8X4: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT8X1: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT8X2: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT8X4: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT16X1: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT16X2: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT16X4: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT16X1: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT16X2: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT16X4: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC1_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC1_UNORM_SRGB: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC2_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC2_UNORM_SRGB: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC3_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC3_UNORM_SRGB: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC4_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC4_SNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC5_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC5_SNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC6H_UF16: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC6H_SF16: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC7_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC7_UNORM_SRGB: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT_101010_2: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102 + else: + return cudaErrorInvalidChannelDescriptor + + # populate bits per channel + pRuntimeDesc[0].x = 0 + pRuntimeDesc[0].y = 0 + pRuntimeDesc[0].z = 0 + pRuntimeDesc[0].w = 0 + + if pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT_101010_2 and pDriverDesc[0].NumChannels == 4: + pRuntimeDesc[0].w = 2 + pRuntimeDesc[0].z = 10 + pRuntimeDesc[0].y = 10 + pRuntimeDesc[0].x = 10 + else: + if pDriverDesc[0].NumChannels >= 4: + pRuntimeDesc[0].w = channel_size + if pDriverDesc[0].NumChannels >= 3: + pRuntimeDesc[0].z = channel_size + if pDriverDesc[0].NumChannels >= 2: + pRuntimeDesc[0].y = channel_size + if pDriverDesc[0].NumChannels >= 1: + pRuntimeDesc[0].x = channel_size + + if pDriverDesc[0].NumChannels not in (4, 3, 2, 1): + return cudaErrorInvalidChannelDescriptor + + # populate dimensions + if pDepth != NULL: + pDepth[0] = pDriverDesc[0].Depth + if pHeight != NULL: + pHeight[0] = pDriverDesc[0].Height + if pWidth != NULL: + pWidth[0] = pDriverDesc[0].Width + return cudaSuccess + +cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cyruntime.cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + cdef unsigned int i = 0 + + err = getDescInfo(&eglFrame.planeDesc[0].channelDesc, &cuEglFrame[0].numChannels, &cuEglFrame[0].cuFormat) + if err != cudaSuccess: + return err + for i in range(eglFrame.planeCount): + if eglFrame.frameType == cyruntime.cudaEglFrameTypeArray: + cuEglFrame[0].frame.pArray[i] = eglFrame.frame.pArray[i] + else: + cuEglFrame[0].frame.pPitch[i] = eglFrame.frame.pPitch[i].ptr + cuEglFrame[0].width = eglFrame.planeDesc[0].width + cuEglFrame[0].height = eglFrame.planeDesc[0].height + cuEglFrame[0].depth = eglFrame.planeDesc[0].depth + cuEglFrame[0].pitch = eglFrame.planeDesc[0].pitch + cuEglFrame[0].planeCount = eglFrame.planeCount + if eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUYV422: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY422: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatARGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatRGBA: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatABGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBGRA: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatL: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatA: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatAYUV: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatVYUY_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUYV_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVYU_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUVA_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatAYUV_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerRGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerBGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerGRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerGBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10RGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10BGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10GRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10GBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12RGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12BGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12GRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12GBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14RGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14BGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14GRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14GBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20RGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20BGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20GRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20GBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspRGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspBGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspGRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspGBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerBCCR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerRCCB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerCRBC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerCBRC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10CCCC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12BCCR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12RCCB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CRBC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CBRC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CCCC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUVA: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVYU: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatVYUY: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER + else: + return cudaErrorInvalidValue + if eglFrame.frameType == cyruntime.cudaEglFrameTypeArray: + cuEglFrame[0].frameType = cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY + elif eglFrame.frameType == cyruntime.cudaEglFrameTypePitch: + cuEglFrame[0].frameType = cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH + else: + return cudaErrorInvalidValue + +@cython.show_performance_hints(False) +cdef cudaError_t getRuntimeEglFrame(cyruntime.cudaEglFrame *eglFrame, cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + cdef unsigned int i + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2 ad + cdef cudaPitchedPtr pPtr + memset(eglFrame, 0, sizeof(eglFrame[0])) + memset(&ad, 0, sizeof(ad)) + for i in range(cueglFrame.planeCount): + ad.Depth = cueglFrame.depth + ad.Flags = 0 + ad.Format = cueglFrame.cuFormat + ad.Height = cueglFrame.height + ad.NumChannels = cueglFrame.numChannels + ad.Width = cueglFrame.width + + err = getChannelFormatDescFromDriverDesc(&eglFrame[0].planeDesc[i].channelDesc, NULL, NULL, NULL, &ad) + if err != cudaSuccess: + return err + + eglFrame[0].planeDesc[i].depth = cueglFrame.depth + eglFrame[0].planeDesc[i].numChannels = cueglFrame.numChannels + if i == 0: + eglFrame[0].planeDesc[i].width = cueglFrame.width + eglFrame[0].planeDesc[i].height = cueglFrame.height + eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709): + eglFrame[0].planeDesc[i].width = (cueglFrame.width / 2) + eglFrame[0].planeDesc[i].height = (cueglFrame.height / 2) + eglFrame[0].planeDesc[i].pitch = (cueglFrame.pitch / 2) + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER): + eglFrame[0].planeDesc[i].width = (cueglFrame.width / 2) + eglFrame[0].planeDesc[i].height = (cueglFrame.height / 2) + eglFrame[0].planeDesc[i].pitch = (cueglFrame.pitch / 2) + eglFrame[0].planeDesc[1].channelDesc.y = 8 + if (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER): + eglFrame[0].planeDesc[1].channelDesc.y = 16 + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER): + eglFrame[0].planeDesc[i].height = cueglFrame.height + eglFrame[0].planeDesc[i].width = (cueglFrame.width / 2) + eglFrame[0].planeDesc[i].pitch = (cueglFrame.pitch / 2) + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709): + eglFrame[0].planeDesc[i].width = (cueglFrame.width / 2) + eglFrame[0].planeDesc[i].height = cueglFrame.height + eglFrame[0].planeDesc[i].pitch = (cueglFrame.pitch / 2) + eglFrame[0].planeDesc[1].channelDesc.y = 8 + if (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709): + eglFrame[0].planeDesc[1].channelDesc.y = 16 + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER): + eglFrame[0].planeDesc[i].height = cueglFrame.height + eglFrame[0].planeDesc[i].width = cueglFrame.width + eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER): + eglFrame[0].planeDesc[i].height = cueglFrame.height + eglFrame[0].planeDesc[i].width = cueglFrame.width + eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch + eglFrame[0].planeDesc[1].channelDesc.y = 8 + if (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER): + eglFrame[0].planeDesc[1].channelDesc.y = 16 + if cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY: + eglFrame[0].frame.pArray[i] = cueglFrame.frame.pArray[i] + else: + pPtr = make_cudaPitchedPtr(cueglFrame.frame.pPitch[i], eglFrame[0].planeDesc[i].pitch, + eglFrame[0].planeDesc[i].width, eglFrame[0].planeDesc[i].height) + eglFrame[0].frame.pPitch[i] = pPtr + + eglFrame[0].planeCount = cueglFrame.planeCount + if cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUYV422 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY422 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatARGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatRGBA + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatABGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBGRA + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatL + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatA + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatAYUV + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatVYUY_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUYV_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVYU_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUVA_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatAYUV_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerRGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerBGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerGRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerGBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10RGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10BGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10GRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10GBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12RGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12BGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12GRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12GBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14RGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14BGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14GRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14GBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20RGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20BGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20GRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20GBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspRGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspBGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspGRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspGBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerBCCR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerRCCB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerCRBC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerCBRC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10CCCC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12BCCR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12RCCB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CRBC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CBRC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CCCC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUVA + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVYU + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatVYUY + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER + else: + return cudaErrorInvalidValue + if cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY: + eglFrame[0].frameType = cyruntime.cudaEglFrameTypeArray + elif cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH: + eglFrame[0].frameType = cyruntime.cudaEglFrameTypePitch + else: + return cudaErrorInvalidValue diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_lib/dlfcn.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/dlfcn.pxd new file mode 100644 index 0000000000000000000000000000000000000000..2ae95814396cab6134db80754e52e6f7b68bf979 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/dlfcn.pxd @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +cdef extern from "" nogil: + void *dlopen(const char *, int) + char *dlerror() + void *dlsym(void *, const char *) + int dlclose(void *) + + enum: + RTLD_LAZY + RTLD_NOW + RTLD_GLOBAL + RTLD_LOCAL diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_lib/param_packer.h b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/param_packer.h new file mode 100644 index 0000000000000000000000000000000000000000..96c56b4fe4e0f2d3ec4d7dc87d7f66b3df545d79 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/param_packer.h @@ -0,0 +1,152 @@ +// SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +// Please refer to the NVIDIA end user license agreement (EULA) associated +// with this source code for terms and conditions that govern your use of +// this software. Any use, reproduction, disclosure, or distribution of +// this software and related documentation outside the terms of the EULA +// is strictly prohibited. + +#include + +#include +#include +#include +#include + +static PyObject* ctypes_module = nullptr; + +static PyTypeObject* ctypes_c_char = nullptr; +static PyTypeObject* ctypes_c_bool = nullptr; +static PyTypeObject* ctypes_c_wchar = nullptr; +static PyTypeObject* ctypes_c_byte = nullptr; +static PyTypeObject* ctypes_c_ubyte = nullptr; +static PyTypeObject* ctypes_c_short = nullptr; +static PyTypeObject* ctypes_c_ushort = nullptr; +static PyTypeObject* ctypes_c_int = nullptr; +static PyTypeObject* ctypes_c_uint = nullptr; +static PyTypeObject* ctypes_c_long = nullptr; +static PyTypeObject* ctypes_c_ulong = nullptr; +static PyTypeObject* ctypes_c_longlong = nullptr; +static PyTypeObject* ctypes_c_ulonglong = nullptr; +static PyTypeObject* ctypes_c_size_t = nullptr; +static PyTypeObject* ctypes_c_float = nullptr; +static PyTypeObject* ctypes_c_double = nullptr; +static PyTypeObject* ctypes_c_void_p = nullptr; + +static void fetch_ctypes() +{ + ctypes_module = PyImport_ImportModule("ctypes"); + if (ctypes_module == nullptr) + throw std::runtime_error("Cannot import ctypes module"); + // get method addressof + PyObject* ctypes_dict = PyModule_GetDict(ctypes_module); + if (ctypes_dict == nullptr) + throw std::runtime_error(std::string("FAILURE @ ") + std::string(__FILE__) + " : " + std::to_string(__LINE__)); + // supportedtypes + ctypes_c_char = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_char"); + ctypes_c_bool = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_bool"); + ctypes_c_wchar = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_wchar"); + ctypes_c_byte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_byte"); + ctypes_c_ubyte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ubyte"); + ctypes_c_short = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_short"); + ctypes_c_ushort = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ushort"); + ctypes_c_int = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_int"); + ctypes_c_uint = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_uint"); + ctypes_c_long = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_long"); + ctypes_c_ulong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulong"); + ctypes_c_longlong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_longlong"); + ctypes_c_ulonglong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulonglong"); + ctypes_c_size_t = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_size_t"); + ctypes_c_float = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_float"); + ctypes_c_double = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_double"); + ctypes_c_void_p = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_void_p"); // == c_voidp +} + + +// (target type, source type) +static std::map, std::function> m_feeders; + +static void populate_feeders(PyTypeObject* target_t, PyTypeObject* source_t) +{ + if (target_t == ctypes_c_int) + { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((int*)ptr) = (int)PyLong_AsLong(value); + return sizeof(int); + }; + return; + } + } else if (target_t == ctypes_c_bool) { + if (source_t == &PyBool_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((bool*)ptr) = (value == Py_True); + return sizeof(bool); + }; + return; + } + } else if (target_t == ctypes_c_byte) { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((int8_t*)ptr) = (int8_t)PyLong_AsLong(value); + return sizeof(int8_t); + }; + return; + } + } else if (target_t == ctypes_c_double) { + if (source_t == &PyFloat_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((double*)ptr) = (double)PyFloat_AsDouble(value); + return sizeof(double); + }; + return; + } + } else if (target_t == ctypes_c_float) { + if (source_t == &PyFloat_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((float*)ptr) = (float)PyFloat_AsDouble(value); + return sizeof(float); + }; + return; + } + } else if (target_t == ctypes_c_longlong) { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((long long*)ptr) = (long long)PyLong_AsLongLong(value); + return sizeof(long long); + }; + return; + } + } +} + +static int feed(void* ptr, PyObject* value, PyObject* type) +{ + PyTypeObject* pto = (PyTypeObject*)type; + if (ctypes_c_int == nullptr) + fetch_ctypes(); + auto found = m_feeders.find({pto,value->ob_type}); + if (found == m_feeders.end()) + { + populate_feeders(pto, value->ob_type); + found = m_feeders.find({pto,value->ob_type}); + } + if (found != m_feeders.end()) + { + return found->second(ptr, value); + } + return 0; +} diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_lib/param_packer.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/param_packer.pxd new file mode 100644 index 0000000000000000000000000000000000000000..ad7fd95668fb3065b8ffa142ddad22970d23ed55 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/param_packer.pxd @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +# Include "param_packer.h" so its contents get compiled into every +# Cython extension module that depends on param_packer.pxd. +cdef extern from "param_packer.h": + int feed(void* ptr, object o, object ct) diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_lib/utils.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/utils.pxd new file mode 100644 index 0000000000000000000000000000000000000000..b3fe005e2ebac038814d87a51865b7d6ece4e2c3 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/utils.pxd @@ -0,0 +1,145 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +cimport cuda.bindings.driver as driver +cimport cuda.bindings.cydriver as cydriver +cimport cuda.bindings.cyruntime as cyruntime +from libcpp.vector cimport vector +from cpython.buffer cimport PyBuffer_Release, Py_buffer + +cdef class _HelperKernelParams: + cdef Py_buffer _pybuffer + cdef bint _pyobj_acquired + cdef void** _ckernelParams + cdef char* _ckernelParamsData + cdef int _length + cdef bint _malloc_list_created + +cdef struct _HelperInputVoidPtrStruct: + Py_buffer _pybuffer + +cdef class _HelperInputVoidPtr: + cdef _HelperInputVoidPtrStruct _helper + cdef void* _cptr + +cdef void * _helper_input_void_ptr(ptr, _HelperInputVoidPtrStruct *buffer) + +cdef inline void * _helper_input_void_ptr_free(_HelperInputVoidPtrStruct *helper): + if helper[0]._pybuffer.buf != NULL: + PyBuffer_Release(&helper[0]._pybuffer) + +cdef class _HelperCUmemPool_attribute: + cdef void* _cptr + cdef cydriver.CUmemPool_attribute_enum _attr + cdef bint _is_getter + + # Return values + cdef int _int_val + cdef driver.cuuint64_t _cuuint64_t_val + +cdef class _HelperCUmem_range_attribute: + cdef void* _cptr + cdef cydriver.CUmem_range_attribute_enum _attr + cdef size_t _data_size + + # Return values + cdef int _int_val # 32 bit integer + cdef int* _int_val_list # 32 bit integer array + +cdef class _HelperCUpointer_attribute: + cdef void* _cptr + cdef cydriver.CUpointer_attribute_enum _attr + cdef bint _is_getter + + # Return values + cdef driver.CUcontext _ctx + cdef unsigned int _uint + cdef int _int + cdef driver.CUdeviceptr _devptr + cdef void** _void + cdef driver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS _token + cdef bint _bool + cdef unsigned long long _ull + cdef size_t _size + cdef driver.CUmemoryPool _mempool + +cdef class _HelperCUgraphMem_attribute: + cdef void* _cptr + cdef cydriver.CUgraphMem_attribute_enum _attr + cdef bint _is_getter + + # Return values + cdef driver.cuuint64_t _cuuint64_t_val + +cdef class _HelperCUjit_option: + cdef void* _cptr + cdef cydriver.CUjit_option_enum _attr + + # Return values + cdef unsigned int _uint + cdef float _float + cdef char* _charstar + cdef cydriver.CUjit_target_enum _target + cdef cydriver.CUjit_fallback_enum _fallback + cdef int _int + cdef cydriver.CUjit_cacheMode_enum _cacheMode + cdef vector[char*] _charstarstar # list of names + cdef _InputVoidPtrPtrHelper _voidstarstar # list of addresses + +cdef class _HelperCudaJitOption: + cdef void* _cptr + cdef cyruntime.cudaJitOption _attr + + # Return values + cdef unsigned int _uint + cdef float _float + cdef char* _charstar + cdef cyruntime.cudaJit_Fallback _fallback + cdef int _int + cdef cyruntime.cudaJit_CacheMode _cacheMode + +cdef class _HelperCUlibraryOption: + cdef void* _cptr + cdef cydriver.CUlibraryOption_enum _attr + + # Return values + cdef unsigned int _uint + +cdef class _HelperCudaLibraryOption: + cdef void* _cptr + cdef cyruntime.cudaLibraryOption _attr + + # Return values + cdef unsigned int _uint + +cdef class _HelperCUmemAllocationHandleType: + cdef void* _cptr + cdef cydriver.CUmemAllocationHandleType_enum _type + + # Return values + cdef int _int + cdef void* _handle + cdef unsigned int _d3dkmt_handle + cdef driver.CUmemFabricHandle _mem_fabric_handle + +cdef class _HelperCUlogicalEndpointIpcHandleType: + cdef void* _cptr + cdef cydriver.CUlogicalEndpointIpcHandleType_enum _type + + # Return values + cdef int _int + cdef driver.CUlogicalEndpointFabricHandle _fabric_handle + +cdef class _InputVoidPtrPtrHelper: + cdef object _references + cdef void** _cptr + +cdef class _HelperCUcoredumpSettings: + cdef void* _cptr + cdef cydriver.CUcoredumpSettings_enum _attrib + cdef bint _is_getter + cdef size_t _size + + # Return values + cdef bint _bool + cdef char* _charstar diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_lib/utils.pxi b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/utils.pxi new file mode 100644 index 0000000000000000000000000000000000000000..18453c8fae7bbf6def0d22fff5f5cd2e29d76240 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/utils.pxi @@ -0,0 +1,640 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS +from libc.stdlib cimport calloc, free +from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t +from libc.stddef cimport wchar_t +from libc.string cimport memcpy +from cuda.bindings._internal._fast_enum import FastEnum as _FastEnum +import ctypes as _ctypes +cimport cuda.bindings.cydriver as cydriver +cimport cuda.bindings._lib.param_packer as param_packer + +cdef void* _callocWrapper(length, size): + cdef void* out = calloc(length, size) + if out is NULL: + raise MemoryError('Failed to allocated length x size memory: {}x{}'.format(length, size)) + return out + +cdef class _HelperKernelParams: + supported_types = { # excluding void_p and None, which are handled specially + _ctypes.c_bool, + _ctypes.c_char, + _ctypes.c_wchar, + _ctypes.c_byte, + _ctypes.c_ubyte, + _ctypes.c_short, + _ctypes.c_ushort, + _ctypes.c_int, + _ctypes.c_uint, + _ctypes.c_long, + _ctypes.c_ulong, + _ctypes.c_longlong, + _ctypes.c_ulonglong, + _ctypes.c_size_t, + _ctypes.c_float, + _ctypes.c_double + } + + max_param_size = max(_ctypes.sizeof(max(_HelperKernelParams.supported_types, key=lambda t:_ctypes.sizeof(t))), sizeof(void_ptr)) + + def __cinit__(self, kernelParams): + self._pyobj_acquired = False + self._malloc_list_created = False + if kernelParams is None: + self._ckernelParams = NULL + elif isinstance(kernelParams, (int)): + # Easy run, user gave us an already configured void** address + self._ckernelParams = kernelParams + elif PyObject_CheckBuffer(kernelParams): + # Easy run, get address from Python Buffer Protocol + err_buffer = PyObject_GetBuffer(kernelParams, &self._pybuffer, PyBUF_SIMPLE | PyBUF_ANY_CONTIGUOUS) + if err_buffer == -1: + raise RuntimeError("Argument 'kernelParams' failed to retrieve buffer through Buffer Protocol") + self._pyobj_acquired = True + self._ckernelParams = self._pybuffer.buf + elif isinstance(kernelParams, (tuple)) and len(kernelParams) == 2 and isinstance(kernelParams[0], (tuple)) and isinstance(kernelParams[1], (tuple)): + # Hard run, construct and fill out contigues memory using provided kernel values and types based + if len(kernelParams[0]) != len(kernelParams[1]): + raise TypeError("Argument 'kernelParams' has tuples with different length") + if len(kernelParams[0]) != 0: + self._length = len(kernelParams[0]) + self._ckernelParams = _callocWrapper(len(kernelParams[0]), sizeof(void*)) + self._ckernelParamsData = _callocWrapper(len(kernelParams[0]), _HelperKernelParams.max_param_size) + self._malloc_list_created = True + + idx = 0 + data_idx = 0 + for value, ctype in zip(kernelParams[0], kernelParams[1]): + if ctype is None: + # special cases for None + if callable(getattr(value, 'getPtr', None)): + self._ckernelParams[idx] = value.getPtr() + elif isinstance(value, (_ctypes.Structure)): + self._ckernelParams[idx] = _ctypes.addressof(value) + elif isinstance(value, (_FastEnum)): + self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) + (self._ckernelParams[idx])[0] = value.value + data_idx += sizeof(int) + else: + raise TypeError("Provided argument is of type {} but expected Type {}, {} or CUDA Binding structure with getPtr() attribute".format(type(value), type(_ctypes.Structure), type(_ctypes.c_void_p))) + elif ctype in _HelperKernelParams.supported_types: + self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) + + # handle case where a float is passed as a double + if ctype == _ctypes.c_double and isinstance(value, _ctypes.c_float): + value = ctype(value.value) + if not isinstance(value, ctype): # make it a ctype + size = param_packer.feed(self._ckernelParams[idx], value, ctype) + if size == 0: # feed failed + value = ctype(value) + size = _ctypes.sizeof(ctype) + addr = (_ctypes.addressof(value)) + memcpy(self._ckernelParams[idx], addr, size) + else: + size = _ctypes.sizeof(ctype) + addr = (_ctypes.addressof(value)) + memcpy(self._ckernelParams[idx], addr, size) + data_idx += size + elif ctype == _ctypes.c_void_p: + # special cases for void_p + if isinstance(value, (int, _ctypes.c_void_p)): + self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) + (self._ckernelParams[idx])[0] = value.value if isinstance(value, (_ctypes.c_void_p)) else value + data_idx += sizeof(void_ptr) + elif callable(getattr(value, 'getPtr', None)): + self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) + (self._ckernelParams[idx])[0] = value.getPtr() + data_idx += sizeof(void_ptr) + else: + raise TypeError("Provided argument is of type {} but expected Type {}, {} or CUDA Binding structure with getPtr() attribute".format(type(value), type(int), type(_ctypes.c_void_p))) + else: + raise TypeError("Unsupported type: " + str(type(ctype))) + idx += 1 + else: + raise TypeError("Argument 'kernelParams' is not a valid type: tuple[tuple[Any, ...], tuple[Any, ...]] or PyObject implimenting Buffer Protocol or Int") + + def __dealloc__(self): + if self._pyobj_acquired is True: + PyBuffer_Release(&self._pybuffer) + if self._malloc_list_created is True: + free(self._ckernelParams) + free(self._ckernelParamsData) + + @property + def ckernelParams(self): + return self._ckernelParams + +cdef class _HelperInputVoidPtr: + def __cinit__(self, ptr): + self._cptr = _helper_input_void_ptr(ptr, &self._helper) + + def __dealloc__(self): + _helper_input_void_ptr_free(&self._helper) + + @property + def cptr(self): + return self._cptr + + +cdef void * _helper_input_void_ptr(ptr, _HelperInputVoidPtrStruct *helper): + helper[0]._pybuffer.buf = NULL + try: + return ptr + except: + if ptr is None: + return NULL + elif PyObject_CheckBuffer(ptr): + # Easy run, get address from Python Buffer Protocol + err_buffer = PyObject_GetBuffer(ptr, &helper[0]._pybuffer, PyBUF_SIMPLE | PyBUF_ANY_CONTIGUOUS) + if err_buffer == -1: + raise RuntimeError("Failed to retrieve buffer through Buffer Protocol") + return (helper[0]._pybuffer.buf) + else: + raise TypeError("Provided argument is of type {} but expected Type {}, {} or object with Buffer Protocol".format(type(ptr), type(None), type(int))) + + +cdef class _HelperCUmemPool_attribute: + def __cinit__(self, attr, init_value, is_getter=False): + self._is_getter = is_getter + self._attr = attr.value + if self._attr in (cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES,): + self._int_val = init_value + self._cptr = &self._int_val + elif self._attr in (cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_CURRENT, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_HIGH,): + if self._is_getter: + self._cuuint64_t_val = _driver["cuuint64_t"]() + self._cptr = self._cuuint64_t_val.getPtr() + else: + self._cptr = init_value.getPtr() + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + assert(self._is_getter == True) + if self._attr in (cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES,): + return self._int_val + elif self._attr in (cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_CURRENT, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_HIGH,): + return self._cuuint64_t_val + else: + raise TypeError('Unsupported attribute value: {}'.format(self._attr)) + +cdef class _HelperCUmem_range_attribute: + def __cinit__(self, attr, data_size): + self._data_size = data_size + self._attr = attr.value + if self._attr in (cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY, + cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION, + cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION,): + self._cptr = &self._int_val + elif self._attr in (cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY,): + self._cptr = _callocWrapper(1, self._data_size) + self._int_val_list = self._cptr + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + if self._attr in (cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY,): + free(self._cptr) + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + if self._attr in (cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY, + cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION, + cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION,): + return self._int_val + elif self._attr in (cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY,): + return [self._int_val_list[idx] for idx in range(int(self._data_size/4))] + else: + raise TypeError('Unsupported attribute value: {}'.format(self._attr)) + +cdef class _HelperCUpointer_attribute: + def __cinit__(self, attr, init_value, is_getter=False): + self._is_getter = is_getter + self._attr = attr.value + if self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT,): + if self._is_getter: + self._ctx = _driver["CUcontext"]() + self._cptr = self._ctx.getPtr() + else: + self._cptr = init_value.getPtr() + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS,): + self._uint = init_value + self._cptr = &self._uint + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL,): + self._int = init_value + self._cptr = &self._int + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR,): + if self._is_getter: + self._devptr = _driver["CUdeviceptr"]() + self._cptr = self._devptr.getPtr() + else: + self._cptr = init_value.getPtr() + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER,): + self._void = init_value + self._cptr = &self._void + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_P2P_TOKENS,): + if self._is_getter: + self._token = _driver["CUDA_POINTER_ATTRIBUTE_P2P_TOKENS"]() + self._cptr = self._token.getPtr() + else: + self._cptr = init_value.getPtr() + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MAPPED,): + self._bool = init_value + self._cptr = &self._bool + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_BUFFER_ID,): + self._ull = init_value + self._cptr = &self._ull + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_SIZE,): + self._size = init_value + self._cptr = &self._size + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE,): + if self._is_getter: + self._mempool = _driver["CUmemoryPool"]() + self._cptr = self._mempool.getPtr() + else: + self._cptr = init_value.getPtr() + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + assert(self._is_getter == True) + if self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT,): + return self._ctx + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS,): + return self._uint + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR,): + return self._devptr + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER,): + return self._void + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_P2P_TOKENS,): + return self._token + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MAPPED,): + return self._bool + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_BUFFER_ID,): + return self._ull + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_SIZE,): + return self._size + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE,): + return self._mempool + else: + raise TypeError('Unsupported attribute value: {}'.format(self._attr)) + +cdef class _HelperCUgraphMem_attribute: + def __cinit__(self, attr, init_value, is_getter=False): + self._is_getter = is_getter + self._attr = attr.value + if self._attr in (cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_HIGH, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH,): + if self._is_getter: + self._cuuint64_t_val = _driver["cuuint64_t"]() + self._cptr = self._cuuint64_t_val.getPtr() + else: + self._cptr = init_value.getPtr() + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + assert(self._is_getter == True) + if self._attr in (cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_HIGH, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH,): + return self._cuuint64_t_val + else: + raise TypeError('Unsupported attribute value: {}'.format(self._attr)) + +cdef class _HelperCUjit_option: + def __cinit__(self, attr, init_value): + self._attr = attr.value + if self._attr in (cydriver.CUjit_option_enum.CU_JIT_MAX_REGISTERS, + cydriver.CUjit_option_enum.CU_JIT_THREADS_PER_BLOCK, + cydriver.CUjit_option_enum.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES, + cydriver.CUjit_option_enum.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES, + cydriver.CUjit_option_enum.CU_JIT_OPTIMIZATION_LEVEL, + cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_COUNT, + cydriver.CUjit_option_enum.CU_JIT_TARGET_FROM_CUCONTEXT, + cydriver.CUjit_option_enum.CU_JIT_REFERENCED_KERNEL_COUNT, + cydriver.CUjit_option_enum.CU_JIT_REFERENCED_VARIABLE_COUNT, + cydriver.CUjit_option_enum.CU_JIT_MIN_CTA_PER_SM, + cydriver.CUjit_option_enum.CU_JIT_SPLIT_COMPILE,): + self._uint = init_value + self._cptr = self._uint + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_WALL_TIME,): + self._float = init_value + self._cptr = self._float + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_INFO_LOG_BUFFER, + cydriver.CUjit_option_enum.CU_JIT_ERROR_LOG_BUFFER): + self._charstar = init_value + self._cptr = self._charstar + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_TARGET,): + self._target = init_value.value + self._cptr = self._target + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_FALLBACK_STRATEGY,): + self._fallback = init_value.value + self._cptr = self._fallback + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_GENERATE_DEBUG_INFO, + cydriver.CUjit_option_enum.CU_JIT_LOG_VERBOSE, + cydriver.CUjit_option_enum.CU_JIT_GENERATE_LINE_INFO, + cydriver.CUjit_option_enum.CU_JIT_LTO, + cydriver.CUjit_option_enum.CU_JIT_FTZ, + cydriver.CUjit_option_enum.CU_JIT_PREC_DIV, + cydriver.CUjit_option_enum.CU_JIT_PREC_SQRT, + cydriver.CUjit_option_enum.CU_JIT_FMA, + cydriver.CUjit_option_enum.CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES,): + self._int = init_value + self._cptr = self._int + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_CACHE_MODE,): + self._cacheMode = init_value.value + self._cptr = self._cacheMode + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_NAMES, + cydriver.CUjit_option_enum.CU_JIT_REFERENCED_KERNEL_NAMES, + cydriver.CUjit_option_enum.CU_JIT_REFERENCED_VARIABLE_NAMES,): + self._charstarstar = init_value + self._cptr = &self._charstarstar[0] + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_ADDRESSES,): + pylist = [_HelperInputVoidPtr(val) for val in init_value] + self._voidstarstar = _InputVoidPtrPtrHelper(pylist) + self._cptr = self._voidstarstar.cptr + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + +cdef class _HelperCudaJitOption: + def __cinit__(self, attr, init_value): + self._attr = attr.value + if self._attr in (cyruntime.cudaJitOption.cudaJitMaxRegisters, + cyruntime.cudaJitOption.cudaJitThreadsPerBlock, + cyruntime.cudaJitOption.cudaJitInfoLogBufferSizeBytes, + cyruntime.cudaJitOption.cudaJitErrorLogBufferSizeBytes, + cyruntime.cudaJitOption.cudaJitOptimizationLevel, + cyruntime.cudaJitOption.cudaJitMinCtaPerSm,): + self._uint = init_value + self._cptr = self._uint + elif self._attr in (cyruntime.cudaJitOption.cudaJitWallTime,): + self._float = init_value + self._cptr = self._float + elif self._attr in (cyruntime.cudaJitOption.cudaJitInfoLogBuffer, + cyruntime.cudaJitOption.cudaJitErrorLogBuffer): + self._charstar = init_value + self._cptr = self._charstar + elif self._attr in (cyruntime.cudaJitOption.cudaJitFallbackStrategy,): + self._fallback = init_value.value + self._cptr = self._fallback + elif self._attr in (cyruntime.cudaJitOption.cudaJitGenerateDebugInfo, + cyruntime.cudaJitOption.cudaJitLogVerbose, + cyruntime.cudaJitOption.cudaJitGenerateLineInfo, + cyruntime.cudaJitOption.cudaJitPositionIndependentCode, + cyruntime.cudaJitOption.cudaJitMaxThreadsPerBlock, + cyruntime.cudaJitOption.cudaJitOverrideDirectiveValues,): + self._int = init_value + self._cptr = self._int + elif self._attr in (cyruntime.cudaJitOption.cudaJitCacheMode,): + self._cacheMode = init_value.value + self._cptr = self._cacheMode + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + +cdef class _HelperCUlibraryOption: + def __cinit__(self, attr, init_value): + self._attr = attr.value + if False: + pass + elif self._attr in (cydriver.CUlibraryOption_enum.CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE,): + self._cptr = init_value.getPtr() + elif self._attr in (cydriver.CUlibraryOption_enum.CU_LIBRARY_BINARY_IS_PRESERVED,): + self._uint = init_value + self._cptr = self._uint + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + +cdef class _HelperCudaLibraryOption: + def __cinit__(self, attr, init_value): + self._attr = attr.value + if False: + pass + elif self._attr in (cyruntime.cudaLibraryOption.cudaLibraryHostUniversalFunctionAndDataTable,): + self._cptr = init_value.getPtr() + elif self._attr in (cyruntime.cudaLibraryOption.cudaLibraryBinaryIsPreserved,): + self._uint = init_value + self._cptr = self._uint + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + +cdef class _HelperCUmemAllocationHandleType: + def __cinit__(self, attr): + self._type = attr.value + if False: + pass + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_NONE,): + self._cptr = &self._int + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR,): + self._cptr = &self._int + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32,): + self._cptr = &self._handle + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32_KMT,): + self._cptr = &self._d3dkmt_handle + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_FABRIC,): + self._mem_fabric_handle = _driver["CUmemFabricHandle"]() + self._cptr = self._mem_fabric_handle.getPtr() + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + if False: + pass + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_NONE,): + return self._int + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR,): + return self._int + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32,): + return self._handle + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32_KMT,): + return self._d3dkmt_handle + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_FABRIC,): + return self._mem_fabric_handle + else: + raise TypeError('Unsupported attribute: {}'.format(self._type)) + +cdef class _HelperCUlogicalEndpointIpcHandleType: + def __cinit__(self, attr): + self._type = attr.value + if False: + pass + elif self._type in (cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE,): + self._cptr = &self._int + elif self._type in (cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC,): + self._fabric_handle = _driver["CUlogicalEndpointFabricHandle"]() + self._cptr = self._fabric_handle.getPtr() + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + if False: + pass + elif self._type in (cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE,): + return self._int + elif self._type in (cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC,): + return self._fabric_handle + else: + raise TypeError('Unsupported attribute: {}'.format(self._type)) + +cdef class _InputVoidPtrPtrHelper: + def __cinit__(self, lst): + # Hold onto references to the original buffers so they + # won't be free'd behind our back + self._references = lst + self._cptr = _callocWrapper(len(lst), sizeof(void*)) + for idx in range(len(lst)): + self._cptr[idx] = lst[idx].cptr + + def __dealloc__(self): + free(self._cptr) + + @property + def cptr(self): + return self._cptr + +cdef class _HelperCUcoredumpSettings: + def __cinit__(self, attr, init_value, is_getter=False): + self._is_getter = is_getter + self._attrib = attr.value + if self._attrib in (cydriver.CUcoredumpSettings_enum.CU_COREDUMP_FILE, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_PIPE,): + if self._is_getter: + self._charstar = _callocWrapper(1024, 1) + self._cptr = self._charstar + self._size = 1024 + else: + self._charstar = init_value + self._cptr = self._charstar + self._size = len(init_value) + elif self._attrib in (cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_ON_EXCEPTION, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_TRIGGER_HOST, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_LIGHTWEIGHT, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_USER_TRIGGER,): + if self._is_getter == False: + self._bool = init_value + + self._cptr = &self._bool + self._size = 1 + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def size(self): + return self._size + + def pyObj(self): + assert(self._is_getter == True) + if self._attrib in (cydriver.CUcoredumpSettings_enum.CU_COREDUMP_FILE, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_PIPE,): + return self._charstar + elif self._attrib in (cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_ON_EXCEPTION, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_TRIGGER_HOST, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_LIGHTWEIGHT, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_USER_TRIGGER,): + return self._bool + else: + raise TypeError('Unsupported attribute value: {}'.format(self._attrib)) diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_lib/windll.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/windll.pxd new file mode 100644 index 0000000000000000000000000000000000000000..7b190f35959d98d17da3a5c7d1433dc7a8c17cc9 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_lib/windll.pxd @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +from libc.stddef cimport wchar_t +from libc.stdint cimport uintptr_t +from cpython cimport PyUnicode_AsWideCharString, PyMem_Free + +cdef extern from "windows.h" nogil: + ctypedef void* HMODULE + ctypedef void* HANDLE + ctypedef void* FARPROC + ctypedef unsigned long DWORD + ctypedef const wchar_t *LPCWSTR + ctypedef const char *LPCSTR + ctypedef int BOOL + + cdef DWORD LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 + + HMODULE _LoadLibraryExW "LoadLibraryExW"( + LPCWSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags + ) + + FARPROC _GetProcAddress "GetProcAddress"(HMODULE hModule, LPCSTR lpProcName) + + BOOL _FreeLibrary "FreeLibrary"(HMODULE hLibModule) + +cdef inline uintptr_t LoadLibraryExW(str path, HANDLE hFile, DWORD dwFlags): + cdef uintptr_t result + cdef wchar_t* wpath = PyUnicode_AsWideCharString(path, NULL) + with nogil: + result = _LoadLibraryExW( + wpath, + hFile, + dwFlags + ) + PyMem_Free(wpath) + return result + +cdef inline FARPROC GetProcAddress(uintptr_t hModule, const char* lpProcName) nogil: + return _GetProcAddress(hModule, lpProcName) + +cdef inline BOOL FreeLibrary(uintptr_t hLibModule) nogil: + return _FreeLibrary(hLibModule) diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__init__.py b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c6b171f9cd3721daade7339515b5c0ed8048d278 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__init__.py @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + + +# This package contains test helper utilities that may also be useful for other libraries outside of `cuda.bindings`, +# such as `cuda.core`. These utilities are not part of the public API of `cuda.bindings` and may change without notice. diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e00c1158fd2b098f4177c47cb03707d8a21158ea Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/arch_check.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/arch_check.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c70ef7dade738ed5d6c1aa6f96443efbcef03a9a Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/arch_check.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/mempool.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/mempool.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a97b38394ded9243baf25e3541dbe5da2e1959bb Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/mempool.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/pep723.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/pep723.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c75cd0e947b34d11ca3c2d39ae54a8c5d5177512 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/__pycache__/pep723.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/arch_check.py b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/arch_check.py new file mode 100644 index 0000000000000000000000000000000000000000..65f5140b394909e5f9d497808b0048721343cf7e --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/arch_check.py @@ -0,0 +1,70 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + + +from contextlib import contextmanager +from functools import cache + +import pytest + +from cuda.bindings import nvml +from cuda.bindings._internal.utils import FunctionNotFoundError as NvmlSymbolNotFoundError + + +@cache +def hardware_supports_nvml(): + """ + Tries to call the simplest NVML API possible to see if just the basics + works. If not we are probably on one of the platforms where NVML is not + supported at all (e.g. Jetson Orin). + """ + nvml.init_v2() + try: + nvml.system_get_driver_branch() + except (nvml.NotSupportedError, nvml.UnknownError): + return False + else: + return True + finally: + nvml.shutdown() + + +@contextmanager +def unsupported_before(device: int, expected_device_arch: nvml.DeviceArch | str | None): + device_arch = nvml.device_get_architecture(device) + + if isinstance(expected_device_arch, nvml.DeviceArch): + expected_device_arch_int = int(expected_device_arch) + elif expected_device_arch == "FERMI": + expected_device_arch_int = 1 + else: + expected_device_arch_int = 0 + + if expected_device_arch is None or expected_device_arch == "HAS_INFOROM" or device_arch == nvml.DeviceArch.UNKNOWN: + # In this case, we don't /know/ if it will fail, but we are ok if it + # does or does not. + + # TODO: There are APIs that are documented as supported only if the + # device has an InfoROM, but I couldn't find a way to detect that. For + # now, they are just handled as "possibly failing". + + try: + yield + except (nvml.NotSupportedError, nvml.FunctionNotFoundError, NvmlSymbolNotFoundError): + # The API call raised NotSupportedError, NVML status FunctionNotFoundError, + # or NvmlSymbolNotFoundError (symbol absent from the loaded NVML DLL), so we + # skip the test but don't fail it + pytest.skip( + f"Unsupported call for device architecture {nvml.DeviceArch(device_arch).name} " + f"on device '{nvml.device_get_name(device)}'" + ) + # If the API call worked, just continue + elif int(device_arch) < expected_device_arch_int: + # In this case, we /know/ if will fail, and we want to assert that it does. + with pytest.raises(nvml.NotSupportedError): + yield + # The above call was unsupported, so the rest of the test is skipped + pytest.skip(f"Unsupported before {expected_device_arch.name}, got {nvml.device_get_name(device)}") + else: + # In this case, we /know/ it should work, and if it fails, the test should fail. + yield diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/mempool.py b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/mempool.py new file mode 100644 index 0000000000000000000000000000000000000000..3113113d251250a835609e6e7cd3b8378f7fcfb5 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/mempool.py @@ -0,0 +1,57 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +import sys + +import pytest + +from cuda.bindings import driver, runtime + + +# Keep in sync with the fallback in cuda_core/tests/conftest.py. The cuda_core +# copy is intentionally simpler because it only handles cuda_core CUDAError +# exceptions when this helper is absent from older published bindings. +def is_windows_mcdm_device(device=0): + if sys.platform != "win32": + return False + import cuda.bindings.nvml as nvml + + device_id = int(getattr(device, "device_id", device)) + (err,) = driver.cuInit(0) + if err != driver.CUresult.CUDA_SUCCESS: + return False + err, pci_bus_id = driver.cuDeviceGetPCIBusId(13, device_id) + if err != driver.CUresult.CUDA_SUCCESS: + return False + pci_bus_id = pci_bus_id.split(b"\x00", 1)[0].decode("ascii") + nvml.init_v2() + try: + handle = nvml.device_get_handle_by_pci_bus_id_v2(pci_bus_id) + current, _ = nvml.device_get_driver_model_v2(handle) + return current == nvml.DriverModel.DRIVER_MCDM + finally: + nvml.shutdown() + + +def xfail_if_mempool_oom(err_or_exc, api_name=None, device=0): + if api_name is not None and not isinstance(api_name, str): + device = api_name + api_name = None + + is_oom = err_or_exc in ( + driver.CUresult.CUDA_ERROR_OUT_OF_MEMORY, + runtime.cudaError_t.cudaErrorMemoryAllocation, + ) or "CUDA_ERROR_OUT_OF_MEMORY" in str(err_or_exc) + + if not is_oom: + return + try: + is_windows_mcdm = is_windows_mcdm_device(device) + except Exception: + # If MCDM detection fails, leave the primary test failure visible. + return + if not is_windows_mcdm: + return + + api_context = f"{api_name} " if api_name else "" + pytest.xfail(f"{api_context}could not reserve VA for mempool operations on Windows MCDM") diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/pep723.py b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/pep723.py new file mode 100644 index 0000000000000000000000000000000000000000..e1f6f920b7c64aeae00047345a1c012d5592b85a --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_test_helpers/pep723.py @@ -0,0 +1,46 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + + +import importlib.metadata +import os +import re + +import pytest + + +def has_package_requirements_or_skip(example): + example_name = os.path.basename(example) + + with open(example, encoding="utf-8") as f: + content = f.read() + + # The canonical regex as defined in PEP 723 + pep723 = re.search(r"(?m)^# /// (?P[a-zA-Z0-9-]+)$\s(?P(^#(| .*)$\s)+)^# ///$", content) + if not pep723: + raise ValueError(f"PEP 723 metadata not found in {example_name}") + + metadata = {} + for line in pep723.group("content").splitlines(): + line = line.lstrip("# ").rstrip() + if not line: + continue + key, value = line.split("=", 1) + key = key.strip() + value = value.strip() + metadata[key] = value + + if "dependencies" not in metadata: + raise ValueError(f"PEP 723 dependencies not found in {example_name}") + + missing_dependencies = [] + dependencies = eval(metadata["dependencies"]) # noqa: S307 + for dependency in dependencies: + name = re.match("[a-zA-Z0-9_-]+", dependency) + try: + importlib.metadata.distribution(name.group(0)) + except importlib.metadata.PackageNotFoundError: + missing_dependencies.append(name.string) + + if missing_dependencies: + pytest.skip(f"Skipping {example} due to missing package requirement: {', '.join(missing_dependencies)}") diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/_version.py b/venv/lib/python3.12/site-packages/cuda/bindings/_version.py new file mode 100644 index 0000000000000000000000000000000000000000..bda9d01a7ab069f0e5da4a064b806c10babe9175 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/_version.py @@ -0,0 +1,24 @@ +# file generated by vcs-versioning +# don't change, don't track in version control +from __future__ import annotations + +__all__ = [ + "__version__", + "__version_tuple__", + "version", + "version_tuple", + "__commit_id__", + "commit_id", +] + +version: str +__version__: str +__version_tuple__: tuple[int | str, ...] +version_tuple: tuple[int | str, ...] +commit_id: str | None +__commit_id__: str | None + +__version__ = version = '13.3.1' +__version_tuple__ = version_tuple = (13, 3, 1) + +__commit_id__ = commit_id = 'g96c7f518d' diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cudla.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/cudla.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..1c06801994aa3be7d1167d62ed0d6c11a7adb6e5 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cudla.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa12c94a027967de46d6fd21f46ff71cd5beb8f6cf8f881a1b77d0784b2285a8 +size 471432 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cudla.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/cudla.pxd new file mode 100644 index 0000000000000000000000000000000000000000..894aacb7c54352f05fa84e6d4f3c073f64e99fb5 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cudla.pxd @@ -0,0 +1,52 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +# This code was automatically generated across versions from 1.5.0 to 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + +from libc.stdint cimport intptr_t + +from .cycudla cimport * + + + + +############################################################################### +# Types +############################################################################### + +ctypedef cudlaDevHandle DevHandle +ctypedef cudlaModule Module + + +############################################################################### +# Enum +############################################################################### + +ctypedef cudlaStatus _Status +ctypedef cudlaMode _Mode +ctypedef cudlaModuleAttributeType _ModuleAttributeType +ctypedef cudlaFenceType _FenceType +ctypedef cudlaModuleLoadFlags _ModuleLoadFlags +ctypedef cudlaSubmissionFlags _SubmissionFlags +ctypedef cudlaAccessPermissionFlags _AccessPermissionFlags +ctypedef cudlaDevAttributeType _DevAttributeType + + +############################################################################### +# Functions +############################################################################### + +cpdef uint64_t get_version() except? -1 +cpdef uint64_t device_get_count() except? -1 +cpdef intptr_t create_device(uint64_t device, uint32_t flags) except * +cpdef intptr_t mem_register(intptr_t dev_handle, intptr_t ptr, size_t size, uint32_t flags) except * +cpdef intptr_t module_load_from_memory(intptr_t dev_handle, p_module, size_t module_size, uint32_t flags) except * +cpdef module_unload(intptr_t h_module, uint32_t flags) +cpdef submit_task(intptr_t dev_handle, intptr_t ptr_to_tasks, uint32_t num_tasks, intptr_t stream, uint32_t flags) +cpdef object device_get_attribute(intptr_t dev_handle, int attrib) except * +cpdef mem_unregister(intptr_t dev_handle, intptr_t dev_ptr) +cpdef int get_last_error(intptr_t dev_handle) except? 0 +cpdef destroy_device(intptr_t dev_handle) +cpdef set_task_timeout_in_ms(intptr_t dev_handle, uint32_t timeout) + +cpdef module_get_attributes(intptr_t h_module, int attr_type) except * diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cufile.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/cufile.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..e349f8b3f6cfde0001ecb4b7d3c4b858521f473c --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cufile.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:908dc01862cb7d237d23f2eef32eb6c7ac2af11ee608cf7d5fa2453285b46dd9 +size 761576 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cufile.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/cufile.pxd new file mode 100644 index 0000000000000000000000000000000000000000..7a4a83cd796a51840c093d2f39428bc0a434235f --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cufile.pxd @@ -0,0 +1,85 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1568+g289771de9.d20260413. Do not modify it directly. + +from libc.stdint cimport intptr_t + +from .cycufile cimport * + + +############################################################################### +# Types +############################################################################### + +ctypedef CUfileHandle_t Handle +ctypedef CUfileBatchHandle_t BatchHandle +ctypedef CUfileError_t Error +ctypedef cufileRDMAInfo_t RDMAInfo +ctypedef CUfileFSOps_t FSOps +ctypedef CUfileDrvProps_t DrvProps + + +############################################################################### +# Enum +############################################################################### + +ctypedef CUfileOpError _OpError +ctypedef CUfileDriverStatusFlags_t _DriverStatusFlags +ctypedef CUfileDriverControlFlags_t _DriverControlFlags +ctypedef CUfileFeatureFlags_t _FeatureFlags +ctypedef CUfileFileHandleType _FileHandleType +ctypedef CUfileOpcode_t _Opcode +ctypedef CUfileStatus_t _Status +ctypedef CUfileBatchMode_t _BatchMode +ctypedef CUFileSizeTConfigParameter_t _SizeTConfigParameter +ctypedef CUFileBoolConfigParameter_t _BoolConfigParameter +ctypedef CUFileStringConfigParameter_t _StringConfigParameter +ctypedef CUFileArrayConfigParameter_t _ArrayConfigParameter +ctypedef CUfileP2PFlags_t _P2PFlags + + +############################################################################### +# Functions +############################################################################### + +cpdef intptr_t handle_register(intptr_t descr) except? 0 +cpdef void handle_deregister(intptr_t fh) except* +cpdef buf_register(intptr_t buf_ptr_base, size_t length, int flags) +cpdef buf_deregister(intptr_t buf_ptr_base) +cpdef driver_open() +cpdef use_count() +cpdef driver_get_properties(intptr_t props) +cpdef driver_set_poll_mode(bint poll, size_t poll_threshold_size) +cpdef driver_set_max_direct_io_size(size_t max_direct_io_size) +cpdef driver_set_max_cache_size(size_t max_cache_size) +cpdef driver_set_max_pinned_mem_size(size_t max_pinned_size) +cpdef intptr_t batch_io_set_up(unsigned nr) except? 0 +cpdef batch_io_submit(intptr_t batch_idp, unsigned nr, intptr_t iocbp, unsigned int flags) +cpdef batch_io_get_status(intptr_t batch_idp, unsigned min_nr, intptr_t nr, intptr_t iocbp, intptr_t timeout) +cpdef batch_io_cancel(intptr_t batch_idp) +cpdef void batch_io_destroy(intptr_t batch_idp) except* +cpdef read_async(intptr_t fh, intptr_t buf_ptr_base, intptr_t size_p, intptr_t file_offset_p, intptr_t buf_ptr_offset_p, intptr_t bytes_read_p, intptr_t stream) +cpdef write_async(intptr_t fh, intptr_t buf_ptr_base, intptr_t size_p, intptr_t file_offset_p, intptr_t buf_ptr_offset_p, intptr_t bytes_written_p, intptr_t stream) +cpdef stream_register(intptr_t stream, unsigned flags) +cpdef stream_deregister(intptr_t stream) +cpdef int get_version() except? 0 +cpdef size_t get_parameter_size_t(int param) except? 0 +cpdef bint get_parameter_bool(int param) except? 0 +cpdef str get_parameter_string(int param, int len) +cpdef set_parameter_size_t(int param, size_t value) +cpdef set_parameter_bool(int param, bint value) +cpdef set_parameter_string(int param, intptr_t desc_str) +cpdef tuple get_parameter_min_max_value(int param) +cpdef set_stats_level(int level) +cpdef int get_stats_level() except? 0 +cpdef stats_start() +cpdef stats_stop() +cpdef stats_reset() +cpdef get_stats_l1(intptr_t stats) +cpdef get_stats_l2(intptr_t stats) +cpdef get_stats_l3(intptr_t stats) +cpdef size_t get_bar_size_in_kb(int gpu_index) except? 0 +cpdef set_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len) +cpdef get_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len) diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cycudla.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/cycudla.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..c1eaa01d041f073901d067f0442dd737d629772d Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/cycudla.cpython-312-x86_64-linux-gnu.so differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cycudla.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/cycudla.pxd new file mode 100644 index 0000000000000000000000000000000000000000..b8fdec0a2f5fbc6517fe6cc3fa07a245efee270b --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cycudla.pxd @@ -0,0 +1,160 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +# This code was automatically generated across versions from 1.5.0 to 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. +# This layer exposes the C header to Cython as-is. + +from libc.stdint cimport int8_t, int16_t, int32_t, int64_t +from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t +from libc.stdint cimport intptr_t, uintptr_t +from libc.stddef cimport size_t + + + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# enums +ctypedef enum cudlaStatus "cudlaStatus": + cudlaSuccess "cudlaSuccess" = 0 + cudlaErrorInvalidParam "cudlaErrorInvalidParam" = 1 + cudlaErrorOutOfResources "cudlaErrorOutOfResources" = 2 + cudlaErrorCreationFailed "cudlaErrorCreationFailed" = 3 + cudlaErrorInvalidAddress "cudlaErrorInvalidAddress" = 4 + cudlaErrorOs "cudlaErrorOs" = 5 + cudlaErrorCuda "cudlaErrorCuda" = 6 + cudlaErrorUmd "cudlaErrorUmd" = 7 + cudlaErrorInvalidDevice "cudlaErrorInvalidDevice" = 8 + cudlaErrorInvalidAttribute "cudlaErrorInvalidAttribute" = 9 + cudlaErrorIncompatibleDlaSWVersion "cudlaErrorIncompatibleDlaSWVersion" = 10 + cudlaErrorMemoryRegistered "cudlaErrorMemoryRegistered" = 11 + cudlaErrorInvalidModule "cudlaErrorInvalidModule" = 12 + cudlaErrorUnsupportedOperation "cudlaErrorUnsupportedOperation" = 13 + cudlaErrorNvSci "cudlaErrorNvSci" = 14 + cudlaErrorDriverNotFound "cudlaErrorDriverNotFound" = 15 + cudlaErrorDlaErrInvalidInput "cudlaErrorDlaErrInvalidInput" = 0x40000001 + cudlaErrorDlaErrInvalidPreAction "cudlaErrorDlaErrInvalidPreAction" = 0x40000002 + cudlaErrorDlaErrNoMem "cudlaErrorDlaErrNoMem" = 0x40000003 + cudlaErrorDlaErrProcessorBusy "cudlaErrorDlaErrProcessorBusy" = 0x40000004 + cudlaErrorDlaErrTaskStatusMismatch "cudlaErrorDlaErrTaskStatusMismatch" = 0x40000005 + cudlaErrorDlaErrEngineTimeout "cudlaErrorDlaErrEngineTimeout" = 0x40000006 + cudlaErrorDlaErrDataMismatch "cudlaErrorDlaErrDataMismatch" = 0x40000007 + cudlaErrorUnknown "cudlaErrorUnknown" = 0x7fffffff + _CUDLASTATUS_INTERNAL_LOADING_ERROR "_CUDLASTATUS_INTERNAL_LOADING_ERROR" = -42 + +ctypedef enum cudlaMode "cudlaMode": + CUDLA_CUDA_DLA "CUDLA_CUDA_DLA" = 0 + CUDLA_STANDALONE "CUDLA_STANDALONE" = 1 + +ctypedef enum cudlaModuleAttributeType "cudlaModuleAttributeType": + CUDLA_NUM_INPUT_TENSORS "CUDLA_NUM_INPUT_TENSORS" = 0 + CUDLA_NUM_OUTPUT_TENSORS "CUDLA_NUM_OUTPUT_TENSORS" = 1 + CUDLA_INPUT_TENSOR_DESCRIPTORS "CUDLA_INPUT_TENSOR_DESCRIPTORS" = 2 + CUDLA_OUTPUT_TENSOR_DESCRIPTORS "CUDLA_OUTPUT_TENSOR_DESCRIPTORS" = 3 + CUDLA_NUM_OUTPUT_TASK_STATISTICS "CUDLA_NUM_OUTPUT_TASK_STATISTICS" = 4 + CUDLA_OUTPUT_TASK_STATISTICS_DESCRIPTORS "CUDLA_OUTPUT_TASK_STATISTICS_DESCRIPTORS" = 5 + +ctypedef enum cudlaFenceType "cudlaFenceType": + CUDLA_NVSCISYNC_FENCE "CUDLA_NVSCISYNC_FENCE" = 1 + CUDLA_NVSCISYNC_FENCE_SOF "CUDLA_NVSCISYNC_FENCE_SOF" = 2 + +ctypedef enum cudlaModuleLoadFlags "cudlaModuleLoadFlags": + CUDLA_MODULE_DEFAULT "CUDLA_MODULE_DEFAULT" = 0 + CUDLA_MODULE_ENABLE_FAULT_DIAGNOSTICS "CUDLA_MODULE_ENABLE_FAULT_DIAGNOSTICS" = 1 + +ctypedef enum cudlaSubmissionFlags "cudlaSubmissionFlags": + CUDLA_SUBMIT_NOOP "CUDLA_SUBMIT_NOOP" = 1 + CUDLA_SUBMIT_SKIP_LOCK_ACQUIRE "CUDLA_SUBMIT_SKIP_LOCK_ACQUIRE" = (1 << 1) + CUDLA_SUBMIT_DIAGNOSTICS_TASK "CUDLA_SUBMIT_DIAGNOSTICS_TASK" = (1 << 2) + +ctypedef enum cudlaAccessPermissionFlags "cudlaAccessPermissionFlags": + CUDLA_READ_WRITE_PERM "CUDLA_READ_WRITE_PERM" = 0 + CUDLA_READ_ONLY_PERM "CUDLA_READ_ONLY_PERM" = 1 + CUDLA_TASK_STATISTICS "CUDLA_TASK_STATISTICS" = (1 << 1) + +ctypedef enum cudlaDevAttributeType "cudlaDevAttributeType": + CUDLA_UNIFIED_ADDRESSING "CUDLA_UNIFIED_ADDRESSING" = 0 + CUDLA_DEVICE_VERSION "CUDLA_DEVICE_VERSION" = 1 + +# types +ctypedef void* cudlaDevHandle 'cudlaDevHandle' + +ctypedef void* cudlaModule 'cudlaModule' + +ctypedef struct cudlaExternalMemoryHandleDesc_t 'cudlaExternalMemoryHandleDesc_t': + void* extBufObject + unsigned long long size + +ctypedef struct cudlaExternalSemaphoreHandleDesc_t 'cudlaExternalSemaphoreHandleDesc_t': + void* extSyncObject + +ctypedef struct cudlaModuleTensorDescriptor 'cudlaModuleTensorDescriptor': + char name[(80U + 1)] + uint64_t size + uint64_t n + uint64_t c + uint64_t h + uint64_t w + uint8_t dataFormat + uint8_t dataType + uint8_t dataCategory + uint8_t pixelFormat + uint8_t pixelMapping + uint32_t stride[8U] + +ctypedef struct CudlaFence 'CudlaFence': + void* fence + cudlaFenceType type + +ctypedef union cudlaDevAttribute 'cudlaDevAttribute': + uint8_t unifiedAddressingSupported + uint32_t deviceVersion + +ctypedef union cudlaModuleAttribute 'cudlaModuleAttribute': + uint32_t numInputTensors + uint32_t numOutputTensors + cudlaModuleTensorDescriptor* inputTensorDesc + cudlaModuleTensorDescriptor* outputTensorDesc + +ctypedef struct cudlaWaitEvents 'cudlaWaitEvents': + CudlaFence* preFences + uint32_t numEvents + +ctypedef struct cudlaSignalEvents 'cudlaSignalEvents': + uint64_t** devPtrs + CudlaFence* eofFences + uint32_t numEvents + +ctypedef struct cudlaTask 'cudlaTask': + cudlaModule moduleHandle + uint64_t** outputTensor + uint32_t numOutputTensors + uint32_t numInputTensors + uint64_t** inputTensor + cudlaWaitEvents* waitEvents + cudlaSignalEvents* signalEvents + +# Typedef aliases for struct types (struct has _t, typedef doesn't) +ctypedef cudlaExternalMemoryHandleDesc_t cudlaExternalMemoryHandleDesc 'cudlaExternalMemoryHandleDesc' +ctypedef cudlaExternalSemaphoreHandleDesc_t cudlaExternalSemaphoreHandleDesc 'cudlaExternalSemaphoreHandleDesc' + + +############################################################################### +# Functions +############################################################################### + +cdef cudlaStatus cudlaGetVersion(uint64_t* const version) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaDeviceGetCount(uint64_t* const pNumDevices) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaCreateDevice(const uint64_t device, cudlaDevHandle* const devHandle, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaMemRegister(const cudlaDevHandle devHandle, const uint64_t* const ptr, const size_t size, uint64_t** const devPtr, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaModuleLoadFromMemory(const cudlaDevHandle devHandle, const uint8_t* const pModule, const size_t moduleSize, cudlaModule* const hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaModuleGetAttributes(const cudlaModule hModule, const cudlaModuleAttributeType attrType, cudlaModuleAttribute* const attribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaModuleUnload(const cudlaModule hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaSubmitTask(const cudlaDevHandle devHandle, const cudlaTask* const ptrToTasks, const uint32_t numTasks, void* const stream, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaDeviceGetAttribute(const cudlaDevHandle devHandle, const cudlaDevAttributeType attrib, cudlaDevAttribute* const pAttribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaMemUnregister(const cudlaDevHandle devHandle, const uint64_t* const devPtr) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaGetLastError(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaDestroyDevice(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaSetTaskTimeoutInMs(const cudlaDevHandle devHandle, const uint32_t timeout) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cycufile.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/cycufile.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..16dfbc21574ff988a7d35f839120771b2f5fc2eb Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/cycufile.cpython-312-x86_64-linux-gnu.so differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cycufile.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/cycufile.pxd new file mode 100644 index 0000000000000000000000000000000000000000..bdbfc8e9a46df93277a61f330448e8f7af9a1cea --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cycufile.pxd @@ -0,0 +1,432 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. + +from libc.stdint cimport uint32_t, uint64_t +from libc.time cimport time_t +from libcpp cimport bool as cpp_bool +from posix.types cimport off_t + +cimport cuda.bindings.cydriver +from cuda.bindings.cydriver cimport CUresult + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# TODO: switch to "from libc.time cimport timespec" once we can use recent +# Cython to build +cdef extern from "": + cdef struct timespec: + time_t tv_sec + long tv_nsec +cdef extern from "": + cdef struct sockaddr: + unsigned short sa_family + char sa_data[14] + ctypedef sockaddr sockaddr_t + + + + + # enums +cdef extern from '': + ctypedef enum CUfileOpError: + CU_FILE_SUCCESS + CU_FILE_DRIVER_NOT_INITIALIZED + CU_FILE_DRIVER_INVALID_PROPS + CU_FILE_DRIVER_UNSUPPORTED_LIMIT + CU_FILE_DRIVER_VERSION_MISMATCH + CU_FILE_DRIVER_VERSION_READ_ERROR + CU_FILE_DRIVER_CLOSING + CU_FILE_PLATFORM_NOT_SUPPORTED + CU_FILE_IO_NOT_SUPPORTED + CU_FILE_DEVICE_NOT_SUPPORTED + CU_FILE_NVFS_DRIVER_ERROR + CU_FILE_CUDA_DRIVER_ERROR + CU_FILE_CUDA_POINTER_INVALID + CU_FILE_CUDA_MEMORY_TYPE_INVALID + CU_FILE_CUDA_POINTER_RANGE_ERROR + CU_FILE_CUDA_CONTEXT_MISMATCH + CU_FILE_INVALID_MAPPING_SIZE + CU_FILE_INVALID_MAPPING_RANGE + CU_FILE_INVALID_FILE_TYPE + CU_FILE_INVALID_FILE_OPEN_FLAG + CU_FILE_DIO_NOT_SET + CU_FILE_INVALID_VALUE + CU_FILE_MEMORY_ALREADY_REGISTERED + CU_FILE_MEMORY_NOT_REGISTERED + CU_FILE_PERMISSION_DENIED + CU_FILE_DRIVER_ALREADY_OPEN + CU_FILE_HANDLE_NOT_REGISTERED + CU_FILE_HANDLE_ALREADY_REGISTERED + CU_FILE_DEVICE_NOT_FOUND + CU_FILE_INTERNAL_ERROR + CU_FILE_GETNEWFD_FAILED + CU_FILE_NVFS_SETUP_ERROR + CU_FILE_IO_DISABLED + CU_FILE_BATCH_SUBMIT_FAILED + CU_FILE_GPU_MEMORY_PINNING_FAILED + CU_FILE_BATCH_FULL + CU_FILE_ASYNC_NOT_SUPPORTED + CU_FILE_INTERNAL_BATCH_SETUP_ERROR + CU_FILE_INTERNAL_BATCH_SUBMIT_ERROR + CU_FILE_INTERNAL_BATCH_GETSTATUS_ERROR + CU_FILE_INTERNAL_BATCH_CANCEL_ERROR + CU_FILE_NOMEM_ERROR + CU_FILE_IO_ERROR + CU_FILE_INTERNAL_BUF_REGISTER_ERROR + CU_FILE_HASH_OPR_ERROR + CU_FILE_INVALID_CONTEXT_ERROR + CU_FILE_NVFS_INTERNAL_DRIVER_ERROR + CU_FILE_BATCH_NOCOMPAT_ERROR + CU_FILE_IO_MAX_ERROR + +cdef extern from '': + ctypedef enum CUfileDriverStatusFlags_t: + CU_FILE_LUSTRE_SUPPORTED + CU_FILE_WEKAFS_SUPPORTED + CU_FILE_NFS_SUPPORTED + CU_FILE_GPFS_SUPPORTED + CU_FILE_NVME_SUPPORTED + CU_FILE_NVMEOF_SUPPORTED + CU_FILE_SCSI_SUPPORTED + CU_FILE_SCALEFLUX_CSD_SUPPORTED + CU_FILE_NVMESH_SUPPORTED + CU_FILE_BEEGFS_SUPPORTED + CU_FILE_NVME_P2P_SUPPORTED + CU_FILE_SCATEFS_SUPPORTED + CU_FILE_VIRTIOFS_SUPPORTED + CU_FILE_MAX_TARGET_TYPES + +cdef extern from '': + ctypedef enum CUfileDriverControlFlags_t: + CU_FILE_USE_POLL_MODE + CU_FILE_ALLOW_COMPAT_MODE + CU_FILE_POSIX_IO_MODE + CU_FILE_FALLBACK_IO_MODE + +cdef extern from '': + ctypedef enum CUfileFeatureFlags_t: + CU_FILE_DYN_ROUTING_SUPPORTED + CU_FILE_BATCH_IO_SUPPORTED + CU_FILE_STREAMS_SUPPORTED + CU_FILE_PARALLEL_IO_SUPPORTED + CU_FILE_P2P_SUPPORTED + +cdef extern from '': + ctypedef enum CUfileFileHandleType: + CU_FILE_HANDLE_TYPE_OPAQUE_FD + CU_FILE_HANDLE_TYPE_OPAQUE_WIN32 + CU_FILE_HANDLE_TYPE_USERSPACE_FS + +cdef extern from '': + ctypedef enum CUfileOpcode_t: + CUFILE_READ + CUFILE_WRITE + +cdef extern from '': + ctypedef enum CUfileStatus_t: + CUFILE_WAITING + CUFILE_PENDING + CUFILE_INVALID + CUFILE_CANCELED + CUFILE_COMPLETE + CUFILE_TIMEOUT + CUFILE_FAILED + +cdef extern from '': + ctypedef enum CUfileBatchMode_t: + CUFILE_BATCH + +cdef extern from '': + ctypedef enum CUFileSizeTConfigParameter_t: + CUFILE_PARAM_PROFILE_STATS + CUFILE_PARAM_EXECUTION_MAX_IO_QUEUE_DEPTH + CUFILE_PARAM_EXECUTION_MAX_IO_THREADS + CUFILE_PARAM_EXECUTION_MIN_IO_THRESHOLD_SIZE_KB + CUFILE_PARAM_EXECUTION_MAX_REQUEST_PARALLELISM + CUFILE_PARAM_PROPERTIES_MAX_DIRECT_IO_SIZE_KB + CUFILE_PARAM_PROPERTIES_MAX_DEVICE_CACHE_SIZE_KB + CUFILE_PARAM_PROPERTIES_PER_BUFFER_CACHE_SIZE_KB + CUFILE_PARAM_PROPERTIES_MAX_DEVICE_PINNED_MEM_SIZE_KB + CUFILE_PARAM_PROPERTIES_IO_BATCHSIZE + CUFILE_PARAM_POLLTHRESHOLD_SIZE_KB + CUFILE_PARAM_PROPERTIES_BATCH_IO_TIMEOUT_MS + +cdef extern from '': + ctypedef enum CUFileBoolConfigParameter_t: + CUFILE_PARAM_PROPERTIES_USE_POLL_MODE + CUFILE_PARAM_PROPERTIES_ALLOW_COMPAT_MODE + CUFILE_PARAM_FORCE_COMPAT_MODE + CUFILE_PARAM_FS_MISC_API_CHECK_AGGRESSIVE + CUFILE_PARAM_EXECUTION_PARALLEL_IO + CUFILE_PARAM_PROFILE_NVTX + CUFILE_PARAM_PROPERTIES_ALLOW_SYSTEM_MEMORY + CUFILE_PARAM_USE_PCIP2PDMA + CUFILE_PARAM_PREFER_IO_URING + CUFILE_PARAM_FORCE_ODIRECT_MODE + CUFILE_PARAM_SKIP_TOPOLOGY_DETECTION + CUFILE_PARAM_STREAM_MEMOPS_BYPASS + +cdef extern from '': + ctypedef enum CUFileStringConfigParameter_t: + CUFILE_PARAM_LOGGING_LEVEL + CUFILE_PARAM_ENV_LOGFILE_PATH + CUFILE_PARAM_LOG_DIR + +cdef extern from '': + ctypedef enum CUFileArrayConfigParameter_t: + CUFILE_PARAM_POSIX_POOL_SLAB_SIZE_KB + CUFILE_PARAM_POSIX_POOL_SLAB_COUNT + CUFILE_PARAM_GPU_BOUNCE_BUFFER_SLAB_SIZE_KB + CUFILE_PARAM_GPU_BOUNCE_BUFFER_SLAB_COUNT + +cdef extern from '': + ctypedef enum CUfileP2PFlags_t: + CUFILE_P2PDMA + CUFILE_NVFS + CUFILE_DMABUF + CUFILE_C2C + CUFILE_NVIDIA_PEERMEM + + # types +cdef extern from '': + ctypedef void* CUfileHandle_t 'CUfileHandle_t' + + +cdef extern from '': + ctypedef void* CUfileBatchHandle_t 'CUfileBatchHandle_t' + + +cdef extern from '': + ctypedef struct CUfileError_t 'CUfileError_t': + CUfileOpError err + CUresult cu_err + +cdef struct cuda_bindings_cufile__anon_pod0: + unsigned int major_version + unsigned int minor_version + size_t poll_thresh_size + size_t max_direct_io_size + unsigned int dstatusflags + unsigned int dcontrolflags + +cdef extern from '': + ctypedef struct cufileRDMAInfo_t 'cufileRDMAInfo_t': + int version + int desc_len + char* desc_str + +cdef extern from '': + ctypedef struct CUfileFSOps_t 'CUfileFSOps_t': + char* (*fs_type)(const void*) + int (*getRDMADeviceList)(const void*, sockaddr_t**) + int (*getRDMADevicePriority)(const void*, char*, size_t, loff_t, const sockaddr_t*) + ssize_t (*read)(const void*, char*, size_t, loff_t, const cufileRDMAInfo_t*) + ssize_t (*write)(const void*, const char*, size_t, loff_t, const cufileRDMAInfo_t*) + +cdef union cuda_bindings_cufile__anon_pod1: + int fd + void* handle + +cdef struct cuda_bindings_cufile__anon_pod3: + void* devPtr_base + off_t file_offset + off_t devPtr_offset + size_t size + +cdef extern from '': + ctypedef struct CUfileIOEvents_t 'CUfileIOEvents_t': + void* cookie + CUfileStatus_t status + size_t ret + +cdef extern from '': + ctypedef struct CUfileOpCounter_t 'CUfileOpCounter_t': + uint64_t ok + uint64_t err + +cdef extern from '': + ctypedef struct CUfilePerGpuStats_t 'CUfilePerGpuStats_t': + char uuid[16] + uint64_t read_bytes + uint64_t read_bw_bytes_per_sec + uint64_t read_utilization + uint64_t read_duration_us + uint64_t n_total_reads + uint64_t n_p2p_reads + uint64_t n_nvfs_reads + uint64_t n_posix_reads + uint64_t n_unaligned_reads + uint64_t n_dr_reads + uint64_t n_sparse_regions + uint64_t n_inline_regions + uint64_t n_reads_err + uint64_t writes_bytes + uint64_t write_bw_bytes_per_sec + uint64_t write_utilization + uint64_t write_duration_us + uint64_t n_total_writes + uint64_t n_p2p_writes + uint64_t n_nvfs_writes + uint64_t n_posix_writes + uint64_t n_unaligned_writes + uint64_t n_dr_writes + uint64_t n_writes_err + uint64_t n_mmap + uint64_t n_mmap_ok + uint64_t n_mmap_err + uint64_t n_mmap_free + uint64_t reg_bytes + +cdef extern from '': + ctypedef struct CUfileDrvProps_t 'CUfileDrvProps_t': + cuda_bindings_cufile__anon_pod0 nvfs + unsigned int fflags + unsigned int max_device_cache_size + unsigned int per_buffer_cache_size + unsigned int max_device_pinned_mem_size + unsigned int max_batch_io_size + unsigned int max_batch_io_timeout_msecs + +cdef extern from '': + ctypedef struct CUfileDescr_t 'CUfileDescr_t': + CUfileFileHandleType type + cuda_bindings_cufile__anon_pod1 handle + CUfileFSOps_t* fs_ops + +cdef union cuda_bindings_cufile__anon_pod2: + cuda_bindings_cufile__anon_pod3 batch + +cdef extern from '': + ctypedef struct CUfileStatsLevel1_t 'CUfileStatsLevel1_t': + CUfileOpCounter_t read_ops + CUfileOpCounter_t write_ops + CUfileOpCounter_t hdl_register_ops + CUfileOpCounter_t hdl_deregister_ops + CUfileOpCounter_t buf_register_ops + CUfileOpCounter_t buf_deregister_ops + uint64_t read_bytes + uint64_t write_bytes + uint64_t read_bw_bytes_per_sec + uint64_t write_bw_bytes_per_sec + uint64_t read_lat_avg_us + uint64_t write_lat_avg_us + uint64_t read_ops_per_sec + uint64_t write_ops_per_sec + uint64_t read_lat_sum_us + uint64_t write_lat_sum_us + CUfileOpCounter_t batch_submit_ops + CUfileOpCounter_t batch_complete_ops + CUfileOpCounter_t batch_setup_ops + CUfileOpCounter_t batch_cancel_ops + CUfileOpCounter_t batch_destroy_ops + CUfileOpCounter_t batch_enqueued_ops + CUfileOpCounter_t batch_posix_enqueued_ops + CUfileOpCounter_t batch_processed_ops + CUfileOpCounter_t batch_posix_processed_ops + CUfileOpCounter_t batch_nvfs_submit_ops + CUfileOpCounter_t batch_p2p_submit_ops + CUfileOpCounter_t batch_aio_submit_ops + CUfileOpCounter_t batch_iouring_submit_ops + CUfileOpCounter_t batch_mixed_io_submit_ops + CUfileOpCounter_t batch_total_submit_ops + uint64_t batch_read_bytes + uint64_t batch_write_bytes + uint64_t batch_read_bw_bytes + uint64_t batch_write_bw_bytes + uint64_t batch_submit_lat_avg_us + uint64_t batch_completion_lat_avg_us + uint64_t batch_submit_ops_per_sec + uint64_t batch_complete_ops_per_sec + uint64_t batch_submit_lat_sum_us + uint64_t batch_completion_lat_sum_us + uint64_t last_batch_read_bytes + uint64_t last_batch_write_bytes + +cdef extern from '': + ctypedef struct CUfileIOParams_t 'CUfileIOParams_t': + CUfileBatchMode_t mode + cuda_bindings_cufile__anon_pod2 u + CUfileHandle_t fh + CUfileOpcode_t opcode + void* cookie + +cdef extern from '': + ctypedef struct CUfileStatsLevel2_t 'CUfileStatsLevel2_t': + CUfileStatsLevel1_t basic + uint64_t read_size_kb_hist[32] + uint64_t write_size_kb_hist[32] + +cdef extern from '': + ctypedef struct CUfileStatsLevel3_t 'CUfileStatsLevel3_t': + CUfileStatsLevel2_t detailed + uint32_t num_gpus + CUfilePerGpuStats_t per_gpu_stats[16] + + +cdef extern from *: + """ + // This is the missing piece we need to supply to help Cython & C++ compilers. + inline bool operator==(const CUfileError_t& lhs, const CUfileError_t& rhs) { + return (lhs.err == rhs.err) && (lhs.cu_err == rhs.cu_err); + } + static CUfileError_t CUFILE_LOADING_ERROR{(CUfileOpError)-1, (CUresult)-1}; + """ + const CUfileError_t CUFILE_LOADING_ERROR + ctypedef void* CUstream "CUstream" + + const char* cufileop_status_error(CUfileOpError) + + +############################################################################### +# Functions +############################################################################### + +cdef CUfileError_t cuFileHandleRegister(CUfileHandle_t* fh, CUfileDescr_t* descr) except?CUFILE_LOADING_ERROR nogil +cdef void cuFileHandleDeregister(CUfileHandle_t fh) except* nogil +cdef CUfileError_t cuFileBufRegister(const void* bufPtr_base, size_t length, int flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileBufDeregister(const void* bufPtr_base) except?CUFILE_LOADING_ERROR nogil +cdef ssize_t cuFileRead(CUfileHandle_t fh, void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil +cdef ssize_t cuFileWrite(CUfileHandle_t fh, const void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil +cdef CUfileError_t cuFileDriverOpen() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverClose_v2() except?CUFILE_LOADING_ERROR nogil +cdef long cuFileUseCount() except* nogil +cdef CUfileError_t cuFileDriverGetProperties(CUfileDrvProps_t* props) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverSetPollMode(cpp_bool poll, size_t poll_threshold_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverSetMaxCacheSize(size_t max_cache_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileBatchIOSetUp(CUfileBatchHandle_t* batch_idp, unsigned nr) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileBatchIOSubmit(CUfileBatchHandle_t batch_idp, unsigned nr, CUfileIOParams_t* iocbp, unsigned int flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileBatchIOGetStatus(CUfileBatchHandle_t batch_idp, unsigned min_nr, unsigned* nr, CUfileIOEvents_t* iocbp, timespec* timeout) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileBatchIOCancel(CUfileBatchHandle_t batch_idp) except?CUFILE_LOADING_ERROR nogil +cdef void cuFileBatchIODestroy(CUfileBatchHandle_t batch_idp) except* nogil +cdef CUfileError_t cuFileReadAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_read_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileWriteAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_written_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileStreamRegister(CUstream stream, unsigned flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileStreamDeregister(CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetVersion(int* version) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t* value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool* value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetParameterString(CUFileStringConfigParameter_t param, char* desc_str, int len) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileSetStatsLevel(int level) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetStatsLevel(int* level) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileStatsStart() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileStatsStop() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileStatsReset() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetStatsL1(CUfileStatsLevel1_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetStatsL2(CUfileStatsLevel2_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetStatsL3(CUfileStatsLevel3_t* stats) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetBARSizeInKB(int gpuIndex, size_t* barSize) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileSetParameterPosixPoolSlabArray(const size_t* size_values, const size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetParameterPosixPoolSlabArray(size_t* size_values, size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cydriver.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/cydriver.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..0d543846b9eee9d9681714b78756b1f35f79daa0 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cydriver.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2999fc786f5fa8629c79a9eb1754b2260dfa89c801c62af58dc474e49efa6437 +size 166688 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cydriver.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/cydriver.pxd new file mode 100644 index 0000000000000000000000000000000000000000..9fec422ca1cf2486c390239dbf5cf1d723ce568a --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cydriver.pxd @@ -0,0 +1,4029 @@ +# 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 13.3.0, generator version 0.3.1.dev1711+g875fec45. Do not modify it directly. + +from libc.stdint cimport uint32_t, uint64_t + +cdef extern from "cuda.h": + + ctypedef uint32_t cuuint32_t + + ctypedef uint64_t cuuint64_t + + ctypedef unsigned long long CUdeviceptr_v2 + + ctypedef CUdeviceptr_v2 CUdeviceptr + + ctypedef int CUdevice_v1 + + ctypedef CUdevice_v1 CUdevice + + cdef struct CUctx_st: + pass + ctypedef CUctx_st* CUcontext + + cdef struct CUmod_st: + pass + ctypedef CUmod_st* CUmodule + + cdef struct CUfunc_st: + pass + ctypedef CUfunc_st* CUfunction + + cdef struct CUlib_st: + pass + ctypedef CUlib_st* CUlibrary + + cdef struct CUkern_st: + pass + ctypedef CUkern_st* CUkernel + + cdef struct CUarray_st: + pass + ctypedef CUarray_st* CUarray + + cdef struct CUmipmappedArray_st: + pass + ctypedef CUmipmappedArray_st* CUmipmappedArray + + cdef struct CUtexref_st: + pass + ctypedef CUtexref_st* CUtexref + + cdef struct CUsurfref_st: + pass + ctypedef CUsurfref_st* CUsurfref + + cdef struct CUevent_st: + pass + ctypedef CUevent_st* CUevent + + cdef struct CUstream_st: + pass + ctypedef CUstream_st* CUstream + + cdef struct CUgraphicsResource_st: + pass + ctypedef CUgraphicsResource_st* CUgraphicsResource + + ctypedef unsigned long long CUtexObject_v1 + + ctypedef CUtexObject_v1 CUtexObject + + ctypedef unsigned long long CUsurfObject_v1 + + ctypedef CUsurfObject_v1 CUsurfObject + + cdef struct CUextMemory_st: + pass + ctypedef CUextMemory_st* CUexternalMemory + + cdef struct CUextSemaphore_st: + pass + ctypedef CUextSemaphore_st* CUexternalSemaphore + + cdef struct CUgraph_st: + pass + ctypedef CUgraph_st* CUgraph + + cdef struct CUgraphNode_st: + pass + ctypedef CUgraphNode_st* CUgraphNode + + cdef struct CUgraphExec_st: + pass + ctypedef CUgraphExec_st* CUgraphExec + + cdef struct CUmemPoolHandle_st: + pass + ctypedef CUmemPoolHandle_st* CUmemoryPool + + cdef struct CUuserObject_st: + pass + ctypedef CUuserObject_st* CUuserObject + + ctypedef cuuint64_t CUgraphConditionalHandle + + cdef struct CUgraphDeviceUpdatableNode_st: + pass + ctypedef CUgraphDeviceUpdatableNode_st* CUgraphDeviceNode + + cdef struct CUasyncCallbackEntry_st: + pass + ctypedef CUasyncCallbackEntry_st* CUasyncCallbackHandle + + cdef struct CUgreenCtx_st: + pass + ctypedef CUgreenCtx_st* CUgreenCtx + + cdef struct CUuuid_st: + char bytes[16] + + ctypedef CUuuid_st CUuuid + + cdef struct CUmemFabricHandle_st: + unsigned char data[64] + + ctypedef CUmemFabricHandle_st CUmemFabricHandle_v1 + + ctypedef CUmemFabricHandle_v1 CUmemFabricHandle + + cdef struct CUipcEventHandle_st: + char reserved[64] + + ctypedef CUipcEventHandle_st CUipcEventHandle_v1 + + ctypedef CUipcEventHandle_v1 CUipcEventHandle + + cdef struct CUipcMemHandle_st: + char reserved[64] + + ctypedef CUipcMemHandle_st CUipcMemHandle_v1 + + ctypedef CUipcMemHandle_v1 CUipcMemHandle + + cdef enum CUipcMem_flags_enum: + CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 1 + + ctypedef CUipcMem_flags_enum CUipcMem_flags + + cdef enum CUmemAttach_flags_enum: + CU_MEM_ATTACH_GLOBAL = 1 + CU_MEM_ATTACH_HOST = 2 + CU_MEM_ATTACH_SINGLE = 4 + + ctypedef CUmemAttach_flags_enum CUmemAttach_flags + + cdef enum CUctx_flags_enum: + CU_CTX_SCHED_AUTO = 0 + CU_CTX_SCHED_SPIN = 1 + CU_CTX_SCHED_YIELD = 2 + CU_CTX_SCHED_BLOCKING_SYNC = 4 + CU_CTX_BLOCKING_SYNC = 4 + CU_CTX_SCHED_MASK = 7 + CU_CTX_MAP_HOST = 8 + CU_CTX_LMEM_RESIZE_TO_MAX = 16 + CU_CTX_COREDUMP_ENABLE = 32 + CU_CTX_USER_COREDUMP_ENABLE = 64 + CU_CTX_SYNC_MEMOPS = 128 + CU_CTX_FLAGS_MASK = 255 + + ctypedef CUctx_flags_enum CUctx_flags + + cdef enum CUevent_sched_flags_enum: + CU_EVENT_SCHED_AUTO = 0 + CU_EVENT_SCHED_SPIN = 1 + CU_EVENT_SCHED_YIELD = 2 + CU_EVENT_SCHED_BLOCKING_SYNC = 4 + + ctypedef CUevent_sched_flags_enum CUevent_sched_flags + + cdef enum cl_event_flags_enum: + NVCL_EVENT_SCHED_AUTO = 0 + NVCL_EVENT_SCHED_SPIN = 1 + NVCL_EVENT_SCHED_YIELD = 2 + NVCL_EVENT_SCHED_BLOCKING_SYNC = 4 + + ctypedef cl_event_flags_enum cl_event_flags + + cdef enum cl_context_flags_enum: + NVCL_CTX_SCHED_AUTO = 0 + NVCL_CTX_SCHED_SPIN = 1 + NVCL_CTX_SCHED_YIELD = 2 + NVCL_CTX_SCHED_BLOCKING_SYNC = 4 + + ctypedef cl_context_flags_enum cl_context_flags + + cdef enum CUhostTaskSyncMode_enum: + CU_HOST_TASK_BLOCKING = 0 + CU_HOST_TASK_SPINWAIT = 1 + + ctypedef CUhostTaskSyncMode_enum CUhostTaskSyncMode + + cdef enum CUstream_flags_enum: + CU_STREAM_DEFAULT = 0 + CU_STREAM_NON_BLOCKING = 1 + + ctypedef CUstream_flags_enum CUstream_flags + + cdef enum CUevent_flags_enum: + CU_EVENT_DEFAULT = 0 + CU_EVENT_BLOCKING_SYNC = 1 + CU_EVENT_DISABLE_TIMING = 2 + CU_EVENT_INTERPROCESS = 4 + + ctypedef CUevent_flags_enum CUevent_flags + + cdef enum CUevent_record_flags_enum: + CU_EVENT_RECORD_DEFAULT = 0 + CU_EVENT_RECORD_EXTERNAL = 1 + + ctypedef CUevent_record_flags_enum CUevent_record_flags + + cdef enum CUevent_wait_flags_enum: + CU_EVENT_WAIT_DEFAULT = 0 + CU_EVENT_WAIT_EXTERNAL = 1 + + ctypedef CUevent_wait_flags_enum CUevent_wait_flags + + cdef enum CUatomicOperation_enum: + CU_ATOMIC_OPERATION_INTEGER_ADD = 0 + CU_ATOMIC_OPERATION_INTEGER_MIN = 1 + CU_ATOMIC_OPERATION_INTEGER_MAX = 2 + CU_ATOMIC_OPERATION_INTEGER_INCREMENT = 3 + CU_ATOMIC_OPERATION_INTEGER_DECREMENT = 4 + CU_ATOMIC_OPERATION_AND = 5 + CU_ATOMIC_OPERATION_OR = 6 + CU_ATOMIC_OPERATION_XOR = 7 + CU_ATOMIC_OPERATION_EXCHANGE = 8 + CU_ATOMIC_OPERATION_CAS = 9 + CU_ATOMIC_OPERATION_FLOAT_ADD = 10 + CU_ATOMIC_OPERATION_FLOAT_MIN = 11 + CU_ATOMIC_OPERATION_FLOAT_MAX = 12 + CU_ATOMIC_OPERATION_MAX = 13 + + ctypedef CUatomicOperation_enum CUatomicOperation + + cdef enum CUatomicOperationCapability_enum: + CU_ATOMIC_CAPABILITY_SIGNED = 1 + CU_ATOMIC_CAPABILITY_UNSIGNED = 2 + CU_ATOMIC_CAPABILITY_REDUCTION = 4 + CU_ATOMIC_CAPABILITY_SCALAR_32 = 8 + CU_ATOMIC_CAPABILITY_SCALAR_64 = 16 + CU_ATOMIC_CAPABILITY_SCALAR_128 = 32 + CU_ATOMIC_CAPABILITY_VECTOR_32x4 = 64 + + ctypedef CUatomicOperationCapability_enum CUatomicOperationCapability + + cdef enum CUstreamWaitValue_flags_enum: + CU_STREAM_WAIT_VALUE_GEQ = 0 + CU_STREAM_WAIT_VALUE_EQ = 1 + CU_STREAM_WAIT_VALUE_AND = 2 + CU_STREAM_WAIT_VALUE_NOR = 3 + CU_STREAM_WAIT_VALUE_FLUSH = 1073741824 + + ctypedef CUstreamWaitValue_flags_enum CUstreamWaitValue_flags + + cdef enum CUstreamWriteValue_flags_enum: + CU_STREAM_WRITE_VALUE_DEFAULT = 0 + CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER = 1 + + ctypedef CUstreamWriteValue_flags_enum CUstreamWriteValue_flags + + cdef enum CUstreamBatchMemOpType_enum: + CU_STREAM_MEM_OP_WAIT_VALUE_32 = 1 + CU_STREAM_MEM_OP_WRITE_VALUE_32 = 2 + CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES = 3 + CU_STREAM_MEM_OP_WAIT_VALUE_64 = 4 + CU_STREAM_MEM_OP_WRITE_VALUE_64 = 5 + CU_STREAM_MEM_OP_BARRIER = 6 + CU_STREAM_MEM_OP_ATOMIC_REDUCTION = 8 + + ctypedef CUstreamBatchMemOpType_enum CUstreamBatchMemOpType + + cdef enum CUstreamMemoryBarrier_flags_enum: + CU_STREAM_MEMORY_BARRIER_TYPE_SYS = 0 + CU_STREAM_MEMORY_BARRIER_TYPE_GPU = 1 + + ctypedef CUstreamMemoryBarrier_flags_enum CUstreamMemoryBarrier_flags + + cdef enum CUstreamAtomicReductionOpType_enum: + CU_STREAM_ATOMIC_REDUCTION_OP_ADD = 0 + CU_STREAM_ATOMIC_REDUCTION_OP_AND = 5 + CU_STREAM_ATOMIC_REDUCTION_OP_OR = 6 + + ctypedef CUstreamAtomicReductionOpType_enum CUstreamAtomicReductionOpType + + cdef enum CUstreamAtomicReductionDataType_enum: + CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_32 = 14 + CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64 = 22 + + ctypedef CUstreamAtomicReductionDataType_enum CUstreamAtomicReductionDataType + + cdef struct CUstreamMemOpWaitValueParams_st: + CUstreamBatchMemOpType operation + CUdeviceptr address + cuuint32_t value + cuuint64_t value64 + unsigned int flags + CUdeviceptr alias + + cdef struct CUstreamMemOpWriteValueParams_st: + CUstreamBatchMemOpType operation + CUdeviceptr address + cuuint32_t value + cuuint64_t value64 + unsigned int flags + CUdeviceptr alias + + cdef struct CUstreamMemOpFlushRemoteWritesParams_st: + CUstreamBatchMemOpType operation + unsigned int flags + + cdef struct CUstreamMemOpMemoryBarrierParams_st: + CUstreamBatchMemOpType operation + unsigned int flags + + cdef struct CUstreamMemOpAtomicReductionParams_st: + CUstreamBatchMemOpType operation + unsigned int flags + CUstreamAtomicReductionOpType reductionOp + CUstreamAtomicReductionDataType dataType + CUdeviceptr address + cuuint64_t value + CUdeviceptr alias + + cdef union CUstreamBatchMemOpParams_union: + CUstreamBatchMemOpType operation + CUstreamMemOpWaitValueParams_st waitValue + CUstreamMemOpWriteValueParams_st writeValue + CUstreamMemOpFlushRemoteWritesParams_st flushRemoteWrites + CUstreamMemOpMemoryBarrierParams_st memoryBarrier + CUstreamMemOpAtomicReductionParams_st atomicReduction + cuuint64_t pad[6] + + ctypedef CUstreamBatchMemOpParams_union CUstreamBatchMemOpParams_v1 + + ctypedef CUstreamBatchMemOpParams_v1 CUstreamBatchMemOpParams + + cdef struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: + CUcontext ctx + unsigned int count + CUstreamBatchMemOpParams* paramArray + unsigned int flags + + ctypedef CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 + + ctypedef CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 CUDA_BATCH_MEM_OP_NODE_PARAMS + + cdef struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: + CUcontext ctx + unsigned int count + CUstreamBatchMemOpParams* paramArray + unsigned int flags + + ctypedef CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 + + cdef enum CUoccupancy_flags_enum: + CU_OCCUPANCY_DEFAULT = 0 + CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = 1 + + ctypedef CUoccupancy_flags_enum CUoccupancy_flags + + cdef enum CUstreamUpdateCaptureDependencies_flags_enum: + CU_STREAM_ADD_CAPTURE_DEPENDENCIES = 0 + CU_STREAM_SET_CAPTURE_DEPENDENCIES = 1 + + ctypedef CUstreamUpdateCaptureDependencies_flags_enum CUstreamUpdateCaptureDependencies_flags + + cdef enum CUasyncNotificationType_enum: + CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET = 1 + + ctypedef CUasyncNotificationType_enum CUasyncNotificationType + + cdef struct anon_struct0: + unsigned long long bytesOverBudget + + cdef union anon_union2: + anon_struct0 overBudget + + cdef struct CUasyncNotificationInfo_st: + CUasyncNotificationType type + anon_union2 info + + ctypedef CUasyncNotificationInfo_st CUasyncNotificationInfo + + ctypedef void (*CUasyncCallback)(CUasyncNotificationInfo* info, void* userData, CUasyncCallbackHandle callback) + + cdef enum CUarray_format_enum: + CU_AD_FORMAT_UNSIGNED_INT8 = 1 + CU_AD_FORMAT_UNSIGNED_INT16 = 2 + CU_AD_FORMAT_UNSIGNED_INT32 = 3 + CU_AD_FORMAT_SIGNED_INT8 = 8 + CU_AD_FORMAT_SIGNED_INT16 = 9 + CU_AD_FORMAT_SIGNED_INT32 = 10 + CU_AD_FORMAT_HALF = 16 + CU_AD_FORMAT_FLOAT = 32 + CU_AD_FORMAT_UNORM_INT_101010_2 = 80 + CU_AD_FORMAT_UINT8_PACKED_422 = 81 + CU_AD_FORMAT_UINT8_PACKED_444 = 82 + CU_AD_FORMAT_UINT8_SEMIPLANAR_420 = 83 + CU_AD_FORMAT_UINT16_SEMIPLANAR_420 = 84 + CU_AD_FORMAT_UINT8_SEMIPLANAR_422 = 85 + CU_AD_FORMAT_UINT16_SEMIPLANAR_422 = 86 + CU_AD_FORMAT_UINT8_SEMIPLANAR_444 = 87 + CU_AD_FORMAT_UINT16_SEMIPLANAR_444 = 88 + CU_AD_FORMAT_UINT8_PLANAR_420 = 89 + CU_AD_FORMAT_UINT16_PLANAR_420 = 90 + CU_AD_FORMAT_UINT8_PLANAR_422 = 91 + CU_AD_FORMAT_UINT16_PLANAR_422 = 92 + CU_AD_FORMAT_UINT8_PLANAR_444 = 93 + CU_AD_FORMAT_UINT16_PLANAR_444 = 94 + CU_AD_FORMAT_BC1_UNORM = 145 + CU_AD_FORMAT_BC1_UNORM_SRGB = 146 + CU_AD_FORMAT_BC2_UNORM = 147 + CU_AD_FORMAT_BC2_UNORM_SRGB = 148 + CU_AD_FORMAT_BC3_UNORM = 149 + CU_AD_FORMAT_BC3_UNORM_SRGB = 150 + CU_AD_FORMAT_BC4_UNORM = 151 + CU_AD_FORMAT_BC4_SNORM = 152 + CU_AD_FORMAT_BC5_UNORM = 153 + CU_AD_FORMAT_BC5_SNORM = 154 + CU_AD_FORMAT_BC6H_UF16 = 155 + CU_AD_FORMAT_BC6H_SF16 = 156 + CU_AD_FORMAT_BC7_UNORM = 157 + CU_AD_FORMAT_BC7_UNORM_SRGB = 158 + CU_AD_FORMAT_P010 = 159 + CU_AD_FORMAT_P016 = 161 + CU_AD_FORMAT_NV16 = 162 + CU_AD_FORMAT_P210 = 163 + CU_AD_FORMAT_P216 = 164 + CU_AD_FORMAT_YUY2 = 165 + CU_AD_FORMAT_Y210 = 166 + CU_AD_FORMAT_Y216 = 167 + CU_AD_FORMAT_AYUV = 168 + CU_AD_FORMAT_Y410 = 169 + CU_AD_FORMAT_NV12 = 176 + CU_AD_FORMAT_Y416 = 177 + CU_AD_FORMAT_Y444_PLANAR8 = 178 + CU_AD_FORMAT_Y444_PLANAR10 = 179 + CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 180 + CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 181 + CU_AD_FORMAT_UNORM_INT8X1 = 192 + CU_AD_FORMAT_UNORM_INT8X2 = 193 + CU_AD_FORMAT_UNORM_INT8X4 = 194 + CU_AD_FORMAT_UNORM_INT16X1 = 195 + CU_AD_FORMAT_UNORM_INT16X2 = 196 + CU_AD_FORMAT_UNORM_INT16X4 = 197 + CU_AD_FORMAT_SNORM_INT8X1 = 198 + CU_AD_FORMAT_SNORM_INT8X2 = 199 + CU_AD_FORMAT_SNORM_INT8X4 = 200 + CU_AD_FORMAT_SNORM_INT16X1 = 201 + CU_AD_FORMAT_SNORM_INT16X2 = 202 + CU_AD_FORMAT_SNORM_INT16X4 = 203 + CU_AD_FORMAT_MAX = 2147483647 + + ctypedef CUarray_format_enum CUarray_format + + cdef enum CUaddress_mode_enum: + CU_TR_ADDRESS_MODE_WRAP = 0 + CU_TR_ADDRESS_MODE_CLAMP = 1 + CU_TR_ADDRESS_MODE_MIRROR = 2 + CU_TR_ADDRESS_MODE_BORDER = 3 + + ctypedef CUaddress_mode_enum CUaddress_mode + + cdef enum CUfilter_mode_enum: + CU_TR_FILTER_MODE_POINT = 0 + CU_TR_FILTER_MODE_LINEAR = 1 + + ctypedef CUfilter_mode_enum CUfilter_mode + + cdef enum CUdevice_attribute_enum: + CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1 + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2 + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3 + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = 4 + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 5 + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y = 6 + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z = 7 + CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK = 8 + CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK = 8 + CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY = 9 + CU_DEVICE_ATTRIBUTE_WARP_SIZE = 10 + CU_DEVICE_ATTRIBUTE_MAX_PITCH = 11 + CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK = 12 + CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK = 12 + CU_DEVICE_ATTRIBUTE_CLOCK_RATE = 13 + CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14 + CU_DEVICE_ATTRIBUTE_GPU_OVERLAP = 15 + CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16 + CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT = 17 + CU_DEVICE_ATTRIBUTE_INTEGRATED = 18 + CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY = 19 + CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = 20 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH = 21 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH = 22 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT = 23 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH = 24 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT = 25 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH = 26 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH = 27 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH = 27 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT = 28 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT = 28 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS = 29 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES = 29 + CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT = 30 + CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = 31 + CU_DEVICE_ATTRIBUTE_ECC_ENABLED = 32 + CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = 33 + CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = 34 + CU_DEVICE_ATTRIBUTE_TCC_DRIVER = 35 + CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = 36 + CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH = 37 + CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE = 38 + CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = 39 + CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = 40 + CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = 41 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH = 42 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS = 43 + CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER = 44 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH = 45 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT = 46 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE = 47 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE = 48 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE = 49 + CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = 50 + CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT = 51 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH = 52 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH = 53 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS = 54 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH = 55 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH = 56 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT = 57 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH = 58 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT = 59 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH = 60 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH = 61 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS = 62 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH = 63 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT = 64 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS = 65 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH = 66 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH = 67 + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS = 68 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH = 69 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH = 70 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT = 71 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH = 72 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH = 73 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT = 74 + CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = 75 + CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = 76 + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH = 77 + CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED = 78 + CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED = 79 + CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED = 80 + CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR = 81 + CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR = 82 + CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = 83 + CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = 84 + CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID = 85 + CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED = 86 + CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO = 87 + CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS = 88 + CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS = 89 + CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED = 90 + CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM = 91 + CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS_V1 = 92 + CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS_V1 = 93 + CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V1 = 94 + CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH = 95 + CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH = 96 + CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN = 97 + CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES = 98 + CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED = 99 + CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES = 100 + CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST = 101 + CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED = 102 + CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = 102 + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED = 103 + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED = 104 + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED = 105 + CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR = 106 + CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED = 107 + CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE = 108 + CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE = 109 + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED = 110 + CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK = 111 + CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED = 112 + CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED = 113 + CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED = 114 + CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED = 115 + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED = 116 + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS = 117 + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING = 118 + CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES = 119 + CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH = 120 + CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED = 121 + CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS = 122 + CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR = 123 + CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED = 124 + CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED = 125 + CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT = 126 + CU_DEVICE_ATTRIBUTE_TENSOR_MAP_ACCESS_SUPPORTED = 127 + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED = 128 + CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS = 129 + CU_DEVICE_ATTRIBUTE_NUMA_CONFIG = 130 + CU_DEVICE_ATTRIBUTE_NUMA_ID = 131 + CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED = 132 + CU_DEVICE_ATTRIBUTE_MPS_ENABLED = 133 + CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID = 134 + CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED = 135 + CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK = 136 + CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH = 137 + CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED = 138 + CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID = 139 + CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID = 140 + CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = 141 + CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED = 142 + CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED = 143 + CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED = 144 + CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = 145 + CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED = 146 + CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED = 147 + CU_DEVICE_ATTRIBUTE_ATOMIC_REDUCTION_SUPPORTED = 148 + CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED = 151 + CU_DEVICE_ATTRIBUTE_DMA_BUF_MMAP_SUPPORTED = 152 + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_SUPPORTED = 153 + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_MULTICAST_SUPPORTED = 154 + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_COUNTED_OPS_SUPPORTED = 155 + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_ACCESS_ON_OWNER_DEVICE_SUPPORTED = 156 + CU_DEVICE_ATTRIBUTE_MAX = 157 + + ctypedef CUdevice_attribute_enum CUdevice_attribute + + cdef struct CUdevprop_st: + int maxThreadsPerBlock + int maxThreadsDim[3] + int maxGridSize[3] + int sharedMemPerBlock + int totalConstantMemory + int SIMDWidth + int memPitch + int regsPerBlock + int clockRate + int textureAlign + + ctypedef CUdevprop_st CUdevprop_v1 + + ctypedef CUdevprop_v1 CUdevprop + + cdef enum CUpointer_attribute_enum: + CU_POINTER_ATTRIBUTE_CONTEXT = 1 + CU_POINTER_ATTRIBUTE_MEMORY_TYPE = 2 + CU_POINTER_ATTRIBUTE_DEVICE_POINTER = 3 + CU_POINTER_ATTRIBUTE_HOST_POINTER = 4 + CU_POINTER_ATTRIBUTE_P2P_TOKENS = 5 + CU_POINTER_ATTRIBUTE_SYNC_MEMOPS = 6 + CU_POINTER_ATTRIBUTE_BUFFER_ID = 7 + CU_POINTER_ATTRIBUTE_IS_MANAGED = 8 + CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL = 9 + CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE = 10 + CU_POINTER_ATTRIBUTE_RANGE_START_ADDR = 11 + CU_POINTER_ATTRIBUTE_RANGE_SIZE = 12 + CU_POINTER_ATTRIBUTE_MAPPED = 13 + CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES = 14 + CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE = 15 + CU_POINTER_ATTRIBUTE_ACCESS_FLAGS = 16 + CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE = 17 + CU_POINTER_ATTRIBUTE_MAPPING_SIZE = 18 + CU_POINTER_ATTRIBUTE_MAPPING_BASE_ADDR = 19 + CU_POINTER_ATTRIBUTE_MEMORY_BLOCK_ID = 20 + CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE = 21 + + ctypedef CUpointer_attribute_enum CUpointer_attribute + + cdef enum CUfunction_attribute_enum: + CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 0 + CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES = 1 + CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES = 2 + CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES = 3 + CU_FUNC_ATTRIBUTE_NUM_REGS = 4 + CU_FUNC_ATTRIBUTE_PTX_VERSION = 5 + CU_FUNC_ATTRIBUTE_BINARY_VERSION = 6 + CU_FUNC_ATTRIBUTE_CACHE_MODE_CA = 7 + CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES = 8 + CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 9 + CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET = 10 + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH = 11 + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT = 12 + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH = 13 + CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED = 14 + CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 15 + CU_FUNC_ATTRIBUTE_DEVICE_NODE_UPDATE_SUPPORTED = 16 + CU_FUNC_ATTRIBUTE_MAX = 17 + + ctypedef CUfunction_attribute_enum CUfunction_attribute + + cdef enum CUfunc_cache_enum: + CU_FUNC_CACHE_PREFER_NONE = 0 + CU_FUNC_CACHE_PREFER_SHARED = 1 + CU_FUNC_CACHE_PREFER_L1 = 2 + CU_FUNC_CACHE_PREFER_EQUAL = 3 + + ctypedef CUfunc_cache_enum CUfunc_cache + + cdef enum CUsharedconfig_enum: + CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE = 0 + CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE = 1 + CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE = 2 + + ctypedef CUsharedconfig_enum CUsharedconfig + + cdef enum CUshared_carveout_enum: + CU_SHAREDMEM_CARVEOUT_DEFAULT = -1 + CU_SHAREDMEM_CARVEOUT_MAX_L1 = 0 + CU_SHAREDMEM_CARVEOUT_MAX_SHARED = 100 + + ctypedef CUshared_carveout_enum CUshared_carveout + + cdef enum CUmemorytype_enum: + CU_MEMORYTYPE_HOST = 1 + CU_MEMORYTYPE_DEVICE = 2 + CU_MEMORYTYPE_ARRAY = 3 + CU_MEMORYTYPE_UNIFIED = 4 + + ctypedef CUmemorytype_enum CUmemorytype + + cdef enum CUcomputemode_enum: + CU_COMPUTEMODE_DEFAULT = 0 + CU_COMPUTEMODE_PROHIBITED = 2 + CU_COMPUTEMODE_EXCLUSIVE_PROCESS = 3 + + ctypedef CUcomputemode_enum CUcomputemode + + cdef enum CUmem_advise_enum: + CU_MEM_ADVISE_SET_READ_MOSTLY = 1 + CU_MEM_ADVISE_UNSET_READ_MOSTLY = 2 + CU_MEM_ADVISE_SET_PREFERRED_LOCATION = 3 + CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION = 4 + CU_MEM_ADVISE_SET_ACCESSED_BY = 5 + CU_MEM_ADVISE_UNSET_ACCESSED_BY = 6 + + ctypedef CUmem_advise_enum CUmem_advise + + cdef enum CUmem_range_attribute_enum: + CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY = 1 + CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION = 2 + CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY = 3 + CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION = 4 + CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE = 5 + CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID = 6 + CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE = 7 + CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID = 8 + + ctypedef CUmem_range_attribute_enum CUmem_range_attribute + + cdef enum CUjit_option_enum: + CU_JIT_MAX_REGISTERS = 0 + CU_JIT_THREADS_PER_BLOCK = 1 + CU_JIT_WALL_TIME = 2 + CU_JIT_INFO_LOG_BUFFER = 3 + CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES = 4 + CU_JIT_ERROR_LOG_BUFFER = 5 + CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES = 6 + CU_JIT_OPTIMIZATION_LEVEL = 7 + CU_JIT_TARGET_FROM_CUCONTEXT = 8 + CU_JIT_TARGET = 9 + CU_JIT_FALLBACK_STRATEGY = 10 + CU_JIT_GENERATE_DEBUG_INFO = 11 + CU_JIT_LOG_VERBOSE = 12 + CU_JIT_GENERATE_LINE_INFO = 13 + CU_JIT_CACHE_MODE = 14 + CU_JIT_NEW_SM3X_OPT = 15 + CU_JIT_FAST_COMPILE = 16 + CU_JIT_GLOBAL_SYMBOL_NAMES = 17 + CU_JIT_GLOBAL_SYMBOL_ADDRESSES = 18 + CU_JIT_GLOBAL_SYMBOL_COUNT = 19 + CU_JIT_LTO = 20 + CU_JIT_FTZ = 21 + CU_JIT_PREC_DIV = 22 + CU_JIT_PREC_SQRT = 23 + CU_JIT_FMA = 24 + CU_JIT_REFERENCED_KERNEL_NAMES = 25 + CU_JIT_REFERENCED_KERNEL_COUNT = 26 + CU_JIT_REFERENCED_VARIABLE_NAMES = 27 + CU_JIT_REFERENCED_VARIABLE_COUNT = 28 + CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES = 29 + CU_JIT_POSITION_INDEPENDENT_CODE = 30 + CU_JIT_MIN_CTA_PER_SM = 31 + CU_JIT_MAX_THREADS_PER_BLOCK = 32 + CU_JIT_OVERRIDE_DIRECTIVE_VALUES = 33 + CU_JIT_SPLIT_COMPILE = 34 + CU_JIT_BINARY_LOADER_THREAD_COUNT = 35 + CU_JIT_NUM_OPTIONS = 36 + + ctypedef CUjit_option_enum CUjit_option + + cdef enum CUjit_target_enum: + CU_TARGET_COMPUTE_30 = 30 + CU_TARGET_COMPUTE_32 = 32 + CU_TARGET_COMPUTE_35 = 35 + CU_TARGET_COMPUTE_37 = 37 + CU_TARGET_COMPUTE_50 = 50 + CU_TARGET_COMPUTE_52 = 52 + CU_TARGET_COMPUTE_53 = 53 + CU_TARGET_COMPUTE_60 = 60 + CU_TARGET_COMPUTE_61 = 61 + CU_TARGET_COMPUTE_62 = 62 + CU_TARGET_COMPUTE_70 = 70 + CU_TARGET_COMPUTE_72 = 72 + CU_TARGET_COMPUTE_75 = 75 + CU_TARGET_COMPUTE_80 = 80 + CU_TARGET_COMPUTE_86 = 86 + CU_TARGET_COMPUTE_87 = 87 + CU_TARGET_COMPUTE_89 = 89 + CU_TARGET_COMPUTE_90 = 90 + CU_TARGET_COMPUTE_100 = 100 + CU_TARGET_COMPUTE_103 = 103 + CU_TARGET_COMPUTE_110 = 110 + CU_TARGET_COMPUTE_120 = 120 + CU_TARGET_COMPUTE_121 = 121 + CU_TARGET_COMPUTE_90A = 65626 + CU_TARGET_COMPUTE_100A = 65636 + CU_TARGET_COMPUTE_103A = 65639 + CU_TARGET_COMPUTE_110A = 65646 + CU_TARGET_COMPUTE_120A = 65656 + CU_TARGET_COMPUTE_121A = 65657 + CU_TARGET_COMPUTE_100F = 131172 + CU_TARGET_COMPUTE_103F = 131175 + CU_TARGET_COMPUTE_110F = 131182 + CU_TARGET_COMPUTE_120F = 131192 + CU_TARGET_COMPUTE_121F = 131193 + + ctypedef CUjit_target_enum CUjit_target + + cdef enum CUjit_fallback_enum: + CU_PREFER_PTX = 0 + CU_PREFER_BINARY = 1 + + ctypedef CUjit_fallback_enum CUjit_fallback + + cdef enum CUjit_cacheMode_enum: + CU_JIT_CACHE_OPTION_NONE = 0 + CU_JIT_CACHE_OPTION_CG = 1 + CU_JIT_CACHE_OPTION_CA = 2 + + ctypedef CUjit_cacheMode_enum CUjit_cacheMode + + cdef enum CUjitInputType_enum: + CU_JIT_INPUT_CUBIN = 0 + CU_JIT_INPUT_PTX = 1 + CU_JIT_INPUT_FATBINARY = 2 + CU_JIT_INPUT_OBJECT = 3 + CU_JIT_INPUT_LIBRARY = 4 + CU_JIT_INPUT_NVVM = 5 + CU_JIT_NUM_INPUT_TYPES = 6 + + ctypedef CUjitInputType_enum CUjitInputType + + cdef struct CUlinkState_st: + pass + ctypedef CUlinkState_st* CUlinkState + + cdef enum CUgraphicsRegisterFlags_enum: + CU_GRAPHICS_REGISTER_FLAGS_NONE = 0 + CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY = 1 + CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = 2 + CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = 4 + CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = 8 + + ctypedef CUgraphicsRegisterFlags_enum CUgraphicsRegisterFlags + + cdef enum CUgraphicsMapResourceFlags_enum: + CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0 + CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = 1 + CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 2 + + ctypedef CUgraphicsMapResourceFlags_enum CUgraphicsMapResourceFlags + + cdef enum CUarray_cubemap_face_enum: + CU_CUBEMAP_FACE_POSITIVE_X = 0 + CU_CUBEMAP_FACE_NEGATIVE_X = 1 + CU_CUBEMAP_FACE_POSITIVE_Y = 2 + CU_CUBEMAP_FACE_NEGATIVE_Y = 3 + CU_CUBEMAP_FACE_POSITIVE_Z = 4 + CU_CUBEMAP_FACE_NEGATIVE_Z = 5 + + ctypedef CUarray_cubemap_face_enum CUarray_cubemap_face + + cdef enum CUlimit_enum: + CU_LIMIT_STACK_SIZE = 0 + CU_LIMIT_PRINTF_FIFO_SIZE = 1 + CU_LIMIT_MALLOC_HEAP_SIZE = 2 + CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 3 + CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = 4 + CU_LIMIT_MAX_L2_FETCH_GRANULARITY = 5 + CU_LIMIT_PERSISTING_L2_CACHE_SIZE = 6 + CU_LIMIT_SHMEM_SIZE = 7 + CU_LIMIT_CIG_ENABLED = 8 + CU_LIMIT_CIG_SHMEM_FALLBACK_ENABLED = 9 + CU_LIMIT_MAX = 10 + + ctypedef CUlimit_enum CUlimit + + cdef enum CUresourcetype_enum: + CU_RESOURCE_TYPE_ARRAY = 0 + CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 1 + CU_RESOURCE_TYPE_LINEAR = 2 + CU_RESOURCE_TYPE_PITCH2D = 3 + + ctypedef CUresourcetype_enum CUresourcetype + + ctypedef void (*CUhostFn)(void* userData) + + cdef enum CUaccessProperty_enum: + CU_ACCESS_PROPERTY_NORMAL = 0 + CU_ACCESS_PROPERTY_STREAMING = 1 + CU_ACCESS_PROPERTY_PERSISTING = 2 + + ctypedef CUaccessProperty_enum CUaccessProperty + + cdef struct CUaccessPolicyWindow_st: + void* base_ptr + size_t num_bytes + float hitRatio + CUaccessProperty hitProp + CUaccessProperty missProp + + ctypedef CUaccessPolicyWindow_st CUaccessPolicyWindow_v1 + + ctypedef CUaccessPolicyWindow_v1 CUaccessPolicyWindow + + cdef struct CUDA_KERNEL_NODE_PARAMS_st: + CUfunction func + unsigned int gridDimX + unsigned int gridDimY + unsigned int gridDimZ + unsigned int blockDimX + unsigned int blockDimY + unsigned int blockDimZ + unsigned int sharedMemBytes + void** kernelParams + void** extra + + ctypedef CUDA_KERNEL_NODE_PARAMS_st CUDA_KERNEL_NODE_PARAMS_v1 + + cdef struct CUDA_KERNEL_NODE_PARAMS_v2_st: + CUfunction func + unsigned int gridDimX + unsigned int gridDimY + unsigned int gridDimZ + unsigned int blockDimX + unsigned int blockDimY + unsigned int blockDimZ + unsigned int sharedMemBytes + void** kernelParams + void** extra + CUkernel kern + CUcontext ctx + + ctypedef CUDA_KERNEL_NODE_PARAMS_v2_st CUDA_KERNEL_NODE_PARAMS_v2 + + ctypedef CUDA_KERNEL_NODE_PARAMS_v2 CUDA_KERNEL_NODE_PARAMS + + cdef struct CUDA_KERNEL_NODE_PARAMS_v3_st: + CUfunction func + unsigned int gridDimX + unsigned int gridDimY + unsigned int gridDimZ + unsigned int blockDimX + unsigned int blockDimY + unsigned int blockDimZ + unsigned int sharedMemBytes + void** kernelParams + void** extra + CUkernel kern + CUcontext ctx + + ctypedef CUDA_KERNEL_NODE_PARAMS_v3_st CUDA_KERNEL_NODE_PARAMS_v3 + + cdef struct CUDA_MEMSET_NODE_PARAMS_st: + CUdeviceptr dst + size_t pitch + unsigned int value + unsigned int elementSize + size_t width + size_t height + + ctypedef CUDA_MEMSET_NODE_PARAMS_st CUDA_MEMSET_NODE_PARAMS_v1 + + ctypedef CUDA_MEMSET_NODE_PARAMS_v1 CUDA_MEMSET_NODE_PARAMS + + cdef struct CUDA_MEMSET_NODE_PARAMS_v2_st: + CUdeviceptr dst + size_t pitch + unsigned int value + unsigned int elementSize + size_t width + size_t height + CUcontext ctx + + ctypedef CUDA_MEMSET_NODE_PARAMS_v2_st CUDA_MEMSET_NODE_PARAMS_v2 + + cdef struct CUDA_HOST_NODE_PARAMS_st: + CUhostFn fn + void* userData + + ctypedef CUDA_HOST_NODE_PARAMS_st CUDA_HOST_NODE_PARAMS_v1 + + ctypedef CUDA_HOST_NODE_PARAMS_v1 CUDA_HOST_NODE_PARAMS + + cdef struct CUDA_HOST_NODE_PARAMS_v2_st: + CUhostFn fn + void* userData + unsigned int syncMode + + ctypedef CUDA_HOST_NODE_PARAMS_v2_st CUDA_HOST_NODE_PARAMS_v2 + + cdef enum CUgraphConditionalNodeType_enum: + CU_GRAPH_COND_TYPE_IF = 0 + CU_GRAPH_COND_TYPE_WHILE = 1 + CU_GRAPH_COND_TYPE_SWITCH = 2 + + ctypedef CUgraphConditionalNodeType_enum CUgraphConditionalNodeType + + cdef struct CUDA_CONDITIONAL_NODE_PARAMS: + CUgraphConditionalHandle handle + CUgraphConditionalNodeType type + unsigned int size + CUgraph* phGraph_out + CUcontext ctx + + cdef enum CUgraphNodeType_enum: + CU_GRAPH_NODE_TYPE_KERNEL = 0 + CU_GRAPH_NODE_TYPE_MEMCPY = 1 + CU_GRAPH_NODE_TYPE_MEMSET = 2 + CU_GRAPH_NODE_TYPE_HOST = 3 + CU_GRAPH_NODE_TYPE_GRAPH = 4 + CU_GRAPH_NODE_TYPE_EMPTY = 5 + CU_GRAPH_NODE_TYPE_WAIT_EVENT = 6 + CU_GRAPH_NODE_TYPE_EVENT_RECORD = 7 + CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL = 8 + CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT = 9 + CU_GRAPH_NODE_TYPE_MEM_ALLOC = 10 + CU_GRAPH_NODE_TYPE_MEM_FREE = 11 + CU_GRAPH_NODE_TYPE_BATCH_MEM_OP = 12 + CU_GRAPH_NODE_TYPE_CONDITIONAL = 13 + CU_GRAPH_NODE_TYPE_RESERVED_16 = 16 + + ctypedef CUgraphNodeType_enum CUgraphNodeType + + cdef enum CUgraphDependencyType_enum: + CU_GRAPH_DEPENDENCY_TYPE_DEFAULT = 0 + CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC = 1 + + ctypedef CUgraphDependencyType_enum CUgraphDependencyType + + cdef struct CUgraphEdgeData_st: + unsigned char from_port + unsigned char to_port + unsigned char type + unsigned char reserved[5] + + ctypedef CUgraphEdgeData_st CUgraphEdgeData + + cdef enum CUgraphInstantiateResult_enum: + CUDA_GRAPH_INSTANTIATE_SUCCESS = 0 + CUDA_GRAPH_INSTANTIATE_ERROR = 1 + CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE = 2 + CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED = 3 + CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED = 4 + CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED = 5 + + ctypedef CUgraphInstantiateResult_enum CUgraphInstantiateResult + + cdef struct CUDA_GRAPH_INSTANTIATE_PARAMS_st: + cuuint64_t flags + CUstream hUploadStream + CUgraphNode hErrNode_out + CUgraphInstantiateResult result_out + + ctypedef CUDA_GRAPH_INSTANTIATE_PARAMS_st CUDA_GRAPH_INSTANTIATE_PARAMS + + cdef enum CUsynchronizationPolicy_enum: + CU_SYNC_POLICY_AUTO = 1 + CU_SYNC_POLICY_SPIN = 2 + CU_SYNC_POLICY_YIELD = 3 + CU_SYNC_POLICY_BLOCKING_SYNC = 4 + + ctypedef CUsynchronizationPolicy_enum CUsynchronizationPolicy + + cdef enum CUclusterSchedulingPolicy_enum: + CU_CLUSTER_SCHEDULING_POLICY_DEFAULT = 0 + CU_CLUSTER_SCHEDULING_POLICY_SPREAD = 1 + CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING = 2 + + ctypedef CUclusterSchedulingPolicy_enum CUclusterSchedulingPolicy + + cdef enum CUlaunchMemSyncDomain_enum: + CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT = 0 + CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE = 1 + + ctypedef CUlaunchMemSyncDomain_enum CUlaunchMemSyncDomain + + cdef struct CUlaunchMemSyncDomainMap_st: + unsigned char default_ + unsigned char remote + + ctypedef CUlaunchMemSyncDomainMap_st CUlaunchMemSyncDomainMap + + cdef enum CUlaunchAttributePortableClusterMode_enum: + CU_LAUNCH_PORTABLE_CLUSTER_MODE_DEFAULT = 0 + CU_LAUNCH_PORTABLE_CLUSTER_MODE_REQUIRE_PORTABLE = 1 + CU_LAUNCH_PORTABLE_CLUSTER_MODE_ALLOW_NON_PORTABLE = 2 + + ctypedef CUlaunchAttributePortableClusterMode_enum CUlaunchAttributePortableClusterMode + + cdef enum CUsharedMemoryMode_enum: + CU_SHARED_MEMORY_MODE_DEFAULT = 0 + CU_SHARED_MEMORY_MODE_REQUIRE_PORTABLE = 1 + CU_SHARED_MEMORY_MODE_ALLOW_NON_PORTABLE = 2 + + ctypedef CUsharedMemoryMode_enum CUsharedMemoryMode + + cdef enum CUlaunchAttributeID_enum: + CU_LAUNCH_ATTRIBUTE_IGNORE = 0 + CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1 + CU_LAUNCH_ATTRIBUTE_COOPERATIVE = 2 + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3 + CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION = 4 + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5 + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION = 6 + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT = 7 + CU_LAUNCH_ATTRIBUTE_PRIORITY = 8 + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9 + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN = 10 + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = 11 + CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT = 12 + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13 + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 14 + CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = 16 + CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE = 17 + CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE = 18 + + ctypedef CUlaunchAttributeID_enum CUlaunchAttributeID + + cdef struct anon_struct1: + unsigned int x + unsigned int y + unsigned int z + + cdef struct anon_struct2: + CUevent event + int flags + int triggerAtBlockStart + + cdef struct anon_struct3: + CUevent event + int flags + + cdef struct anon_struct4: + unsigned int x + unsigned int y + unsigned int z + + cdef struct anon_struct5: + int deviceUpdatable + CUgraphDeviceNode devNode + + cdef union CUlaunchAttributeValue_union: + char pad[64] + CUaccessPolicyWindow accessPolicyWindow + int cooperative + CUsynchronizationPolicy syncPolicy + anon_struct1 clusterDim + CUclusterSchedulingPolicy clusterSchedulingPolicyPreference + int programmaticStreamSerializationAllowed + anon_struct2 programmaticEvent + anon_struct3 launchCompletionEvent + int priority + CUlaunchMemSyncDomainMap memSyncDomainMap + CUlaunchMemSyncDomain memSyncDomain + anon_struct4 preferredClusterDim + anon_struct5 deviceUpdatableKernelNode + unsigned int sharedMemCarveout + unsigned int nvlinkUtilCentricScheduling + CUlaunchAttributePortableClusterMode portableClusterSizeMode + CUsharedMemoryMode sharedMemoryMode + + ctypedef CUlaunchAttributeValue_union CUlaunchAttributeValue + + cdef struct CUlaunchAttribute_st: + CUlaunchAttributeID id + CUlaunchAttributeValue value + + ctypedef CUlaunchAttribute_st CUlaunchAttribute + + cdef struct CUlaunchConfig_st: + unsigned int gridDimX + unsigned int gridDimY + unsigned int gridDimZ + unsigned int blockDimX + unsigned int blockDimY + unsigned int blockDimZ + unsigned int sharedMemBytes + CUstream hStream + CUlaunchAttribute* attrs + unsigned int numAttrs + + ctypedef CUlaunchConfig_st CUlaunchConfig + + ctypedef CUlaunchAttributeID CUkernelNodeAttrID + + ctypedef CUlaunchAttributeValue CUkernelNodeAttrValue_v1 + + ctypedef CUkernelNodeAttrValue_v1 CUkernelNodeAttrValue + + cdef enum CUstreamCaptureStatus_enum: + CU_STREAM_CAPTURE_STATUS_NONE = 0 + CU_STREAM_CAPTURE_STATUS_ACTIVE = 1 + CU_STREAM_CAPTURE_STATUS_INVALIDATED = 2 + + ctypedef CUstreamCaptureStatus_enum CUstreamCaptureStatus + + cdef enum CUstreamCaptureMode_enum: + CU_STREAM_CAPTURE_MODE_GLOBAL = 0 + CU_STREAM_CAPTURE_MODE_THREAD_LOCAL = 1 + CU_STREAM_CAPTURE_MODE_RELAXED = 2 + + ctypedef CUstreamCaptureMode_enum CUstreamCaptureMode + + ctypedef CUlaunchAttributeID CUstreamAttrID + + ctypedef CUlaunchAttributeValue CUstreamAttrValue_v1 + + ctypedef CUstreamAttrValue_v1 CUstreamAttrValue + + cdef enum CUdriverProcAddress_flags_enum: + CU_GET_PROC_ADDRESS_DEFAULT = 0 + CU_GET_PROC_ADDRESS_LEGACY_STREAM = 1 + CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM = 2 + + ctypedef CUdriverProcAddress_flags_enum CUdriverProcAddress_flags + + cdef enum CUdriverProcAddressQueryResult_enum: + CU_GET_PROC_ADDRESS_SUCCESS = 0 + CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND = 1 + CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT = 2 + + ctypedef CUdriverProcAddressQueryResult_enum CUdriverProcAddressQueryResult + + cdef enum CUexecAffinityType_enum: + CU_EXEC_AFFINITY_TYPE_SM_COUNT = 0 + CU_EXEC_AFFINITY_TYPE_MAX = 1 + + ctypedef CUexecAffinityType_enum CUexecAffinityType + + cdef struct CUexecAffinitySmCount_st: + unsigned int val + + ctypedef CUexecAffinitySmCount_st CUexecAffinitySmCount_v1 + + ctypedef CUexecAffinitySmCount_v1 CUexecAffinitySmCount + + cdef union anon_union3: + CUexecAffinitySmCount smCount + + cdef struct CUexecAffinityParam_st: + CUexecAffinityType type + anon_union3 param + + ctypedef CUexecAffinityParam_st CUexecAffinityParam_v1 + + ctypedef CUexecAffinityParam_v1 CUexecAffinityParam + + cdef enum CUcigDataType_enum: + CIG_DATA_TYPE_D3D12_COMMAND_QUEUE = 1 + CIG_DATA_TYPE_NV_BLOB = 2 + + ctypedef CUcigDataType_enum CUcigDataType + + cdef struct CUctxCigParam_st: + CUcigDataType sharedDataType + void* sharedData + + ctypedef CUctxCigParam_st CUctxCigParam + + cdef struct CUctxCreateParams_st: + CUexecAffinityParam* execAffinityParams + int numExecAffinityParams + CUctxCigParam* cigParams + + ctypedef CUctxCreateParams_st CUctxCreateParams + + cdef enum CUstreamCigDataType_enum: + STREAM_CIG_DATA_TYPE_D3D12_COMMAND_LIST = 1 + + ctypedef CUstreamCigDataType_enum CUstreamCigDataType + + cdef struct CUstreamCigParam_st: + CUstreamCigDataType streamSharedDataType + void* streamSharedData + + ctypedef CUstreamCigParam_st CUstreamCigParam + + cdef struct CUstreamCigCaptureParams_st: + CUstreamCigParam* streamCigParams + + ctypedef CUstreamCigCaptureParams_st CUstreamCigCaptureParams + + cdef enum CUlibraryOption_enum: + CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE = 0 + CU_LIBRARY_BINARY_IS_PRESERVED = 1 + CU_LIBRARY_NUM_OPTIONS = 2 + + ctypedef CUlibraryOption_enum CUlibraryOption + + cdef struct CUlibraryHostUniversalFunctionAndDataTable_st: + void* functionTable + size_t functionWindowSize + void* dataTable + size_t dataWindowSize + + ctypedef CUlibraryHostUniversalFunctionAndDataTable_st CUlibraryHostUniversalFunctionAndDataTable + + cdef enum cudaError_enum: + CUDA_SUCCESS = 0 + CUDA_ERROR_INVALID_VALUE = 1 + CUDA_ERROR_OUT_OF_MEMORY = 2 + CUDA_ERROR_NOT_INITIALIZED = 3 + CUDA_ERROR_DEINITIALIZED = 4 + CUDA_ERROR_PROFILER_DISABLED = 5 + CUDA_ERROR_PROFILER_NOT_INITIALIZED = 6 + CUDA_ERROR_PROFILER_ALREADY_STARTED = 7 + CUDA_ERROR_PROFILER_ALREADY_STOPPED = 8 + CUDA_ERROR_STUB_LIBRARY = 34 + CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER = 36 + CUDA_ERROR_DEVICE_UNAVAILABLE = 46 + CUDA_ERROR_NO_DEVICE = 100 + CUDA_ERROR_INVALID_DEVICE = 101 + CUDA_ERROR_DEVICE_NOT_LICENSED = 102 + CUDA_ERROR_INVALID_IMAGE = 200 + CUDA_ERROR_INVALID_CONTEXT = 201 + CUDA_ERROR_CONTEXT_ALREADY_CURRENT = 202 + CUDA_ERROR_MAP_FAILED = 205 + CUDA_ERROR_UNMAP_FAILED = 206 + CUDA_ERROR_ARRAY_IS_MAPPED = 207 + CUDA_ERROR_ALREADY_MAPPED = 208 + CUDA_ERROR_NO_BINARY_FOR_GPU = 209 + CUDA_ERROR_ALREADY_ACQUIRED = 210 + CUDA_ERROR_NOT_MAPPED = 211 + CUDA_ERROR_NOT_MAPPED_AS_ARRAY = 212 + CUDA_ERROR_NOT_MAPPED_AS_POINTER = 213 + CUDA_ERROR_ECC_UNCORRECTABLE = 214 + CUDA_ERROR_UNSUPPORTED_LIMIT = 215 + CUDA_ERROR_CONTEXT_ALREADY_IN_USE = 216 + CUDA_ERROR_PEER_ACCESS_UNSUPPORTED = 217 + CUDA_ERROR_INVALID_PTX = 218 + CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = 219 + CUDA_ERROR_NVLINK_UNCORRECTABLE = 220 + CUDA_ERROR_JIT_COMPILER_NOT_FOUND = 221 + CUDA_ERROR_UNSUPPORTED_PTX_VERSION = 222 + CUDA_ERROR_JIT_COMPILATION_DISABLED = 223 + CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY = 224 + CUDA_ERROR_UNSUPPORTED_DEVSIDE_SYNC = 225 + CUDA_ERROR_CONTAINED = 226 + CUDA_ERROR_INVALID_SOURCE = 300 + CUDA_ERROR_FILE_NOT_FOUND = 301 + CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND = 302 + CUDA_ERROR_SHARED_OBJECT_INIT_FAILED = 303 + CUDA_ERROR_OPERATING_SYSTEM = 304 + CUDA_ERROR_INVALID_HANDLE = 400 + CUDA_ERROR_ILLEGAL_STATE = 401 + CUDA_ERROR_LOSSY_QUERY = 402 + CUDA_ERROR_NOT_FOUND = 500 + CUDA_ERROR_NOT_READY = 600 + CUDA_ERROR_ILLEGAL_ADDRESS = 700 + CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES = 701 + CUDA_ERROR_LAUNCH_TIMEOUT = 702 + CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING = 703 + CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED = 704 + CUDA_ERROR_PEER_ACCESS_NOT_ENABLED = 705 + CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE = 708 + CUDA_ERROR_CONTEXT_IS_DESTROYED = 709 + CUDA_ERROR_ASSERT = 710 + CUDA_ERROR_TOO_MANY_PEERS = 711 + CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED = 712 + CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED = 713 + CUDA_ERROR_HARDWARE_STACK_ERROR = 714 + CUDA_ERROR_ILLEGAL_INSTRUCTION = 715 + CUDA_ERROR_MISALIGNED_ADDRESS = 716 + CUDA_ERROR_INVALID_ADDRESS_SPACE = 717 + CUDA_ERROR_INVALID_PC = 718 + CUDA_ERROR_LAUNCH_FAILED = 719 + CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE = 720 + CUDA_ERROR_TENSOR_MEMORY_LEAK = 721 + CUDA_ERROR_NOT_PERMITTED = 800 + CUDA_ERROR_NOT_SUPPORTED = 801 + CUDA_ERROR_SYSTEM_NOT_READY = 802 + CUDA_ERROR_SYSTEM_DRIVER_MISMATCH = 803 + CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE = 804 + CUDA_ERROR_MPS_CONNECTION_FAILED = 805 + CUDA_ERROR_MPS_RPC_FAILURE = 806 + CUDA_ERROR_MPS_SERVER_NOT_READY = 807 + CUDA_ERROR_MPS_MAX_CLIENTS_REACHED = 808 + CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED = 809 + CUDA_ERROR_MPS_CLIENT_TERMINATED = 810 + CUDA_ERROR_CDP_NOT_SUPPORTED = 811 + CUDA_ERROR_CDP_VERSION_MISMATCH = 812 + CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED = 900 + CUDA_ERROR_STREAM_CAPTURE_INVALIDATED = 901 + CUDA_ERROR_STREAM_CAPTURE_MERGE = 902 + CUDA_ERROR_STREAM_CAPTURE_UNMATCHED = 903 + CUDA_ERROR_STREAM_CAPTURE_UNJOINED = 904 + CUDA_ERROR_STREAM_CAPTURE_ISOLATION = 905 + CUDA_ERROR_STREAM_CAPTURE_IMPLICIT = 906 + CUDA_ERROR_CAPTURED_EVENT = 907 + CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD = 908 + CUDA_ERROR_TIMEOUT = 909 + CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE = 910 + CUDA_ERROR_EXTERNAL_DEVICE = 911 + CUDA_ERROR_INVALID_CLUSTER_SIZE = 912 + CUDA_ERROR_FUNCTION_NOT_LOADED = 913 + CUDA_ERROR_INVALID_RESOURCE_TYPE = 914 + CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION = 915 + CUDA_ERROR_KEY_ROTATION = 916 + CUDA_ERROR_STREAM_DETACHED = 917 + CUDA_ERROR_GRAPH_RECAPTURE_FAILURE = 918 + CUDA_ERROR_UNKNOWN = 999 + + ctypedef cudaError_enum CUresult + + cdef enum CUdevice_P2PAttribute_enum: + CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = 1 + CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = 2 + CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = 3 + CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED = 4 + CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED = 4 + CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED = 5 + + ctypedef CUdevice_P2PAttribute_enum CUdevice_P2PAttribute + + ctypedef void (*CUstreamCallback)(CUstream hStream, CUresult status, void* userData) + + ctypedef size_t (*CUoccupancyB2DSize)(int blockSize) + + cdef struct CUDA_MEMCPY2D_st: + size_t srcXInBytes + size_t srcY + CUmemorytype srcMemoryType + const void* srcHost + CUdeviceptr srcDevice + CUarray srcArray + size_t srcPitch + size_t dstXInBytes + size_t dstY + CUmemorytype dstMemoryType + void* dstHost + CUdeviceptr dstDevice + CUarray dstArray + size_t dstPitch + size_t WidthInBytes + size_t Height + + ctypedef CUDA_MEMCPY2D_st CUDA_MEMCPY2D_v2 + + ctypedef CUDA_MEMCPY2D_v2 CUDA_MEMCPY2D + + cdef struct CUDA_MEMCPY3D_st: + size_t srcXInBytes + size_t srcY + size_t srcZ + size_t srcLOD + CUmemorytype srcMemoryType + const void* srcHost + CUdeviceptr srcDevice + CUarray srcArray + void* reserved0 + size_t srcPitch + size_t srcHeight + size_t dstXInBytes + size_t dstY + size_t dstZ + size_t dstLOD + CUmemorytype dstMemoryType + void* dstHost + CUdeviceptr dstDevice + CUarray dstArray + void* reserved1 + size_t dstPitch + size_t dstHeight + size_t WidthInBytes + size_t Height + size_t Depth + + ctypedef CUDA_MEMCPY3D_st CUDA_MEMCPY3D_v2 + + ctypedef CUDA_MEMCPY3D_v2 CUDA_MEMCPY3D + + cdef struct CUDA_MEMCPY3D_PEER_st: + size_t srcXInBytes + size_t srcY + size_t srcZ + size_t srcLOD + CUmemorytype srcMemoryType + const void* srcHost + CUdeviceptr srcDevice + CUarray srcArray + CUcontext srcContext + size_t srcPitch + size_t srcHeight + size_t dstXInBytes + size_t dstY + size_t dstZ + size_t dstLOD + CUmemorytype dstMemoryType + void* dstHost + CUdeviceptr dstDevice + CUarray dstArray + CUcontext dstContext + size_t dstPitch + size_t dstHeight + size_t WidthInBytes + size_t Height + size_t Depth + + ctypedef CUDA_MEMCPY3D_PEER_st CUDA_MEMCPY3D_PEER_v1 + + ctypedef CUDA_MEMCPY3D_PEER_v1 CUDA_MEMCPY3D_PEER + + cdef struct CUDA_MEMCPY_NODE_PARAMS_st: + int flags + int reserved + CUcontext copyCtx + CUDA_MEMCPY3D copyParams + + ctypedef CUDA_MEMCPY_NODE_PARAMS_st CUDA_MEMCPY_NODE_PARAMS + + cdef struct CUDA_ARRAY_DESCRIPTOR_st: + size_t Width + size_t Height + CUarray_format Format + unsigned int NumChannels + + ctypedef CUDA_ARRAY_DESCRIPTOR_st CUDA_ARRAY_DESCRIPTOR_v2 + + ctypedef CUDA_ARRAY_DESCRIPTOR_v2 CUDA_ARRAY_DESCRIPTOR + + cdef struct CUDA_ARRAY3D_DESCRIPTOR_st: + size_t Width + size_t Height + size_t Depth + CUarray_format Format + unsigned int NumChannels + unsigned int Flags + + ctypedef CUDA_ARRAY3D_DESCRIPTOR_st CUDA_ARRAY3D_DESCRIPTOR_v2 + + ctypedef CUDA_ARRAY3D_DESCRIPTOR_v2 CUDA_ARRAY3D_DESCRIPTOR + + cdef struct anon_struct6: + unsigned int width + unsigned int height + unsigned int depth + + cdef struct CUDA_ARRAY_SPARSE_PROPERTIES_st: + anon_struct6 tileExtent + unsigned int miptailFirstLevel + unsigned long long miptailSize + unsigned int flags + unsigned int reserved[4] + + ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_st CUDA_ARRAY_SPARSE_PROPERTIES_v1 + + ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_v1 CUDA_ARRAY_SPARSE_PROPERTIES + + cdef struct CUDA_ARRAY_MEMORY_REQUIREMENTS_st: + size_t size + size_t alignment + unsigned int reserved[4] + + ctypedef CUDA_ARRAY_MEMORY_REQUIREMENTS_st CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 + + ctypedef CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 CUDA_ARRAY_MEMORY_REQUIREMENTS + + cdef struct anon_struct7: + CUarray hArray + + cdef struct anon_struct8: + CUmipmappedArray hMipmappedArray + + cdef struct anon_struct9: + CUdeviceptr devPtr + CUarray_format format + unsigned int numChannels + size_t sizeInBytes + + cdef struct anon_struct10: + CUdeviceptr devPtr + CUarray_format format + unsigned int numChannels + size_t width + size_t height + size_t pitchInBytes + + cdef struct anon_struct11: + int reserved[32] + + cdef union anon_union4: + anon_struct7 array + anon_struct8 mipmap + anon_struct9 linear + anon_struct10 pitch2D + anon_struct11 reserved + + cdef struct CUDA_RESOURCE_DESC_st: + CUresourcetype resType + anon_union4 res + unsigned int flags + + ctypedef CUDA_RESOURCE_DESC_st CUDA_RESOURCE_DESC_v1 + + ctypedef CUDA_RESOURCE_DESC_v1 CUDA_RESOURCE_DESC + + cdef struct CUDA_TEXTURE_DESC_st: + CUaddress_mode addressMode[3] + CUfilter_mode filterMode + unsigned int flags + unsigned int maxAnisotropy + CUfilter_mode mipmapFilterMode + float mipmapLevelBias + float minMipmapLevelClamp + float maxMipmapLevelClamp + float borderColor[4] + int reserved[12] + + ctypedef CUDA_TEXTURE_DESC_st CUDA_TEXTURE_DESC_v1 + + ctypedef CUDA_TEXTURE_DESC_v1 CUDA_TEXTURE_DESC + + cdef enum CUresourceViewFormat_enum: + CU_RES_VIEW_FORMAT_NONE = 0 + CU_RES_VIEW_FORMAT_UINT_1X8 = 1 + CU_RES_VIEW_FORMAT_UINT_2X8 = 2 + CU_RES_VIEW_FORMAT_UINT_4X8 = 3 + CU_RES_VIEW_FORMAT_SINT_1X8 = 4 + CU_RES_VIEW_FORMAT_SINT_2X8 = 5 + CU_RES_VIEW_FORMAT_SINT_4X8 = 6 + CU_RES_VIEW_FORMAT_UINT_1X16 = 7 + CU_RES_VIEW_FORMAT_UINT_2X16 = 8 + CU_RES_VIEW_FORMAT_UINT_4X16 = 9 + CU_RES_VIEW_FORMAT_SINT_1X16 = 10 + CU_RES_VIEW_FORMAT_SINT_2X16 = 11 + CU_RES_VIEW_FORMAT_SINT_4X16 = 12 + CU_RES_VIEW_FORMAT_UINT_1X32 = 13 + CU_RES_VIEW_FORMAT_UINT_2X32 = 14 + CU_RES_VIEW_FORMAT_UINT_4X32 = 15 + CU_RES_VIEW_FORMAT_SINT_1X32 = 16 + CU_RES_VIEW_FORMAT_SINT_2X32 = 17 + CU_RES_VIEW_FORMAT_SINT_4X32 = 18 + CU_RES_VIEW_FORMAT_FLOAT_1X16 = 19 + CU_RES_VIEW_FORMAT_FLOAT_2X16 = 20 + CU_RES_VIEW_FORMAT_FLOAT_4X16 = 21 + CU_RES_VIEW_FORMAT_FLOAT_1X32 = 22 + CU_RES_VIEW_FORMAT_FLOAT_2X32 = 23 + CU_RES_VIEW_FORMAT_FLOAT_4X32 = 24 + CU_RES_VIEW_FORMAT_UNSIGNED_BC1 = 25 + CU_RES_VIEW_FORMAT_UNSIGNED_BC2 = 26 + CU_RES_VIEW_FORMAT_UNSIGNED_BC3 = 27 + CU_RES_VIEW_FORMAT_UNSIGNED_BC4 = 28 + CU_RES_VIEW_FORMAT_SIGNED_BC4 = 29 + CU_RES_VIEW_FORMAT_UNSIGNED_BC5 = 30 + CU_RES_VIEW_FORMAT_SIGNED_BC5 = 31 + CU_RES_VIEW_FORMAT_UNSIGNED_BC6H = 32 + CU_RES_VIEW_FORMAT_SIGNED_BC6H = 33 + CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = 34 + + ctypedef CUresourceViewFormat_enum CUresourceViewFormat + + cdef struct CUDA_RESOURCE_VIEW_DESC_st: + CUresourceViewFormat format + size_t width + size_t height + size_t depth + unsigned int firstMipmapLevel + unsigned int lastMipmapLevel + unsigned int firstLayer + unsigned int lastLayer + unsigned int reserved[16] + + ctypedef CUDA_RESOURCE_VIEW_DESC_st CUDA_RESOURCE_VIEW_DESC_v1 + + ctypedef CUDA_RESOURCE_VIEW_DESC_v1 CUDA_RESOURCE_VIEW_DESC + + cdef struct CUtensorMap_st: + cuuint64_t opaque[16] + + ctypedef CUtensorMap_st CUtensorMap + + cdef enum CUtensorMapDataType_enum: + CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0 + CU_TENSOR_MAP_DATA_TYPE_UINT16 = 1 + CU_TENSOR_MAP_DATA_TYPE_UINT32 = 2 + CU_TENSOR_MAP_DATA_TYPE_INT32 = 3 + CU_TENSOR_MAP_DATA_TYPE_UINT64 = 4 + CU_TENSOR_MAP_DATA_TYPE_INT64 = 5 + CU_TENSOR_MAP_DATA_TYPE_FLOAT16 = 6 + CU_TENSOR_MAP_DATA_TYPE_FLOAT32 = 7 + CU_TENSOR_MAP_DATA_TYPE_FLOAT64 = 8 + CU_TENSOR_MAP_DATA_TYPE_BFLOAT16 = 9 + CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ = 10 + CU_TENSOR_MAP_DATA_TYPE_TFLOAT32 = 11 + CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ = 12 + CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B = 13 + CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B = 14 + CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B = 15 + + ctypedef CUtensorMapDataType_enum CUtensorMapDataType + + cdef enum CUtensorMapInterleave_enum: + CU_TENSOR_MAP_INTERLEAVE_NONE = 0 + CU_TENSOR_MAP_INTERLEAVE_16B = 1 + CU_TENSOR_MAP_INTERLEAVE_32B = 2 + + ctypedef CUtensorMapInterleave_enum CUtensorMapInterleave + + cdef enum CUtensorMapSwizzle_enum: + CU_TENSOR_MAP_SWIZZLE_NONE = 0 + CU_TENSOR_MAP_SWIZZLE_32B = 1 + CU_TENSOR_MAP_SWIZZLE_64B = 2 + CU_TENSOR_MAP_SWIZZLE_128B = 3 + CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B = 4 + CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B = 5 + CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B = 6 + + ctypedef CUtensorMapSwizzle_enum CUtensorMapSwizzle + + cdef enum CUtensorMapL2promotion_enum: + CU_TENSOR_MAP_L2_PROMOTION_NONE = 0 + CU_TENSOR_MAP_L2_PROMOTION_L2_64B = 1 + CU_TENSOR_MAP_L2_PROMOTION_L2_128B = 2 + CU_TENSOR_MAP_L2_PROMOTION_L2_256B = 3 + + ctypedef CUtensorMapL2promotion_enum CUtensorMapL2promotion + + cdef enum CUtensorMapFloatOOBfill_enum: + CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0 + CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA = 1 + + ctypedef CUtensorMapFloatOOBfill_enum CUtensorMapFloatOOBfill + + cdef enum CUtensorMapIm2ColWideMode_enum: + CU_TENSOR_MAP_IM2COL_WIDE_MODE_W = 0 + CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 = 1 + + ctypedef CUtensorMapIm2ColWideMode_enum CUtensorMapIm2ColWideMode + + cdef struct CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: + unsigned long long p2pToken + unsigned int vaSpaceToken + + ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 + + ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 CUDA_POINTER_ATTRIBUTE_P2P_TOKENS + + cdef enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum: + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE = 0 + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ = 1 + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE = 3 + + ctypedef CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS + + cdef struct CUDA_LAUNCH_PARAMS_st: + CUfunction function + 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 + + ctypedef CUDA_LAUNCH_PARAMS_st CUDA_LAUNCH_PARAMS_v1 + + ctypedef CUDA_LAUNCH_PARAMS_v1 CUDA_LAUNCH_PARAMS + + cdef enum CUexternalMemoryHandleType_enum: + CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD = 1 + CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 = 2 + CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3 + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP = 4 + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE = 5 + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE = 6 + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT = 7 + CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF = 8 + CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD = 9 + + ctypedef CUexternalMemoryHandleType_enum CUexternalMemoryHandleType + + cdef struct anon_struct12: + void* handle + const void* name + + cdef union anon_union5: + int fd + anon_struct12 win32 + const void* nvSciBufObject + + cdef struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: + CUexternalMemoryHandleType type + anon_union5 handle + unsigned long long size + unsigned int flags + unsigned int reserved[16] + + ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 + + ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 CUDA_EXTERNAL_MEMORY_HANDLE_DESC + + cdef struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: + unsigned long long offset + unsigned long long size + unsigned int flags + unsigned int reserved[16] + + ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 + + ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 CUDA_EXTERNAL_MEMORY_BUFFER_DESC + + cdef struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: + unsigned long long offset + CUDA_ARRAY3D_DESCRIPTOR arrayDesc + unsigned int numLevels + unsigned int reserved[16] + + ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 + + ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC + + cdef enum CUexternalSemaphoreHandleType_enum: + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD = 1 + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 = 2 + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3 + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE = 4 + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE = 5 + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC = 6 + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX = 7 + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT = 8 + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD = 9 + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 = 10 + + ctypedef CUexternalSemaphoreHandleType_enum CUexternalSemaphoreHandleType + + cdef struct anon_struct13: + void* handle + const void* name + + cdef union anon_union6: + int fd + anon_struct13 win32 + const void* nvSciSyncObj + + cdef struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: + CUexternalSemaphoreHandleType type + anon_union6 handle + unsigned int flags + unsigned int reserved[16] + + ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 + + ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC + + cdef struct anon_struct14: + unsigned long long value + + cdef union anon_union7: + void* fence + unsigned long long reserved + + cdef struct anon_struct15: + unsigned long long key + + cdef struct anon_struct16: + anon_struct14 fence + anon_union7 nvSciSync + anon_struct15 keyedMutex + unsigned int reserved[12] + + cdef struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: + anon_struct16 params + unsigned int flags + unsigned int reserved[16] + + ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 + + ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + + cdef struct anon_struct17: + unsigned long long value + + cdef union anon_union8: + void* fence + unsigned long long reserved + + cdef struct anon_struct18: + unsigned long long key + unsigned int timeoutMs + + cdef struct anon_struct19: + anon_struct17 fence + anon_union8 nvSciSync + anon_struct18 keyedMutex + unsigned int reserved[10] + + cdef struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: + anon_struct19 params + unsigned int flags + unsigned int reserved[16] + + ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 + + ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + + cdef struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: + CUexternalSemaphore* extSemArray + const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray + unsigned int numExtSems + + ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 + + ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 CUDA_EXT_SEM_SIGNAL_NODE_PARAMS + + cdef struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: + CUexternalSemaphore* extSemArray + const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray + unsigned int numExtSems + + ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 + + cdef struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: + CUexternalSemaphore* extSemArray + const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray + unsigned int numExtSems + + ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_st CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 + + ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 CUDA_EXT_SEM_WAIT_NODE_PARAMS + + cdef struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: + CUexternalSemaphore* extSemArray + const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray + unsigned int numExtSems + + ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 + + ctypedef unsigned long long CUmemGenericAllocationHandle_v1 + + ctypedef CUmemGenericAllocationHandle_v1 CUmemGenericAllocationHandle + + cdef enum CUmemAllocationHandleType_enum: + CU_MEM_HANDLE_TYPE_NONE = 0 + CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR = 1 + CU_MEM_HANDLE_TYPE_WIN32 = 2 + CU_MEM_HANDLE_TYPE_WIN32_KMT = 4 + CU_MEM_HANDLE_TYPE_FABRIC = 8 + CU_MEM_HANDLE_TYPE_MAX = 2147483647 + + ctypedef CUmemAllocationHandleType_enum CUmemAllocationHandleType + + cdef enum CUmemAccess_flags_enum: + CU_MEM_ACCESS_FLAGS_PROT_NONE = 0 + CU_MEM_ACCESS_FLAGS_PROT_READ = 1 + CU_MEM_ACCESS_FLAGS_PROT_READWRITE = 3 + CU_MEM_ACCESS_FLAGS_PROT_MAX = 2147483647 + + ctypedef CUmemAccess_flags_enum CUmemAccess_flags + + cdef enum CUmemLocationType_enum: + CU_MEM_LOCATION_TYPE_INVALID = 0 + CU_MEM_LOCATION_TYPE_NONE = 0 + CU_MEM_LOCATION_TYPE_DEVICE = 1 + CU_MEM_LOCATION_TYPE_HOST = 2 + CU_MEM_LOCATION_TYPE_HOST_NUMA = 3 + CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT = 4 + CU_MEM_LOCATION_TYPE_INVISIBLE = 5 + CU_MEM_LOCATION_TYPE_MAX = 2147483647 + + ctypedef CUmemLocationType_enum CUmemLocationType + + cdef enum CUmemAllocationType_enum: + CU_MEM_ALLOCATION_TYPE_INVALID = 0 + CU_MEM_ALLOCATION_TYPE_PINNED = 1 + CU_MEM_ALLOCATION_TYPE_MANAGED = 2 + CU_MEM_ALLOCATION_TYPE_MAX = 2147483647 + + ctypedef CUmemAllocationType_enum CUmemAllocationType + + cdef enum CUmemAllocationGranularity_flags_enum: + CU_MEM_ALLOC_GRANULARITY_MINIMUM = 0 + CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = 1 + + ctypedef CUmemAllocationGranularity_flags_enum CUmemAllocationGranularity_flags + + cdef enum CUmemRangeHandleType_enum: + CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD = 1 + CU_MEM_RANGE_HANDLE_TYPE_MAX = 2147483647 + + ctypedef CUmemRangeHandleType_enum CUmemRangeHandleType + + cdef enum CUmemRangeFlags_enum: + CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE = 1 + + ctypedef CUmemRangeFlags_enum CUmemRangeFlags + + cdef enum CUarraySparseSubresourceType_enum: + CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL = 0 + CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = 1 + + ctypedef CUarraySparseSubresourceType_enum CUarraySparseSubresourceType + + cdef enum CUmemOperationType_enum: + CU_MEM_OPERATION_TYPE_MAP = 1 + CU_MEM_OPERATION_TYPE_UNMAP = 2 + + ctypedef CUmemOperationType_enum CUmemOperationType + + cdef enum CUmemHandleType_enum: + CU_MEM_HANDLE_TYPE_GENERIC = 0 + + ctypedef CUmemHandleType_enum CUmemHandleType + + cdef union anon_union9: + CUmipmappedArray mipmap + CUarray array + + cdef struct anon_struct20: + unsigned int level + unsigned int layer + unsigned int offsetX + unsigned int offsetY + unsigned int offsetZ + unsigned int extentWidth + unsigned int extentHeight + unsigned int extentDepth + + cdef struct anon_struct21: + unsigned int layer + unsigned long long offset + unsigned long long size + + cdef union anon_union10: + anon_struct20 sparseLevel + anon_struct21 miptail + + cdef union anon_union11: + CUmemGenericAllocationHandle memHandle + + cdef struct CUarrayMapInfo_st: + CUresourcetype resourceType + anon_union9 resource + CUarraySparseSubresourceType subresourceType + anon_union10 subresource + CUmemOperationType memOperationType + CUmemHandleType memHandleType + anon_union11 memHandle + unsigned long long offset + unsigned int deviceBitMask + unsigned int flags + unsigned int reserved[2] + + ctypedef CUarrayMapInfo_st CUarrayMapInfo_v1 + + ctypedef CUarrayMapInfo_v1 CUarrayMapInfo + + cdef struct CUmemLocation_st: + CUmemLocationType type + int id + + ctypedef CUmemLocation_st CUmemLocation_v1 + + ctypedef CUmemLocation_v1 CUmemLocation + + cdef enum CUmemAllocationCompType_enum: + CU_MEM_ALLOCATION_COMP_NONE = 0 + CU_MEM_ALLOCATION_COMP_GENERIC = 1 + + ctypedef CUmemAllocationCompType_enum CUmemAllocationCompType + + cdef struct anon_struct22: + unsigned char compressionType + unsigned char gpuDirectRDMACapable + unsigned short usage + unsigned char reserved[4] + + cdef struct CUmemAllocationProp_st: + CUmemAllocationType type + CUmemAllocationHandleType requestedHandleTypes + CUmemLocation location + void* win32HandleMetaData + anon_struct22 allocFlags + + ctypedef CUmemAllocationProp_st CUmemAllocationProp_v1 + + ctypedef CUmemAllocationProp_v1 CUmemAllocationProp + + cdef enum CUmulticastGranularity_flags_enum: + CU_MULTICAST_GRANULARITY_MINIMUM = 0 + CU_MULTICAST_GRANULARITY_RECOMMENDED = 1 + + ctypedef CUmulticastGranularity_flags_enum CUmulticastGranularity_flags + + cdef struct CUmulticastObjectProp_st: + unsigned int numDevices + size_t size + unsigned long long handleTypes + unsigned long long flags + + ctypedef CUmulticastObjectProp_st CUmulticastObjectProp_v1 + + ctypedef CUmulticastObjectProp_v1 CUmulticastObjectProp + + cdef struct CUmemAccessDesc_st: + CUmemLocation location + CUmemAccess_flags flags + + ctypedef CUmemAccessDesc_st CUmemAccessDesc_v1 + + ctypedef CUmemAccessDesc_v1 CUmemAccessDesc + + cdef enum CUgraphExecUpdateResult_enum: + CU_GRAPH_EXEC_UPDATE_SUCCESS = 0 + CU_GRAPH_EXEC_UPDATE_ERROR = 1 + CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED = 2 + CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED = 3 + CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED = 4 + CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED = 5 + CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED = 6 + CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE = 7 + CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED = 8 + + ctypedef CUgraphExecUpdateResult_enum CUgraphExecUpdateResult + + cdef struct CUgraphExecUpdateResultInfo_st: + CUgraphExecUpdateResult result + CUgraphNode errorNode + CUgraphNode errorFromNode + + ctypedef CUgraphExecUpdateResultInfo_st CUgraphExecUpdateResultInfo_v1 + + ctypedef CUgraphExecUpdateResultInfo_v1 CUgraphExecUpdateResultInfo + + cdef enum CUmemPool_attribute_enum: + CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES = 1 + CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC = 2 + CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES = 3 + CU_MEMPOOL_ATTR_RELEASE_THRESHOLD = 4 + CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT = 5 + CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH = 6 + CU_MEMPOOL_ATTR_USED_MEM_CURRENT = 7 + CU_MEMPOOL_ATTR_USED_MEM_HIGH = 8 + CU_MEMPOOL_ATTR_ALLOCATION_TYPE = 9 + CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES = 10 + CU_MEMPOOL_ATTR_LOCATION_ID = 11 + CU_MEMPOOL_ATTR_LOCATION_TYPE = 12 + CU_MEMPOOL_ATTR_MAX_POOL_SIZE = 13 + CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED = 14 + + ctypedef CUmemPool_attribute_enum CUmemPool_attribute + + cdef struct CUmemPoolProps_st: + CUmemAllocationType allocType + CUmemAllocationHandleType handleTypes + CUmemLocation location + void* win32SecurityAttributes + size_t maxSize + unsigned short usage + unsigned char reserved[54] + + ctypedef CUmemPoolProps_st CUmemPoolProps_v1 + + ctypedef CUmemPoolProps_v1 CUmemPoolProps + + cdef struct CUmemPoolPtrExportData_st: + unsigned char reserved[64] + + ctypedef CUmemPoolPtrExportData_st CUmemPoolPtrExportData_v1 + + ctypedef CUmemPoolPtrExportData_v1 CUmemPoolPtrExportData + + cdef enum CUmemcpyFlags_enum: + CU_MEMCPY_FLAG_DEFAULT = 0 + CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE = 1 + + ctypedef CUmemcpyFlags_enum CUmemcpyFlags + + cdef enum CUmemcpySrcAccessOrder_enum: + CU_MEMCPY_SRC_ACCESS_ORDER_INVALID = 0 + CU_MEMCPY_SRC_ACCESS_ORDER_STREAM = 1 + CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL = 2 + CU_MEMCPY_SRC_ACCESS_ORDER_ANY = 3 + CU_MEMCPY_SRC_ACCESS_ORDER_MAX = 2147483647 + + ctypedef CUmemcpySrcAccessOrder_enum CUmemcpySrcAccessOrder + + cdef struct CUmemcpyAttributes_st: + CUmemcpySrcAccessOrder srcAccessOrder + CUmemLocation srcLocHint + CUmemLocation dstLocHint + unsigned int flags + + ctypedef CUmemcpyAttributes_st CUmemcpyAttributes_v1 + + ctypedef CUmemcpyAttributes_v1 CUmemcpyAttributes + + cdef enum CUmemcpy3DOperandType_enum: + CU_MEMCPY_OPERAND_TYPE_POINTER = 1 + CU_MEMCPY_OPERAND_TYPE_ARRAY = 2 + CU_MEMCPY_OPERAND_TYPE_MAX = 2147483647 + + ctypedef CUmemcpy3DOperandType_enum CUmemcpy3DOperandType + + cdef struct CUoffset3D_st: + size_t x + size_t y + size_t z + + ctypedef CUoffset3D_st CUoffset3D_v1 + + ctypedef CUoffset3D_v1 CUoffset3D + + cdef struct CUextent3D_st: + size_t width + size_t height + size_t depth + + ctypedef CUextent3D_st CUextent3D_v1 + + ctypedef CUextent3D_v1 CUextent3D + + cdef struct anon_struct23: + CUdeviceptr ptr + size_t rowLength + size_t layerHeight + CUmemLocation locHint + + cdef struct anon_struct24: + CUarray array + CUoffset3D offset + + cdef union anon_union13: + anon_struct23 ptr + anon_struct24 array + + cdef struct CUmemcpy3DOperand_st: + CUmemcpy3DOperandType type + anon_union13 op + + ctypedef CUmemcpy3DOperand_st CUmemcpy3DOperand_v1 + + ctypedef CUmemcpy3DOperand_v1 CUmemcpy3DOperand + + cdef struct CUDA_MEMCPY3D_BATCH_OP_st: + CUmemcpy3DOperand src + CUmemcpy3DOperand dst + CUextent3D extent + CUmemcpySrcAccessOrder srcAccessOrder + unsigned int flags + + ctypedef CUDA_MEMCPY3D_BATCH_OP_st CUDA_MEMCPY3D_BATCH_OP_v1 + + ctypedef CUDA_MEMCPY3D_BATCH_OP_v1 CUDA_MEMCPY3D_BATCH_OP + + cdef struct CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: + CUmemPoolProps poolProps + const CUmemAccessDesc* accessDescs + size_t accessDescCount + size_t bytesize + CUdeviceptr dptr + + ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v1_st CUDA_MEM_ALLOC_NODE_PARAMS_v1 + + ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v1 CUDA_MEM_ALLOC_NODE_PARAMS + + cdef struct CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: + CUmemPoolProps poolProps + const CUmemAccessDesc* accessDescs + size_t accessDescCount + size_t bytesize + CUdeviceptr dptr + + ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v2_st CUDA_MEM_ALLOC_NODE_PARAMS_v2 + + cdef struct CUDA_MEM_FREE_NODE_PARAMS_st: + CUdeviceptr dptr + + ctypedef CUDA_MEM_FREE_NODE_PARAMS_st CUDA_MEM_FREE_NODE_PARAMS + + cdef enum CUgraphMem_attribute_enum: + CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT = 0 + CU_GRAPH_MEM_ATTR_USED_MEM_HIGH = 1 + CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT = 2 + CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH = 3 + + ctypedef CUgraphMem_attribute_enum CUgraphMem_attribute + + cdef enum CUgraphChildGraphNodeOwnership_enum: + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_INVALID = -1 + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_CLONE = 0 + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE = 1 + + ctypedef CUgraphChildGraphNodeOwnership_enum CUgraphChildGraphNodeOwnership + + cdef struct CUDA_CHILD_GRAPH_NODE_PARAMS_st: + CUgraph graph + CUgraphChildGraphNodeOwnership ownership + + ctypedef CUDA_CHILD_GRAPH_NODE_PARAMS_st CUDA_CHILD_GRAPH_NODE_PARAMS + + cdef struct CUDA_EVENT_RECORD_NODE_PARAMS_st: + CUevent event + + ctypedef CUDA_EVENT_RECORD_NODE_PARAMS_st CUDA_EVENT_RECORD_NODE_PARAMS + + cdef struct CUDA_EVENT_WAIT_NODE_PARAMS_st: + CUevent event + + ctypedef CUDA_EVENT_WAIT_NODE_PARAMS_st CUDA_EVENT_WAIT_NODE_PARAMS + + cdef struct CUgraphNodeParams_st: + CUgraphNodeType type + int reserved0[3] + long long reserved1[29] + CUDA_KERNEL_NODE_PARAMS_v3 kernel + CUDA_MEMCPY_NODE_PARAMS memcpy + CUDA_MEMSET_NODE_PARAMS_v2 memset + CUDA_HOST_NODE_PARAMS_v2 host + CUDA_CHILD_GRAPH_NODE_PARAMS graph + CUDA_EVENT_WAIT_NODE_PARAMS eventWait + CUDA_EVENT_RECORD_NODE_PARAMS eventRecord + CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 extSemSignal + CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 extSemWait + CUDA_MEM_ALLOC_NODE_PARAMS_v2 alloc + CUDA_MEM_FREE_NODE_PARAMS free + CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 memOp + CUDA_CONDITIONAL_NODE_PARAMS conditional + char asBytes[232] + long long reserved2 + + ctypedef CUgraphNodeParams_st CUgraphNodeParams + + cdef enum CUflushGPUDirectRDMAWritesOptions_enum: + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST = 1 + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS = 2 + + ctypedef CUflushGPUDirectRDMAWritesOptions_enum CUflushGPUDirectRDMAWritesOptions + + cdef enum CUGPUDirectRDMAWritesOrdering_enum: + CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE = 0 + CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER = 100 + CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES = 200 + + ctypedef CUGPUDirectRDMAWritesOrdering_enum CUGPUDirectRDMAWritesOrdering + + cdef enum CUflushGPUDirectRDMAWritesScope_enum: + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER = 100 + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES = 200 + + ctypedef CUflushGPUDirectRDMAWritesScope_enum CUflushGPUDirectRDMAWritesScope + + cdef enum CUflushGPUDirectRDMAWritesTarget_enum: + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX = 0 + + ctypedef CUflushGPUDirectRDMAWritesTarget_enum CUflushGPUDirectRDMAWritesTarget + + cdef enum CUgraphDebugDot_flags_enum: + CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE = 1 + CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES = 2 + CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS = 4 + CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS = 8 + CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS = 16 + CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS = 32 + CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS = 64 + CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS = 128 + CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS = 256 + CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES = 512 + CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES = 1024 + CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS = 2048 + CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS = 4096 + CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS = 8192 + CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO = 16384 + CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS = 32768 + + ctypedef CUgraphDebugDot_flags_enum CUgraphDebugDot_flags + + cdef enum CUuserObject_flags_enum: + CU_USER_OBJECT_NO_DESTRUCTOR_SYNC = 1 + + ctypedef CUuserObject_flags_enum CUuserObject_flags + + cdef enum CUuserObjectRetain_flags_enum: + CU_GRAPH_USER_OBJECT_MOVE = 1 + + ctypedef CUuserObjectRetain_flags_enum CUuserObjectRetain_flags + + cdef enum CUgraphInstantiate_flags_enum: + CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH = 1 + CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD = 2 + CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH = 4 + CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY = 8 + + ctypedef CUgraphInstantiate_flags_enum CUgraphInstantiate_flags + + cdef enum CUdeviceNumaConfig_enum: + CU_DEVICE_NUMA_CONFIG_NONE = 0 + CU_DEVICE_NUMA_CONFIG_NUMA_NODE = 1 + + ctypedef CUdeviceNumaConfig_enum CUdeviceNumaConfig + + cdef enum CUprocessState_enum: + CU_PROCESS_STATE_RUNNING = 0 + CU_PROCESS_STATE_LOCKED = 1 + CU_PROCESS_STATE_CHECKPOINTED = 2 + CU_PROCESS_STATE_FAILED = 3 + + ctypedef CUprocessState_enum CUprocessState + + cdef struct CUcheckpointLockArgs_st: + unsigned int timeoutMs + unsigned int reserved0 + cuuint64_t reserved1[7] + + ctypedef CUcheckpointLockArgs_st CUcheckpointLockArgs + + cdef struct CUcheckpointCheckpointArgs_st: + cuuint64_t reserved[8] + + ctypedef CUcheckpointCheckpointArgs_st CUcheckpointCheckpointArgs + + cdef struct CUcheckpointGpuPair_st: + CUuuid oldUuid + CUuuid newUuid + + ctypedef CUcheckpointGpuPair_st CUcheckpointGpuPair + + cdef struct CUcheckpointRestoreArgs_st: + CUcheckpointGpuPair* gpuPairs + unsigned int gpuPairsCount + char reserved[52] + + ctypedef CUcheckpointRestoreArgs_st CUcheckpointRestoreArgs + + cdef struct CUcheckpointUnlockArgs_st: + cuuint64_t reserved[8] + + ctypedef CUcheckpointUnlockArgs_st CUcheckpointUnlockArgs + + cdef enum CUmoduleLoadingMode_enum: + CU_MODULE_EAGER_LOADING = 1 + CU_MODULE_LAZY_LOADING = 2 + + ctypedef CUmoduleLoadingMode_enum CUmoduleLoadingMode + + cdef enum CUmemDecompressAlgorithm_enum: + CU_MEM_DECOMPRESS_UNSUPPORTED = 0 + CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE = 1 + CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY = 2 + CU_MEM_DECOMPRESS_ALGORITHM_LZ4 = 4 + + ctypedef CUmemDecompressAlgorithm_enum CUmemDecompressAlgorithm + + cdef struct CUmemDecompressParams_st: + size_t srcNumBytes + size_t dstNumBytes + cuuint32_t* dstActBytes + const void* src + void* dst + CUmemDecompressAlgorithm algo + unsigned char padding[20] + + ctypedef CUmemDecompressParams_st CUmemDecompressParams + + ctypedef cuuint32_t CUlogicalEndpointId + + cdef enum CUlogicalEndpointIpcHandleType_enum: + CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE = 0 + CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC = 1 + + ctypedef CUlogicalEndpointIpcHandleType_enum CUlogicalEndpointIpcHandleType + + cdef struct CUlogicalEndpointFabricHandle_st: + unsigned char data[64] + + ctypedef CUlogicalEndpointFabricHandle_st CUlogicalEndpointFabricHandle + + cdef enum CUlogicalEndpointType_enum: + CU_LOGICAL_ENDPOINT_TYPE_INVALID = 0 + CU_LOGICAL_ENDPOINT_TYPE_UNICAST = 1 + CU_LOGICAL_ENDPOINT_TYPE_MULTICAST = 2 + + ctypedef CUlogicalEndpointType_enum CUlogicalEndpointType + + cdef enum CUlogicalEndpointFlag_enum: + CU_LOGICAL_ENDPOINT_FLAG_NONE = 0 + CU_LOGICAL_ENDPOINT_FLAG_COUNTED_OPS = 1 + + ctypedef CUlogicalEndpointFlag_enum CUlogicalEndpointFlag + + cdef struct anon_struct25: + CUdevice device + + cdef struct anon_struct26: + unsigned int numDevices + + cdef struct CUlogicalEndpointProp_struct: + CUlogicalEndpointType type + anon_struct25 unicast + anon_struct26 multicast + unsigned long long size + unsigned int ipcHandleTypes + unsigned int flags + + ctypedef CUlogicalEndpointProp_struct CUlogicalEndpointProp + + cdef enum CUgraphRecaptureStatus_enum: + CU_GRAPH_RECAPTURE_ELIGIBLE_FOR_UPDATE = 0 + CU_GRAPH_RECAPTURE_INELIGIBLE_FOR_UPDATE = 1 + CU_GRAPH_RECAPTURE_ERROR = 2 + + ctypedef CUgraphRecaptureStatus_enum CUgraphRecaptureStatus + + ctypedef CUresult (*CUgraphRecaptureCallback)(void* data, CUgraphNode node, const CUgraphNodeParams* originalParams, const CUgraphNodeParams* recaptureParams, CUgraphRecaptureStatus status) + + cdef enum CUfunctionLoadingState_enum: + CU_FUNCTION_LOADING_STATE_UNLOADED = 0 + CU_FUNCTION_LOADING_STATE_LOADED = 1 + CU_FUNCTION_LOADING_STATE_MAX = 2 + + ctypedef CUfunctionLoadingState_enum CUfunctionLoadingState + + cdef enum CUcoredumpSettings_enum: + CU_COREDUMP_ENABLE_ON_EXCEPTION = 1 + CU_COREDUMP_TRIGGER_HOST = 2 + CU_COREDUMP_LIGHTWEIGHT = 3 + CU_COREDUMP_ENABLE_USER_TRIGGER = 4 + CU_COREDUMP_FILE = 5 + CU_COREDUMP_PIPE = 6 + CU_COREDUMP_GENERATION_FLAGS = 7 + CU_COREDUMP_MAX = 8 + + ctypedef CUcoredumpSettings_enum CUcoredumpSettings + + cdef enum CUCoredumpGenerationFlags: + CU_COREDUMP_DEFAULT_FLAGS = 0 + CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES = 1 + CU_COREDUMP_SKIP_GLOBAL_MEMORY = 2 + CU_COREDUMP_SKIP_SHARED_MEMORY = 4 + CU_COREDUMP_SKIP_LOCAL_MEMORY = 8 + CU_COREDUMP_SKIP_ABORT = 16 + CU_COREDUMP_SKIP_CONSTBANK_MEMORY = 32 + CU_COREDUMP_LIGHTWEIGHT_FLAGS = 47 + CU_COREDUMP_GZIP_COMPRESS = 64 + CU_COREDUMP_FAULTED_CONTEXTS_ONLY = 128 + CU_COREDUMP_NO_ERRBAR_AT_EXIT = 1073741824 + CU_COREDUMP_LOG_ONLY = 2147483648 + + cdef struct CUcoredumpCallbackEntry_st: + pass + ctypedef CUcoredumpCallbackEntry_st* CUcoredumpCallbackHandle + + ctypedef void (*CUcoredumpStatusCallback)(void* userData, int pid, CUdevice dev) + + cdef struct CUdevResourceDesc_st: + pass + ctypedef CUdevResourceDesc_st* CUdevResourceDesc + + ctypedef enum CUgreenCtxCreate_flags: + CU_GREEN_CTX_NONE = 0 + CU_GREEN_CTX_DEFAULT_STREAM = 1 + + ctypedef enum CUdevSmResourceGroup_flags: + CU_DEV_SM_RESOURCE_GROUP_DEFAULT = 0 + CU_DEV_SM_RESOURCE_GROUP_BACKFILL = 1 + + ctypedef enum CUdevSmResourceSplitByCount_flags: + CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING = 1 + CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE = 2 + + ctypedef enum CUdevResourceType: + CU_DEV_RESOURCE_TYPE_INVALID = 0 + CU_DEV_RESOURCE_TYPE_SM = 1 + CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG = 1000 + CU_DEV_RESOURCE_TYPE_WORKQUEUE = 10000 + + cdef struct CUdevSmResource_st: + unsigned int smCount + unsigned int minSmPartitionSize + unsigned int smCoscheduledAlignment + unsigned int flags + + ctypedef CUdevSmResource_st CUdevSmResource + + ctypedef enum CUdevWorkqueueConfigScope: + CU_WORKQUEUE_SCOPE_DEVICE_CTX = 0 + CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED = 1 + + cdef struct CUdevWorkqueueConfigResource_st: + CUdevice device + unsigned int wqConcurrencyLimit + CUdevWorkqueueConfigScope sharingScope + + ctypedef CUdevWorkqueueConfigResource_st CUdevWorkqueueConfigResource + + cdef struct CUdevWorkqueueResource_st: + unsigned char reserved[40] + + ctypedef CUdevWorkqueueResource_st CUdevWorkqueueResource + + cdef struct CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: + unsigned int smCount + unsigned int coscheduledSmCount + unsigned int preferredCoscheduledSmCount + unsigned int flags + unsigned int reserved[12] + + ctypedef CU_DEV_SM_RESOURCE_GROUP_PARAMS_st CU_DEV_SM_RESOURCE_GROUP_PARAMS + + cdef struct CUdevResource_st: + CUdevResourceType type + unsigned char _internal_padding[92] + CUdevSmResource sm + CUdevWorkqueueConfigResource wqConfig + CUdevWorkqueueResource wq + unsigned char _oversize[40] + CUdevResource_st* nextResource + + ctypedef CUdevResource_st CUdevResource_v1 + + ctypedef CUdevResource_v1 CUdevResource + + cdef enum CUlogLevel_enum: + CU_LOG_LEVEL_ERROR = 0 + CU_LOG_LEVEL_WARNING = 1 + + ctypedef CUlogLevel_enum CUlogLevel + + cdef struct CUlogsCallbackEntry_st: + pass + ctypedef CUlogsCallbackEntry_st* CUlogsCallbackHandle + + ctypedef void (*CUlogsCallback)(void* data, CUlogLevel logLevel, char* message, size_t length) + + ctypedef unsigned int CUlogIterator + +cdef extern from "cudaProfiler.h": + + cdef enum CUoutput_mode_enum: + CU_OUT_KEY_VALUE_PAIR = 0 + CU_OUT_CSV = 1 + + ctypedef CUoutput_mode_enum CUoutput_mode + +cdef enum CUeglFrameType_enum: + CU_EGL_FRAME_TYPE_ARRAY = 0 + CU_EGL_FRAME_TYPE_PITCH = 1 + +ctypedef CUeglFrameType_enum CUeglFrameType + +cdef enum CUeglResourceLocationFlags_enum: + CU_EGL_RESOURCE_LOCATION_SYSMEM = 0 + CU_EGL_RESOURCE_LOCATION_VIDMEM = 1 + +ctypedef CUeglResourceLocationFlags_enum CUeglResourceLocationFlags + +cdef enum CUeglColorFormat_enum: + CU_EGL_COLOR_FORMAT_YUV420_PLANAR = 0 + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR = 1 + CU_EGL_COLOR_FORMAT_YUV422_PLANAR = 2 + CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR = 3 + CU_EGL_COLOR_FORMAT_RGB = 4 + CU_EGL_COLOR_FORMAT_BGR = 5 + CU_EGL_COLOR_FORMAT_ARGB = 6 + CU_EGL_COLOR_FORMAT_RGBA = 7 + CU_EGL_COLOR_FORMAT_L = 8 + CU_EGL_COLOR_FORMAT_R = 9 + CU_EGL_COLOR_FORMAT_YUV444_PLANAR = 10 + CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR = 11 + CU_EGL_COLOR_FORMAT_YUYV_422 = 12 + CU_EGL_COLOR_FORMAT_UYVY_422 = 13 + CU_EGL_COLOR_FORMAT_ABGR = 14 + CU_EGL_COLOR_FORMAT_BGRA = 15 + CU_EGL_COLOR_FORMAT_A = 16 + CU_EGL_COLOR_FORMAT_RG = 17 + CU_EGL_COLOR_FORMAT_AYUV = 18 + CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR = 19 + CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR = 20 + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR = 21 + CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR = 22 + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR = 23 + CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR = 24 + CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR = 25 + CU_EGL_COLOR_FORMAT_VYUY_ER = 26 + CU_EGL_COLOR_FORMAT_UYVY_ER = 27 + CU_EGL_COLOR_FORMAT_YUYV_ER = 28 + CU_EGL_COLOR_FORMAT_YVYU_ER = 29 + CU_EGL_COLOR_FORMAT_YUV_ER = 30 + CU_EGL_COLOR_FORMAT_YUVA_ER = 31 + CU_EGL_COLOR_FORMAT_AYUV_ER = 32 + CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER = 33 + CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER = 34 + CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER = 35 + CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER = 36 + CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER = 37 + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER = 38 + CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER = 39 + CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER = 40 + CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER = 41 + CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER = 42 + CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER = 43 + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER = 44 + CU_EGL_COLOR_FORMAT_BAYER_RGGB = 45 + CU_EGL_COLOR_FORMAT_BAYER_BGGR = 46 + CU_EGL_COLOR_FORMAT_BAYER_GRBG = 47 + CU_EGL_COLOR_FORMAT_BAYER_GBRG = 48 + CU_EGL_COLOR_FORMAT_BAYER10_RGGB = 49 + CU_EGL_COLOR_FORMAT_BAYER10_BGGR = 50 + CU_EGL_COLOR_FORMAT_BAYER10_GRBG = 51 + CU_EGL_COLOR_FORMAT_BAYER10_GBRG = 52 + CU_EGL_COLOR_FORMAT_BAYER12_RGGB = 53 + CU_EGL_COLOR_FORMAT_BAYER12_BGGR = 54 + CU_EGL_COLOR_FORMAT_BAYER12_GRBG = 55 + CU_EGL_COLOR_FORMAT_BAYER12_GBRG = 56 + CU_EGL_COLOR_FORMAT_BAYER14_RGGB = 57 + CU_EGL_COLOR_FORMAT_BAYER14_BGGR = 58 + CU_EGL_COLOR_FORMAT_BAYER14_GRBG = 59 + CU_EGL_COLOR_FORMAT_BAYER14_GBRG = 60 + CU_EGL_COLOR_FORMAT_BAYER20_RGGB = 61 + CU_EGL_COLOR_FORMAT_BAYER20_BGGR = 62 + CU_EGL_COLOR_FORMAT_BAYER20_GRBG = 63 + CU_EGL_COLOR_FORMAT_BAYER20_GBRG = 64 + CU_EGL_COLOR_FORMAT_YVU444_PLANAR = 65 + CU_EGL_COLOR_FORMAT_YVU422_PLANAR = 66 + CU_EGL_COLOR_FORMAT_YVU420_PLANAR = 67 + CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB = 68 + CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR = 69 + CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG = 70 + CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG = 71 + CU_EGL_COLOR_FORMAT_BAYER_BCCR = 72 + CU_EGL_COLOR_FORMAT_BAYER_RCCB = 73 + CU_EGL_COLOR_FORMAT_BAYER_CRBC = 74 + CU_EGL_COLOR_FORMAT_BAYER_CBRC = 75 + CU_EGL_COLOR_FORMAT_BAYER10_CCCC = 76 + CU_EGL_COLOR_FORMAT_BAYER12_BCCR = 77 + CU_EGL_COLOR_FORMAT_BAYER12_RCCB = 78 + CU_EGL_COLOR_FORMAT_BAYER12_CRBC = 79 + CU_EGL_COLOR_FORMAT_BAYER12_CBRC = 80 + CU_EGL_COLOR_FORMAT_BAYER12_CCCC = 81 + CU_EGL_COLOR_FORMAT_Y = 82 + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 = 83 + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 = 84 + CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 = 85 + CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 = 86 + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 = 87 + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 = 88 + CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 = 89 + CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709 = 90 + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 = 91 + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 = 92 + CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 = 93 + CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR = 94 + CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709 = 95 + CU_EGL_COLOR_FORMAT_Y_ER = 96 + CU_EGL_COLOR_FORMAT_Y_709_ER = 97 + CU_EGL_COLOR_FORMAT_Y10_ER = 98 + CU_EGL_COLOR_FORMAT_Y10_709_ER = 99 + CU_EGL_COLOR_FORMAT_Y12_ER = 100 + CU_EGL_COLOR_FORMAT_Y12_709_ER = 101 + CU_EGL_COLOR_FORMAT_YUVA = 102 + CU_EGL_COLOR_FORMAT_YUV = 103 + CU_EGL_COLOR_FORMAT_YVYU = 104 + CU_EGL_COLOR_FORMAT_VYUY = 105 + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER = 106 + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER = 107 + CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER = 108 + CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER = 109 + CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER = 110 + CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER = 111 + CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER = 112 + CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER = 113 + CU_EGL_COLOR_FORMAT_UYVY_709 = 114 + CU_EGL_COLOR_FORMAT_UYVY_709_ER = 115 + CU_EGL_COLOR_FORMAT_UYVY_2020 = 116 + CU_EGL_COLOR_FORMAT_MAX = 117 + +ctypedef CUeglColorFormat_enum CUeglColorFormat + +cdef union anon_union17: + CUarray pArray[3] + void* pPitch[3] + +cdef struct CUeglFrame_st: + anon_union17 frame + unsigned int width + unsigned int height + unsigned int depth + unsigned int pitch + unsigned int planeCount + unsigned int numChannels + CUeglFrameType frameType + CUeglColorFormat eglColorFormat + CUarray_format cuFormat + +ctypedef CUeglFrame_st CUeglFrame_v1 + +ctypedef CUeglFrame_v1 CUeglFrame + +cdef extern from "": + cdef struct CUeglStreamConnection_st: + pass +ctypedef CUeglStreamConnection_st* CUeglStreamConnection + +cdef enum CUGLDeviceList_enum: + CU_GL_DEVICE_LIST_ALL = 1 + CU_GL_DEVICE_LIST_CURRENT_FRAME = 2 + CU_GL_DEVICE_LIST_NEXT_FRAME = 3 + +ctypedef CUGLDeviceList_enum CUGLDeviceList + +cdef enum CUGLmap_flags_enum: + CU_GL_MAP_RESOURCE_FLAGS_NONE = 0 + CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY = 1 + CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 2 + +ctypedef CUGLmap_flags_enum CUGLmap_flags + +ctypedef unsigned int GLenum + +ctypedef unsigned int GLuint + +cdef extern from "": + cdef struct void: + pass +ctypedef void* EGLImageKHR + +cdef extern from "": + cdef struct void: + pass +ctypedef void* EGLStreamKHR + +ctypedef unsigned int EGLint + +cdef extern from "": + cdef struct void: + pass +ctypedef void* EGLSyncKHR + +ctypedef uint32_t VdpDevice + +ctypedef unsigned long long VdpGetProcAddress + +ctypedef uint32_t VdpVideoSurface + +ctypedef uint32_t VdpOutputSurface + +cdef CUresult cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceTotalMem(size_t* numbytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format pformat, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType typename, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDevicePrimaryCtxRelease(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDevicePrimaryCtxSetFlags(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDevicePrimaryCtxReset(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxCreate(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxDestroy(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxPushCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxPopCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxSynchronize_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLinkCreate(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLinkAddData(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 + +cdef CUresult cuLinkAddFile(CUlinkState state, CUjitInputType typename, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +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 + +cdef CUresult cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLibraryGetManaged(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemGetInfo(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemAlloc(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemAllocPitch(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemFree(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemGetAddressRange(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemAllocHost(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemHostGetDevicePointer(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetPCIBusId(char* pciBusId, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuIpcOpenMemHandle(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemHostRegister(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyHtoD(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyDtoH(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyDtoD(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyDtoA(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyAtoD(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyHtoA(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyAtoH(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyAtoA(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpy2D(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpy2DUnaligned(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpy3D(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyHtoDAsync(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyDtoHAsync(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyDtoDAsync(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyHtoAAsync(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyAtoHAsync(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpy2DAsync(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpy3DAsync(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemsetD8(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemsetD16(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemsetD32(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemsetD2D8(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemsetD2D16(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemsetD2D32(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +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 + +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 + +cdef CUresult cuArrayCreate(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuArrayGetDescriptor(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuArray3DCreate(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuArray3DGetDescriptor(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType typename, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointIdReserve(CUlogicalEndpointId* baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointIdRelease(CUlogicalEndpointId baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointCreate(CUlogicalEndpointId leId, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointAddDevice(CUlogicalEndpointId leId, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointDestroy(CUlogicalEndpointId leId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointBindAddr(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, void* ptr, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointBindMem(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, CUmemGenericAllocationHandle memHandle, cuuint64_t memOffset, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointUnbind(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, cuuint64_t size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointExport(void* handle, CUlogicalEndpointId leId, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointImport(CUlogicalEndpointId leId, const void* handle, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointGetLimits(cuuint64_t* bindAlignment, cuuint64_t* maxSize, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogicalEndpointQuery(CUlogicalEndpointId leId, cuuint32_t count, int* queryStatus) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemPrefetchBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, CUmemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemDiscardBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemDiscardAndPrefetchBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, CUmemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamBeginCapture(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMode mode, CUgraph hGraph, CUgraphRecaptureCallback callbackFunc, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamGetCaptureInfo(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 + +cdef CUresult cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamDestroy(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEventDestroy(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamWaitValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamWaitValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamWriteValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamWriteValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamBatchMemOp(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncSetSharedSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphAddKernelNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphKernelNodeGetParams(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphKernelNodeSetParams(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphInstantiate(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecKernelNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecUpdate(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetAddress(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t numbytes) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetAddress2D(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetAddress(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +cdef CUresult cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil + +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 + +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 + +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 + +cdef CUresult cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsResourceGetMappedPointer(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsResourceSetMapFlags(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGetProcAddress(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGLGetDevices(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuVDPAUCtxCreate(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef CUresult cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + +cdef enum: CUDA_VERSION = 13030 + +cdef enum: CU_IPC_HANDLE_SIZE = 64 + +cdef enum: CU_STREAM_LEGACY = 1 + +cdef enum: CU_STREAM_PER_THREAD = 2 + +cdef enum: CU_COMPUTE_ACCELERATED_TARGET_BASE = 65536 + +cdef enum: CU_COMPUTE_FAMILY_TARGET_BASE = 131072 + +cdef enum: CU_GRAPH_COND_ASSIGN_DEFAULT = 1 + +cdef enum: CU_GRAPH_KERNEL_NODE_PORT_DEFAULT = 0 + +cdef enum: CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC = 1 + +cdef enum: CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER = 2 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = 2 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_DIMENSION = 4 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_PRIORITY = 8 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN = 10 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = 11 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 14 + +cdef enum: CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1 + +cdef enum: CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3 + +cdef enum: CU_STREAM_ATTRIBUTE_PRIORITY = 8 + +cdef enum: CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9 + +cdef enum: CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN = 10 + +cdef enum: CU_MEMHOSTALLOC_PORTABLE = 1 + +cdef enum: CU_MEMHOSTALLOC_DEVICEMAP = 2 + +cdef enum: CU_MEMHOSTALLOC_WRITECOMBINED = 4 + +cdef enum: CU_MEMHOSTREGISTER_PORTABLE = 1 + +cdef enum: CU_MEMHOSTREGISTER_DEVICEMAP = 2 + +cdef enum: CU_MEMHOSTREGISTER_IOMEMORY = 4 + +cdef enum: CU_MEMHOSTREGISTER_READ_ONLY = 8 + +cdef enum: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = 1 + +cdef enum: CU_TENSOR_MAP_NUM_QWORDS = 16 + +cdef enum: CUDA_EXTERNAL_MEMORY_DEDICATED = 1 + +cdef enum: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC = 1 + +cdef enum: CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC = 2 + +cdef enum: CUDA_NVSCISYNC_ATTR_SIGNAL = 1 + +cdef enum: CUDA_NVSCISYNC_ATTR_WAIT = 2 + +cdef enum: CU_MEM_CREATE_USAGE_TILE_POOL = 1 + +cdef enum: CU_MEM_CREATE_USAGE_HW_DECOMPRESS = 2 + +cdef enum: CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS = 2 + +cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = 1 + +cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = 2 + +cdef enum: CUDA_ARRAY3D_LAYERED = 1 + +cdef enum: CUDA_ARRAY3D_2DARRAY = 1 + +cdef enum: CUDA_ARRAY3D_SURFACE_LDST = 2 + +cdef enum: CUDA_ARRAY3D_CUBEMAP = 4 + +cdef enum: CUDA_ARRAY3D_TEXTURE_GATHER = 8 + +cdef enum: CUDA_ARRAY3D_DEPTH_TEXTURE = 16 + +cdef enum: CUDA_ARRAY3D_COLOR_ATTACHMENT = 32 + +cdef enum: CUDA_ARRAY3D_SPARSE = 64 + +cdef enum: CUDA_ARRAY3D_DEFERRED_MAPPING = 128 + +cdef enum: CUDA_ARRAY3D_VIDEO_ENCODE_DECODE = 256 + +cdef enum: CU_TRSA_OVERRIDE_FORMAT = 1 + +cdef enum: CU_TRSF_READ_AS_INTEGER = 1 + +cdef enum: CU_TRSF_NORMALIZED_COORDINATES = 2 + +cdef enum: CU_TRSF_SRGB = 16 + +cdef enum: CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 32 + +cdef enum: CU_TRSF_SEAMLESS_CUBEMAP = 64 + +cdef enum: CU_LAUNCH_KERNEL_REQUIRED_BLOCK_DIM = 1 + +cdef enum: CU_LAUNCH_PARAM_END_AS_INT = 0 + +cdef enum: CU_LAUNCH_PARAM_END = 0 + +cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT = 1 + +cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER = 1 + +cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT = 2 + +cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE = 2 + +cdef enum: CU_PARAM_TR_DEFAULT = -1 + +cdef enum: CU_DEVICE_CPU = -1 + +cdef enum: CU_DEVICE_INVALID = -2 + +cdef enum: MAX_PLANES = 3 + +cdef enum: CUDA_EGL_INFINITE_TIMEOUT = 4294967295 \ No newline at end of file diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cynvfatbin.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/cynvfatbin.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..f75063dd2d72ced4d7b6eb3f9eb495bd070f4c92 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/cynvfatbin.cpython-312-x86_64-linux-gnu.so differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cynvfatbin.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/cynvfatbin.pxd new file mode 100644 index 0000000000000000000000000000000000000000..5aab8de073e507de7151c7cc6e9fa576f2879ebf --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cynvfatbin.pxd @@ -0,0 +1,56 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.4.1 to 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + +from libc.stdint cimport intptr_t, uint32_t + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# enums +ctypedef enum nvFatbinResult "nvFatbinResult": + NVFATBIN_SUCCESS "NVFATBIN_SUCCESS" = 0 + NVFATBIN_ERROR_INTERNAL "NVFATBIN_ERROR_INTERNAL" + NVFATBIN_ERROR_ELF_ARCH_MISMATCH "NVFATBIN_ERROR_ELF_ARCH_MISMATCH" + NVFATBIN_ERROR_ELF_SIZE_MISMATCH "NVFATBIN_ERROR_ELF_SIZE_MISMATCH" + NVFATBIN_ERROR_MISSING_PTX_VERSION "NVFATBIN_ERROR_MISSING_PTX_VERSION" + NVFATBIN_ERROR_NULL_POINTER "NVFATBIN_ERROR_NULL_POINTER" + NVFATBIN_ERROR_COMPRESSION_FAILED "NVFATBIN_ERROR_COMPRESSION_FAILED" + NVFATBIN_ERROR_COMPRESSED_SIZE_EXCEEDED "NVFATBIN_ERROR_COMPRESSED_SIZE_EXCEEDED" + NVFATBIN_ERROR_UNRECOGNIZED_OPTION "NVFATBIN_ERROR_UNRECOGNIZED_OPTION" + NVFATBIN_ERROR_INVALID_ARCH "NVFATBIN_ERROR_INVALID_ARCH" + NVFATBIN_ERROR_INVALID_NVVM "NVFATBIN_ERROR_INVALID_NVVM" + NVFATBIN_ERROR_EMPTY_INPUT "NVFATBIN_ERROR_EMPTY_INPUT" + NVFATBIN_ERROR_MISSING_PTX_ARCH "NVFATBIN_ERROR_MISSING_PTX_ARCH" + NVFATBIN_ERROR_PTX_ARCH_MISMATCH "NVFATBIN_ERROR_PTX_ARCH_MISMATCH" + NVFATBIN_ERROR_MISSING_FATBIN "NVFATBIN_ERROR_MISSING_FATBIN" + NVFATBIN_ERROR_INVALID_INDEX "NVFATBIN_ERROR_INVALID_INDEX" + NVFATBIN_ERROR_IDENTIFIER_REUSE "NVFATBIN_ERROR_IDENTIFIER_REUSE" + NVFATBIN_ERROR_INTERNAL_PTX_OPTION "NVFATBIN_ERROR_INTERNAL_PTX_OPTION" + _NVFATBINRESULT_INTERNAL_LOADING_ERROR "_NVFATBINRESULT_INTERNAL_LOADING_ERROR" = -42 + + +# types +ctypedef void* nvFatbinHandle 'nvFatbinHandle' + + +############################################################################### +# Functions +############################################################################### + +cdef const char* nvFatbinGetErrorString(nvFatbinResult result) except?NULL nogil +cdef nvFatbinResult nvFatbinCreate(nvFatbinHandle* handle_indirect, const char** options, size_t optionsCount) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinDestroy(nvFatbinHandle* handle_indirect) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinAddPTX(nvFatbinHandle handle, const char* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinAddCubin(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinAddLTOIR(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinSize(nvFatbinHandle handle, size_t* size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinGet(nvFatbinHandle handle, void* buffer) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinVersion(unsigned int* major, unsigned int* minor) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinAddIndex(nvFatbinHandle handle, const void* code, size_t size, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinAddReloc(nvFatbinHandle handle, const void* code, size_t size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinAddTileIR(nvFatbinHandle handle, const void* code, size_t size, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cynvjitlink.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/cynvjitlink.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..18f83db6c703b381af46f971f7e0d764cf7b0a16 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/cynvjitlink.cpython-312-x86_64-linux-gnu.so differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cynvjitlink.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/cynvjitlink.pxd new file mode 100644 index 0000000000000000000000000000000000000000..8e94647775ee84e2516e4c1a425f4c67499f8250 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cynvjitlink.pxd @@ -0,0 +1,70 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. + +from libc.stdint cimport intptr_t, uint32_t + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# enums +ctypedef enum nvJitLinkResult "nvJitLinkResult": + NVJITLINK_SUCCESS "NVJITLINK_SUCCESS" = 0 + NVJITLINK_ERROR_UNRECOGNIZED_OPTION "NVJITLINK_ERROR_UNRECOGNIZED_OPTION" + NVJITLINK_ERROR_MISSING_ARCH "NVJITLINK_ERROR_MISSING_ARCH" + NVJITLINK_ERROR_INVALID_INPUT "NVJITLINK_ERROR_INVALID_INPUT" + NVJITLINK_ERROR_PTX_COMPILE "NVJITLINK_ERROR_PTX_COMPILE" + NVJITLINK_ERROR_NVVM_COMPILE "NVJITLINK_ERROR_NVVM_COMPILE" + NVJITLINK_ERROR_INTERNAL "NVJITLINK_ERROR_INTERNAL" + NVJITLINK_ERROR_THREADPOOL "NVJITLINK_ERROR_THREADPOOL" + NVJITLINK_ERROR_UNRECOGNIZED_INPUT "NVJITLINK_ERROR_UNRECOGNIZED_INPUT" + NVJITLINK_ERROR_FINALIZE "NVJITLINK_ERROR_FINALIZE" + NVJITLINK_ERROR_NULL_INPUT "NVJITLINK_ERROR_NULL_INPUT" + NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS "NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS" + NVJITLINK_ERROR_INCORRECT_INPUT_TYPE "NVJITLINK_ERROR_INCORRECT_INPUT_TYPE" + NVJITLINK_ERROR_ARCH_MISMATCH "NVJITLINK_ERROR_ARCH_MISMATCH" + NVJITLINK_ERROR_OUTDATED_LIBRARY "NVJITLINK_ERROR_OUTDATED_LIBRARY" + NVJITLINK_ERROR_MISSING_FATBIN "NVJITLINK_ERROR_MISSING_FATBIN" + NVJITLINK_ERROR_UNRECOGNIZED_ARCH "NVJITLINK_ERROR_UNRECOGNIZED_ARCH" + NVJITLINK_ERROR_UNSUPPORTED_ARCH "NVJITLINK_ERROR_UNSUPPORTED_ARCH" + NVJITLINK_ERROR_LTO_NOT_ENABLED "NVJITLINK_ERROR_LTO_NOT_ENABLED" + _NVJITLINKRESULT_INTERNAL_LOADING_ERROR "_NVJITLINKRESULT_INTERNAL_LOADING_ERROR" = -42 + +ctypedef enum nvJitLinkInputType "nvJitLinkInputType": + NVJITLINK_INPUT_NONE "NVJITLINK_INPUT_NONE" = 0 + NVJITLINK_INPUT_CUBIN "NVJITLINK_INPUT_CUBIN" = 1 + NVJITLINK_INPUT_PTX "NVJITLINK_INPUT_PTX" + NVJITLINK_INPUT_LTOIR "NVJITLINK_INPUT_LTOIR" + NVJITLINK_INPUT_FATBIN "NVJITLINK_INPUT_FATBIN" + NVJITLINK_INPUT_OBJECT "NVJITLINK_INPUT_OBJECT" + NVJITLINK_INPUT_LIBRARY "NVJITLINK_INPUT_LIBRARY" + NVJITLINK_INPUT_INDEX "NVJITLINK_INPUT_INDEX" + NVJITLINK_INPUT_ANY "NVJITLINK_INPUT_ANY" = 10 + + +# types +ctypedef void* nvJitLinkHandle 'nvJitLinkHandle' + + +############################################################################### +# Functions +############################################################################### + +cdef nvJitLinkResult nvJitLinkCreate(nvJitLinkHandle* handle, uint32_t numOptions, const char** options) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkDestroy(nvJitLinkHandle* handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkAddData(nvJitLinkHandle handle, nvJitLinkInputType inputType, const void* data, size_t size, const char* name) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkAddFile(nvJitLinkHandle handle, nvJitLinkInputType inputType, const char* fileName) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkComplete(nvJitLinkHandle handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetLinkedCubinSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetLinkedCubin(nvJitLinkHandle handle, void* cubin) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetLinkedPtxSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetLinkedPtx(nvJitLinkHandle handle, char* ptx) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetErrorLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetErrorLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetInfoLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetInfoLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkVersion(unsigned int* major, unsigned int* minor) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cynvml.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/cynvml.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..c6fa2e34a287244798604209bf6b024bf26e9196 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cynvml.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a72c1437da26ff75d838a0b7ad297f925c7b38f45567de6c0cb58b98e8bd0b49 +size 119168 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cynvml.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/cynvml.pxd new file mode 100644 index 0000000000000000000000000000000000000000..2bd67517e41f37afe93cb729d5b18896293775db --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cynvml.pxd @@ -0,0 +1,2358 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.9.1 to 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + +from libc.stdint cimport int64_t + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# enums +ctypedef enum nvmlBridgeChipType_t "nvmlBridgeChipType_t": + NVML_BRIDGE_CHIP_PLX "NVML_BRIDGE_CHIP_PLX" = 0 + NVML_BRIDGE_CHIP_BRO4 "NVML_BRIDGE_CHIP_BRO4" = 1 + +ctypedef enum nvmlNvLinkUtilizationCountUnits_t "nvmlNvLinkUtilizationCountUnits_t": + NVML_NVLINK_COUNTER_UNIT_CYCLES "NVML_NVLINK_COUNTER_UNIT_CYCLES" = 0 + NVML_NVLINK_COUNTER_UNIT_PACKETS "NVML_NVLINK_COUNTER_UNIT_PACKETS" = 1 + NVML_NVLINK_COUNTER_UNIT_BYTES "NVML_NVLINK_COUNTER_UNIT_BYTES" = 2 + NVML_NVLINK_COUNTER_UNIT_RESERVED "NVML_NVLINK_COUNTER_UNIT_RESERVED" = 3 + NVML_NVLINK_COUNTER_UNIT_COUNT "NVML_NVLINK_COUNTER_UNIT_COUNT" + +ctypedef enum nvmlNvLinkUtilizationCountPktTypes_t "nvmlNvLinkUtilizationCountPktTypes_t": + NVML_NVLINK_COUNTER_PKTFILTER_NOP "NVML_NVLINK_COUNTER_PKTFILTER_NOP" = 0x1 + NVML_NVLINK_COUNTER_PKTFILTER_READ "NVML_NVLINK_COUNTER_PKTFILTER_READ" = 0x2 + NVML_NVLINK_COUNTER_PKTFILTER_WRITE "NVML_NVLINK_COUNTER_PKTFILTER_WRITE" = 0x4 + NVML_NVLINK_COUNTER_PKTFILTER_RATOM "NVML_NVLINK_COUNTER_PKTFILTER_RATOM" = 0x8 + NVML_NVLINK_COUNTER_PKTFILTER_NRATOM "NVML_NVLINK_COUNTER_PKTFILTER_NRATOM" = 0x10 + NVML_NVLINK_COUNTER_PKTFILTER_FLUSH "NVML_NVLINK_COUNTER_PKTFILTER_FLUSH" = 0x20 + NVML_NVLINK_COUNTER_PKTFILTER_RESPDATA "NVML_NVLINK_COUNTER_PKTFILTER_RESPDATA" = 0x40 + NVML_NVLINK_COUNTER_PKTFILTER_RESPNODATA "NVML_NVLINK_COUNTER_PKTFILTER_RESPNODATA" = 0x80 + NVML_NVLINK_COUNTER_PKTFILTER_ALL "NVML_NVLINK_COUNTER_PKTFILTER_ALL" = 0xFF + +ctypedef enum nvmlNvLinkCapability_t "nvmlNvLinkCapability_t": + NVML_NVLINK_CAP_P2P_SUPPORTED "NVML_NVLINK_CAP_P2P_SUPPORTED" = 0 + NVML_NVLINK_CAP_SYSMEM_ACCESS "NVML_NVLINK_CAP_SYSMEM_ACCESS" = 1 + NVML_NVLINK_CAP_P2P_ATOMICS "NVML_NVLINK_CAP_P2P_ATOMICS" = 2 + NVML_NVLINK_CAP_SYSMEM_ATOMICS "NVML_NVLINK_CAP_SYSMEM_ATOMICS" = 3 + NVML_NVLINK_CAP_SLI_BRIDGE "NVML_NVLINK_CAP_SLI_BRIDGE" = 4 + NVML_NVLINK_CAP_VALID "NVML_NVLINK_CAP_VALID" = 5 + NVML_NVLINK_CAP_COUNT "NVML_NVLINK_CAP_COUNT" + +ctypedef enum nvmlNvLinkErrorCounter_t "nvmlNvLinkErrorCounter_t": + NVML_NVLINK_ERROR_DL_REPLAY "NVML_NVLINK_ERROR_DL_REPLAY" = 0 + NVML_NVLINK_ERROR_DL_RECOVERY "NVML_NVLINK_ERROR_DL_RECOVERY" = 1 + NVML_NVLINK_ERROR_DL_CRC_FLIT "NVML_NVLINK_ERROR_DL_CRC_FLIT" = 2 + NVML_NVLINK_ERROR_DL_CRC_DATA "NVML_NVLINK_ERROR_DL_CRC_DATA" = 3 + NVML_NVLINK_ERROR_DL_ECC_DATA "NVML_NVLINK_ERROR_DL_ECC_DATA" = 4 + NVML_NVLINK_ERROR_COUNT "NVML_NVLINK_ERROR_COUNT" + +ctypedef enum nvmlIntNvLinkDeviceType_t "nvmlIntNvLinkDeviceType_t": + NVML_NVLINK_DEVICE_TYPE_GPU "NVML_NVLINK_DEVICE_TYPE_GPU" = 0x00 + NVML_NVLINK_DEVICE_TYPE_IBMNPU "NVML_NVLINK_DEVICE_TYPE_IBMNPU" = 0x01 + NVML_NVLINK_DEVICE_TYPE_SWITCH "NVML_NVLINK_DEVICE_TYPE_SWITCH" = 0x02 + NVML_NVLINK_DEVICE_TYPE_UNKNOWN "NVML_NVLINK_DEVICE_TYPE_UNKNOWN" = 0xFF + +ctypedef enum nvmlGpuTopologyLevel_t "nvmlGpuTopologyLevel_t": + NVML_TOPOLOGY_INTERNAL "NVML_TOPOLOGY_INTERNAL" = 0 + NVML_TOPOLOGY_SINGLE "NVML_TOPOLOGY_SINGLE" = 10 + NVML_TOPOLOGY_MULTIPLE "NVML_TOPOLOGY_MULTIPLE" = 20 + NVML_TOPOLOGY_HOSTBRIDGE "NVML_TOPOLOGY_HOSTBRIDGE" = 30 + NVML_TOPOLOGY_NODE "NVML_TOPOLOGY_NODE" = 40 + NVML_TOPOLOGY_SYSTEM "NVML_TOPOLOGY_SYSTEM" = 50 + +ctypedef enum nvmlGpuP2PStatus_t "nvmlGpuP2PStatus_t": + NVML_P2P_STATUS_OK "NVML_P2P_STATUS_OK" = 0 + NVML_P2P_STATUS_CHIPSET_NOT_SUPPORED "NVML_P2P_STATUS_CHIPSET_NOT_SUPPORED" + NVML_P2P_STATUS_CHIPSET_NOT_SUPPORTED "NVML_P2P_STATUS_CHIPSET_NOT_SUPPORTED" = NVML_P2P_STATUS_CHIPSET_NOT_SUPPORED + NVML_P2P_STATUS_GPU_NOT_SUPPORTED "NVML_P2P_STATUS_GPU_NOT_SUPPORTED" + NVML_P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED "NVML_P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED" + NVML_P2P_STATUS_DISABLED_BY_REGKEY "NVML_P2P_STATUS_DISABLED_BY_REGKEY" + NVML_P2P_STATUS_NOT_SUPPORTED "NVML_P2P_STATUS_NOT_SUPPORTED" + NVML_P2P_STATUS_UNKNOWN "NVML_P2P_STATUS_UNKNOWN" + +ctypedef enum nvmlGpuP2PCapsIndex_t "nvmlGpuP2PCapsIndex_t": + NVML_P2P_CAPS_INDEX_READ "NVML_P2P_CAPS_INDEX_READ" = 0 + NVML_P2P_CAPS_INDEX_WRITE "NVML_P2P_CAPS_INDEX_WRITE" = 1 + NVML_P2P_CAPS_INDEX_NVLINK "NVML_P2P_CAPS_INDEX_NVLINK" = 2 + NVML_P2P_CAPS_INDEX_ATOMICS "NVML_P2P_CAPS_INDEX_ATOMICS" = 3 + NVML_P2P_CAPS_INDEX_PCI "NVML_P2P_CAPS_INDEX_PCI" = 4 + NVML_P2P_CAPS_INDEX_PROP "NVML_P2P_CAPS_INDEX_PROP" = NVML_P2P_CAPS_INDEX_PCI + NVML_P2P_CAPS_INDEX_UNKNOWN "NVML_P2P_CAPS_INDEX_UNKNOWN" = 5 + +ctypedef enum nvmlSamplingType_t "nvmlSamplingType_t": + NVML_TOTAL_POWER_SAMPLES "NVML_TOTAL_POWER_SAMPLES" = 0 + NVML_GPU_UTILIZATION_SAMPLES "NVML_GPU_UTILIZATION_SAMPLES" = 1 + NVML_MEMORY_UTILIZATION_SAMPLES "NVML_MEMORY_UTILIZATION_SAMPLES" = 2 + NVML_ENC_UTILIZATION_SAMPLES "NVML_ENC_UTILIZATION_SAMPLES" = 3 + NVML_DEC_UTILIZATION_SAMPLES "NVML_DEC_UTILIZATION_SAMPLES" = 4 + NVML_PROCESSOR_CLK_SAMPLES "NVML_PROCESSOR_CLK_SAMPLES" = 5 + NVML_MEMORY_CLK_SAMPLES "NVML_MEMORY_CLK_SAMPLES" = 6 + NVML_MODULE_POWER_SAMPLES "NVML_MODULE_POWER_SAMPLES" = 7 + NVML_JPG_UTILIZATION_SAMPLES "NVML_JPG_UTILIZATION_SAMPLES" = 8 + NVML_OFA_UTILIZATION_SAMPLES "NVML_OFA_UTILIZATION_SAMPLES" = 9 + NVML_SAMPLINGTYPE_COUNT "NVML_SAMPLINGTYPE_COUNT" + +ctypedef enum nvmlPcieUtilCounter_t "nvmlPcieUtilCounter_t": + NVML_PCIE_UTIL_TX_BYTES "NVML_PCIE_UTIL_TX_BYTES" = 0 + NVML_PCIE_UTIL_RX_BYTES "NVML_PCIE_UTIL_RX_BYTES" = 1 + NVML_PCIE_UTIL_COUNT "NVML_PCIE_UTIL_COUNT" + +ctypedef enum nvmlValueType_t "nvmlValueType_t": + NVML_VALUE_TYPE_DOUBLE "NVML_VALUE_TYPE_DOUBLE" = 0 + NVML_VALUE_TYPE_UNSIGNED_INT "NVML_VALUE_TYPE_UNSIGNED_INT" = 1 + NVML_VALUE_TYPE_UNSIGNED_LONG "NVML_VALUE_TYPE_UNSIGNED_LONG" = 2 + NVML_VALUE_TYPE_UNSIGNED_LONG_LONG "NVML_VALUE_TYPE_UNSIGNED_LONG_LONG" = 3 + NVML_VALUE_TYPE_SIGNED_LONG_LONG "NVML_VALUE_TYPE_SIGNED_LONG_LONG" = 4 + NVML_VALUE_TYPE_SIGNED_INT "NVML_VALUE_TYPE_SIGNED_INT" = 5 + NVML_VALUE_TYPE_UNSIGNED_SHORT "NVML_VALUE_TYPE_UNSIGNED_SHORT" = 6 + NVML_VALUE_TYPE_COUNT "NVML_VALUE_TYPE_COUNT" + +ctypedef enum nvmlPerfPolicyType_t "nvmlPerfPolicyType_t": + NVML_PERF_POLICY_POWER "NVML_PERF_POLICY_POWER" = 0 + NVML_PERF_POLICY_THERMAL "NVML_PERF_POLICY_THERMAL" = 1 + NVML_PERF_POLICY_SYNC_BOOST "NVML_PERF_POLICY_SYNC_BOOST" = 2 + NVML_PERF_POLICY_BOARD_LIMIT "NVML_PERF_POLICY_BOARD_LIMIT" = 3 + NVML_PERF_POLICY_LOW_UTILIZATION "NVML_PERF_POLICY_LOW_UTILIZATION" = 4 + NVML_PERF_POLICY_RELIABILITY "NVML_PERF_POLICY_RELIABILITY" = 5 + NVML_PERF_POLICY_TOTAL_APP_CLOCKS "NVML_PERF_POLICY_TOTAL_APP_CLOCKS" = 10 + NVML_PERF_POLICY_TOTAL_BASE_CLOCKS "NVML_PERF_POLICY_TOTAL_BASE_CLOCKS" = 11 + NVML_PERF_POLICY_COUNT "NVML_PERF_POLICY_COUNT" + +ctypedef enum nvmlThermalTarget_t "nvmlThermalTarget_t": + NVML_THERMAL_TARGET_NONE "NVML_THERMAL_TARGET_NONE" = 0 + NVML_THERMAL_TARGET_GPU "NVML_THERMAL_TARGET_GPU" = 1 + NVML_THERMAL_TARGET_MEMORY "NVML_THERMAL_TARGET_MEMORY" = 2 + NVML_THERMAL_TARGET_POWER_SUPPLY "NVML_THERMAL_TARGET_POWER_SUPPLY" = 4 + NVML_THERMAL_TARGET_BOARD "NVML_THERMAL_TARGET_BOARD" = 8 + NVML_THERMAL_TARGET_VCD_BOARD "NVML_THERMAL_TARGET_VCD_BOARD" = 9 + NVML_THERMAL_TARGET_VCD_INLET "NVML_THERMAL_TARGET_VCD_INLET" = 10 + NVML_THERMAL_TARGET_VCD_OUTLET "NVML_THERMAL_TARGET_VCD_OUTLET" = 11 + NVML_THERMAL_TARGET_ALL "NVML_THERMAL_TARGET_ALL" = 15 + NVML_THERMAL_TARGET_UNKNOWN "NVML_THERMAL_TARGET_UNKNOWN" = -(1) + +ctypedef enum nvmlThermalController_t "nvmlThermalController_t": + NVML_THERMAL_CONTROLLER_NONE "NVML_THERMAL_CONTROLLER_NONE" = 0 + NVML_THERMAL_CONTROLLER_GPU_INTERNAL "NVML_THERMAL_CONTROLLER_GPU_INTERNAL" + NVML_THERMAL_CONTROLLER_ADM1032 "NVML_THERMAL_CONTROLLER_ADM1032" + NVML_THERMAL_CONTROLLER_ADT7461 "NVML_THERMAL_CONTROLLER_ADT7461" + NVML_THERMAL_CONTROLLER_MAX6649 "NVML_THERMAL_CONTROLLER_MAX6649" + NVML_THERMAL_CONTROLLER_MAX1617 "NVML_THERMAL_CONTROLLER_MAX1617" + NVML_THERMAL_CONTROLLER_LM99 "NVML_THERMAL_CONTROLLER_LM99" + NVML_THERMAL_CONTROLLER_LM89 "NVML_THERMAL_CONTROLLER_LM89" + NVML_THERMAL_CONTROLLER_LM64 "NVML_THERMAL_CONTROLLER_LM64" + NVML_THERMAL_CONTROLLER_G781 "NVML_THERMAL_CONTROLLER_G781" + NVML_THERMAL_CONTROLLER_ADT7473 "NVML_THERMAL_CONTROLLER_ADT7473" + NVML_THERMAL_CONTROLLER_SBMAX6649 "NVML_THERMAL_CONTROLLER_SBMAX6649" + NVML_THERMAL_CONTROLLER_VBIOSEVT "NVML_THERMAL_CONTROLLER_VBIOSEVT" + NVML_THERMAL_CONTROLLER_OS "NVML_THERMAL_CONTROLLER_OS" + NVML_THERMAL_CONTROLLER_NVSYSCON_CANOAS "NVML_THERMAL_CONTROLLER_NVSYSCON_CANOAS" + NVML_THERMAL_CONTROLLER_NVSYSCON_E551 "NVML_THERMAL_CONTROLLER_NVSYSCON_E551" + NVML_THERMAL_CONTROLLER_MAX6649R "NVML_THERMAL_CONTROLLER_MAX6649R" + NVML_THERMAL_CONTROLLER_ADT7473S "NVML_THERMAL_CONTROLLER_ADT7473S" + NVML_THERMAL_CONTROLLER_UNKNOWN "NVML_THERMAL_CONTROLLER_UNKNOWN" = -(1) + +ctypedef enum nvmlCoolerControl_t "nvmlCoolerControl_t": + NVML_THERMAL_COOLER_SIGNAL_NONE "NVML_THERMAL_COOLER_SIGNAL_NONE" = 0 + NVML_THERMAL_COOLER_SIGNAL_TOGGLE "NVML_THERMAL_COOLER_SIGNAL_TOGGLE" = 1 + NVML_THERMAL_COOLER_SIGNAL_VARIABLE "NVML_THERMAL_COOLER_SIGNAL_VARIABLE" = 2 + NVML_THERMAL_COOLER_SIGNAL_COUNT "NVML_THERMAL_COOLER_SIGNAL_COUNT" + +ctypedef enum nvmlCoolerTarget_t "nvmlCoolerTarget_t": + NVML_THERMAL_COOLER_TARGET_NONE "NVML_THERMAL_COOLER_TARGET_NONE" = (1 << 0) + NVML_THERMAL_COOLER_TARGET_GPU "NVML_THERMAL_COOLER_TARGET_GPU" = (1 << 1) + NVML_THERMAL_COOLER_TARGET_MEMORY "NVML_THERMAL_COOLER_TARGET_MEMORY" = (1 << 2) + NVML_THERMAL_COOLER_TARGET_POWER_SUPPLY "NVML_THERMAL_COOLER_TARGET_POWER_SUPPLY" = (1 << 3) + NVML_THERMAL_COOLER_TARGET_GPU_RELATED "NVML_THERMAL_COOLER_TARGET_GPU_RELATED" = ((NVML_THERMAL_COOLER_TARGET_GPU | NVML_THERMAL_COOLER_TARGET_MEMORY) | NVML_THERMAL_COOLER_TARGET_POWER_SUPPLY) + +ctypedef enum nvmlUUIDType_t "nvmlUUIDType_t": + NVML_UUID_TYPE_NONE "NVML_UUID_TYPE_NONE" = 0 + NVML_UUID_TYPE_ASCII "NVML_UUID_TYPE_ASCII" = 1 + NVML_UUID_TYPE_BINARY "NVML_UUID_TYPE_BINARY" = 2 + +ctypedef enum nvmlEnableState_t "nvmlEnableState_t": + NVML_FEATURE_DISABLED "NVML_FEATURE_DISABLED" = 0 + NVML_FEATURE_ENABLED "NVML_FEATURE_ENABLED" = 1 + +ctypedef enum nvmlBrandType_t "nvmlBrandType_t": + NVML_BRAND_UNKNOWN "NVML_BRAND_UNKNOWN" = 0 + NVML_BRAND_QUADRO "NVML_BRAND_QUADRO" = 1 + NVML_BRAND_TESLA "NVML_BRAND_TESLA" = 2 + NVML_BRAND_NVS "NVML_BRAND_NVS" = 3 + NVML_BRAND_GRID "NVML_BRAND_GRID" = 4 + NVML_BRAND_GEFORCE "NVML_BRAND_GEFORCE" = 5 + NVML_BRAND_TITAN "NVML_BRAND_TITAN" = 6 + NVML_BRAND_NVIDIA_VAPPS "NVML_BRAND_NVIDIA_VAPPS" = 7 + NVML_BRAND_NVIDIA_VPC "NVML_BRAND_NVIDIA_VPC" = 8 + NVML_BRAND_NVIDIA_VCS "NVML_BRAND_NVIDIA_VCS" = 9 + NVML_BRAND_NVIDIA_VWS "NVML_BRAND_NVIDIA_VWS" = 10 + NVML_BRAND_NVIDIA_CLOUD_GAMING "NVML_BRAND_NVIDIA_CLOUD_GAMING" = 11 + NVML_BRAND_NVIDIA_VGAMING "NVML_BRAND_NVIDIA_VGAMING" = NVML_BRAND_NVIDIA_CLOUD_GAMING + NVML_BRAND_QUADRO_RTX "NVML_BRAND_QUADRO_RTX" = 12 + NVML_BRAND_NVIDIA_RTX "NVML_BRAND_NVIDIA_RTX" = 13 + NVML_BRAND_NVIDIA "NVML_BRAND_NVIDIA" = 14 + NVML_BRAND_GEFORCE_RTX "NVML_BRAND_GEFORCE_RTX" = 15 + NVML_BRAND_TITAN_RTX "NVML_BRAND_TITAN_RTX" = 16 + NVML_BRAND_COUNT "NVML_BRAND_COUNT" = 18 + +ctypedef enum nvmlTemperatureThresholds_t "nvmlTemperatureThresholds_t": + NVML_TEMPERATURE_THRESHOLD_SHUTDOWN "NVML_TEMPERATURE_THRESHOLD_SHUTDOWN" = 0 + NVML_TEMPERATURE_THRESHOLD_SLOWDOWN "NVML_TEMPERATURE_THRESHOLD_SLOWDOWN" = 1 + NVML_TEMPERATURE_THRESHOLD_MEM_MAX "NVML_TEMPERATURE_THRESHOLD_MEM_MAX" = 2 + NVML_TEMPERATURE_THRESHOLD_GPU_MAX "NVML_TEMPERATURE_THRESHOLD_GPU_MAX" = 3 + NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MIN "NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MIN" = 4 + NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_CURR "NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_CURR" = 5 + NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MAX "NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MAX" = 6 + NVML_TEMPERATURE_THRESHOLD_GPS_CURR "NVML_TEMPERATURE_THRESHOLD_GPS_CURR" = 7 + NVML_TEMPERATURE_THRESHOLD_COUNT "NVML_TEMPERATURE_THRESHOLD_COUNT" + +ctypedef enum nvmlTemperatureSensors_t "nvmlTemperatureSensors_t": + NVML_TEMPERATURE_GPU "NVML_TEMPERATURE_GPU" = 0 + NVML_TEMPERATURE_COUNT "NVML_TEMPERATURE_COUNT" + +ctypedef enum nvmlComputeMode_t "nvmlComputeMode_t": + NVML_COMPUTEMODE_DEFAULT "NVML_COMPUTEMODE_DEFAULT" = 0 + NVML_COMPUTEMODE_EXCLUSIVE_THREAD "NVML_COMPUTEMODE_EXCLUSIVE_THREAD" = 1 + NVML_COMPUTEMODE_PROHIBITED "NVML_COMPUTEMODE_PROHIBITED" = 2 + NVML_COMPUTEMODE_EXCLUSIVE_PROCESS "NVML_COMPUTEMODE_EXCLUSIVE_PROCESS" = 3 + NVML_COMPUTEMODE_COUNT "NVML_COMPUTEMODE_COUNT" + +ctypedef enum nvmlMemoryErrorType_t "nvmlMemoryErrorType_t": + NVML_MEMORY_ERROR_TYPE_CORRECTED "NVML_MEMORY_ERROR_TYPE_CORRECTED" = 0 + NVML_MEMORY_ERROR_TYPE_UNCORRECTED "NVML_MEMORY_ERROR_TYPE_UNCORRECTED" = 1 + NVML_MEMORY_ERROR_TYPE_COUNT "NVML_MEMORY_ERROR_TYPE_COUNT" + +ctypedef enum nvmlNvlinkVersion_t "nvmlNvlinkVersion_t": + NVML_NVLINK_VERSION_INVALID "NVML_NVLINK_VERSION_INVALID" = 0 + NVML_NVLINK_VERSION_1_0 "NVML_NVLINK_VERSION_1_0" = 1 + NVML_NVLINK_VERSION_2_0 "NVML_NVLINK_VERSION_2_0" = 2 + NVML_NVLINK_VERSION_2_2 "NVML_NVLINK_VERSION_2_2" = 3 + NVML_NVLINK_VERSION_3_0 "NVML_NVLINK_VERSION_3_0" = 4 + NVML_NVLINK_VERSION_3_1 "NVML_NVLINK_VERSION_3_1" = 5 + NVML_NVLINK_VERSION_4_0 "NVML_NVLINK_VERSION_4_0" = 6 + NVML_NVLINK_VERSION_5_0 "NVML_NVLINK_VERSION_5_0" = 7 + NVML_NVLINK_VERSION_6_0 "NVML_NVLINK_VERSION_6_0" = 8 + +ctypedef enum nvmlEccCounterType_t "nvmlEccCounterType_t": + NVML_VOLATILE_ECC "NVML_VOLATILE_ECC" = 0 + NVML_AGGREGATE_ECC "NVML_AGGREGATE_ECC" = 1 + NVML_ECC_COUNTER_TYPE_COUNT "NVML_ECC_COUNTER_TYPE_COUNT" + +ctypedef enum nvmlClockType_t "nvmlClockType_t": + NVML_CLOCK_GRAPHICS "NVML_CLOCK_GRAPHICS" = 0 + NVML_CLOCK_SM "NVML_CLOCK_SM" = 1 + NVML_CLOCK_MEM "NVML_CLOCK_MEM" = 2 + NVML_CLOCK_VIDEO "NVML_CLOCK_VIDEO" = 3 + NVML_CLOCK_COUNT "NVML_CLOCK_COUNT" + +ctypedef enum nvmlClockId_t "nvmlClockId_t": + NVML_CLOCK_ID_CURRENT "NVML_CLOCK_ID_CURRENT" = 0 + NVML_CLOCK_ID_APP_CLOCK_TARGET "NVML_CLOCK_ID_APP_CLOCK_TARGET" = 1 + NVML_CLOCK_ID_APP_CLOCK_DEFAULT "NVML_CLOCK_ID_APP_CLOCK_DEFAULT" = 2 + NVML_CLOCK_ID_CUSTOMER_BOOST_MAX "NVML_CLOCK_ID_CUSTOMER_BOOST_MAX" = 3 + NVML_CLOCK_ID_COUNT "NVML_CLOCK_ID_COUNT" + +ctypedef enum nvmlDriverModel_t "nvmlDriverModel_t": + NVML_DRIVER_WDDM "NVML_DRIVER_WDDM" = 0 + NVML_DRIVER_WDM "NVML_DRIVER_WDM" = 1 + NVML_DRIVER_MCDM "NVML_DRIVER_MCDM" = 2 + +ctypedef enum nvmlPstates_t "nvmlPstates_t": + NVML_PSTATE_0 "NVML_PSTATE_0" = 0 + NVML_PSTATE_1 "NVML_PSTATE_1" = 1 + NVML_PSTATE_2 "NVML_PSTATE_2" = 2 + NVML_PSTATE_3 "NVML_PSTATE_3" = 3 + NVML_PSTATE_4 "NVML_PSTATE_4" = 4 + NVML_PSTATE_5 "NVML_PSTATE_5" = 5 + NVML_PSTATE_6 "NVML_PSTATE_6" = 6 + NVML_PSTATE_7 "NVML_PSTATE_7" = 7 + NVML_PSTATE_8 "NVML_PSTATE_8" = 8 + NVML_PSTATE_9 "NVML_PSTATE_9" = 9 + NVML_PSTATE_10 "NVML_PSTATE_10" = 10 + NVML_PSTATE_11 "NVML_PSTATE_11" = 11 + NVML_PSTATE_12 "NVML_PSTATE_12" = 12 + NVML_PSTATE_13 "NVML_PSTATE_13" = 13 + NVML_PSTATE_14 "NVML_PSTATE_14" = 14 + NVML_PSTATE_15 "NVML_PSTATE_15" = 15 + NVML_PSTATE_UNKNOWN "NVML_PSTATE_UNKNOWN" = 32 + +ctypedef enum nvmlGpuOperationMode_t "nvmlGpuOperationMode_t": + NVML_GOM_ALL_ON "NVML_GOM_ALL_ON" = 0 + NVML_GOM_COMPUTE "NVML_GOM_COMPUTE" = 1 + NVML_GOM_LOW_DP "NVML_GOM_LOW_DP" = 2 + +ctypedef enum nvmlInforomObject_t "nvmlInforomObject_t": + NVML_INFOROM_OEM "NVML_INFOROM_OEM" = 0 + NVML_INFOROM_ECC "NVML_INFOROM_ECC" = 1 + NVML_INFOROM_POWER "NVML_INFOROM_POWER" = 2 + NVML_INFOROM_DEN "NVML_INFOROM_DEN" = 3 + NVML_INFOROM_COUNT "NVML_INFOROM_COUNT" + +ctypedef enum nvmlReturn_t "nvmlReturn_t": + NVML_SUCCESS "NVML_SUCCESS" = 0 + NVML_ERROR_UNINITIALIZED "NVML_ERROR_UNINITIALIZED" = 1 + NVML_ERROR_INVALID_ARGUMENT "NVML_ERROR_INVALID_ARGUMENT" = 2 + NVML_ERROR_NOT_SUPPORTED "NVML_ERROR_NOT_SUPPORTED" = 3 + NVML_ERROR_NO_PERMISSION "NVML_ERROR_NO_PERMISSION" = 4 + NVML_ERROR_ALREADY_INITIALIZED "NVML_ERROR_ALREADY_INITIALIZED" = 5 + NVML_ERROR_NOT_FOUND "NVML_ERROR_NOT_FOUND" = 6 + NVML_ERROR_INSUFFICIENT_SIZE "NVML_ERROR_INSUFFICIENT_SIZE" = 7 + NVML_ERROR_INSUFFICIENT_POWER "NVML_ERROR_INSUFFICIENT_POWER" = 8 + NVML_ERROR_DRIVER_NOT_LOADED "NVML_ERROR_DRIVER_NOT_LOADED" = 9 + NVML_ERROR_TIMEOUT "NVML_ERROR_TIMEOUT" = 10 + NVML_ERROR_IRQ_ISSUE "NVML_ERROR_IRQ_ISSUE" = 11 + NVML_ERROR_LIBRARY_NOT_FOUND "NVML_ERROR_LIBRARY_NOT_FOUND" = 12 + NVML_ERROR_FUNCTION_NOT_FOUND "NVML_ERROR_FUNCTION_NOT_FOUND" = 13 + NVML_ERROR_CORRUPTED_INFOROM "NVML_ERROR_CORRUPTED_INFOROM" = 14 + NVML_ERROR_GPU_IS_LOST "NVML_ERROR_GPU_IS_LOST" = 15 + NVML_ERROR_RESET_REQUIRED "NVML_ERROR_RESET_REQUIRED" = 16 + NVML_ERROR_OPERATING_SYSTEM "NVML_ERROR_OPERATING_SYSTEM" = 17 + NVML_ERROR_LIB_RM_VERSION_MISMATCH "NVML_ERROR_LIB_RM_VERSION_MISMATCH" = 18 + NVML_ERROR_IN_USE "NVML_ERROR_IN_USE" = 19 + NVML_ERROR_MEMORY "NVML_ERROR_MEMORY" = 20 + NVML_ERROR_NO_DATA "NVML_ERROR_NO_DATA" = 21 + NVML_ERROR_VGPU_ECC_NOT_SUPPORTED "NVML_ERROR_VGPU_ECC_NOT_SUPPORTED" = 22 + NVML_ERROR_INSUFFICIENT_RESOURCES "NVML_ERROR_INSUFFICIENT_RESOURCES" = 23 + NVML_ERROR_FREQ_NOT_SUPPORTED "NVML_ERROR_FREQ_NOT_SUPPORTED" = 24 + NVML_ERROR_ARGUMENT_VERSION_MISMATCH "NVML_ERROR_ARGUMENT_VERSION_MISMATCH" = 25 + NVML_ERROR_DEPRECATED "NVML_ERROR_DEPRECATED" = 26 + NVML_ERROR_NOT_READY "NVML_ERROR_NOT_READY" = 27 + NVML_ERROR_GPU_NOT_FOUND "NVML_ERROR_GPU_NOT_FOUND" = 28 + NVML_ERROR_INVALID_STATE "NVML_ERROR_INVALID_STATE" = 29 + NVML_ERROR_RESET_TYPE_NOT_SUPPORTED "NVML_ERROR_RESET_TYPE_NOT_SUPPORTED" = 30 + NVML_ERROR_UNKNOWN "NVML_ERROR_UNKNOWN" = 999 + _NVMLRETURN_T_INTERNAL_LOADING_ERROR "_NVMLRETURN_T_INTERNAL_LOADING_ERROR" = -42 + +ctypedef enum nvmlMemoryLocation_t "nvmlMemoryLocation_t": + NVML_MEMORY_LOCATION_L1_CACHE "NVML_MEMORY_LOCATION_L1_CACHE" = 0 + NVML_MEMORY_LOCATION_L2_CACHE "NVML_MEMORY_LOCATION_L2_CACHE" = 1 + NVML_MEMORY_LOCATION_DRAM "NVML_MEMORY_LOCATION_DRAM" = 2 + NVML_MEMORY_LOCATION_DEVICE_MEMORY "NVML_MEMORY_LOCATION_DEVICE_MEMORY" = 2 + NVML_MEMORY_LOCATION_REGISTER_FILE "NVML_MEMORY_LOCATION_REGISTER_FILE" = 3 + NVML_MEMORY_LOCATION_TEXTURE_MEMORY "NVML_MEMORY_LOCATION_TEXTURE_MEMORY" = 4 + NVML_MEMORY_LOCATION_TEXTURE_SHM "NVML_MEMORY_LOCATION_TEXTURE_SHM" = 5 + NVML_MEMORY_LOCATION_CBU "NVML_MEMORY_LOCATION_CBU" = 6 + NVML_MEMORY_LOCATION_SRAM "NVML_MEMORY_LOCATION_SRAM" = 7 + NVML_MEMORY_LOCATION_COUNT "NVML_MEMORY_LOCATION_COUNT" + +ctypedef enum nvmlPageRetirementCause_t "nvmlPageRetirementCause_t": + NVML_PAGE_RETIREMENT_CAUSE_MULTIPLE_SINGLE_BIT_ECC_ERRORS "NVML_PAGE_RETIREMENT_CAUSE_MULTIPLE_SINGLE_BIT_ECC_ERRORS" = 0 + NVML_PAGE_RETIREMENT_CAUSE_DOUBLE_BIT_ECC_ERROR "NVML_PAGE_RETIREMENT_CAUSE_DOUBLE_BIT_ECC_ERROR" = 1 + NVML_PAGE_RETIREMENT_CAUSE_COUNT "NVML_PAGE_RETIREMENT_CAUSE_COUNT" + +ctypedef enum nvmlRestrictedAPI_t "nvmlRestrictedAPI_t": + NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS "NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS" = 0 + NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS "NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS" = 1 + NVML_RESTRICTED_API_COUNT "NVML_RESTRICTED_API_COUNT" + +ctypedef enum nvmlGpuUtilizationDomainId_t "nvmlGpuUtilizationDomainId_t": + NVML_GPU_UTILIZATION_DOMAIN_GPU "NVML_GPU_UTILIZATION_DOMAIN_GPU" = 0 + NVML_GPU_UTILIZATION_DOMAIN_FB "NVML_GPU_UTILIZATION_DOMAIN_FB" = 1 + NVML_GPU_UTILIZATION_DOMAIN_VID "NVML_GPU_UTILIZATION_DOMAIN_VID" = 2 + NVML_GPU_UTILIZATION_DOMAIN_BUS "NVML_GPU_UTILIZATION_DOMAIN_BUS" = 3 + +ctypedef enum nvmlGpuVirtualizationMode_t "nvmlGpuVirtualizationMode_t": + NVML_GPU_VIRTUALIZATION_MODE_NONE "NVML_GPU_VIRTUALIZATION_MODE_NONE" = 0 + NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH "NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH" = 1 + NVML_GPU_VIRTUALIZATION_MODE_VGPU "NVML_GPU_VIRTUALIZATION_MODE_VGPU" = 2 + NVML_GPU_VIRTUALIZATION_MODE_HOST_VGPU "NVML_GPU_VIRTUALIZATION_MODE_HOST_VGPU" = 3 + NVML_GPU_VIRTUALIZATION_MODE_HOST_VSGA "NVML_GPU_VIRTUALIZATION_MODE_HOST_VSGA" = 4 + +ctypedef enum nvmlHostVgpuMode_t "nvmlHostVgpuMode_t": + NVML_HOST_VGPU_MODE_NON_SRIOV "NVML_HOST_VGPU_MODE_NON_SRIOV" = 0 + NVML_HOST_VGPU_MODE_SRIOV "NVML_HOST_VGPU_MODE_SRIOV" = 1 + +ctypedef enum nvmlVgpuVmIdType_t "nvmlVgpuVmIdType_t": + NVML_VGPU_VM_ID_DOMAIN_ID "NVML_VGPU_VM_ID_DOMAIN_ID" = 0 + NVML_VGPU_VM_ID_UUID "NVML_VGPU_VM_ID_UUID" = 1 + +ctypedef enum nvmlVgpuGuestInfoState_t "nvmlVgpuGuestInfoState_t": + NVML_VGPU_INSTANCE_GUEST_INFO_STATE_UNINITIALIZED "NVML_VGPU_INSTANCE_GUEST_INFO_STATE_UNINITIALIZED" = 0 + NVML_VGPU_INSTANCE_GUEST_INFO_STATE_INITIALIZED "NVML_VGPU_INSTANCE_GUEST_INFO_STATE_INITIALIZED" = 1 + +ctypedef enum nvmlGridLicenseFeatureCode_t "nvmlGridLicenseFeatureCode_t": + NVML_GRID_LICENSE_FEATURE_CODE_UNKNOWN "NVML_GRID_LICENSE_FEATURE_CODE_UNKNOWN" = 0 + NVML_GRID_LICENSE_FEATURE_CODE_VGPU "NVML_GRID_LICENSE_FEATURE_CODE_VGPU" = 1 + NVML_GRID_LICENSE_FEATURE_CODE_NVIDIA_RTX "NVML_GRID_LICENSE_FEATURE_CODE_NVIDIA_RTX" = 2 + NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION "NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION" = NVML_GRID_LICENSE_FEATURE_CODE_NVIDIA_RTX + NVML_GRID_LICENSE_FEATURE_CODE_GAMING "NVML_GRID_LICENSE_FEATURE_CODE_GAMING" = 3 + NVML_GRID_LICENSE_FEATURE_CODE_COMPUTE "NVML_GRID_LICENSE_FEATURE_CODE_COMPUTE" = 4 + +ctypedef enum nvmlVgpuCapability_t "nvmlVgpuCapability_t": + NVML_VGPU_CAP_NVLINK_P2P "NVML_VGPU_CAP_NVLINK_P2P" = 0 + NVML_VGPU_CAP_GPUDIRECT "NVML_VGPU_CAP_GPUDIRECT" = 1 + NVML_VGPU_CAP_MULTI_VGPU_EXCLUSIVE "NVML_VGPU_CAP_MULTI_VGPU_EXCLUSIVE" = 2 + NVML_VGPU_CAP_EXCLUSIVE_TYPE "NVML_VGPU_CAP_EXCLUSIVE_TYPE" = 3 + NVML_VGPU_CAP_EXCLUSIVE_SIZE "NVML_VGPU_CAP_EXCLUSIVE_SIZE" = 4 + NVML_VGPU_CAP_COUNT "NVML_VGPU_CAP_COUNT" + +ctypedef enum nvmlVgpuDriverCapability_t "nvmlVgpuDriverCapability_t": + NVML_VGPU_DRIVER_CAP_HETEROGENEOUS_MULTI_VGPU "NVML_VGPU_DRIVER_CAP_HETEROGENEOUS_MULTI_VGPU" = 0 + NVML_VGPU_DRIVER_CAP_WARM_UPDATE "NVML_VGPU_DRIVER_CAP_WARM_UPDATE" = 1 + NVML_VGPU_DRIVER_CAP_COUNT "NVML_VGPU_DRIVER_CAP_COUNT" + +ctypedef enum nvmlDeviceVgpuCapability_t "nvmlDeviceVgpuCapability_t": + NVML_DEVICE_VGPU_CAP_FRACTIONAL_MULTI_VGPU "NVML_DEVICE_VGPU_CAP_FRACTIONAL_MULTI_VGPU" = 0 + NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_PROFILES "NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_PROFILES" = 1 + NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_SIZES "NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_SIZES" = 2 + NVML_DEVICE_VGPU_CAP_READ_DEVICE_BUFFER_BW "NVML_DEVICE_VGPU_CAP_READ_DEVICE_BUFFER_BW" = 3 + NVML_DEVICE_VGPU_CAP_WRITE_DEVICE_BUFFER_BW "NVML_DEVICE_VGPU_CAP_WRITE_DEVICE_BUFFER_BW" = 4 + NVML_DEVICE_VGPU_CAP_DEVICE_STREAMING "NVML_DEVICE_VGPU_CAP_DEVICE_STREAMING" = 5 + NVML_DEVICE_VGPU_CAP_MINI_QUARTER_GPU "NVML_DEVICE_VGPU_CAP_MINI_QUARTER_GPU" = 6 + NVML_DEVICE_VGPU_CAP_COMPUTE_MEDIA_ENGINE_GPU "NVML_DEVICE_VGPU_CAP_COMPUTE_MEDIA_ENGINE_GPU" = 7 + NVML_DEVICE_VGPU_CAP_WARM_UPDATE "NVML_DEVICE_VGPU_CAP_WARM_UPDATE" = 8 + NVML_DEVICE_VGPU_CAP_HOMOGENEOUS_PLACEMENTS "NVML_DEVICE_VGPU_CAP_HOMOGENEOUS_PLACEMENTS" = 9 + NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_SUPPORTED "NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_SUPPORTED" = 10 + NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_ENABLED "NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_ENABLED" = 11 + NVML_DEVICE_VGPU_CAP_COUNT "NVML_DEVICE_VGPU_CAP_COUNT" + +ctypedef enum nvmlDeviceGpuRecoveryAction_t "nvmlDeviceGpuRecoveryAction_t": + NVML_GPU_RECOVERY_ACTION_NONE "NVML_GPU_RECOVERY_ACTION_NONE" = 0 + NVML_GPU_RECOVERY_ACTION_GPU_RESET "NVML_GPU_RECOVERY_ACTION_GPU_RESET" = 1 + NVML_GPU_RECOVERY_ACTION_NODE_REBOOT "NVML_GPU_RECOVERY_ACTION_NODE_REBOOT" = 2 + NVML_GPU_RECOVERY_ACTION_DRAIN_P2P "NVML_GPU_RECOVERY_ACTION_DRAIN_P2P" = 3 + NVML_GPU_RECOVERY_ACTION_DRAIN_AND_RESET "NVML_GPU_RECOVERY_ACTION_DRAIN_AND_RESET" = 4 + NVML_GPU_RECOVERY_ACTION_RECOVER_IMEX_DOMAIN "NVML_GPU_RECOVERY_ACTION_RECOVER_IMEX_DOMAIN" = 5 + +ctypedef enum nvmlFanState_t "nvmlFanState_t": + NVML_FAN_NORMAL "NVML_FAN_NORMAL" = 0 + NVML_FAN_FAILED "NVML_FAN_FAILED" = 1 + +ctypedef enum nvmlLedColor_t "nvmlLedColor_t": + NVML_LED_COLOR_GREEN "NVML_LED_COLOR_GREEN" = 0 + NVML_LED_COLOR_AMBER "NVML_LED_COLOR_AMBER" = 1 + +ctypedef enum nvmlEncoderType_t "nvmlEncoderType_t": + NVML_ENCODER_QUERY_H264 "NVML_ENCODER_QUERY_H264" = 0x00 + NVML_ENCODER_QUERY_HEVC "NVML_ENCODER_QUERY_HEVC" = 0x01 + NVML_ENCODER_QUERY_AV1 "NVML_ENCODER_QUERY_AV1" = 0x02 + NVML_ENCODER_QUERY_UNKNOWN "NVML_ENCODER_QUERY_UNKNOWN" = 0xFF + +ctypedef enum nvmlFBCSessionType_t "nvmlFBCSessionType_t": + NVML_FBC_SESSION_TYPE_UNKNOWN "NVML_FBC_SESSION_TYPE_UNKNOWN" = 0 + NVML_FBC_SESSION_TYPE_TOSYS "NVML_FBC_SESSION_TYPE_TOSYS" + NVML_FBC_SESSION_TYPE_CUDA "NVML_FBC_SESSION_TYPE_CUDA" + NVML_FBC_SESSION_TYPE_VID "NVML_FBC_SESSION_TYPE_VID" + NVML_FBC_SESSION_TYPE_HWENC "NVML_FBC_SESSION_TYPE_HWENC" + +ctypedef enum nvmlDetachGpuState_t "nvmlDetachGpuState_t": + NVML_DETACH_GPU_KEEP "NVML_DETACH_GPU_KEEP" = 0 + NVML_DETACH_GPU_REMOVE "NVML_DETACH_GPU_REMOVE" + +ctypedef enum nvmlPcieLinkState_t "nvmlPcieLinkState_t": + NVML_PCIE_LINK_KEEP "NVML_PCIE_LINK_KEEP" = 0 + NVML_PCIE_LINK_SHUT_DOWN "NVML_PCIE_LINK_SHUT_DOWN" + +ctypedef enum nvmlClockLimitId_t "nvmlClockLimitId_t": + NVML_CLOCK_LIMIT_ID_RANGE_START "NVML_CLOCK_LIMIT_ID_RANGE_START" = 0xffffff00 + NVML_CLOCK_LIMIT_ID_TDP "NVML_CLOCK_LIMIT_ID_TDP" + NVML_CLOCK_LIMIT_ID_UNLIMITED "NVML_CLOCK_LIMIT_ID_UNLIMITED" + +ctypedef enum nvmlVgpuVmCompatibility_t "nvmlVgpuVmCompatibility_t": + NVML_VGPU_VM_COMPATIBILITY_NONE "NVML_VGPU_VM_COMPATIBILITY_NONE" = 0x0 + NVML_VGPU_VM_COMPATIBILITY_COLD "NVML_VGPU_VM_COMPATIBILITY_COLD" = 0x1 + NVML_VGPU_VM_COMPATIBILITY_HIBERNATE "NVML_VGPU_VM_COMPATIBILITY_HIBERNATE" = 0x2 + NVML_VGPU_VM_COMPATIBILITY_SLEEP "NVML_VGPU_VM_COMPATIBILITY_SLEEP" = 0x4 + NVML_VGPU_VM_COMPATIBILITY_LIVE "NVML_VGPU_VM_COMPATIBILITY_LIVE" = 0x8 + +ctypedef enum nvmlVgpuPgpuCompatibilityLimitCode_t "nvmlVgpuPgpuCompatibilityLimitCode_t": + NVML_VGPU_COMPATIBILITY_LIMIT_NONE "NVML_VGPU_COMPATIBILITY_LIMIT_NONE" = 0x0 + NVML_VGPU_COMPATIBILITY_LIMIT_HOST_DRIVER "NVML_VGPU_COMPATIBILITY_LIMIT_HOST_DRIVER" = 0x1 + NVML_VGPU_COMPATIBILITY_LIMIT_GUEST_DRIVER "NVML_VGPU_COMPATIBILITY_LIMIT_GUEST_DRIVER" = 0x2 + NVML_VGPU_COMPATIBILITY_LIMIT_GPU "NVML_VGPU_COMPATIBILITY_LIMIT_GPU" = 0x4 + NVML_VGPU_COMPATIBILITY_LIMIT_OTHER "NVML_VGPU_COMPATIBILITY_LIMIT_OTHER" = 0x80000000 + +ctypedef enum nvmlGpmMetricId_t "nvmlGpmMetricId_t": + NVML_GPM_METRIC_GRAPHICS_UTIL "NVML_GPM_METRIC_GRAPHICS_UTIL" = 1 + NVML_GPM_METRIC_SM_UTIL "NVML_GPM_METRIC_SM_UTIL" = 2 + NVML_GPM_METRIC_SM_OCCUPANCY "NVML_GPM_METRIC_SM_OCCUPANCY" = 3 + NVML_GPM_METRIC_INTEGER_UTIL "NVML_GPM_METRIC_INTEGER_UTIL" = 4 + NVML_GPM_METRIC_ANY_TENSOR_UTIL "NVML_GPM_METRIC_ANY_TENSOR_UTIL" = 5 + NVML_GPM_METRIC_DFMA_TENSOR_UTIL "NVML_GPM_METRIC_DFMA_TENSOR_UTIL" = 6 + NVML_GPM_METRIC_HMMA_TENSOR_UTIL "NVML_GPM_METRIC_HMMA_TENSOR_UTIL" = 7 + NVML_GPM_METRIC_DMMA_TENSOR_UTIL "NVML_GPM_METRIC_DMMA_TENSOR_UTIL" = 8 + NVML_GPM_METRIC_IMMA_TENSOR_UTIL "NVML_GPM_METRIC_IMMA_TENSOR_UTIL" = 9 + NVML_GPM_METRIC_DRAM_BW_UTIL "NVML_GPM_METRIC_DRAM_BW_UTIL" = 10 + NVML_GPM_METRIC_FP64_UTIL "NVML_GPM_METRIC_FP64_UTIL" = 11 + NVML_GPM_METRIC_FP32_UTIL "NVML_GPM_METRIC_FP32_UTIL" = 12 + NVML_GPM_METRIC_FP16_UTIL "NVML_GPM_METRIC_FP16_UTIL" = 13 + NVML_GPM_METRIC_PCIE_TX_PER_SEC "NVML_GPM_METRIC_PCIE_TX_PER_SEC" = 20 + NVML_GPM_METRIC_PCIE_RX_PER_SEC "NVML_GPM_METRIC_PCIE_RX_PER_SEC" = 21 + NVML_GPM_METRIC_NVDEC_0_UTIL "NVML_GPM_METRIC_NVDEC_0_UTIL" = 30 + NVML_GPM_METRIC_NVDEC_1_UTIL "NVML_GPM_METRIC_NVDEC_1_UTIL" = 31 + NVML_GPM_METRIC_NVDEC_2_UTIL "NVML_GPM_METRIC_NVDEC_2_UTIL" = 32 + NVML_GPM_METRIC_NVDEC_3_UTIL "NVML_GPM_METRIC_NVDEC_3_UTIL" = 33 + NVML_GPM_METRIC_NVDEC_4_UTIL "NVML_GPM_METRIC_NVDEC_4_UTIL" = 34 + NVML_GPM_METRIC_NVDEC_5_UTIL "NVML_GPM_METRIC_NVDEC_5_UTIL" = 35 + NVML_GPM_METRIC_NVDEC_6_UTIL "NVML_GPM_METRIC_NVDEC_6_UTIL" = 36 + NVML_GPM_METRIC_NVDEC_7_UTIL "NVML_GPM_METRIC_NVDEC_7_UTIL" = 37 + NVML_GPM_METRIC_NVJPG_0_UTIL "NVML_GPM_METRIC_NVJPG_0_UTIL" = 40 + NVML_GPM_METRIC_NVJPG_1_UTIL "NVML_GPM_METRIC_NVJPG_1_UTIL" = 41 + NVML_GPM_METRIC_NVJPG_2_UTIL "NVML_GPM_METRIC_NVJPG_2_UTIL" = 42 + NVML_GPM_METRIC_NVJPG_3_UTIL "NVML_GPM_METRIC_NVJPG_3_UTIL" = 43 + NVML_GPM_METRIC_NVJPG_4_UTIL "NVML_GPM_METRIC_NVJPG_4_UTIL" = 44 + NVML_GPM_METRIC_NVJPG_5_UTIL "NVML_GPM_METRIC_NVJPG_5_UTIL" = 45 + NVML_GPM_METRIC_NVJPG_6_UTIL "NVML_GPM_METRIC_NVJPG_6_UTIL" = 46 + NVML_GPM_METRIC_NVJPG_7_UTIL "NVML_GPM_METRIC_NVJPG_7_UTIL" = 47 + NVML_GPM_METRIC_NVOFA_0_UTIL "NVML_GPM_METRIC_NVOFA_0_UTIL" = 50 + NVML_GPM_METRIC_NVOFA_1_UTIL "NVML_GPM_METRIC_NVOFA_1_UTIL" = 51 + NVML_GPM_METRIC_NVLINK_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_TOTAL_RX_PER_SEC" = 60 + NVML_GPM_METRIC_NVLINK_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_TOTAL_TX_PER_SEC" = 61 + NVML_GPM_METRIC_NVLINK_L0_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L0_RX_PER_SEC" = 62 + NVML_GPM_METRIC_NVLINK_L0_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L0_TX_PER_SEC" = 63 + NVML_GPM_METRIC_NVLINK_L1_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L1_RX_PER_SEC" = 64 + NVML_GPM_METRIC_NVLINK_L1_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L1_TX_PER_SEC" = 65 + NVML_GPM_METRIC_NVLINK_L2_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L2_RX_PER_SEC" = 66 + NVML_GPM_METRIC_NVLINK_L2_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L2_TX_PER_SEC" = 67 + NVML_GPM_METRIC_NVLINK_L3_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L3_RX_PER_SEC" = 68 + NVML_GPM_METRIC_NVLINK_L3_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L3_TX_PER_SEC" = 69 + NVML_GPM_METRIC_NVLINK_L4_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L4_RX_PER_SEC" = 70 + NVML_GPM_METRIC_NVLINK_L4_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L4_TX_PER_SEC" = 71 + NVML_GPM_METRIC_NVLINK_L5_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L5_RX_PER_SEC" = 72 + NVML_GPM_METRIC_NVLINK_L5_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L5_TX_PER_SEC" = 73 + NVML_GPM_METRIC_NVLINK_L6_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L6_RX_PER_SEC" = 74 + NVML_GPM_METRIC_NVLINK_L6_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L6_TX_PER_SEC" = 75 + NVML_GPM_METRIC_NVLINK_L7_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L7_RX_PER_SEC" = 76 + NVML_GPM_METRIC_NVLINK_L7_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L7_TX_PER_SEC" = 77 + NVML_GPM_METRIC_NVLINK_L8_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L8_RX_PER_SEC" = 78 + NVML_GPM_METRIC_NVLINK_L8_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L8_TX_PER_SEC" = 79 + NVML_GPM_METRIC_NVLINK_L9_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L9_RX_PER_SEC" = 80 + NVML_GPM_METRIC_NVLINK_L9_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L9_TX_PER_SEC" = 81 + NVML_GPM_METRIC_NVLINK_L10_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L10_RX_PER_SEC" = 82 + NVML_GPM_METRIC_NVLINK_L10_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L10_TX_PER_SEC" = 83 + NVML_GPM_METRIC_NVLINK_L11_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L11_RX_PER_SEC" = 84 + NVML_GPM_METRIC_NVLINK_L11_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L11_TX_PER_SEC" = 85 + NVML_GPM_METRIC_NVLINK_L12_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L12_RX_PER_SEC" = 86 + NVML_GPM_METRIC_NVLINK_L12_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L12_TX_PER_SEC" = 87 + NVML_GPM_METRIC_NVLINK_L13_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L13_RX_PER_SEC" = 88 + NVML_GPM_METRIC_NVLINK_L13_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L13_TX_PER_SEC" = 89 + NVML_GPM_METRIC_NVLINK_L14_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L14_RX_PER_SEC" = 90 + NVML_GPM_METRIC_NVLINK_L14_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L14_TX_PER_SEC" = 91 + NVML_GPM_METRIC_NVLINK_L15_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L15_RX_PER_SEC" = 92 + NVML_GPM_METRIC_NVLINK_L15_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L15_TX_PER_SEC" = 93 + NVML_GPM_METRIC_NVLINK_L16_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L16_RX_PER_SEC" = 94 + NVML_GPM_METRIC_NVLINK_L16_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L16_TX_PER_SEC" = 95 + NVML_GPM_METRIC_NVLINK_L17_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L17_RX_PER_SEC" = 96 + NVML_GPM_METRIC_NVLINK_L17_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L17_TX_PER_SEC" = 97 + NVML_GPM_METRIC_C2C_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_TOTAL_TX_PER_SEC" = 100 + NVML_GPM_METRIC_C2C_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_TOTAL_RX_PER_SEC" = 101 + NVML_GPM_METRIC_C2C_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_DATA_TX_PER_SEC" = 102 + NVML_GPM_METRIC_C2C_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_DATA_RX_PER_SEC" = 103 + NVML_GPM_METRIC_C2C_LINK0_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK0_TOTAL_TX_PER_SEC" = 104 + NVML_GPM_METRIC_C2C_LINK0_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK0_TOTAL_RX_PER_SEC" = 105 + NVML_GPM_METRIC_C2C_LINK0_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK0_DATA_TX_PER_SEC" = 106 + NVML_GPM_METRIC_C2C_LINK0_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK0_DATA_RX_PER_SEC" = 107 + NVML_GPM_METRIC_C2C_LINK1_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK1_TOTAL_TX_PER_SEC" = 108 + NVML_GPM_METRIC_C2C_LINK1_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK1_TOTAL_RX_PER_SEC" = 109 + NVML_GPM_METRIC_C2C_LINK1_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK1_DATA_TX_PER_SEC" = 110 + NVML_GPM_METRIC_C2C_LINK1_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK1_DATA_RX_PER_SEC" = 111 + NVML_GPM_METRIC_C2C_LINK2_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK2_TOTAL_TX_PER_SEC" = 112 + NVML_GPM_METRIC_C2C_LINK2_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK2_TOTAL_RX_PER_SEC" = 113 + NVML_GPM_METRIC_C2C_LINK2_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK2_DATA_TX_PER_SEC" = 114 + NVML_GPM_METRIC_C2C_LINK2_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK2_DATA_RX_PER_SEC" = 115 + NVML_GPM_METRIC_C2C_LINK3_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK3_TOTAL_TX_PER_SEC" = 116 + NVML_GPM_METRIC_C2C_LINK3_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK3_TOTAL_RX_PER_SEC" = 117 + NVML_GPM_METRIC_C2C_LINK3_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK3_DATA_TX_PER_SEC" = 118 + NVML_GPM_METRIC_C2C_LINK3_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK3_DATA_RX_PER_SEC" = 119 + NVML_GPM_METRIC_C2C_LINK4_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK4_TOTAL_TX_PER_SEC" = 120 + NVML_GPM_METRIC_C2C_LINK4_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK4_TOTAL_RX_PER_SEC" = 121 + NVML_GPM_METRIC_C2C_LINK4_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK4_DATA_TX_PER_SEC" = 122 + NVML_GPM_METRIC_C2C_LINK4_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK4_DATA_RX_PER_SEC" = 123 + NVML_GPM_METRIC_C2C_LINK5_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK5_TOTAL_TX_PER_SEC" = 124 + NVML_GPM_METRIC_C2C_LINK5_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK5_TOTAL_RX_PER_SEC" = 125 + NVML_GPM_METRIC_C2C_LINK5_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK5_DATA_TX_PER_SEC" = 126 + NVML_GPM_METRIC_C2C_LINK5_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK5_DATA_RX_PER_SEC" = 127 + NVML_GPM_METRIC_C2C_LINK6_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK6_TOTAL_TX_PER_SEC" = 128 + NVML_GPM_METRIC_C2C_LINK6_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK6_TOTAL_RX_PER_SEC" = 129 + NVML_GPM_METRIC_C2C_LINK6_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK6_DATA_TX_PER_SEC" = 130 + NVML_GPM_METRIC_C2C_LINK6_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK6_DATA_RX_PER_SEC" = 131 + NVML_GPM_METRIC_C2C_LINK7_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK7_TOTAL_TX_PER_SEC" = 132 + NVML_GPM_METRIC_C2C_LINK7_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK7_TOTAL_RX_PER_SEC" = 133 + NVML_GPM_METRIC_C2C_LINK7_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK7_DATA_TX_PER_SEC" = 134 + NVML_GPM_METRIC_C2C_LINK7_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK7_DATA_RX_PER_SEC" = 135 + NVML_GPM_METRIC_C2C_LINK8_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK8_TOTAL_TX_PER_SEC" = 136 + NVML_GPM_METRIC_C2C_LINK8_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK8_TOTAL_RX_PER_SEC" = 137 + NVML_GPM_METRIC_C2C_LINK8_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK8_DATA_TX_PER_SEC" = 138 + NVML_GPM_METRIC_C2C_LINK8_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK8_DATA_RX_PER_SEC" = 139 + NVML_GPM_METRIC_C2C_LINK9_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK9_TOTAL_TX_PER_SEC" = 140 + NVML_GPM_METRIC_C2C_LINK9_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK9_TOTAL_RX_PER_SEC" = 141 + NVML_GPM_METRIC_C2C_LINK9_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK9_DATA_TX_PER_SEC" = 142 + NVML_GPM_METRIC_C2C_LINK9_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK9_DATA_RX_PER_SEC" = 143 + NVML_GPM_METRIC_C2C_LINK10_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK10_TOTAL_TX_PER_SEC" = 144 + NVML_GPM_METRIC_C2C_LINK10_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK10_TOTAL_RX_PER_SEC" = 145 + NVML_GPM_METRIC_C2C_LINK10_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK10_DATA_TX_PER_SEC" = 146 + NVML_GPM_METRIC_C2C_LINK10_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK10_DATA_RX_PER_SEC" = 147 + NVML_GPM_METRIC_C2C_LINK11_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK11_TOTAL_TX_PER_SEC" = 148 + NVML_GPM_METRIC_C2C_LINK11_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK11_TOTAL_RX_PER_SEC" = 149 + NVML_GPM_METRIC_C2C_LINK11_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK11_DATA_TX_PER_SEC" = 150 + NVML_GPM_METRIC_C2C_LINK11_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK11_DATA_RX_PER_SEC" = 151 + NVML_GPM_METRIC_C2C_LINK12_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK12_TOTAL_TX_PER_SEC" = 152 + NVML_GPM_METRIC_C2C_LINK12_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK12_TOTAL_RX_PER_SEC" = 153 + NVML_GPM_METRIC_C2C_LINK12_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK12_DATA_TX_PER_SEC" = 154 + NVML_GPM_METRIC_C2C_LINK12_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK12_DATA_RX_PER_SEC" = 155 + NVML_GPM_METRIC_C2C_LINK13_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK13_TOTAL_TX_PER_SEC" = 156 + NVML_GPM_METRIC_C2C_LINK13_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK13_TOTAL_RX_PER_SEC" = 157 + NVML_GPM_METRIC_C2C_LINK13_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK13_DATA_TX_PER_SEC" = 158 + NVML_GPM_METRIC_C2C_LINK13_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK13_DATA_RX_PER_SEC" = 159 + NVML_GPM_METRIC_HOSTMEM_CACHE_HIT "NVML_GPM_METRIC_HOSTMEM_CACHE_HIT" = 160 + NVML_GPM_METRIC_HOSTMEM_CACHE_MISS "NVML_GPM_METRIC_HOSTMEM_CACHE_MISS" = 161 + NVML_GPM_METRIC_PEERMEM_CACHE_HIT "NVML_GPM_METRIC_PEERMEM_CACHE_HIT" = 162 + NVML_GPM_METRIC_PEERMEM_CACHE_MISS "NVML_GPM_METRIC_PEERMEM_CACHE_MISS" = 163 + NVML_GPM_METRIC_DRAM_CACHE_HIT "NVML_GPM_METRIC_DRAM_CACHE_HIT" = 164 + NVML_GPM_METRIC_DRAM_CACHE_MISS "NVML_GPM_METRIC_DRAM_CACHE_MISS" = 165 + NVML_GPM_METRIC_NVENC_0_UTIL "NVML_GPM_METRIC_NVENC_0_UTIL" = 166 + NVML_GPM_METRIC_NVENC_1_UTIL "NVML_GPM_METRIC_NVENC_1_UTIL" = 167 + NVML_GPM_METRIC_NVENC_2_UTIL "NVML_GPM_METRIC_NVENC_2_UTIL" = 168 + NVML_GPM_METRIC_NVENC_3_UTIL "NVML_GPM_METRIC_NVENC_3_UTIL" = 169 + NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ELAPSED" = 170 + NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ACTIVE" = 171 + NVML_GPM_METRIC_GR0_CTXSW_REQUESTS "NVML_GPM_METRIC_GR0_CTXSW_REQUESTS" = 172 + NVML_GPM_METRIC_GR0_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR0_CTXSW_CYCLES_PER_REQ" = 173 + NVML_GPM_METRIC_GR0_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR0_CTXSW_ACTIVE_PCT" = 174 + NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ELAPSED" = 175 + NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ACTIVE" = 176 + NVML_GPM_METRIC_GR1_CTXSW_REQUESTS "NVML_GPM_METRIC_GR1_CTXSW_REQUESTS" = 177 + NVML_GPM_METRIC_GR1_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR1_CTXSW_CYCLES_PER_REQ" = 178 + NVML_GPM_METRIC_GR1_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR1_CTXSW_ACTIVE_PCT" = 179 + NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ELAPSED" = 180 + NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ACTIVE" = 181 + NVML_GPM_METRIC_GR2_CTXSW_REQUESTS "NVML_GPM_METRIC_GR2_CTXSW_REQUESTS" = 182 + NVML_GPM_METRIC_GR2_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR2_CTXSW_CYCLES_PER_REQ" = 183 + NVML_GPM_METRIC_GR2_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR2_CTXSW_ACTIVE_PCT" = 184 + NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ELAPSED" = 185 + NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ACTIVE" = 186 + NVML_GPM_METRIC_GR3_CTXSW_REQUESTS "NVML_GPM_METRIC_GR3_CTXSW_REQUESTS" = 187 + NVML_GPM_METRIC_GR3_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR3_CTXSW_CYCLES_PER_REQ" = 188 + NVML_GPM_METRIC_GR3_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR3_CTXSW_ACTIVE_PCT" = 189 + NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ELAPSED" = 190 + NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ACTIVE" = 191 + NVML_GPM_METRIC_GR4_CTXSW_REQUESTS "NVML_GPM_METRIC_GR4_CTXSW_REQUESTS" = 192 + NVML_GPM_METRIC_GR4_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR4_CTXSW_CYCLES_PER_REQ" = 193 + NVML_GPM_METRIC_GR4_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR4_CTXSW_ACTIVE_PCT" = 194 + NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ELAPSED" = 195 + NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ACTIVE" = 196 + NVML_GPM_METRIC_GR5_CTXSW_REQUESTS "NVML_GPM_METRIC_GR5_CTXSW_REQUESTS" = 197 + NVML_GPM_METRIC_GR5_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR5_CTXSW_CYCLES_PER_REQ" = 198 + NVML_GPM_METRIC_GR5_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR5_CTXSW_ACTIVE_PCT" = 199 + NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ELAPSED" = 200 + NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ACTIVE" = 201 + NVML_GPM_METRIC_GR6_CTXSW_REQUESTS "NVML_GPM_METRIC_GR6_CTXSW_REQUESTS" = 202 + NVML_GPM_METRIC_GR6_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR6_CTXSW_CYCLES_PER_REQ" = 203 + NVML_GPM_METRIC_GR6_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR6_CTXSW_ACTIVE_PCT" = 204 + NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ELAPSED" = 205 + NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ACTIVE" = 206 + NVML_GPM_METRIC_GR7_CTXSW_REQUESTS "NVML_GPM_METRIC_GR7_CTXSW_REQUESTS" = 207 + NVML_GPM_METRIC_GR7_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR7_CTXSW_CYCLES_PER_REQ" = 208 + NVML_GPM_METRIC_GR7_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR7_CTXSW_ACTIVE_PCT" = 209 + NVML_GPM_METRIC_NVLINK_L18_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L18_RX_PER_SEC" = 212 + NVML_GPM_METRIC_NVLINK_L18_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L18_TX_PER_SEC" = 213 + NVML_GPM_METRIC_NVLINK_L19_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L19_RX_PER_SEC" = 214 + NVML_GPM_METRIC_NVLINK_L19_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L19_TX_PER_SEC" = 215 + NVML_GPM_METRIC_NVLINK_L20_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L20_RX_PER_SEC" = 216 + NVML_GPM_METRIC_NVLINK_L20_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L20_TX_PER_SEC" = 217 + NVML_GPM_METRIC_NVLINK_L21_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L21_RX_PER_SEC" = 218 + NVML_GPM_METRIC_NVLINK_L21_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L21_TX_PER_SEC" = 219 + NVML_GPM_METRIC_NVLINK_L22_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L22_RX_PER_SEC" = 220 + NVML_GPM_METRIC_NVLINK_L22_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L22_TX_PER_SEC" = 221 + NVML_GPM_METRIC_NVLINK_L23_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L23_RX_PER_SEC" = 222 + NVML_GPM_METRIC_NVLINK_L23_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L23_TX_PER_SEC" = 223 + NVML_GPM_METRIC_NVLINK_L24_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L24_RX_PER_SEC" = 224 + NVML_GPM_METRIC_NVLINK_L24_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L24_TX_PER_SEC" = 225 + NVML_GPM_METRIC_NVLINK_L25_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L25_RX_PER_SEC" = 226 + NVML_GPM_METRIC_NVLINK_L25_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L25_TX_PER_SEC" = 227 + NVML_GPM_METRIC_NVLINK_L26_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L26_RX_PER_SEC" = 228 + NVML_GPM_METRIC_NVLINK_L26_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L26_TX_PER_SEC" = 229 + NVML_GPM_METRIC_NVLINK_L27_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L27_RX_PER_SEC" = 230 + NVML_GPM_METRIC_NVLINK_L27_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L27_TX_PER_SEC" = 231 + NVML_GPM_METRIC_NVLINK_L28_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L28_RX_PER_SEC" = 232 + NVML_GPM_METRIC_NVLINK_L28_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L28_TX_PER_SEC" = 233 + NVML_GPM_METRIC_NVLINK_L29_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L29_RX_PER_SEC" = 234 + NVML_GPM_METRIC_NVLINK_L29_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L29_TX_PER_SEC" = 235 + NVML_GPM_METRIC_NVLINK_L30_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L30_RX_PER_SEC" = 236 + NVML_GPM_METRIC_NVLINK_L30_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L30_TX_PER_SEC" = 237 + NVML_GPM_METRIC_NVLINK_L31_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L31_RX_PER_SEC" = 238 + NVML_GPM_METRIC_NVLINK_L31_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L31_TX_PER_SEC" = 239 + NVML_GPM_METRIC_NVLINK_L32_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L32_RX_PER_SEC" = 240 + NVML_GPM_METRIC_NVLINK_L32_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L32_TX_PER_SEC" = 241 + NVML_GPM_METRIC_NVLINK_L33_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L33_RX_PER_SEC" = 242 + NVML_GPM_METRIC_NVLINK_L33_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L33_TX_PER_SEC" = 243 + NVML_GPM_METRIC_NVLINK_L34_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L34_RX_PER_SEC" = 244 + NVML_GPM_METRIC_NVLINK_L34_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L34_TX_PER_SEC" = 245 + NVML_GPM_METRIC_NVLINK_L35_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L35_RX_PER_SEC" = 246 + NVML_GPM_METRIC_NVLINK_L35_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L35_TX_PER_SEC" = 247 + NVML_GPM_METRIC_SM_CYCLES_ELAPSED "NVML_GPM_METRIC_SM_CYCLES_ELAPSED" = 248 + NVML_GPM_METRIC_SM_CYCLES_ACTIVE "NVML_GPM_METRIC_SM_CYCLES_ACTIVE" = 249 + NVML_GPM_METRIC_MMA_CYCLES_ACTIVE "NVML_GPM_METRIC_MMA_CYCLES_ACTIVE" = 250 + NVML_GPM_METRIC_DMMA_CYCLES_ACTIVE "NVML_GPM_METRIC_DMMA_CYCLES_ACTIVE" = 251 + NVML_GPM_METRIC_HMMA_CYCLES_ACTIVE "NVML_GPM_METRIC_HMMA_CYCLES_ACTIVE" = 252 + NVML_GPM_METRIC_IMMA_CYCLES_ACTIVE "NVML_GPM_METRIC_IMMA_CYCLES_ACTIVE" = 253 + NVML_GPM_METRIC_DFMA_CYCLES_ACTIVE "NVML_GPM_METRIC_DFMA_CYCLES_ACTIVE" = 254 + NVML_GPM_METRIC_PCIE_TX "NVML_GPM_METRIC_PCIE_TX" = 255 + NVML_GPM_METRIC_PCIE_RX "NVML_GPM_METRIC_PCIE_RX" = 256 + NVML_GPM_METRIC_INTEGER_CYCLES_ACTIVE "NVML_GPM_METRIC_INTEGER_CYCLES_ACTIVE" = 257 + NVML_GPM_METRIC_FP64_CYCLES_ACTIVE "NVML_GPM_METRIC_FP64_CYCLES_ACTIVE" = 258 + NVML_GPM_METRIC_FP32_CYCLES_ACTIVE "NVML_GPM_METRIC_FP32_CYCLES_ACTIVE" = 259 + NVML_GPM_METRIC_FP16_CYCLES_ACTIVE "NVML_GPM_METRIC_FP16_CYCLES_ACTIVE" = 260 + NVML_GPM_METRIC_NVLINK_L0_RX "NVML_GPM_METRIC_NVLINK_L0_RX" = 261 + NVML_GPM_METRIC_NVLINK_L0_TX "NVML_GPM_METRIC_NVLINK_L0_TX" = 262 + NVML_GPM_METRIC_NVLINK_L1_RX "NVML_GPM_METRIC_NVLINK_L1_RX" = 263 + NVML_GPM_METRIC_NVLINK_L1_TX "NVML_GPM_METRIC_NVLINK_L1_TX" = 264 + NVML_GPM_METRIC_NVLINK_L2_RX "NVML_GPM_METRIC_NVLINK_L2_RX" = 265 + NVML_GPM_METRIC_NVLINK_L2_TX "NVML_GPM_METRIC_NVLINK_L2_TX" = 266 + NVML_GPM_METRIC_NVLINK_L3_RX "NVML_GPM_METRIC_NVLINK_L3_RX" = 267 + NVML_GPM_METRIC_NVLINK_L3_TX "NVML_GPM_METRIC_NVLINK_L3_TX" = 268 + NVML_GPM_METRIC_NVLINK_L4_RX "NVML_GPM_METRIC_NVLINK_L4_RX" = 269 + NVML_GPM_METRIC_NVLINK_L4_TX "NVML_GPM_METRIC_NVLINK_L4_TX" = 270 + NVML_GPM_METRIC_NVLINK_L5_RX "NVML_GPM_METRIC_NVLINK_L5_RX" = 271 + NVML_GPM_METRIC_NVLINK_L5_TX "NVML_GPM_METRIC_NVLINK_L5_TX" = 272 + NVML_GPM_METRIC_NVLINK_L6_RX "NVML_GPM_METRIC_NVLINK_L6_RX" = 273 + NVML_GPM_METRIC_NVLINK_L6_TX "NVML_GPM_METRIC_NVLINK_L6_TX" = 274 + NVML_GPM_METRIC_NVLINK_L7_RX "NVML_GPM_METRIC_NVLINK_L7_RX" = 275 + NVML_GPM_METRIC_NVLINK_L7_TX "NVML_GPM_METRIC_NVLINK_L7_TX" = 276 + NVML_GPM_METRIC_NVLINK_L8_RX "NVML_GPM_METRIC_NVLINK_L8_RX" = 277 + NVML_GPM_METRIC_NVLINK_L8_TX "NVML_GPM_METRIC_NVLINK_L8_TX" = 278 + NVML_GPM_METRIC_NVLINK_L9_RX "NVML_GPM_METRIC_NVLINK_L9_RX" = 279 + NVML_GPM_METRIC_NVLINK_L9_TX "NVML_GPM_METRIC_NVLINK_L9_TX" = 280 + NVML_GPM_METRIC_NVLINK_L10_RX "NVML_GPM_METRIC_NVLINK_L10_RX" = 281 + NVML_GPM_METRIC_NVLINK_L10_TX "NVML_GPM_METRIC_NVLINK_L10_TX" = 282 + NVML_GPM_METRIC_NVLINK_L11_RX "NVML_GPM_METRIC_NVLINK_L11_RX" = 283 + NVML_GPM_METRIC_NVLINK_L11_TX "NVML_GPM_METRIC_NVLINK_L11_TX" = 284 + NVML_GPM_METRIC_NVLINK_L12_RX "NVML_GPM_METRIC_NVLINK_L12_RX" = 285 + NVML_GPM_METRIC_NVLINK_L12_TX "NVML_GPM_METRIC_NVLINK_L12_TX" = 286 + NVML_GPM_METRIC_NVLINK_L13_RX "NVML_GPM_METRIC_NVLINK_L13_RX" = 287 + NVML_GPM_METRIC_NVLINK_L13_TX "NVML_GPM_METRIC_NVLINK_L13_TX" = 288 + NVML_GPM_METRIC_NVLINK_L14_RX "NVML_GPM_METRIC_NVLINK_L14_RX" = 289 + NVML_GPM_METRIC_NVLINK_L14_TX "NVML_GPM_METRIC_NVLINK_L14_TX" = 290 + NVML_GPM_METRIC_NVLINK_L15_RX "NVML_GPM_METRIC_NVLINK_L15_RX" = 291 + NVML_GPM_METRIC_NVLINK_L15_TX "NVML_GPM_METRIC_NVLINK_L15_TX" = 292 + NVML_GPM_METRIC_NVLINK_L16_RX "NVML_GPM_METRIC_NVLINK_L16_RX" = 293 + NVML_GPM_METRIC_NVLINK_L16_TX "NVML_GPM_METRIC_NVLINK_L16_TX" = 294 + NVML_GPM_METRIC_NVLINK_L17_RX "NVML_GPM_METRIC_NVLINK_L17_RX" = 295 + NVML_GPM_METRIC_NVLINK_L17_TX "NVML_GPM_METRIC_NVLINK_L17_TX" = 296 + NVML_GPM_METRIC_NVLINK_L18_RX "NVML_GPM_METRIC_NVLINK_L18_RX" = 297 + NVML_GPM_METRIC_NVLINK_L18_TX "NVML_GPM_METRIC_NVLINK_L18_TX" = 298 + NVML_GPM_METRIC_NVLINK_L19_RX "NVML_GPM_METRIC_NVLINK_L19_RX" = 299 + NVML_GPM_METRIC_NVLINK_L19_TX "NVML_GPM_METRIC_NVLINK_L19_TX" = 300 + NVML_GPM_METRIC_NVLINK_L20_RX "NVML_GPM_METRIC_NVLINK_L20_RX" = 301 + NVML_GPM_METRIC_NVLINK_L20_TX "NVML_GPM_METRIC_NVLINK_L20_TX" = 302 + NVML_GPM_METRIC_NVLINK_L21_RX "NVML_GPM_METRIC_NVLINK_L21_RX" = 303 + NVML_GPM_METRIC_NVLINK_L21_TX "NVML_GPM_METRIC_NVLINK_L21_TX" = 304 + NVML_GPM_METRIC_NVLINK_L22_RX "NVML_GPM_METRIC_NVLINK_L22_RX" = 305 + NVML_GPM_METRIC_NVLINK_L22_TX "NVML_GPM_METRIC_NVLINK_L22_TX" = 306 + NVML_GPM_METRIC_NVLINK_L23_RX "NVML_GPM_METRIC_NVLINK_L23_RX" = 307 + NVML_GPM_METRIC_NVLINK_L23_TX "NVML_GPM_METRIC_NVLINK_L23_TX" = 308 + NVML_GPM_METRIC_NVLINK_L24_RX "NVML_GPM_METRIC_NVLINK_L24_RX" = 309 + NVML_GPM_METRIC_NVLINK_L24_TX "NVML_GPM_METRIC_NVLINK_L24_TX" = 310 + NVML_GPM_METRIC_NVLINK_L25_RX "NVML_GPM_METRIC_NVLINK_L25_RX" = 311 + NVML_GPM_METRIC_NVLINK_L25_TX "NVML_GPM_METRIC_NVLINK_L25_TX" = 312 + NVML_GPM_METRIC_NVLINK_L26_RX "NVML_GPM_METRIC_NVLINK_L26_RX" = 313 + NVML_GPM_METRIC_NVLINK_L26_TX "NVML_GPM_METRIC_NVLINK_L26_TX" = 314 + NVML_GPM_METRIC_NVLINK_L27_RX "NVML_GPM_METRIC_NVLINK_L27_RX" = 315 + NVML_GPM_METRIC_NVLINK_L27_TX "NVML_GPM_METRIC_NVLINK_L27_TX" = 316 + NVML_GPM_METRIC_NVLINK_L28_RX "NVML_GPM_METRIC_NVLINK_L28_RX" = 317 + NVML_GPM_METRIC_NVLINK_L28_TX "NVML_GPM_METRIC_NVLINK_L28_TX" = 318 + NVML_GPM_METRIC_NVLINK_L29_RX "NVML_GPM_METRIC_NVLINK_L29_RX" = 319 + NVML_GPM_METRIC_NVLINK_L29_TX "NVML_GPM_METRIC_NVLINK_L29_TX" = 320 + NVML_GPM_METRIC_NVLINK_L30_RX "NVML_GPM_METRIC_NVLINK_L30_RX" = 321 + NVML_GPM_METRIC_NVLINK_L30_TX "NVML_GPM_METRIC_NVLINK_L30_TX" = 322 + NVML_GPM_METRIC_NVLINK_L31_RX "NVML_GPM_METRIC_NVLINK_L31_RX" = 323 + NVML_GPM_METRIC_NVLINK_L31_TX "NVML_GPM_METRIC_NVLINK_L31_TX" = 324 + NVML_GPM_METRIC_NVLINK_L32_RX "NVML_GPM_METRIC_NVLINK_L32_RX" = 325 + NVML_GPM_METRIC_NVLINK_L32_TX "NVML_GPM_METRIC_NVLINK_L32_TX" = 326 + NVML_GPM_METRIC_NVLINK_L33_RX "NVML_GPM_METRIC_NVLINK_L33_RX" = 327 + NVML_GPM_METRIC_NVLINK_L33_TX "NVML_GPM_METRIC_NVLINK_L33_TX" = 328 + NVML_GPM_METRIC_NVLINK_L34_RX "NVML_GPM_METRIC_NVLINK_L34_RX" = 329 + NVML_GPM_METRIC_NVLINK_L34_TX "NVML_GPM_METRIC_NVLINK_L34_TX" = 330 + NVML_GPM_METRIC_NVLINK_L35_RX "NVML_GPM_METRIC_NVLINK_L35_RX" = 331 + NVML_GPM_METRIC_NVLINK_L35_TX "NVML_GPM_METRIC_NVLINK_L35_TX" = 332 + NVML_GPM_METRIC_MAX "NVML_GPM_METRIC_MAX" = 333 + +ctypedef enum nvmlPowerProfileType_t "nvmlPowerProfileType_t": + NVML_POWER_PROFILE_MAX_P "NVML_POWER_PROFILE_MAX_P" = 0 + NVML_POWER_PROFILE_MAX_Q "NVML_POWER_PROFILE_MAX_Q" = 1 + NVML_POWER_PROFILE_COMPUTE "NVML_POWER_PROFILE_COMPUTE" = 2 + NVML_POWER_PROFILE_MEMORY_BOUND "NVML_POWER_PROFILE_MEMORY_BOUND" = 3 + NVML_POWER_PROFILE_NETWORK "NVML_POWER_PROFILE_NETWORK" = 4 + NVML_POWER_PROFILE_BALANCED "NVML_POWER_PROFILE_BALANCED" = 5 + NVML_POWER_PROFILE_LLM_INFERENCE "NVML_POWER_PROFILE_LLM_INFERENCE" = 6 + NVML_POWER_PROFILE_LLM_TRAINING "NVML_POWER_PROFILE_LLM_TRAINING" = 7 + NVML_POWER_PROFILE_RBM "NVML_POWER_PROFILE_RBM" = 8 + NVML_POWER_PROFILE_DCPCIE "NVML_POWER_PROFILE_DCPCIE" = 9 + NVML_POWER_PROFILE_HMMA_SPARSE "NVML_POWER_PROFILE_HMMA_SPARSE" = 10 + NVML_POWER_PROFILE_HMMA_DENSE "NVML_POWER_PROFILE_HMMA_DENSE" = 11 + NVML_POWER_PROFILE_SYNC_BALANCED "NVML_POWER_PROFILE_SYNC_BALANCED" = 12 + NVML_POWER_PROFILE_HPC "NVML_POWER_PROFILE_HPC" = 13 + NVML_POWER_PROFILE_MIG "NVML_POWER_PROFILE_MIG" = 14 + NVML_POWER_PROFILE_MAX "NVML_POWER_PROFILE_MAX" = 15 + +ctypedef enum nvmlDeviceAddressingModeType_t "nvmlDeviceAddressingModeType_t": + NVML_DEVICE_ADDRESSING_MODE_NONE "NVML_DEVICE_ADDRESSING_MODE_NONE" = 0 + NVML_DEVICE_ADDRESSING_MODE_HMM "NVML_DEVICE_ADDRESSING_MODE_HMM" = 1 + NVML_DEVICE_ADDRESSING_MODE_ATS "NVML_DEVICE_ADDRESSING_MODE_ATS" = 2 + +ctypedef enum nvmlPRMCounterId_t "nvmlPRMCounterId_t": + NVML_PRM_COUNTER_ID_NONE "NVML_PRM_COUNTER_ID_NONE" = 0 + NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_LINK_DOWN_EVENTS "NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_LINK_DOWN_EVENTS" = 1 + NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_SUCCESSFUL_RECOVERY_EVENTS "NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_SUCCESSFUL_RECOVERY_EVENTS" = 2 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS" = 101 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY" = 102 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES" = 103 + NVML_PRM_COUNTER_ID_PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT "NVML_PRM_COUNTER_ID_PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT" = 201 + NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODES "NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODES" = 301 + NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODE_ERR "NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODE_ERR" = 302 + NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_UNCORRECTABLE_CODE "NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_UNCORRECTABLE_CODE" = 303 + NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_CODES "NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_CODES" = 304 + NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_CODES "NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_CODES" = 305 + NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_EVENTS "NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_EVENTS" = 306 + NVML_PRM_COUNTER_ID_PPCNT_PLR_SYNC_EVENTS "NVML_PRM_COUNTER_ID_PPCNT_PLR_SYNC_EVENTS" = 307 + NVML_PRM_COUNTER_ID_PPRM_OPER_RECOVERY "NVML_PRM_COUNTER_ID_PPRM_OPER_RECOVERY" = 1001 + +ctypedef enum nvmlPowerProfileOperation_t "nvmlPowerProfileOperation_t": + NVML_POWER_PROFILE_OPERATION_CLEAR "NVML_POWER_PROFILE_OPERATION_CLEAR" = 0 + NVML_POWER_PROFILE_OPERATION_SET "NVML_POWER_PROFILE_OPERATION_SET" = 1 + NVML_POWER_PROFILE_OPERATION_SET_AND_OVERWRITE "NVML_POWER_PROFILE_OPERATION_SET_AND_OVERWRITE" = 2 + NVML_POWER_PROFILE_OPERATION_MAX "NVML_POWER_PROFILE_OPERATION_MAX" = 3 + +ctypedef enum nvmlProcessMode_t "nvmlProcessMode_t": + NVML_PROCESS_MODE_COMPUTE "NVML_PROCESS_MODE_COMPUTE" = 0 + NVML_PROCESS_MODE_GRAPHICS "NVML_PROCESS_MODE_GRAPHICS" = 1 + NVML_PROCESS_MODE_MPS "NVML_PROCESS_MODE_MPS" = 2 + NVML_PROCESS_MODE_ALL "NVML_PROCESS_MODE_ALL" = 3 + NVML_PROCESS_MODE_MAX "NVML_PROCESS_MODE_MAX" = (NVML_PROCESS_MODE_ALL + 1) + +ctypedef enum nvmlCPERType_t "nvmlCPERType_t": + NVML_CPER_ACCESS_TYPE_GPU "NVML_CPER_ACCESS_TYPE_GPU" = (1 << 0) + + +# types +ctypedef struct nvmlPciInfoExt_v1_t 'nvmlPciInfoExt_v1_t': + unsigned int version + unsigned int domain + unsigned int bus + unsigned int device + unsigned int pciDeviceId + unsigned int pciSubSystemId + unsigned int baseClass + unsigned int subClass + char busId[32] + +ctypedef struct nvmlCoolerInfo_v1_t 'nvmlCoolerInfo_v1_t': + unsigned int version + unsigned int index + nvmlCoolerControl_t signalType + nvmlCoolerTarget_t target + +ctypedef struct nvmlDramEncryptionInfo_v1_t 'nvmlDramEncryptionInfo_v1_t': + unsigned int version + nvmlEnableState_t encryptionState + +ctypedef struct nvmlMarginTemperature_v1_t 'nvmlMarginTemperature_v1_t': + unsigned int version + int marginTemperature + +ctypedef struct nvmlClockOffset_v1_t 'nvmlClockOffset_v1_t': + unsigned int version + nvmlClockType_t type + nvmlPstates_t pstate + int clockOffsetMHz + int minClockOffsetMHz + int maxClockOffsetMHz + +ctypedef struct nvmlFanSpeedInfo_v1_t 'nvmlFanSpeedInfo_v1_t': + unsigned int version + unsigned int fan + unsigned int speed + +ctypedef struct nvmlDevicePerfModes_v1_t 'nvmlDevicePerfModes_v1_t': + unsigned int version + char str[2048] + +ctypedef struct nvmlDeviceCurrentClockFreqs_v1_t 'nvmlDeviceCurrentClockFreqs_v1_t': + unsigned int version + char str[2048] + +ctypedef struct nvmlEccSramErrorStatus_v1_t 'nvmlEccSramErrorStatus_v1_t': + unsigned int version + unsigned long long aggregateUncParity + unsigned long long aggregateUncSecDed + unsigned long long aggregateCor + unsigned long long volatileUncParity + unsigned long long volatileUncSecDed + unsigned long long volatileCor + unsigned long long aggregateUncBucketL2 + unsigned long long aggregateUncBucketSm + unsigned long long aggregateUncBucketPcie + unsigned long long aggregateUncBucketMcu + unsigned long long aggregateUncBucketOther + unsigned int bThresholdExceeded + +ctypedef struct nvmlPlatformInfo_v2_t 'nvmlPlatformInfo_v2_t': + unsigned int version + unsigned char ibGuid[16] + unsigned char chassisSerialNumber[16] + unsigned char slotNumber + unsigned char trayIndex + unsigned char hostId + unsigned char peerType + unsigned char moduleId + +ctypedef unsigned int nvmlDeviceArchitecture_t 'nvmlDeviceArchitecture_t' + +ctypedef unsigned int nvmlBusType_t 'nvmlBusType_t' + +ctypedef unsigned int nvmlFanControlPolicy_t 'nvmlFanControlPolicy_t' + +ctypedef unsigned int nvmlPowerSource_t 'nvmlPowerSource_t' + +ctypedef unsigned char nvmlPowerScopeType_t 'nvmlPowerScopeType_t' + +ctypedef unsigned int nvmlVgpuTypeId_t 'nvmlVgpuTypeId_t' + +ctypedef unsigned int nvmlVgpuInstance_t 'nvmlVgpuInstance_t' + +ctypedef struct nvmlVgpuHeterogeneousMode_v1_t 'nvmlVgpuHeterogeneousMode_v1_t': + unsigned int version + unsigned int mode + +ctypedef struct nvmlVgpuPlacementId_v1_t 'nvmlVgpuPlacementId_v1_t': + unsigned int version + unsigned int placementId + +ctypedef struct nvmlVgpuPlacementList_v2_t 'nvmlVgpuPlacementList_v2_t': + unsigned int version + unsigned int placementSize + unsigned int count + unsigned int* placementIds + unsigned int mode + +ctypedef struct nvmlVgpuTypeBar1Info_v1_t 'nvmlVgpuTypeBar1Info_v1_t': + unsigned int version + unsigned long long bar1Size + +ctypedef struct nvmlVgpuRuntimeState_v1_t 'nvmlVgpuRuntimeState_v1_t': + unsigned int version + unsigned long long size + +ctypedef struct nvmlSystemConfComputeSettings_v1_t 'nvmlSystemConfComputeSettings_v1_t': + unsigned int version + unsigned int environment + unsigned int ccFeature + unsigned int devToolsMode + unsigned int multiGpuMode + +ctypedef struct nvmlConfComputeSetKeyRotationThresholdInfo_v1_t 'nvmlConfComputeSetKeyRotationThresholdInfo_v1_t': + unsigned int version + unsigned long long maxAttackerAdvantage + +ctypedef struct nvmlConfComputeGetKeyRotationThresholdInfo_v1_t 'nvmlConfComputeGetKeyRotationThresholdInfo_v1_t': + unsigned int version + unsigned long long attackerAdvantage + +ctypedef unsigned char nvmlGpuFabricState_t 'nvmlGpuFabricState_t' + +ctypedef struct nvmlSystemDriverBranchInfo_v1_t 'nvmlSystemDriverBranchInfo_v1_t': + unsigned int version + char branch[80] + +ctypedef unsigned int nvmlAffinityScope_t 'nvmlAffinityScope_t' + +ctypedef struct nvmlTemperature_v1_t 'nvmlTemperature_v1_t': + unsigned int version + nvmlTemperatureSensors_t sensorType + int temperature + +ctypedef struct nvmlNvlinkSupportedBwModes_v1_t 'nvmlNvlinkSupportedBwModes_v1_t': + unsigned int version + unsigned char bwModes[23] + unsigned char totalBwModes + +ctypedef struct nvmlNvlinkGetBwMode_v1_t 'nvmlNvlinkGetBwMode_v1_t': + unsigned int version + unsigned int bIsBest + unsigned char bwMode + +ctypedef struct nvmlNvlinkSetBwMode_v1_t 'nvmlNvlinkSetBwMode_v1_t': + unsigned int version + unsigned int bSetBest + unsigned char bwMode + +ctypedef struct nvmlDeviceCapabilities_v1_t 'nvmlDeviceCapabilities_v1_t': + unsigned int version + unsigned int capMask + +ctypedef struct nvmlPowerSmoothingProfile_v1_t 'nvmlPowerSmoothingProfile_v1_t': + unsigned int version + unsigned int profileId + unsigned int paramId + double value + +ctypedef struct nvmlPowerSmoothingState_v1_t 'nvmlPowerSmoothingState_v1_t': + unsigned int version + nvmlEnableState_t state + +ctypedef struct nvmlDeviceAddressingMode_v1_t 'nvmlDeviceAddressingMode_v1_t': + unsigned int version + unsigned int value + +ctypedef struct nvmlRepairStatus_v1_t 'nvmlRepairStatus_v1_t': + unsigned int version + unsigned int bChannelRepairPending + unsigned int bTpcRepairPending + +ctypedef struct nvmlPdi_v1_t 'nvmlPdi_v1_t': + unsigned int version + unsigned long long value + +ctypedef unsigned long long nvmlCPERCursorHandle_t 'nvmlCPERCursorHandle_t' + +ctypedef void* nvmlDevice_t 'nvmlDevice_t' + +ctypedef void* nvmlGpuInstance_t 'nvmlGpuInstance_t' + +ctypedef void* nvmlUnit_t 'nvmlUnit_t' + +ctypedef void* nvmlEventSet_t 'nvmlEventSet_t' + +ctypedef void* nvmlSystemEventSet_t 'nvmlSystemEventSet_t' + +ctypedef void* nvmlComputeInstance_t 'nvmlComputeInstance_t' + +ctypedef void* nvmlGpmSample_t 'nvmlGpmSample_t' + +ctypedef struct nvmlPciInfo_t 'nvmlPciInfo_t': + char busIdLegacy[16] + unsigned int domain + unsigned int bus + unsigned int device + unsigned int pciDeviceId + unsigned int pciSubSystemId + char busId[32] + +ctypedef struct nvmlEccErrorCounts_t 'nvmlEccErrorCounts_t': + unsigned long long l1Cache + unsigned long long l2Cache + unsigned long long deviceMemory + unsigned long long registerFile + +ctypedef struct nvmlUtilization_t 'nvmlUtilization_t': + unsigned int gpu + unsigned int memory + +ctypedef struct nvmlMemory_t 'nvmlMemory_t': + unsigned long long total + unsigned long long free + unsigned long long used + +ctypedef struct nvmlMemory_v2_t 'nvmlMemory_v2_t': + unsigned int version + unsigned long long total + unsigned long long reserved + unsigned long long free + unsigned long long used + +ctypedef struct nvmlBAR1Memory_t 'nvmlBAR1Memory_t': + unsigned long long bar1Total + unsigned long long bar1Free + unsigned long long bar1Used + +ctypedef struct nvmlProcessInfo_v1_t 'nvmlProcessInfo_v1_t': + unsigned int pid + unsigned long long usedGpuMemory + +ctypedef struct nvmlProcessInfo_v2_t 'nvmlProcessInfo_v2_t': + unsigned int pid + unsigned long long usedGpuMemory + unsigned int gpuInstanceId + unsigned int computeInstanceId + +ctypedef struct nvmlProcessInfo_t 'nvmlProcessInfo_t': + unsigned int pid + unsigned long long usedGpuMemory + unsigned int gpuInstanceId + unsigned int computeInstanceId + +ctypedef struct nvmlProcessDetail_v1_t 'nvmlProcessDetail_v1_t': + unsigned int pid + unsigned long long usedGpuMemory + unsigned int gpuInstanceId + unsigned int computeInstanceId + unsigned long long usedGpuCcProtectedMemory + +ctypedef struct nvmlDeviceAttributes_t 'nvmlDeviceAttributes_t': + unsigned int multiprocessorCount + unsigned int sharedCopyEngineCount + unsigned int sharedDecoderCount + unsigned int sharedEncoderCount + unsigned int sharedJpegCount + unsigned int sharedOfaCount + unsigned int gpuInstanceSliceCount + unsigned int computeInstanceSliceCount + unsigned long long memorySizeMB + +ctypedef struct nvmlC2cModeInfo_v1_t 'nvmlC2cModeInfo_v1_t': + unsigned int isC2cEnabled + +ctypedef struct nvmlRowRemapperHistogramValues_t 'nvmlRowRemapperHistogramValues_t': + unsigned int max + unsigned int high + unsigned int partial + unsigned int low + unsigned int none + +ctypedef struct nvmlNvLinkUtilizationControl_t 'nvmlNvLinkUtilizationControl_t': + nvmlNvLinkUtilizationCountUnits_t units + nvmlNvLinkUtilizationCountPktTypes_t pktfilter + +ctypedef struct nvmlBridgeChipInfo_t 'nvmlBridgeChipInfo_t': + nvmlBridgeChipType_t type + unsigned int fwVersion + +ctypedef union nvmlValue_t 'nvmlValue_t': + double dVal + int siVal + unsigned int uiVal + unsigned long ulVal + unsigned long long ullVal + signed long long sllVal + unsigned short usVal + +ctypedef struct nvmlViolationTime_t 'nvmlViolationTime_t': + unsigned long long referenceTime + unsigned long long violationTime + +ctypedef struct cuda_bindings_nvml__anon_pod0: + nvmlThermalController_t controller + int defaultMinTemp + int defaultMaxTemp + int currentTemp + nvmlThermalTarget_t target + +ctypedef union nvmlUUIDValue_t 'nvmlUUIDValue_t': + char str[41] + unsigned char bytes[16] + +ctypedef struct nvmlClkMonFaultInfo_t 'nvmlClkMonFaultInfo_t': + unsigned int clkApiDomain + unsigned int clkDomainFaultMask + +ctypedef struct nvmlProcessUtilizationSample_t 'nvmlProcessUtilizationSample_t': + unsigned int pid + unsigned long long timeStamp + unsigned int smUtil + unsigned int memUtil + unsigned int encUtil + unsigned int decUtil + +ctypedef struct nvmlProcessUtilizationInfo_v1_t 'nvmlProcessUtilizationInfo_v1_t': + unsigned long long timeStamp + unsigned int pid + unsigned int smUtil + unsigned int memUtil + unsigned int encUtil + unsigned int decUtil + unsigned int jpgUtil + unsigned int ofaUtil + +ctypedef struct nvmlPlatformInfo_v1_t 'nvmlPlatformInfo_v1_t': + unsigned int version + unsigned char ibGuid[16] + unsigned char rackGuid[16] + unsigned char chassisPhysicalSlotNumber + unsigned char computeSlotIndex + unsigned char nodeIndex + unsigned char peerType + unsigned char moduleId + +ctypedef struct cuda_bindings_nvml__anon_pod1: + unsigned int bIsPresent + unsigned int percentage + unsigned int incThreshold + unsigned int decThreshold + +ctypedef struct nvmlVgpuPlacementList_v1_t 'nvmlVgpuPlacementList_v1_t': + unsigned int version + unsigned int placementSize + unsigned int count + unsigned int* placementIds + +ctypedef struct cuda_bindings_nvml__anon_pod2: + unsigned int avgFactor + unsigned int timeslice + +ctypedef struct cuda_bindings_nvml__anon_pod3: + unsigned int timeslice + +ctypedef struct nvmlVgpuSchedulerLogEntry_t 'nvmlVgpuSchedulerLogEntry_t': + unsigned long long timestamp + unsigned long long timeRunTotal + unsigned long long timeRun + unsigned int swRunlistId + unsigned long long targetTimeSlice + unsigned long long cumulativePreemptionTime + +ctypedef struct cuda_bindings_nvml__anon_pod4: + unsigned int avgFactor + unsigned int frequency + +ctypedef struct cuda_bindings_nvml__anon_pod5: + unsigned int timeslice + +ctypedef struct nvmlVgpuSchedulerCapabilities_t 'nvmlVgpuSchedulerCapabilities_t': + unsigned int supportedSchedulers[3] + unsigned int maxTimeslice + unsigned int minTimeslice + unsigned int isArrModeSupported + unsigned int maxFrequencyForARR + unsigned int minFrequencyForARR + unsigned int maxAvgFactorForARR + unsigned int minAvgFactorForARR + +ctypedef struct nvmlVgpuLicenseExpiry_t 'nvmlVgpuLicenseExpiry_t': + unsigned int year + unsigned short month + unsigned short day + unsigned short hour + unsigned short min + unsigned short sec + unsigned char status + +ctypedef struct nvmlGridLicenseExpiry_t 'nvmlGridLicenseExpiry_t': + unsigned int year + unsigned short month + unsigned short day + unsigned short hour + unsigned short min + unsigned short sec + unsigned char status + +ctypedef struct nvmlNvLinkPowerThres_t 'nvmlNvLinkPowerThres_t': + unsigned int lowPwrThreshold + +ctypedef struct nvmlHwbcEntry_t 'nvmlHwbcEntry_t': + unsigned int hwbcId + char firmwareVersion[32] + +ctypedef struct nvmlLedState_t 'nvmlLedState_t': + char cause[256] + nvmlLedColor_t color + +ctypedef struct nvmlUnitInfo_t 'nvmlUnitInfo_t': + char name[96] + char id[96] + char serial[96] + char firmwareVersion[96] + +ctypedef struct nvmlPSUInfo_t 'nvmlPSUInfo_t': + char state[256] + unsigned int current + unsigned int voltage + unsigned int power + +ctypedef struct nvmlUnitFanInfo_t 'nvmlUnitFanInfo_t': + unsigned int speed + nvmlFanState_t state + +ctypedef struct nvmlSystemEventData_v1_t 'nvmlSystemEventData_v1_t': + unsigned long long eventType + unsigned int gpuId + +ctypedef struct nvmlAccountingStats_t 'nvmlAccountingStats_t': + unsigned int gpuUtilization + unsigned int memoryUtilization + unsigned long long maxMemoryUsage + unsigned long long time + unsigned long long startTime + unsigned int isRunning + unsigned int reserved[5] + +ctypedef struct nvmlFBCStats_t 'nvmlFBCStats_t': + unsigned int sessionsCount + unsigned int averageFPS + unsigned int averageLatency + +ctypedef struct nvmlConfComputeSystemCaps_t 'nvmlConfComputeSystemCaps_t': + unsigned int cpuCaps + unsigned int gpusCaps + +ctypedef struct nvmlConfComputeSystemState_t 'nvmlConfComputeSystemState_t': + unsigned int environment + unsigned int ccFeature + unsigned int devToolsMode + +ctypedef struct nvmlConfComputeMemSizeInfo_t 'nvmlConfComputeMemSizeInfo_t': + unsigned long long protectedMemSizeKib + unsigned long long unprotectedMemSizeKib + +ctypedef struct nvmlConfComputeGpuCertificate_t 'nvmlConfComputeGpuCertificate_t': + unsigned int certChainSize + unsigned int attestationCertChainSize + unsigned char certChain[0x1000] + unsigned char attestationCertChain[0x1400] + +ctypedef struct nvmlConfComputeGpuAttestationReport_t 'nvmlConfComputeGpuAttestationReport_t': + unsigned int isCecAttestationReportPresent + unsigned int attestationReportSize + unsigned int cecAttestationReportSize + unsigned char nonce[0x20] + unsigned char attestationReport[0x2000] + unsigned char cecAttestationReport[0x1000] + +ctypedef struct nvmlVgpuVersion_t 'nvmlVgpuVersion_t': + unsigned int minVersion + unsigned int maxVersion + +ctypedef struct nvmlVgpuMetadata_t 'nvmlVgpuMetadata_t': + unsigned int version + unsigned int revision + nvmlVgpuGuestInfoState_t guestInfoState + char guestDriverVersion[80] + char hostDriverVersion[80] + unsigned int reserved[6] + unsigned int vgpuVirtualizationCaps + unsigned int guestVgpuVersion + unsigned int opaqueDataSize + char opaqueData[4] + +ctypedef struct nvmlVgpuPgpuCompatibility_t 'nvmlVgpuPgpuCompatibility_t': + nvmlVgpuVmCompatibility_t vgpuVmCompatibility + nvmlVgpuPgpuCompatibilityLimitCode_t compatibilityLimitCode + +ctypedef struct nvmlGpuInstancePlacement_t 'nvmlGpuInstancePlacement_t': + unsigned int start + unsigned int size + +ctypedef struct nvmlGpuInstanceProfileInfo_t 'nvmlGpuInstanceProfileInfo_t': + unsigned int id + unsigned int isP2pSupported + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int copyEngineCount + unsigned int decoderCount + unsigned int encoderCount + unsigned int jpegCount + unsigned int ofaCount + unsigned long long memorySizeMB + +ctypedef struct nvmlGpuInstanceProfileInfo_v2_t 'nvmlGpuInstanceProfileInfo_v2_t': + unsigned int version + unsigned int id + unsigned int isP2pSupported + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int copyEngineCount + unsigned int decoderCount + unsigned int encoderCount + unsigned int jpegCount + unsigned int ofaCount + unsigned long long memorySizeMB + char name[96] + +ctypedef struct nvmlGpuInstanceProfileInfo_v3_t 'nvmlGpuInstanceProfileInfo_v3_t': + unsigned int version + unsigned int id + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int copyEngineCount + unsigned int decoderCount + unsigned int encoderCount + unsigned int jpegCount + unsigned int ofaCount + unsigned long long memorySizeMB + char name[96] + unsigned int capabilities + +ctypedef struct nvmlComputeInstancePlacement_t 'nvmlComputeInstancePlacement_t': + unsigned int start + unsigned int size + +ctypedef struct nvmlComputeInstanceProfileInfo_t 'nvmlComputeInstanceProfileInfo_t': + unsigned int id + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int sharedCopyEngineCount + unsigned int sharedDecoderCount + unsigned int sharedEncoderCount + unsigned int sharedJpegCount + unsigned int sharedOfaCount + +ctypedef struct nvmlComputeInstanceProfileInfo_v2_t 'nvmlComputeInstanceProfileInfo_v2_t': + unsigned int version + unsigned int id + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int sharedCopyEngineCount + unsigned int sharedDecoderCount + unsigned int sharedEncoderCount + unsigned int sharedJpegCount + unsigned int sharedOfaCount + char name[96] + +ctypedef struct nvmlComputeInstanceProfileInfo_v3_t 'nvmlComputeInstanceProfileInfo_v3_t': + unsigned int version + unsigned int id + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int sharedCopyEngineCount + unsigned int sharedDecoderCount + unsigned int sharedEncoderCount + unsigned int sharedJpegCount + unsigned int sharedOfaCount + char name[96] + unsigned int capabilities + +ctypedef struct cuda_bindings_nvml__anon_pod6: + char* shortName + char* longName + char* unit + +ctypedef struct nvmlGpmSupport_t 'nvmlGpmSupport_t': + unsigned int version + unsigned int isSupportedDevice + +ctypedef struct nvmlMask255_t 'nvmlMask255_t': + unsigned int mask[8] + +ctypedef struct nvmlDevicePowerMizerModes_v1_t 'nvmlDevicePowerMizerModes_v1_t': + unsigned int currentMode + unsigned int mode + unsigned int supportedPowerMizerModes + +ctypedef struct nvmlHostname_v1_t 'nvmlHostname_v1_t': + char value[64] + +ctypedef struct nvmlEccSramUniqueUncorrectedErrorEntry_v1_t 'nvmlEccSramUniqueUncorrectedErrorEntry_v1_t': + unsigned int unit + unsigned int location + unsigned int sublocation + unsigned int extlocation + unsigned int address + unsigned int isParity + unsigned int count + +ctypedef struct nvmlNvLinkInfo_v1_t 'nvmlNvLinkInfo_v1_t': + unsigned int version + unsigned int isNvleEnabled + +ctypedef struct nvmlNvlinkFirmwareVersion_t 'nvmlNvlinkFirmwareVersion_t': + unsigned char ucodeType + unsigned int major + unsigned int minor + unsigned int subMinor + +ctypedef union cuda_bindings_nvml__anon_pod7: + unsigned char inData[496] + unsigned char outData[496] + +ctypedef struct nvmlUnrepairableMemoryStatus_v1_t 'nvmlUnrepairableMemoryStatus_v1_t': + unsigned int bUnrepairableMemory + +ctypedef struct nvmlRusdSettings_v1_t 'nvmlRusdSettings_v1_t': + unsigned int version + unsigned long long pollMask + +ctypedef struct nvmlPRMCounterInput_v1_t 'nvmlPRMCounterInput_v1_t': + unsigned int localPort + +ctypedef struct nvmlVgpuSchedulerStateInfo_v2_t 'nvmlVgpuSchedulerStateInfo_v2_t': + unsigned int engineId + unsigned int schedulerPolicy + unsigned int avgFactor + unsigned int timeslice + +ctypedef struct nvmlVgpuSchedulerLogEntry_v2_t 'nvmlVgpuSchedulerLogEntry_v2_t': + unsigned long long timestamp + unsigned long long timeRunTotal + unsigned long long timeRun + unsigned int swRunlistId + unsigned long long targetTimeSlice + unsigned long long cumulativePreemptionTime + unsigned int weight + +ctypedef struct nvmlVgpuSchedulerState_v2_t 'nvmlVgpuSchedulerState_v2_t': + unsigned int engineId + unsigned int schedulerPolicy + unsigned int avgFactor + unsigned int frequency + +ctypedef struct nvmlBBXTimeData_v1_t 'nvmlBBXTimeData_v1_t': + unsigned int timeRun + +ctypedef struct nvmlRemappedRowsInfo_v2_t 'nvmlRemappedRowsInfo_v2_t': + unsigned int corrActiveRemaps + unsigned int corrInactiveRemaps + unsigned int uncActiveRemaps + unsigned int uncInactiveRemaps + unsigned int bPending + unsigned int bFailureOccurred + +ctypedef struct nvmlAccountingStats_v2_t 'nvmlAccountingStats_v2_t': + unsigned int pid + unsigned int isRunning + unsigned int gpuUtilization + unsigned int memoryUtilization + unsigned long long maxMemoryUsage + unsigned int sampleCount + unsigned long long sumGpuUtil + unsigned long long sumFbUtil + unsigned long long time + unsigned long long startTime + +ctypedef nvmlPciInfoExt_v1_t nvmlPciInfoExt_t 'nvmlPciInfoExt_t' + +ctypedef nvmlCoolerInfo_v1_t nvmlCoolerInfo_t 'nvmlCoolerInfo_t' + +ctypedef nvmlDramEncryptionInfo_v1_t nvmlDramEncryptionInfo_t 'nvmlDramEncryptionInfo_t' + +ctypedef nvmlMarginTemperature_v1_t nvmlMarginTemperature_t 'nvmlMarginTemperature_t' + +ctypedef nvmlClockOffset_v1_t nvmlClockOffset_t 'nvmlClockOffset_t' + +ctypedef nvmlFanSpeedInfo_v1_t nvmlFanSpeedInfo_t 'nvmlFanSpeedInfo_t' + +ctypedef nvmlDevicePerfModes_v1_t nvmlDevicePerfModes_t 'nvmlDevicePerfModes_t' + +ctypedef nvmlDeviceCurrentClockFreqs_v1_t nvmlDeviceCurrentClockFreqs_t 'nvmlDeviceCurrentClockFreqs_t' + +ctypedef nvmlEccSramErrorStatus_v1_t nvmlEccSramErrorStatus_t 'nvmlEccSramErrorStatus_t' + +ctypedef nvmlPlatformInfo_v2_t nvmlPlatformInfo_t 'nvmlPlatformInfo_t' + +ctypedef struct nvmlPowerValue_v2_t 'nvmlPowerValue_v2_t': + unsigned int version + nvmlPowerScopeType_t powerScope + unsigned int powerValueMw + +ctypedef struct nvmlVgpuTypeIdInfo_v1_t 'nvmlVgpuTypeIdInfo_v1_t': + unsigned int version + unsigned int vgpuCount + nvmlVgpuTypeId_t* vgpuTypeIds + +ctypedef struct nvmlVgpuTypeMaxInstance_v1_t 'nvmlVgpuTypeMaxInstance_v1_t': + unsigned int version + nvmlVgpuTypeId_t vgpuTypeId + unsigned int maxInstancePerGI + +ctypedef struct nvmlVgpuCreatablePlacementInfo_v1_t 'nvmlVgpuCreatablePlacementInfo_v1_t': + unsigned int version + nvmlVgpuTypeId_t vgpuTypeId + unsigned int count + unsigned int* placementIds + unsigned int placementSize + +ctypedef struct nvmlVgpuProcessUtilizationSample_t 'nvmlVgpuProcessUtilizationSample_t': + nvmlVgpuInstance_t vgpuInstance + unsigned int pid + char processName[64] + unsigned long long timeStamp + unsigned int smUtil + unsigned int memUtil + unsigned int encUtil + unsigned int decUtil + +ctypedef struct nvmlVgpuProcessUtilizationInfo_v1_t 'nvmlVgpuProcessUtilizationInfo_v1_t': + char processName[64] + unsigned long long timeStamp + nvmlVgpuInstance_t vgpuInstance + unsigned int pid + unsigned int smUtil + unsigned int memUtil + unsigned int encUtil + unsigned int decUtil + unsigned int jpgUtil + unsigned int ofaUtil + +ctypedef struct nvmlActiveVgpuInstanceInfo_v1_t 'nvmlActiveVgpuInstanceInfo_v1_t': + unsigned int version + unsigned int vgpuCount + nvmlVgpuInstance_t* vgpuInstances + +ctypedef struct nvmlEncoderSessionInfo_t 'nvmlEncoderSessionInfo_t': + unsigned int sessionId + unsigned int pid + nvmlVgpuInstance_t vgpuInstance + nvmlEncoderType_t codecType + unsigned int hResolution + unsigned int vResolution + unsigned int averageFps + unsigned int averageLatency + +ctypedef struct nvmlFBCSessionInfo_t 'nvmlFBCSessionInfo_t': + unsigned int sessionId + unsigned int pid + nvmlVgpuInstance_t vgpuInstance + unsigned int displayOrdinal + nvmlFBCSessionType_t sessionType + unsigned int sessionFlags + unsigned int hMaxResolution + unsigned int vMaxResolution + unsigned int hResolution + unsigned int vResolution + unsigned int averageFPS + unsigned int averageLatency + +ctypedef nvmlVgpuHeterogeneousMode_v1_t nvmlVgpuHeterogeneousMode_t 'nvmlVgpuHeterogeneousMode_t' + +ctypedef nvmlVgpuPlacementId_v1_t nvmlVgpuPlacementId_t 'nvmlVgpuPlacementId_t' + +ctypedef nvmlVgpuPlacementList_v2_t nvmlVgpuPlacementList_t 'nvmlVgpuPlacementList_t' + +ctypedef nvmlVgpuTypeBar1Info_v1_t nvmlVgpuTypeBar1Info_t 'nvmlVgpuTypeBar1Info_t' + +ctypedef nvmlVgpuRuntimeState_v1_t nvmlVgpuRuntimeState_t 'nvmlVgpuRuntimeState_t' + +ctypedef nvmlSystemConfComputeSettings_v1_t nvmlSystemConfComputeSettings_t 'nvmlSystemConfComputeSettings_t' + +ctypedef nvmlConfComputeSetKeyRotationThresholdInfo_v1_t nvmlConfComputeSetKeyRotationThresholdInfo_t 'nvmlConfComputeSetKeyRotationThresholdInfo_t' + +ctypedef nvmlConfComputeGetKeyRotationThresholdInfo_v1_t nvmlConfComputeGetKeyRotationThresholdInfo_t 'nvmlConfComputeGetKeyRotationThresholdInfo_t' + +ctypedef struct nvmlGpuFabricInfo_t 'nvmlGpuFabricInfo_t': + unsigned char clusterUuid[16] + nvmlReturn_t status + unsigned int cliqueId + nvmlGpuFabricState_t state + +ctypedef struct nvmlGpuFabricInfo_v2_t 'nvmlGpuFabricInfo_v2_t': + unsigned int version + unsigned char clusterUuid[16] + nvmlReturn_t status + unsigned int cliqueId + nvmlGpuFabricState_t state + unsigned int healthMask + +ctypedef struct nvmlGpuFabricInfo_v3_t 'nvmlGpuFabricInfo_v3_t': + unsigned int version + unsigned char clusterUuid[16] + nvmlReturn_t status + unsigned int cliqueId + nvmlGpuFabricState_t state + unsigned int healthMask + unsigned char healthSummary + +ctypedef nvmlSystemDriverBranchInfo_v1_t nvmlSystemDriverBranchInfo_t 'nvmlSystemDriverBranchInfo_t' + +ctypedef nvmlTemperature_v1_t nvmlTemperature_t 'nvmlTemperature_t' + +ctypedef nvmlNvlinkSupportedBwModes_v1_t nvmlNvlinkSupportedBwModes_t 'nvmlNvlinkSupportedBwModes_t' + +ctypedef nvmlNvlinkGetBwMode_v1_t nvmlNvlinkGetBwMode_t 'nvmlNvlinkGetBwMode_t' + +ctypedef nvmlNvlinkSetBwMode_v1_t nvmlNvlinkSetBwMode_t 'nvmlNvlinkSetBwMode_t' + +ctypedef nvmlDeviceCapabilities_v1_t nvmlDeviceCapabilities_t 'nvmlDeviceCapabilities_t' + +ctypedef nvmlPowerSmoothingProfile_v1_t nvmlPowerSmoothingProfile_t 'nvmlPowerSmoothingProfile_t' + +ctypedef nvmlPowerSmoothingState_v1_t nvmlPowerSmoothingState_t 'nvmlPowerSmoothingState_t' + +ctypedef nvmlDeviceAddressingMode_v1_t nvmlDeviceAddressingMode_t 'nvmlDeviceAddressingMode_t' + +ctypedef nvmlRepairStatus_v1_t nvmlRepairStatus_t 'nvmlRepairStatus_t' + +ctypedef nvmlPdi_v1_t nvmlPdi_t 'nvmlPdi_t' + +ctypedef struct nvmlCPERCursor_v1_t 'nvmlCPERCursor_v1_t': + unsigned int cperTypeMask + char uuid[80] + nvmlCPERCursorHandle_t handle + +ctypedef struct nvmlEventData_t 'nvmlEventData_t': + nvmlDevice_t device + unsigned long long eventType + unsigned long long eventData + unsigned int gpuInstanceId + unsigned int computeInstanceId + +ctypedef struct nvmlSystemEventSetCreateRequest_v1_t 'nvmlSystemEventSetCreateRequest_v1_t': + unsigned int version + nvmlSystemEventSet_t set + +ctypedef struct nvmlSystemEventSetFreeRequest_v1_t 'nvmlSystemEventSetFreeRequest_v1_t': + unsigned int version + nvmlSystemEventSet_t set + +ctypedef struct nvmlSystemRegisterEventRequest_v1_t 'nvmlSystemRegisterEventRequest_v1_t': + unsigned int version + unsigned long long eventTypes + nvmlSystemEventSet_t set + +ctypedef struct nvmlExcludedDeviceInfo_t 'nvmlExcludedDeviceInfo_t': + nvmlPciInfo_t pciInfo + char uuid[80] + +ctypedef struct nvmlProcessDetailList_v1_t 'nvmlProcessDetailList_v1_t': + unsigned int version + unsigned int mode + unsigned int numProcArrayEntries + nvmlProcessDetail_v1_t* procArray + +ctypedef struct nvmlBridgeChipHierarchy_t 'nvmlBridgeChipHierarchy_t': + unsigned char bridgeCount + nvmlBridgeChipInfo_t bridgeChipInfo[128] + +ctypedef struct nvmlSample_t 'nvmlSample_t': + unsigned long long timeStamp + nvmlValue_t sampleValue + +ctypedef struct nvmlVgpuInstanceUtilizationSample_t 'nvmlVgpuInstanceUtilizationSample_t': + nvmlVgpuInstance_t vgpuInstance + unsigned long long timeStamp + nvmlValue_t smUtil + nvmlValue_t memUtil + nvmlValue_t encUtil + nvmlValue_t decUtil + +ctypedef struct nvmlVgpuInstanceUtilizationInfo_v1_t 'nvmlVgpuInstanceUtilizationInfo_v1_t': + unsigned long long timeStamp + nvmlVgpuInstance_t vgpuInstance + nvmlValue_t smUtil + nvmlValue_t memUtil + nvmlValue_t encUtil + nvmlValue_t decUtil + nvmlValue_t jpgUtil + nvmlValue_t ofaUtil + +ctypedef struct nvmlFieldValue_t 'nvmlFieldValue_t': + unsigned int fieldId + unsigned int scopeId + long long timestamp + long long latencyUsec + nvmlValueType_t valueType + nvmlReturn_t nvmlReturn + nvmlValue_t value + +ctypedef struct nvmlPRMCounterValue_v1_t 'nvmlPRMCounterValue_v1_t': + nvmlReturn_t status + nvmlValueType_t outputType + nvmlValue_t outputValue + +ctypedef struct nvmlGpuThermalSettings_t 'nvmlGpuThermalSettings_t': + unsigned int count + cuda_bindings_nvml__anon_pod0 sensor[3] + +ctypedef struct nvmlUUID_v1_t 'nvmlUUID_v1_t': + unsigned int version + unsigned int type + nvmlUUIDValue_t value + +ctypedef struct nvmlClkMonStatus_t 'nvmlClkMonStatus_t': + unsigned int bGlobalStatus + unsigned int clkMonListSize + nvmlClkMonFaultInfo_t clkMonList[32] + +ctypedef struct nvmlProcessesUtilizationInfo_v1_t 'nvmlProcessesUtilizationInfo_v1_t': + unsigned int version + unsigned int processSamplesCount + unsigned long long lastSeenTimeStamp + nvmlProcessUtilizationInfo_v1_t* procUtilArray + +ctypedef struct nvmlGpuDynamicPstatesInfo_t 'nvmlGpuDynamicPstatesInfo_t': + unsigned int flags + cuda_bindings_nvml__anon_pod1 utilization[8] + +ctypedef union nvmlVgpuSchedulerParams_t 'nvmlVgpuSchedulerParams_t': + cuda_bindings_nvml__anon_pod2 vgpuSchedDataWithARR + cuda_bindings_nvml__anon_pod3 vgpuSchedData + +ctypedef union nvmlVgpuSchedulerSetParams_t 'nvmlVgpuSchedulerSetParams_t': + cuda_bindings_nvml__anon_pod4 vgpuSchedDataWithARR + cuda_bindings_nvml__anon_pod5 vgpuSchedData + +ctypedef struct nvmlVgpuLicenseInfo_t 'nvmlVgpuLicenseInfo_t': + unsigned char isLicensed + nvmlVgpuLicenseExpiry_t licenseExpiry + unsigned int currentState + +ctypedef struct nvmlGridLicensableFeature_t 'nvmlGridLicensableFeature_t': + nvmlGridLicenseFeatureCode_t featureCode + unsigned int featureState + char licenseInfo[128] + char productName[128] + unsigned int featureEnabled + nvmlGridLicenseExpiry_t licenseExpiry + +ctypedef struct nvmlUnitFanSpeeds_t 'nvmlUnitFanSpeeds_t': + nvmlUnitFanInfo_t fans[24] + unsigned int count + +ctypedef struct nvmlSystemEventSetWaitRequest_v1_t 'nvmlSystemEventSetWaitRequest_v1_t': + unsigned int version + unsigned int timeoutms + nvmlSystemEventSet_t set + nvmlSystemEventData_v1_t* data + unsigned int dataSize + unsigned int numEvent + +ctypedef struct nvmlVgpuPgpuMetadata_t 'nvmlVgpuPgpuMetadata_t': + unsigned int version + unsigned int revision + char hostDriverVersion[80] + unsigned int pgpuVirtualizationCaps + unsigned int reserved[5] + nvmlVgpuVersion_t hostSupportedVgpuRange + unsigned int opaqueDataSize + char opaqueData[4] + +ctypedef struct nvmlGpuInstanceInfo_t 'nvmlGpuInstanceInfo_t': + nvmlDevice_t device + unsigned int id + unsigned int profileId + nvmlGpuInstancePlacement_t placement + +ctypedef struct nvmlComputeInstanceInfo_t 'nvmlComputeInstanceInfo_t': + nvmlDevice_t device + nvmlGpuInstance_t gpuInstance + unsigned int id + unsigned int profileId + nvmlComputeInstancePlacement_t placement + +ctypedef struct nvmlGpmMetric_t 'nvmlGpmMetric_t': + unsigned int metricId + nvmlReturn_t nvmlReturn + double value + cuda_bindings_nvml__anon_pod6 metricInfo + +ctypedef struct nvmlWorkloadPowerProfileInfo_v1_t 'nvmlWorkloadPowerProfileInfo_v1_t': + unsigned int version + unsigned int profileId + unsigned int priority + nvmlMask255_t conflictingMask + +ctypedef struct nvmlWorkloadPowerProfileCurrentProfiles_v1_t 'nvmlWorkloadPowerProfileCurrentProfiles_v1_t': + unsigned int version + nvmlMask255_t perfProfilesMask + nvmlMask255_t requestedProfilesMask + nvmlMask255_t enforcedProfilesMask + +ctypedef struct nvmlWorkloadPowerProfileRequestedProfiles_v1_t 'nvmlWorkloadPowerProfileRequestedProfiles_v1_t': + unsigned int version + nvmlMask255_t requestedProfilesMask + +ctypedef struct nvmlWorkloadPowerProfileUpdateProfiles_v1_t 'nvmlWorkloadPowerProfileUpdateProfiles_v1_t': + nvmlPowerProfileOperation_t operation + nvmlMask255_t updateProfilesMask + +ctypedef struct nvmlEccSramUniqueUncorrectedErrorCounts_v1_t 'nvmlEccSramUniqueUncorrectedErrorCounts_v1_t': + unsigned int version + unsigned int entryCount + nvmlEccSramUniqueUncorrectedErrorEntry_v1_t* entries + +ctypedef struct nvmlNvlinkFirmwareInfo_t 'nvmlNvlinkFirmwareInfo_t': + nvmlNvlinkFirmwareVersion_t firmwareVersion[100] + unsigned int numValidEntries + +ctypedef struct nvmlPRMTLV_v1_t 'nvmlPRMTLV_v1_t': + unsigned dataSize + unsigned status + cuda_bindings_nvml__anon_pod7 _anon_pod_member0 + +ctypedef struct nvmlVgpuSchedulerLogInfo_v2_t 'nvmlVgpuSchedulerLogInfo_v2_t': + unsigned int engineId + unsigned int schedulerPolicy + unsigned int avgFactor + unsigned int timeslice + unsigned int entriesCount + nvmlVgpuSchedulerLogEntry_v2_t logEntries[200] + +ctypedef nvmlVgpuTypeIdInfo_v1_t nvmlVgpuTypeIdInfo_t 'nvmlVgpuTypeIdInfo_t' + +ctypedef nvmlVgpuTypeMaxInstance_v1_t nvmlVgpuTypeMaxInstance_t 'nvmlVgpuTypeMaxInstance_t' + +ctypedef nvmlVgpuCreatablePlacementInfo_v1_t nvmlVgpuCreatablePlacementInfo_t 'nvmlVgpuCreatablePlacementInfo_t' + +ctypedef struct nvmlVgpuProcessesUtilizationInfo_v1_t 'nvmlVgpuProcessesUtilizationInfo_v1_t': + unsigned int version + unsigned int vgpuProcessCount + unsigned long long lastSeenTimeStamp + nvmlVgpuProcessUtilizationInfo_v1_t* vgpuProcUtilArray + +ctypedef nvmlActiveVgpuInstanceInfo_v1_t nvmlActiveVgpuInstanceInfo_t 'nvmlActiveVgpuInstanceInfo_t' + +ctypedef nvmlGpuFabricInfo_v3_t nvmlGpuFabricInfoV_t 'nvmlGpuFabricInfoV_t' + +ctypedef struct nvmlGetCPER_v1_t 'nvmlGetCPER_v1_t': + nvmlCPERCursor_v1_t cursor + unsigned char* buffer + unsigned int bufferSize + +ctypedef nvmlSystemEventSetCreateRequest_v1_t nvmlSystemEventSetCreateRequest_t 'nvmlSystemEventSetCreateRequest_t' + +ctypedef nvmlSystemEventSetFreeRequest_v1_t nvmlSystemEventSetFreeRequest_t 'nvmlSystemEventSetFreeRequest_t' + +ctypedef nvmlSystemRegisterEventRequest_v1_t nvmlSystemRegisterEventRequest_t 'nvmlSystemRegisterEventRequest_t' + +ctypedef nvmlProcessDetailList_v1_t nvmlProcessDetailList_t 'nvmlProcessDetailList_t' + +ctypedef struct nvmlVgpuInstancesUtilizationInfo_v1_t 'nvmlVgpuInstancesUtilizationInfo_v1_t': + unsigned int version + nvmlValueType_t sampleValType + unsigned int vgpuInstanceCount + unsigned long long lastSeenTimeStamp + nvmlVgpuInstanceUtilizationInfo_v1_t* vgpuUtilArray + +ctypedef struct nvmlPRMCounter_v1_t 'nvmlPRMCounter_v1_t': + unsigned int counterId + nvmlPRMCounterInput_v1_t inData + nvmlPRMCounterValue_v1_t counterValue + +ctypedef nvmlUUID_v1_t nvmlUUID_t 'nvmlUUID_t' + +ctypedef nvmlProcessesUtilizationInfo_v1_t nvmlProcessesUtilizationInfo_t 'nvmlProcessesUtilizationInfo_t' + +ctypedef struct nvmlVgpuSchedulerLog_t 'nvmlVgpuSchedulerLog_t': + unsigned int engineId + unsigned int schedulerPolicy + unsigned int arrMode + nvmlVgpuSchedulerParams_t schedulerParams + unsigned int entriesCount + nvmlVgpuSchedulerLogEntry_t logEntries[200] + +ctypedef struct nvmlVgpuSchedulerGetState_t 'nvmlVgpuSchedulerGetState_t': + unsigned int schedulerPolicy + unsigned int arrMode + nvmlVgpuSchedulerParams_t schedulerParams + +ctypedef struct nvmlVgpuSchedulerStateInfo_v1_t 'nvmlVgpuSchedulerStateInfo_v1_t': + unsigned int version + unsigned int engineId + unsigned int schedulerPolicy + unsigned int arrMode + nvmlVgpuSchedulerParams_t schedulerParams + +ctypedef struct nvmlVgpuSchedulerLogInfo_v1_t 'nvmlVgpuSchedulerLogInfo_v1_t': + unsigned int version + unsigned int engineId + unsigned int schedulerPolicy + unsigned int arrMode + nvmlVgpuSchedulerParams_t schedulerParams + unsigned int entriesCount + nvmlVgpuSchedulerLogEntry_t logEntries[200] + +ctypedef struct nvmlVgpuSchedulerSetState_t 'nvmlVgpuSchedulerSetState_t': + unsigned int schedulerPolicy + unsigned int enableARRMode + nvmlVgpuSchedulerSetParams_t schedulerParams + +ctypedef struct nvmlVgpuSchedulerState_v1_t 'nvmlVgpuSchedulerState_v1_t': + unsigned int version + unsigned int engineId + unsigned int schedulerPolicy + unsigned int enableARRMode + nvmlVgpuSchedulerSetParams_t schedulerParams + +ctypedef struct nvmlGridLicensableFeatures_t 'nvmlGridLicensableFeatures_t': + int isGridLicenseSupported + unsigned int licensableFeaturesCount + nvmlGridLicensableFeature_t gridLicensableFeatures[3] + +ctypedef nvmlSystemEventSetWaitRequest_v1_t nvmlSystemEventSetWaitRequest_t 'nvmlSystemEventSetWaitRequest_t' + +ctypedef struct nvmlGpmMetricsGet_t 'nvmlGpmMetricsGet_t': + unsigned int version + unsigned int numMetrics + nvmlGpmSample_t sample1 + nvmlGpmSample_t sample2 + nvmlGpmMetric_t metrics[333] + +ctypedef nvmlWorkloadPowerProfileInfo_v1_t nvmlWorkloadPowerProfileInfo_t 'nvmlWorkloadPowerProfileInfo_t' + +ctypedef nvmlWorkloadPowerProfileCurrentProfiles_v1_t nvmlWorkloadPowerProfileCurrentProfiles_t 'nvmlWorkloadPowerProfileCurrentProfiles_t' + +ctypedef nvmlWorkloadPowerProfileRequestedProfiles_v1_t nvmlWorkloadPowerProfileRequestedProfiles_t 'nvmlWorkloadPowerProfileRequestedProfiles_t' + +ctypedef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t nvmlEccSramUniqueUncorrectedErrorCounts_t 'nvmlEccSramUniqueUncorrectedErrorCounts_t' + +ctypedef struct nvmlNvLinkInfo_v2_t 'nvmlNvLinkInfo_v2_t': + unsigned int version + unsigned int isNvleEnabled + nvmlNvlinkFirmwareInfo_t firmwareInfo + +ctypedef nvmlVgpuProcessesUtilizationInfo_v1_t nvmlVgpuProcessesUtilizationInfo_t 'nvmlVgpuProcessesUtilizationInfo_t' + +ctypedef nvmlVgpuInstancesUtilizationInfo_v1_t nvmlVgpuInstancesUtilizationInfo_t 'nvmlVgpuInstancesUtilizationInfo_t' + +ctypedef struct nvmlPRMCounterList_v1_t 'nvmlPRMCounterList_v1_t': + unsigned int numCounters + nvmlPRMCounter_v1_t* counters + +ctypedef nvmlVgpuSchedulerStateInfo_v1_t nvmlVgpuSchedulerStateInfo_t 'nvmlVgpuSchedulerStateInfo_t' + +ctypedef nvmlVgpuSchedulerLogInfo_v1_t nvmlVgpuSchedulerLogInfo_t 'nvmlVgpuSchedulerLogInfo_t' + +ctypedef nvmlVgpuSchedulerState_v1_t nvmlVgpuSchedulerState_t 'nvmlVgpuSchedulerState_t' + +ctypedef struct nvmlWorkloadPowerProfileProfilesInfo_v1_t 'nvmlWorkloadPowerProfileProfilesInfo_v1_t': + unsigned int version + nvmlMask255_t perfProfilesMask + nvmlWorkloadPowerProfileInfo_t perfProfile[255] + +ctypedef nvmlNvLinkInfo_v2_t nvmlNvLinkInfo_t 'nvmlNvLinkInfo_t' + +ctypedef nvmlWorkloadPowerProfileProfilesInfo_v1_t nvmlWorkloadPowerProfileProfilesInfo_t 'nvmlWorkloadPowerProfileProfilesInfo_t' + + +############################################################################### +# Functions +############################################################################### + +cdef nvmlReturn_t nvmlInit_v2() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlInitWithFlags(unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlShutdown() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef const char* nvmlErrorString(nvmlReturn_t result) except?NULL nogil +cdef nvmlReturn_t nvmlSystemGetDriverVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetNVMLVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetCudaDriverVersion(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetCudaDriverVersion_v2(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetProcessName(unsigned int pid, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetHicVersion(unsigned int* hwbcCount, nvmlHwbcEntry_t* hwbcEntries) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetTopologyGpuSet(unsigned int cpuNumber, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetDriverBranch(nvmlSystemDriverBranchInfo_t* branchInfo, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetCount(unsigned int* unitCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetHandleByIndex(unsigned int index, nvmlUnit_t* unit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetUnitInfo(nvmlUnit_t unit, nvmlUnitInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetLedState(nvmlUnit_t unit, nvmlLedState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetPsuInfo(nvmlUnit_t unit, nvmlPSUInfo_t* psu) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetTemperature(nvmlUnit_t unit, unsigned int type, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetFanSpeedInfo(nvmlUnit_t unit, nvmlUnitFanSpeeds_t* fanSpeeds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetDevices(nvmlUnit_t unit, unsigned int* deviceCount, nvmlDevice_t* devices) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCount_v2(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAttributes_v2(nvmlDevice_t device, nvmlDeviceAttributes_t* attributes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHandleByIndex_v2(unsigned int index, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHandleBySerial(const char* serial, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHandleByUUID(const char* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHandleByUUIDV(const nvmlUUID_t* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHandleByPciBusId_v2(const char* pciBusId, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetName(nvmlDevice_t device, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBrand(nvmlDevice_t device, nvmlBrandType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetIndex(nvmlDevice_t device, unsigned int* index) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSerial(nvmlDevice_t device, char* serial, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetModuleId(nvmlDevice_t device, unsigned int* moduleId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetC2cModeInfoV(nvmlDevice_t device, nvmlC2cModeInfo_v1_t* c2cModeInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemoryAffinity(nvmlDevice_t device, unsigned int nodeSetSize, unsigned long* nodeSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCpuAffinityWithinScope(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCpuAffinity(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceClearCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNumaNodeId(nvmlDevice_t device, unsigned int* node) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuTopologyLevel_t* pathInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTopologyNearestGpus(nvmlDevice_t device, nvmlGpuTopologyLevel_t level, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetP2PStatus(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuP2PCapsIndex_t p2pIndex, nvmlGpuP2PStatus_t* p2pStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetUUID(nvmlDevice_t device, char* uuid, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMinorNumber(nvmlDevice_t device, unsigned int* minorNumber) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBoardPartNumber(nvmlDevice_t device, char* partNumber, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetInforomVersion(nvmlDevice_t device, nvmlInforomObject_t object, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetInforomImageVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_t device, unsigned int* checksum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceValidateInforom(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetLastBBXFlushTime(nvmlDevice_t device, unsigned long long* timestamp, unsigned long* durationUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDisplayMode(nvmlDevice_t device, nvmlEnableState_t* display) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDisplayActive(nvmlDevice_t device, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPciInfoExt(nvmlDevice_t device, nvmlPciInfoExt_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPciInfo_v3(nvmlDevice_t device, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGenDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_t device, unsigned int* maxLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_t device, unsigned int* currLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_t device, unsigned int* currLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPcieThroughput(nvmlDevice_t device, nvmlPcieUtilCounter_t counter, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPcieReplayCounter(nvmlDevice_t device, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMaxClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpcClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetClock(nvmlDevice_t device, nvmlClockType_t clockType, nvmlClockId_t clockId, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_t device, nvmlClockType_t clockType, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_t device, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_t device, unsigned int memoryClockMHz, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t* isEnabled, nvmlEnableState_t* defaultIsEnabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFanSpeed(nvmlDevice_t device, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFanSpeedRPM(nvmlDevice_t device, nvmlFanSpeedInfo_t* fanSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTargetFanSpeed(nvmlDevice_t device, unsigned int fan, unsigned int* targetSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMinMaxFanSpeed(nvmlDevice_t device, unsigned int* minSpeed, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFanControlPolicy_v2(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t* policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNumFans(nvmlDevice_t device, unsigned int* numFans) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCoolerInfo(nvmlDevice_t device, nvmlCoolerInfo_t* coolerInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTemperatureV(nvmlDevice_t device, nvmlTemperature_t* temperature) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMarginTemperature(nvmlDevice_t device, nvmlMarginTemperature_t* marginTempInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetThermalSettings(nvmlDevice_t device, unsigned int sensorIndex, nvmlGpuThermalSettings_t* pThermalSettings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCurrentClocksEventReasons(nvmlDevice_t device, unsigned long long* clocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedClocksEventReasons(nvmlDevice_t device, unsigned long long* supportedClocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDynamicPstatesInfo(nvmlDevice_t device, nvmlGpuDynamicPstatesInfo_t* pDynamicPstatesInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMinMaxClockOfPState(nvmlDevice_t device, nvmlClockType_t type, nvmlPstates_t pstate, unsigned int* minClockMHz, unsigned int* maxClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedPerformanceStates(nvmlDevice_t device, nvmlPstates_t* pstates, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpcClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPerformanceModes(nvmlDevice_t device, nvmlDevicePerfModes_t* perfModes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCurrentClockFreqs(nvmlDevice_t device, nvmlDeviceCurrentClockFreqs_t* currentClockFreqs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerManagementLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_t device, unsigned int* minLimit, unsigned int* maxLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_t device, unsigned int* defaultLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerUsage(nvmlDevice_t device, unsigned int* power) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTotalEnergyConsumption(nvmlDevice_t device, unsigned long long* energy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t* current, nvmlGpuOperationMode_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemoryInfo_v2(nvmlDevice_t device, nvmlMemory_v2_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetComputeMode(nvmlDevice_t device, nvmlComputeMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCudaComputeCapability(nvmlDevice_t device, int* major, int* minor) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDramEncryptionMode(nvmlDevice_t device, nvmlDramEncryptionInfo_t* current, nvmlDramEncryptionInfo_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetDramEncryptionMode(nvmlDevice_t device, const nvmlDramEncryptionInfo_t* dramEncryption) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEccMode(nvmlDevice_t device, nvmlEnableState_t* current, nvmlEnableState_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDefaultEccMode(nvmlDevice_t device, nvmlEnableState_t* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBoardId(nvmlDevice_t device, unsigned int* boardId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMultiGpuBoard(nvmlDevice_t device, unsigned int* multiGpuBool) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTotalEccErrors(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, unsigned long long* eccCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemoryErrorCounter(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, nvmlMemoryLocation_t locationType, unsigned long long* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t* utilization) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEncoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEncoderCapacity(nvmlDevice_t device, nvmlEncoderType_t encoderQueryType, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEncoderStats(nvmlDevice_t device, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEncoderSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDecoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetJpgUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetOfaUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFBCStats(nvmlDevice_t device, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFBCSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverModel_t* current, nvmlDriverModel_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVbiosVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBridgeChipInfo(nvmlDevice_t device, nvmlBridgeChipHierarchy_t* bridgeHierarchy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRunningProcessDetailList(nvmlDevice_t device, nvmlProcessDetailList_t* plist) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceOnSameBoard(nvmlDevice_t device1, nvmlDevice_t device2, int* onSameBoard) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t* isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSamples(nvmlDevice_t device, nvmlSamplingType_t type, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* sampleCount, nvmlSample_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBAR1MemoryInfo(nvmlDevice_t device, nvmlBAR1Memory_t* bar1Memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetIrqNum(nvmlDevice_t device, unsigned int* irqNum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNumGpuCores(nvmlDevice_t device, unsigned int* numCores) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerSource(nvmlDevice_t device, nvmlPowerSource_t* powerSource) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemoryBusWidth(nvmlDevice_t device, unsigned int* busWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPcieLinkMaxSpeed(nvmlDevice_t device, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPcieSpeed(nvmlDevice_t device, unsigned int* pcieSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAdaptiveClockInfoStatus(nvmlDevice_t device, unsigned int* adaptiveClockStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBusType(nvmlDevice_t device, nvmlBusType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuFabricInfoV(nvmlDevice_t device, nvmlGpuFabricInfoV_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetConfComputeCapabilities(nvmlConfComputeSystemCaps_t* capabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetConfComputeState(nvmlConfComputeSystemState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetConfComputeMemSizeInfo(nvmlDevice_t device, nvmlConfComputeMemSizeInfo_t* memInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetConfComputeGpusReadyState(unsigned int* isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetConfComputeProtectedMemoryUsage(nvmlDevice_t device, nvmlMemory_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetConfComputeGpuCertificate(nvmlDevice_t device, nvmlConfComputeGpuCertificate_t* gpuCert) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetConfComputeGpuAttestationReport(nvmlDevice_t device, nvmlConfComputeGpuAttestationReport_t* gpuAtstReport) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetConfComputeKeyRotationThresholdInfo(nvmlConfComputeGetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetConfComputeUnprotectedMemSize(nvmlDevice_t device, unsigned long long sizeKiB) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemSetConfComputeGpusReadyState(unsigned int isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemSetConfComputeKeyRotationThresholdInfo(nvmlConfComputeSetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetConfComputeSettings(nvmlSystemConfComputeSettings_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGspFirmwareVersion(nvmlDevice_t device, char* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGspFirmwareMode(nvmlDevice_t device, unsigned int* isEnabled, unsigned int* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSramEccErrorStatus(nvmlDevice_t device, nvmlEccSramErrorStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAccountingMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAccountingStats(nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAccountingPids(nvmlDevice_t device, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAccountingBufferSize(nvmlDevice_t device, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRetiredPages(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRetiredPages_v2(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses, unsigned long long* timestamps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_t device, nvmlEnableState_t* isPending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRemappedRows(nvmlDevice_t device, unsigned int* corrRows, unsigned int* uncRows, unsigned int* isPending, unsigned int* failureOccurred) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRowRemapperHistogram(nvmlDevice_t device, nvmlRowRemapperHistogramValues_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetArchitecture(nvmlDevice_t device, nvmlDeviceArchitecture_t* arch) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetClkMonStatus(nvmlDevice_t device, nvmlClkMonStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetProcessUtilization(nvmlDevice_t device, nvmlProcessUtilizationSample_t* utilization, unsigned int* processSamplesCount, unsigned long long lastSeenTimeStamp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetProcessesUtilizationInfo(nvmlDevice_t device, nvmlProcessesUtilizationInfo_t* procesesUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPlatformInfo(nvmlDevice_t device, nvmlPlatformInfo_t* platformInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitSetLedState(nvmlUnit_t unit, nvmlLedColor_t color) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetComputeMode(nvmlDevice_t device, nvmlComputeMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetEccMode(nvmlDevice_t device, nvmlEnableState_t ecc) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceClearEccErrorCounts(nvmlDevice_t device, nvmlEccCounterType_t counterType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetDriverModel(nvmlDevice_t device, nvmlDriverModel_t driverModel, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetGpuLockedClocks(nvmlDevice_t device, unsigned int minGpuClockMHz, unsigned int maxGpuClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceResetGpuLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetMemoryLockedClocks(nvmlDevice_t device, unsigned int minMemClockMHz, unsigned int maxMemClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceResetMemoryLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetDefaultFanSpeed_v2(nvmlDevice_t device, unsigned int fan) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetFanControlPolicy(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetAccountingMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceClearAccountingPids(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetPowerManagementLimit_v2(nvmlDevice_t device, nvmlPowerValue_v2_t* powerValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkState(nvmlDevice_t device, unsigned int link, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkVersion(nvmlDevice_t device, unsigned int link, unsigned int* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkCapability(nvmlDevice_t device, unsigned int link, nvmlNvLinkCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice_t device, unsigned int link, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_t device, unsigned int link, nvmlNvLinkErrorCounter_t counter, unsigned long long* counterValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceResetNvLinkErrorCounters(nvmlDevice_t device, unsigned int link) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice_t device, unsigned int link, nvmlIntNvLinkDeviceType_t* pNvLinkDeviceType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetNvLinkDeviceLowPowerThreshold(nvmlDevice_t device, nvmlNvLinkPowerThres_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemSetNvlinkBwMode(unsigned int nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetNvlinkBwMode(unsigned int* nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvlinkSupportedBwModes(nvmlDevice_t device, nvmlNvlinkSupportedBwModes_t* supportedBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkGetBwMode_t* getBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkSetBwMode_t* setBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetCreate(nvmlEventSet_t* set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceRegisterEvents(nvmlDevice_t device, unsigned long long eventTypes, nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedEventTypes(nvmlDevice_t device, unsigned long long* eventTypes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetWait_v2(nvmlEventSet_t set, nvmlEventData_t* data, unsigned int timeoutms) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetFree(nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemEventSetCreate(nvmlSystemEventSetCreateRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemEventSetFree(nvmlSystemEventSetFreeRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemRegisterEvents(nvmlSystemRegisterEventRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemEventSetWait(nvmlSystemEventSetWaitRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceModifyDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t newState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceQueryDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t* currentState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceRemoveGpu_v2(nvmlPciInfo_t* pciInfo, nvmlDetachGpuState_t gpuState, nvmlPcieLinkState_t linkState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceDiscoverGpus(nvmlPciInfo_t* pciInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceClearFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t* pVirtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHostVgpuMode(nvmlDevice_t device, nvmlHostVgpuMode_t* pHostVgpuMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t virtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuHeterogeneousMode(nvmlDevice_t device, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetVgpuHeterogeneousMode(nvmlDevice_t device, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetPlacementId(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuPlacementId_t* pPlacement) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuTypeSupportedPlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuTypeCreatablePlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetGspHeapSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* gspHeapSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetFbReservation(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbReservation) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetRuntimeStateSize(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuRuntimeState_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, nvmlEnableState_t state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGridLicensableFeatures_v4(nvmlDevice_t device, nvmlGridLicensableFeatures_t* pGridLicensableFeatures) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGetVgpuDriverCapabilities(nvmlVgpuDriverCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCreatableVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetClass(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeClass, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetName(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeName, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetGpuInstanceProfileId(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* gpuInstanceProfileId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetDeviceID(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* deviceID, unsigned long long* subsystemID) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetFramebufferSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetNumDisplayHeads(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* numDisplayHeads) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetResolution(nvmlVgpuTypeId_t vgpuTypeId, unsigned int displayIndex, unsigned int* xdim, unsigned int* ydim) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetLicense(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeLicenseString, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetFrameRateLimit(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetMaxInstances(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetMaxInstancesPerVm(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCountPerVm) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetBAR1Info(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuTypeBar1Info_t* bar1Info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetActiveVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuInstance_t* vgpuInstances) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetVmID(nvmlVgpuInstance_t vgpuInstance, char* vmId, unsigned int size, nvmlVgpuVmIdType_t* vmIdType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetUUID(nvmlVgpuInstance_t vgpuInstance, char* uuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetVmDriverVersion(nvmlVgpuInstance_t vgpuInstance, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetFbUsage(nvmlVgpuInstance_t vgpuInstance, unsigned long long* fbUsage) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetLicenseStatus(nvmlVgpuInstance_t vgpuInstance, unsigned int* licensed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetType(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuTypeId_t* vgpuTypeId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetFrameRateLimit(nvmlVgpuInstance_t vgpuInstance, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetEccMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* eccMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceSetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetEncoderStats(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetEncoderSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetFBCStats(nvmlVgpuInstance_t vgpuInstance, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetFBCSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetGpuInstanceId(nvmlVgpuInstance_t vgpuInstance, unsigned int* gpuInstanceId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetGpuPciId(nvmlVgpuInstance_t vgpuInstance, char* vgpuPciId, unsigned int* length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetCapabilities(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetMdevUUID(nvmlVgpuInstance_t vgpuInstance, char* mdevUuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetCreatableVgpus(nvmlGpuInstance_t gpuInstance, nvmlVgpuTypeIdInfo_t* pVgpus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetMaxInstancesPerGpuInstance(nvmlVgpuTypeMaxInstance_t* pMaxInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetActiveVgpus(nvmlGpuInstance_t gpuInstance, nvmlActiveVgpuInstanceInfo_t* pVgpuInstanceInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceSetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_t* pScheduler) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerLog(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuTypeCreatablePlacements(nvmlGpuInstance_t gpuInstance, nvmlVgpuCreatablePlacementInfo_t* pCreatablePlacementInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceSetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetMetadata(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuMetadata_t* vgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuMetadata(nvmlDevice_t device, nvmlVgpuPgpuMetadata_t* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGetVgpuCompatibility(nvmlVgpuMetadata_t* vgpuMetadata, nvmlVgpuPgpuMetadata_t* pgpuMetadata, nvmlVgpuPgpuCompatibility_t* compatibilityInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPgpuMetadataString(nvmlDevice_t device, char* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerLog(nvmlDevice_t device, nvmlVgpuSchedulerLog_t* pSchedulerLog) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerGetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerCapabilities(nvmlDevice_t device, nvmlVgpuSchedulerCapabilities_t* pCapabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerSetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGetVgpuVersion(nvmlVgpuVersion_t* supported, nvmlVgpuVersion_t* current) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSetVgpuVersion(nvmlVgpuVersion_t* vgpuVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* vgpuInstanceSamplesCount, nvmlVgpuInstanceUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuInstancesUtilizationInfo(nvmlDevice_t device, nvmlVgpuInstancesUtilizationInfo_t* vgpuUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, unsigned int* vgpuProcessSamplesCount, nvmlVgpuProcessUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuProcessesUtilizationInfo(nvmlDevice_t device, nvmlVgpuProcessesUtilizationInfo_t* vgpuProcUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetAccountingMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetAccountingPids(nvmlVgpuInstance_t vgpuInstance, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetAccountingStats(nvmlVgpuInstance_t vgpuInstance, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceClearAccountingPids(nvmlVgpuInstance_t vgpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetLicenseInfo_v2(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuLicenseInfo_t* licenseInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGetExcludedDeviceCount(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGetExcludedDeviceInfoByIndex(unsigned int index, nvmlExcludedDeviceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetMigMode(nvmlDevice_t device, unsigned int mode, nvmlReturn_t* activationStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMigMode(nvmlDevice_t device, unsigned int* currentMode, unsigned int* pendingMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice_t device, unsigned int profile, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstancePossiblePlacements_v2(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceRemainingCapacity(nvmlDevice_t device, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceCreateGpuInstance(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceCreateGpuInstanceWithPlacement(nvmlDevice_t device, unsigned int profileId, const nvmlGpuInstancePlacement_t* placement, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceDestroy(nvmlGpuInstance_t gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstances(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceById(nvmlDevice_t device, unsigned int id, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetInfo(nvmlGpuInstance_t gpuInstance, nvmlGpuInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstanceProfileInfoV(nvmlGpuInstance_t gpuInstance, unsigned int profile, unsigned int engProfile, nvmlComputeInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstanceRemainingCapacity(nvmlGpuInstance_t gpuInstance, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstancePossiblePlacements(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceCreateComputeInstance(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceCreateComputeInstanceWithPlacement(nvmlGpuInstance_t gpuInstance, unsigned int profileId, const nvmlComputeInstancePlacement_t* placement, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlComputeInstanceDestroy(nvmlComputeInstance_t computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstances(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance_t gpuInstance, unsigned int id, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlComputeInstanceGetInfo_v2(nvmlComputeInstance_t computeInstance, nvmlComputeInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceIsMigDeviceHandle(nvmlDevice_t device, unsigned int* isMigDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetComputeInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMaxMigDeviceCount(nvmlDevice_t device, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMigDeviceHandleByIndex(nvmlDevice_t device, unsigned int index, nvmlDevice_t* migDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDeviceHandleFromMigDeviceHandle(nvmlDevice_t migDevice, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCapabilities(nvmlDevice_t device, nvmlDeviceCapabilities_t* caps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDevicePowerSmoothingActivatePresetProfile(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDevicePowerSmoothingUpdatePresetProfileParam(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDevicePowerSmoothingSetState(nvmlDevice_t device, nvmlPowerSmoothingState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAddressingMode(nvmlDevice_t device, nvmlDeviceAddressingMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRepairStatus(nvmlDevice_t device, nvmlRepairStatus_t* repairStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPdi(nvmlDevice_t device, nvmlPdi_t* pdi) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkInfo(nvmlDevice_t device, nvmlNvLinkInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceReadWritePRM_v1(nvmlDevice_t device, nvmlPRMTLV_v1_t* buffer) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceProfileInfoByIdV(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t device, nvmlEccSramUniqueUncorrectedErrorCounts_t* errorCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetUnrepairableMemoryFlag_v1(nvmlDevice_t device, nvmlUnrepairableMemoryStatus_v1_t* unrepairableMemoryStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceReadPRMCounters_v1(nvmlDevice_t device, nvmlPRMCounterList_v1_t* counterList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSettings_v1_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cynvrtc.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/cynvrtc.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..70fdf2a8d70b5d5514745b6a5aac462c140a4b6d Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/cynvrtc.cpython-312-x86_64-linux-gnu.so differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cynvrtc.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/cynvrtc.pxd new file mode 100644 index 0000000000000000000000000000000000000000..9a4476c3ced0f03223544c05d7580b8b5b264f51 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cynvrtc.pxd @@ -0,0 +1,108 @@ +# 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 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + +from libc.stdint cimport uint32_t, uint64_t + +cdef extern from "nvrtc.h": + + ctypedef enum nvrtcResult: + NVRTC_SUCCESS = 0 + NVRTC_ERROR_OUT_OF_MEMORY = 1 + NVRTC_ERROR_PROGRAM_CREATION_FAILURE = 2 + NVRTC_ERROR_INVALID_INPUT = 3 + NVRTC_ERROR_INVALID_PROGRAM = 4 + NVRTC_ERROR_INVALID_OPTION = 5 + NVRTC_ERROR_COMPILATION = 6 + NVRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7 + NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8 + NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9 + NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10 + NVRTC_ERROR_INTERNAL_ERROR = 11 + NVRTC_ERROR_TIME_FILE_WRITE_FAILED = 12 + NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED = 13 + NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED = 14 + NVRTC_ERROR_PCH_CREATE = 15 + NVRTC_ERROR_CANCELLED = 16 + NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED = 17 + NVRTC_ERROR_BUSY = 18 + + cdef struct _nvrtcProgram: + pass + ctypedef _nvrtcProgram* nvrtcProgram + + cdef struct anon_struct0: + int available + size_t compressedSize + size_t uncompressedSize + int cudaVersionMajor + int cudaVersionMinor + unsigned int numFiles + + ctypedef anon_struct0 nvrtcBundledHeadersInfo + +cdef const char* nvrtcGetErrorString(nvrtcResult result) except ?NULL nogil + +cdef nvrtcResult nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcCreateProgram(nvrtcProgram* prog, const char* src, const char* name, int numHeaders, const char** headers, const char** includeNames) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcSetFlowCallback(nvrtcProgram prog, void* callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcInstallBundledHeaders(const char* installPath, unsigned int flags, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcGetBundledHeadersInfo(nvrtcBundledHeadersInfo* info, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef nvrtcResult nvrtcRemoveBundledHeaders(const char* installPath, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil + +cdef enum: NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS = 0 + +cdef enum: NVRTC_INSTALL_HEADERS_FORCE_OVERWRITE = 1 + +cdef enum: NVRTC_INSTALL_HEADERS_NO_WAIT = 2 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cynvvm.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/cynvvm.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..f7bf7671061dede315f933ebc53e341b27f90ba7 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/cynvvm.cpython-312-x86_64-linux-gnu.so differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cynvvm.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/cynvvm.pxd new file mode 100644 index 0000000000000000000000000000000000000000..d9d5baf229f597b212c00e5a39a150851f411e2b --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cynvvm.pxd @@ -0,0 +1,49 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# enums +ctypedef enum nvvmResult "nvvmResult": + NVVM_SUCCESS "NVVM_SUCCESS" = 0 + NVVM_ERROR_OUT_OF_MEMORY "NVVM_ERROR_OUT_OF_MEMORY" = 1 + NVVM_ERROR_PROGRAM_CREATION_FAILURE "NVVM_ERROR_PROGRAM_CREATION_FAILURE" = 2 + NVVM_ERROR_IR_VERSION_MISMATCH "NVVM_ERROR_IR_VERSION_MISMATCH" = 3 + NVVM_ERROR_INVALID_INPUT "NVVM_ERROR_INVALID_INPUT" = 4 + NVVM_ERROR_INVALID_PROGRAM "NVVM_ERROR_INVALID_PROGRAM" = 5 + NVVM_ERROR_INVALID_IR "NVVM_ERROR_INVALID_IR" = 6 + NVVM_ERROR_INVALID_OPTION "NVVM_ERROR_INVALID_OPTION" = 7 + NVVM_ERROR_NO_MODULE_IN_PROGRAM "NVVM_ERROR_NO_MODULE_IN_PROGRAM" = 8 + NVVM_ERROR_COMPILATION "NVVM_ERROR_COMPILATION" = 9 + NVVM_ERROR_CANCELLED "NVVM_ERROR_CANCELLED" = 10 + _NVVMRESULT_INTERNAL_LOADING_ERROR "_NVVMRESULT_INTERNAL_LOADING_ERROR" = -42 + + +# types +ctypedef void* nvvmProgram 'nvvmProgram' + + +############################################################################### +# Functions +############################################################################### + +cdef const char* nvvmGetErrorString(nvvmResult result) except?NULL nogil +cdef nvvmResult nvvmVersion(int* major, int* minor) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmIRVersion(int* majorIR, int* minorIR, int* majorDbg, int* minorDbg) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmCreateProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmDestroyProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmLazyAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmCompileProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmVerifyProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmGetCompiledResultSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmGetCompiledResult(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmGetProgramLogSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmGetProgramLog(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmLLVMVersion(const char* arch, int* major) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..fcc1f37b4ee634b320c592f2ddcb2283ce2a9f1c --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2aa3e5f93cdfa55252564cd1c0e9297740576090f47e7d09f9d90812dbbf877c +size 127360 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime.pxd new file mode 100644 index 0000000000000000000000000000000000000000..90793df8752719dc26d026519430c667d6303fb9 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime.pxd @@ -0,0 +1,1071 @@ +# 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 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + +from libc.stdint cimport uint32_t, uint64_t + +include "cyruntime_types.pxi" + +ctypedef unsigned int GLenum + +ctypedef unsigned int GLuint + +cdef extern from "": + cdef struct void: + pass +ctypedef void* EGLImageKHR + +cdef extern from "": + cdef struct void: + pass +ctypedef void* EGLStreamKHR + +ctypedef unsigned int EGLint + +cdef extern from "": + cdef struct void: + pass +ctypedef void* EGLSyncKHR + +ctypedef uint32_t VdpDevice + +ctypedef unsigned long long VdpGetProcAddress + +ctypedef uint32_t VdpVideoSurface + +ctypedef uint32_t VdpOutputSurface + +cdef enum cudaEglFrameType_enum: + cudaEglFrameTypeArray = 0 + cudaEglFrameTypePitch = 1 + +ctypedef cudaEglFrameType_enum cudaEglFrameType + +cdef enum cudaEglResourceLocationFlags_enum: + cudaEglResourceLocationSysmem = 0 + cudaEglResourceLocationVidmem = 1 + +ctypedef cudaEglResourceLocationFlags_enum cudaEglResourceLocationFlags + +cdef enum cudaEglColorFormat_enum: + cudaEglColorFormatYUV420Planar = 0 + cudaEglColorFormatYUV420SemiPlanar = 1 + cudaEglColorFormatYUV422Planar = 2 + cudaEglColorFormatYUV422SemiPlanar = 3 + cudaEglColorFormatARGB = 6 + cudaEglColorFormatRGBA = 7 + cudaEglColorFormatL = 8 + cudaEglColorFormatR = 9 + cudaEglColorFormatYUV444Planar = 10 + cudaEglColorFormatYUV444SemiPlanar = 11 + cudaEglColorFormatYUYV422 = 12 + cudaEglColorFormatUYVY422 = 13 + cudaEglColorFormatABGR = 14 + cudaEglColorFormatBGRA = 15 + cudaEglColorFormatA = 16 + cudaEglColorFormatRG = 17 + cudaEglColorFormatAYUV = 18 + cudaEglColorFormatYVU444SemiPlanar = 19 + cudaEglColorFormatYVU422SemiPlanar = 20 + cudaEglColorFormatYVU420SemiPlanar = 21 + cudaEglColorFormatY10V10U10_444SemiPlanar = 22 + cudaEglColorFormatY10V10U10_420SemiPlanar = 23 + cudaEglColorFormatY12V12U12_444SemiPlanar = 24 + cudaEglColorFormatY12V12U12_420SemiPlanar = 25 + cudaEglColorFormatVYUY_ER = 26 + cudaEglColorFormatUYVY_ER = 27 + cudaEglColorFormatYUYV_ER = 28 + cudaEglColorFormatYVYU_ER = 29 + cudaEglColorFormatYUVA_ER = 31 + cudaEglColorFormatAYUV_ER = 32 + cudaEglColorFormatYUV444Planar_ER = 33 + cudaEglColorFormatYUV422Planar_ER = 34 + cudaEglColorFormatYUV420Planar_ER = 35 + cudaEglColorFormatYUV444SemiPlanar_ER = 36 + cudaEglColorFormatYUV422SemiPlanar_ER = 37 + cudaEglColorFormatYUV420SemiPlanar_ER = 38 + cudaEglColorFormatYVU444Planar_ER = 39 + cudaEglColorFormatYVU422Planar_ER = 40 + cudaEglColorFormatYVU420Planar_ER = 41 + cudaEglColorFormatYVU444SemiPlanar_ER = 42 + cudaEglColorFormatYVU422SemiPlanar_ER = 43 + cudaEglColorFormatYVU420SemiPlanar_ER = 44 + cudaEglColorFormatBayerRGGB = 45 + cudaEglColorFormatBayerBGGR = 46 + cudaEglColorFormatBayerGRBG = 47 + cudaEglColorFormatBayerGBRG = 48 + cudaEglColorFormatBayer10RGGB = 49 + cudaEglColorFormatBayer10BGGR = 50 + cudaEglColorFormatBayer10GRBG = 51 + cudaEglColorFormatBayer10GBRG = 52 + cudaEglColorFormatBayer12RGGB = 53 + cudaEglColorFormatBayer12BGGR = 54 + cudaEglColorFormatBayer12GRBG = 55 + cudaEglColorFormatBayer12GBRG = 56 + cudaEglColorFormatBayer14RGGB = 57 + cudaEglColorFormatBayer14BGGR = 58 + cudaEglColorFormatBayer14GRBG = 59 + cudaEglColorFormatBayer14GBRG = 60 + cudaEglColorFormatBayer20RGGB = 61 + cudaEglColorFormatBayer20BGGR = 62 + cudaEglColorFormatBayer20GRBG = 63 + cudaEglColorFormatBayer20GBRG = 64 + cudaEglColorFormatYVU444Planar = 65 + cudaEglColorFormatYVU422Planar = 66 + cudaEglColorFormatYVU420Planar = 67 + cudaEglColorFormatBayerIspRGGB = 68 + cudaEglColorFormatBayerIspBGGR = 69 + cudaEglColorFormatBayerIspGRBG = 70 + cudaEglColorFormatBayerIspGBRG = 71 + cudaEglColorFormatBayerBCCR = 72 + cudaEglColorFormatBayerRCCB = 73 + cudaEglColorFormatBayerCRBC = 74 + cudaEglColorFormatBayerCBRC = 75 + cudaEglColorFormatBayer10CCCC = 76 + cudaEglColorFormatBayer12BCCR = 77 + cudaEglColorFormatBayer12RCCB = 78 + cudaEglColorFormatBayer12CRBC = 79 + cudaEglColorFormatBayer12CBRC = 80 + cudaEglColorFormatBayer12CCCC = 81 + cudaEglColorFormatY = 82 + cudaEglColorFormatYUV420SemiPlanar_2020 = 83 + cudaEglColorFormatYVU420SemiPlanar_2020 = 84 + cudaEglColorFormatYUV420Planar_2020 = 85 + cudaEglColorFormatYVU420Planar_2020 = 86 + cudaEglColorFormatYUV420SemiPlanar_709 = 87 + cudaEglColorFormatYVU420SemiPlanar_709 = 88 + cudaEglColorFormatYUV420Planar_709 = 89 + cudaEglColorFormatYVU420Planar_709 = 90 + cudaEglColorFormatY10V10U10_420SemiPlanar_709 = 91 + cudaEglColorFormatY10V10U10_420SemiPlanar_2020 = 92 + cudaEglColorFormatY10V10U10_422SemiPlanar_2020 = 93 + cudaEglColorFormatY10V10U10_422SemiPlanar = 94 + cudaEglColorFormatY10V10U10_422SemiPlanar_709 = 95 + cudaEglColorFormatY_ER = 96 + cudaEglColorFormatY_709_ER = 97 + cudaEglColorFormatY10_ER = 98 + cudaEglColorFormatY10_709_ER = 99 + cudaEglColorFormatY12_ER = 100 + cudaEglColorFormatY12_709_ER = 101 + cudaEglColorFormatYUVA = 102 + cudaEglColorFormatYVYU = 104 + cudaEglColorFormatVYUY = 105 + cudaEglColorFormatY10V10U10_420SemiPlanar_ER = 106 + cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER = 107 + cudaEglColorFormatY10V10U10_444SemiPlanar_ER = 108 + cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER = 109 + cudaEglColorFormatY12V12U12_420SemiPlanar_ER = 110 + cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER = 111 + cudaEglColorFormatY12V12U12_444SemiPlanar_ER = 112 + cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER = 113 + cudaEglColorFormatUYVY709 = 114 + cudaEglColorFormatUYVY709_ER = 115 + cudaEglColorFormatUYVY2020 = 116 + +ctypedef cudaEglColorFormat_enum cudaEglColorFormat + +cdef struct cudaEglPlaneDesc_st: + unsigned int width + unsigned int height + unsigned int depth + unsigned int pitch + unsigned int numChannels + cudaChannelFormatDesc channelDesc + unsigned int reserved[4] + +ctypedef cudaEglPlaneDesc_st cudaEglPlaneDesc + +cdef union anon_union12: + cudaArray_t pArray[3] + cudaPitchedPtr pPitch[3] + +cdef struct cudaEglFrame_st: + anon_union12 frame + cudaEglPlaneDesc planeDesc[3] + unsigned int planeCount + cudaEglFrameType frameType + cudaEglColorFormat eglColorFormat + +ctypedef cudaEglFrame_st cudaEglFrame + +cdef extern from "": + cdef struct CUeglStreamConnection_st: + pass +ctypedef CUeglStreamConnection_st* cudaEglStreamConnection + +cdef enum cudaGLDeviceList: + cudaGLDeviceListAll = 1 + cudaGLDeviceListCurrentFrame = 2 + cudaGLDeviceListNextFrame = 3 + +cdef enum cudaGLMapFlags: + cudaGLMapFlagsNone = 0 + cudaGLMapFlagsReadOnly = 1 + cudaGLMapFlagsWriteDiscard = 2 + +cdef cudaError_t cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef const char* cudaGetErrorName(cudaError_t error) except ?NULL nogil + +cdef const char* cudaGetErrorString(cudaError_t error) except ?NULL nogil + +cdef cudaError_t cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetDeviceProperties(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaFuncGetParamCount(const void* func, size_t* paramCount) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLaunchHostFunc_v2(cudaStream_t stream, cudaHostFn_t fn, void* userData, unsigned int syncMode) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpyBatchAsync(const void** dsts, const void** srcs, const size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpyWithAttributesAsync(void* dst, const void* src, size_t size, cudaMemcpyAttributes* attr, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy3DWithAttributesAsync(cudaMemcpy3DBatchOp* op, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPrefetchAsync(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemDiscardBatchAsync(void** dptrs, size_t* sizes, size_t count, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemDiscardAndPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemGetDefaultMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemGetMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemSetMemPool(cudaMemLocation* location, cudaMemAllocationType typename, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil + +cdef cudaError_t cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLogsRegisterCallback(cudaLogsCallback_t callbackFunc, void* userData, cudaLogsCallbackHandle* callback_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLogsUnregisterCallback(cudaLogsCallbackHandle callback) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLogsCurrent(cudaLogIterator* iterator_out, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLogsDumpToFile(cudaLogIterator* iterator, const char* pathToFile, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLogsDumpToMemory(cudaLogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hDst, cudaGraphNode_t hSrc) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphNodeGetContainingGraph(cudaGraphNode_t hNode, cudaGraph_t* phGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphNodeGetLocalId(cudaGraphNode_t hNode, unsigned int* nodeId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphNodeGetToolsId(cudaGraphNode_t hNode, unsigned long long* toolsNodeId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphGetId(cudaGraph_t hGraph, unsigned int* graphID) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecGetId(cudaGraphExec_t hGraphExec, unsigned int* graphID) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphNodeGetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphConditionalHandleCreate_v2(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, cudaExecutionContext_t ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetDevResource(int device, cudaDevResource* resource, cudaDevResourceType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDevSmResourceSplitByCount(cudaDevResource* result, unsigned int* nbGroups, const cudaDevResource* input, cudaDevResource* remaining, unsigned int flags, unsigned int minCount) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDevSmResourceSplit(cudaDevResource* result, unsigned int nbGroups, const cudaDevResource* input, cudaDevResource* remainder, unsigned int flags, cudaDevSmResourceGroupParams* groupParams) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDevResourceGenerateDesc(cudaDevResourceDesc_t* phDesc, cudaDevResource* resources, unsigned int nbResources) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGreenCtxCreate(cudaExecutionContext_t* phCtx, cudaDevResourceDesc_t desc, int device, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaExecutionCtxDestroy(cudaExecutionContext_t ctx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaExecutionCtxGetDevResource(cudaExecutionContext_t ctx, cudaDevResource* resource, cudaDevResourceType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaExecutionCtxGetDevice(int* device, cudaExecutionContext_t ctx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaExecutionCtxGetId(cudaExecutionContext_t ctx, unsigned long long* ctxId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaExecutionCtxStreamCreate(cudaStream_t* phStream, cudaExecutionContext_t ctx, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaExecutionCtxSynchronize(cudaExecutionContext_t ctx) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaStreamGetDevResource(cudaStream_t hStream, cudaDevResource* resource, cudaDevResourceType typename) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaExecutionCtxRecordEvent(cudaExecutionContext_t ctx, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaExecutionCtxWaitEvent(cudaExecutionContext_t ctx, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaDeviceGetExecutionCtx(cudaExecutionContext_t* ctx, int device) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaPitchedPtr make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil + +cdef cudaPos make_cudaPos(size_t x, size_t y, size_t z) except* nogil + +cdef cudaExtent make_cudaExtent(size_t w, size_t h, size_t d) except* nogil + +cdef cudaError_t cudaGraphicsEGLRegisterImage(cudaGraphicsResource** pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil + +cdef enum: cudaHostAllocDefault = 0 + +cdef enum: cudaHostAllocPortable = 1 + +cdef enum: cudaHostAllocMapped = 2 + +cdef enum: cudaHostAllocWriteCombined = 4 + +cdef enum: cudaHostRegisterDefault = 0 + +cdef enum: cudaHostRegisterPortable = 1 + +cdef enum: cudaHostRegisterMapped = 2 + +cdef enum: cudaHostRegisterIoMemory = 4 + +cdef enum: cudaHostRegisterReadOnly = 8 + +cdef enum: cudaPeerAccessDefault = 0 + +cdef enum: cudaStreamDefault = 0 + +cdef enum: cudaStreamNonBlocking = 1 + +cdef enum: cudaStreamLegacy = 1 + +cdef enum: cudaStreamPerThread = 2 + +cdef enum: cudaEventDefault = 0 + +cdef enum: cudaEventBlockingSync = 1 + +cdef enum: cudaEventDisableTiming = 2 + +cdef enum: cudaEventInterprocess = 4 + +cdef enum: cudaEventRecordDefault = 0 + +cdef enum: cudaEventRecordExternal = 1 + +cdef enum: cudaEventWaitDefault = 0 + +cdef enum: cudaEventWaitExternal = 1 + +cdef enum: cudaDeviceScheduleAuto = 0 + +cdef enum: cudaDeviceScheduleSpin = 1 + +cdef enum: cudaDeviceScheduleYield = 2 + +cdef enum: cudaDeviceScheduleBlockingSync = 4 + +cdef enum: cudaDeviceBlockingSync = 4 + +cdef enum: cudaDeviceScheduleMask = 7 + +cdef enum: cudaDeviceMapHost = 8 + +cdef enum: cudaDeviceLmemResizeToMax = 16 + +cdef enum: cudaDeviceSyncMemops = 128 + +cdef enum: cudaDeviceMask = 255 + +cdef enum: cudaArrayDefault = 0 + +cdef enum: cudaArrayLayered = 1 + +cdef enum: cudaArraySurfaceLoadStore = 2 + +cdef enum: cudaArrayCubemap = 4 + +cdef enum: cudaArrayTextureGather = 8 + +cdef enum: cudaArrayColorAttachment = 32 + +cdef enum: cudaArraySparse = 64 + +cdef enum: cudaArrayDeferredMapping = 128 + +cdef enum: cudaIpcMemLazyEnablePeerAccess = 1 + +cdef enum: cudaMemAttachGlobal = 1 + +cdef enum: cudaMemAttachHost = 2 + +cdef enum: cudaMemAttachSingle = 4 + +cdef enum: cudaOccupancyDefault = 0 + +cdef enum: cudaOccupancyDisableCachingOverride = 1 + +cdef enum: cudaCpuDeviceId = -1 + +cdef enum: cudaInvalidDeviceId = -2 + +cdef enum: cudaInitDeviceFlagsAreValid = 1 + +cdef enum: cudaArraySparsePropertiesSingleMipTail = 1 + +cdef enum: cudaMemPoolCreateUsageHwDecompress = 2 + +cdef enum: CUDA_IPC_HANDLE_SIZE = 64 + +cdef enum: cudaExternalMemoryDedicated = 1 + +cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1 + +cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 2 + +cdef enum: cudaNvSciSyncAttrSignal = 1 + +cdef enum: cudaNvSciSyncAttrWait = 2 + +cdef enum: cudaGraphKernelNodePortDefault = 0 + +cdef enum: cudaGraphKernelNodePortProgrammatic = 1 + +cdef enum: cudaGraphKernelNodePortLaunchCompletion = 2 + +cdef enum: cudaStreamAttributeAccessPolicyWindow = 1 + +cdef enum: cudaStreamAttributeSynchronizationPolicy = 3 + +cdef enum: cudaStreamAttributeMemSyncDomainMap = 9 + +cdef enum: cudaStreamAttributeMemSyncDomain = 10 + +cdef enum: cudaStreamAttributePriority = 8 + +cdef enum: cudaKernelNodeAttributeAccessPolicyWindow = 1 + +cdef enum: cudaKernelNodeAttributeCooperative = 2 + +cdef enum: cudaKernelNodeAttributePriority = 8 + +cdef enum: cudaKernelNodeAttributeClusterDimension = 4 + +cdef enum: cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5 + +cdef enum: cudaKernelNodeAttributeMemSyncDomainMap = 9 + +cdef enum: cudaKernelNodeAttributeMemSyncDomain = 10 + +cdef enum: cudaKernelNodeAttributePreferredSharedMemoryCarveout = 14 + +cdef enum: cudaKernelNodeAttributeDeviceUpdatableKernelNode = 13 + +cdef enum: cudaKernelNodeAttributeNvlinkUtilCentricScheduling = 16 + +cdef enum: cudaSurfaceType1D = 1 + +cdef enum: cudaSurfaceType2D = 2 + +cdef enum: cudaSurfaceType3D = 3 + +cdef enum: cudaSurfaceTypeCubemap = 12 + +cdef enum: cudaSurfaceType1DLayered = 241 + +cdef enum: cudaSurfaceType2DLayered = 242 + +cdef enum: cudaSurfaceTypeCubemapLayered = 252 + +cdef enum: cudaTextureType1D = 1 + +cdef enum: cudaTextureType2D = 2 + +cdef enum: cudaTextureType3D = 3 + +cdef enum: cudaTextureTypeCubemap = 12 + +cdef enum: cudaTextureType1DLayered = 241 + +cdef enum: cudaTextureType2DLayered = 242 + +cdef enum: cudaTextureTypeCubemapLayered = 252 + +cdef enum: CUDART_VERSION = 13030 + +cdef enum: __CUDART_API_VERSION = 13030 + +cdef enum: CUDA_EGL_MAX_PLANES = 3 \ No newline at end of file diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime_functions.pxi b/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime_functions.pxi new file mode 100644 index 0000000000000000000000000000000000000000..30eb108ebf0356455b4a2d8078d07a352d195abf --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime_functions.pxi @@ -0,0 +1,975 @@ +# 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 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. +cdef extern from "cuda_runtime_api.h": + + + cudaError_t cudaDeviceReset() nogil + + + cudaError_t cudaDeviceSynchronize() nogil + + + cudaError_t cudaDeviceSetLimit(cudaLimit limit, size_t value) nogil + + + cudaError_t cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) nogil + + + cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) nogil + + + cudaError_t cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) nogil + + + cudaError_t cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) nogil + + + cudaError_t cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) nogil + + + cudaError_t cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) nogil + + + cudaError_t cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) nogil + + + cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) nogil + + + cudaError_t cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) nogil + + + cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) nogil + + + cudaError_t cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) nogil + + + cudaError_t cudaIpcCloseMemHandle(void* devPtr) nogil + + + cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) nogil + + + cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) nogil + + + cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) nogil + + + cudaError_t cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) nogil + + + cudaError_t cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) nogil + + + cudaError_t cudaGetLastError() nogil + + + cudaError_t cudaPeekAtLastError() nogil + + + const char* cudaGetErrorName(cudaError_t error) nogil + + + const char* cudaGetErrorString(cudaError_t error) nogil + + + cudaError_t cudaGetDeviceCount(int* count) nogil + + + cudaError_t cudaGetDeviceProperties(cudaDeviceProp* prop, int device) nogil + + + cudaError_t cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) nogil + + + cudaError_t cudaDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int device) nogil + + + cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) nogil + + + cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) nogil + + + cudaError_t cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) nogil + + + cudaError_t cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) nogil + + + cudaError_t cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) nogil + + + cudaError_t cudaDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const cudaAtomicOperation* operations, unsigned int count, int srcDevice, int dstDevice) nogil + + + cudaError_t cudaChooseDevice(int* device, const cudaDeviceProp* prop) nogil + + + cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) nogil + + + cudaError_t cudaSetDevice(int device) nogil + + + cudaError_t cudaGetDevice(int* device) nogil + + + cudaError_t cudaSetDeviceFlags(unsigned int flags) nogil + + + cudaError_t cudaGetDeviceFlags(unsigned int* flags) nogil + + + cudaError_t cudaStreamCreate(cudaStream_t* pStream) nogil + + + cudaError_t cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) nogil + + + cudaError_t cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) nogil + + + cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int* priority) nogil + + + cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) nogil + + + cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) nogil + + + cudaError_t cudaStreamGetDevice(cudaStream_t hStream, int* device) nogil + + + cudaError_t cudaCtxResetPersistingL2Cache() nogil + + + cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) nogil + + + cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) nogil + + + cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) nogil + + + cudaError_t cudaStreamDestroy(cudaStream_t stream) nogil + + + cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) nogil + + + cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) nogil + + + cudaError_t cudaStreamSynchronize(cudaStream_t stream) nogil + + + cudaError_t cudaStreamQuery(cudaStream_t stream) nogil + + + cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) nogil + + + cudaError_t cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) nogil + + + cudaError_t cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) nogil + + + cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) nogil + + + cudaError_t cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) nogil + + + cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) nogil + + + cudaError_t cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) nogil + + + cudaError_t cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) nogil + + + cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) nogil + + + cudaError_t cudaEventCreate(cudaEvent_t* event) nogil + + + cudaError_t cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) nogil + + + cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) nogil + + + cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) nogil + + + cudaError_t cudaEventQuery(cudaEvent_t event) nogil + + + cudaError_t cudaEventSynchronize(cudaEvent_t event) nogil + + + cudaError_t cudaEventDestroy(cudaEvent_t event) nogil + + + cudaError_t cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) nogil + + + cudaError_t cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) nogil + + + cudaError_t cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) nogil + + + cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) nogil + + + cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) nogil + + + cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) nogil + + + cudaError_t cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil + + + cudaError_t cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil + + + cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) nogil + + + cudaError_t cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) nogil + + + cudaError_t cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) nogil + + + cudaError_t cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) nogil + + + cudaError_t cudaFuncGetParamCount(const void* func, size_t* paramCount) nogil + + + cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) nogil + + + cudaError_t cudaLaunchHostFunc_v2(cudaStream_t stream, cudaHostFn_t fn, void* userData, unsigned int syncMode) nogil + + + cudaError_t cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) nogil + + + cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) nogil + + + cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) nogil + + + cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) nogil + + + cudaError_t cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) nogil + + + cudaError_t cudaMalloc(void** devPtr, size_t size) nogil + + + cudaError_t cudaMallocHost(void** ptr, size_t size) nogil + + + cudaError_t cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) nogil + + + cudaError_t cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) nogil + + + cudaError_t cudaFree(void* devPtr) nogil + + + cudaError_t cudaFreeHost(void* ptr) nogil + + + cudaError_t cudaFreeArray(cudaArray_t array) nogil + + + cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) nogil + + + cudaError_t cudaHostAlloc(void** pHost, size_t size, unsigned int flags) nogil + + + cudaError_t cudaHostRegister(void* ptr, size_t size, unsigned int flags) nogil + + + cudaError_t cudaHostUnregister(void* ptr) nogil + + + cudaError_t cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) nogil + + + cudaError_t cudaHostGetFlags(unsigned int* pFlags, void* pHost) nogil + + + cudaError_t cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) nogil + + + cudaError_t cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) nogil + + + cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) nogil + + + cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) nogil + + + cudaError_t cudaMemcpy3D(const cudaMemcpy3DParms* p) nogil + + + cudaError_t cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) nogil + + + cudaError_t cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) nogil + + + cudaError_t cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) nogil + + + cudaError_t cudaMemGetInfo(size_t* free, size_t* total) nogil + + + cudaError_t cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) nogil + + + cudaError_t cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) nogil + + + cudaError_t cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) nogil + + + cudaError_t cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) nogil + + + cudaError_t cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) nogil + + + cudaError_t cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) nogil + + + cudaError_t cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil + + + cudaError_t cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) nogil + + + cudaError_t cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) nogil + + + cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) nogil + + + cudaError_t cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) nogil + + + cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) nogil + + + cudaError_t cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil + + + cudaError_t cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) nogil + + + cudaError_t cudaMemcpyBatchAsync(const void** dsts, const void** srcs, const size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, cudaStream_t stream) nogil + + + cudaError_t cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, unsigned long long flags, cudaStream_t stream) nogil + + + cudaError_t cudaMemcpyWithAttributesAsync(void* dst, const void* src, size_t size, cudaMemcpyAttributes* attr, cudaStream_t stream) nogil + + + cudaError_t cudaMemcpy3DWithAttributesAsync(cudaMemcpy3DBatchOp* op, unsigned long long flags, cudaStream_t stream) nogil + + + cudaError_t cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil + + + cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil + + + cudaError_t cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil + + + cudaError_t cudaMemset(void* devPtr, int value, size_t count) nogil + + + cudaError_t cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) nogil + + + cudaError_t cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) nogil + + + cudaError_t cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) nogil + + + cudaError_t cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) nogil + + + cudaError_t cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) nogil + + + cudaError_t cudaMemPrefetchAsync(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) nogil + + + cudaError_t cudaMemPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) nogil + + + cudaError_t cudaMemDiscardBatchAsync(void** dptrs, size_t* sizes, size_t count, unsigned long long flags, cudaStream_t stream) nogil + + + cudaError_t cudaMemDiscardAndPrefetchBatchAsync(void** dptrs, size_t* sizes, size_t count, cudaMemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, cudaStream_t stream) nogil + + + cudaError_t cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) nogil + + + cudaError_t cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) nogil + + + cudaError_t cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) nogil + + + cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) nogil + + + cudaError_t cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) nogil + + + cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) nogil + + + cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil + + + cudaError_t cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil + + + cudaError_t cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) nogil + + + cudaError_t cudaFreeAsync(void* devPtr, cudaStream_t hStream) nogil + + + cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) nogil + + + cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) nogil + + + cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) nogil + + + cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) nogil + + + cudaError_t cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) nogil + + + cudaError_t cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) nogil + + + cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) nogil + + + cudaError_t cudaMemGetDefaultMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) nogil + + + cudaError_t cudaMemGetMemPool(cudaMemPool_t* memPool, cudaMemLocation* location, cudaMemAllocationType typename) nogil + + + cudaError_t cudaMemSetMemPool(cudaMemLocation* location, cudaMemAllocationType typename, cudaMemPool_t memPool) nogil + + + cudaError_t cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) nogil + + + cudaError_t cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) nogil + + + cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) nogil + + + cudaError_t cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) nogil + + + cudaError_t cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) nogil + + + cudaError_t cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) nogil + + + cudaError_t cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) nogil + + + cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) nogil + + + cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) nogil + + + cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) nogil + + + cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) nogil + + + cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) nogil + + + cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) nogil + + + cudaError_t cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) nogil + + + cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) nogil + + + cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) nogil + + + cudaError_t cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) nogil + + + cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) nogil + + + cudaError_t cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) nogil + + + cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) nogil + + + cudaError_t cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) nogil + + + cudaError_t cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) nogil + + + cudaError_t cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) nogil + + + cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) nogil + + + cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) nogil + + + cudaError_t cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) nogil + + + cudaError_t cudaDriverGetVersion(int* driverVersion) nogil + + + cudaError_t cudaRuntimeGetVersion(int* runtimeVersion) nogil + + + cudaError_t cudaLogsRegisterCallback(cudaLogsCallback_t callbackFunc, void* userData, cudaLogsCallbackHandle* callback_out) nogil + + + cudaError_t cudaLogsUnregisterCallback(cudaLogsCallbackHandle callback) nogil + + + cudaError_t cudaLogsCurrent(cudaLogIterator* iterator_out, unsigned int flags) nogil + + + cudaError_t cudaLogsDumpToFile(cudaLogIterator* iterator, const char* pathToFile, unsigned int flags) nogil + + + cudaError_t cudaLogsDumpToMemory(cudaLogIterator* iterator, char* buffer, size_t* size, unsigned int flags) nogil + + + cudaError_t cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) nogil + + + cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) nogil + + + cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) nogil + + + cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) nogil + + + cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hDst, cudaGraphNode_t hSrc) nogil + + + cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) nogil + + + cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) nogil + + + cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) nogil + + + cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil + + + cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) nogil + + + cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) nogil + + + cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil + + + cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) nogil + + + cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) nogil + + + cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) nogil + + + cudaError_t cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) nogil + + + cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) nogil + + + cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) nogil + + + cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) nogil + + + cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) nogil + + + cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) nogil + + + cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) nogil + + + cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) nogil + + + cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) nogil + + + cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) nogil + + + cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) nogil + + + cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) nogil + + + cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) nogil + + + cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) nogil + + + cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) nogil + + + cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) nogil + + + cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) nogil + + + cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) nogil + + + cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) nogil + + + cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) nogil + + + cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) nogil + + + cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) nogil + + + cudaError_t cudaDeviceGraphMemTrim(int device) nogil + + + cudaError_t cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) nogil + + + cudaError_t cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) nogil + + + cudaError_t cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) nogil + + + cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) nogil + + + cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) nogil + + + cudaError_t cudaGraphNodeGetContainingGraph(cudaGraphNode_t hNode, cudaGraph_t* phGraph) nogil + + + cudaError_t cudaGraphNodeGetLocalId(cudaGraphNode_t hNode, unsigned int* nodeId) nogil + + + cudaError_t cudaGraphNodeGetToolsId(cudaGraphNode_t hNode, unsigned long long* toolsNodeId) nogil + + + cudaError_t cudaGraphGetId(cudaGraph_t hGraph, unsigned int* graphID) nogil + + + cudaError_t cudaGraphExecGetId(cudaGraphExec_t hGraphExec, unsigned int* graphID) nogil + + + cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) nogil + + + cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) nogil + + + cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) nogil + + + cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) nogil + + + cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) nogil + + + cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) nogil + + + cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) nogil + + + cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) nogil + + + cudaError_t cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) nogil + + + cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) nogil + + + cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) nogil + + + cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) nogil + + + cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) nogil + + + cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) nogil + + + cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil + + + cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) nogil + + + cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) nogil + + + cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) nogil + + + cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) nogil + + + cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) nogil + + + cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) nogil + + + cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) nogil + + + cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) nogil + + + cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) nogil + + + cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) nogil + + + cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) nogil + + + cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) nogil + + + cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) nogil + + + cudaError_t cudaGraphDestroy(cudaGraph_t graph) nogil + + + cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) nogil + + + cudaError_t cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) nogil + + + cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) nogil + + + cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) nogil + + + cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) nogil + + + cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) nogil + + + cudaError_t cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) nogil + + + cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) nogil + + + cudaError_t cudaGraphNodeGetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) nogil + + + cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) nogil + + + cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) nogil + + + cudaError_t cudaGraphConditionalHandleCreate_v2(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, cudaExecutionContext_t ctx, unsigned int defaultLaunchValue, unsigned int flags) nogil + + + cudaError_t cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) nogil + + + cudaError_t cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) nogil + + + cudaError_t cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) nogil + + + cudaError_t cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) nogil + + + cudaError_t cudaLibraryUnload(cudaLibrary_t library) nogil + + + cudaError_t cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) nogil + + + cudaError_t cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) nogil + + + cudaError_t cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) nogil + + + cudaError_t cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) nogil + + + cudaError_t cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) nogil + + + cudaError_t cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) nogil + + + cudaError_t cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) nogil + + + cudaError_t cudaDeviceGetDevResource(int device, cudaDevResource* resource, cudaDevResourceType typename) nogil + + + cudaError_t cudaDevSmResourceSplitByCount(cudaDevResource* result, unsigned int* nbGroups, const cudaDevResource* input, cudaDevResource* remaining, unsigned int flags, unsigned int minCount) nogil + + + cudaError_t cudaDevSmResourceSplit(cudaDevResource* result, unsigned int nbGroups, const cudaDevResource* input, cudaDevResource* remainder, unsigned int flags, cudaDevSmResourceGroupParams* groupParams) nogil + + + cudaError_t cudaDevResourceGenerateDesc(cudaDevResourceDesc_t* phDesc, cudaDevResource* resources, unsigned int nbResources) nogil + + + cudaError_t cudaGreenCtxCreate(cudaExecutionContext_t* phCtx, cudaDevResourceDesc_t desc, int device, unsigned int flags) nogil + + + cudaError_t cudaExecutionCtxDestroy(cudaExecutionContext_t ctx) nogil + + + cudaError_t cudaExecutionCtxGetDevResource(cudaExecutionContext_t ctx, cudaDevResource* resource, cudaDevResourceType typename) nogil + + + cudaError_t cudaExecutionCtxGetDevice(int* device, cudaExecutionContext_t ctx) nogil + + + cudaError_t cudaExecutionCtxGetId(cudaExecutionContext_t ctx, unsigned long long* ctxId) nogil + + + cudaError_t cudaExecutionCtxStreamCreate(cudaStream_t* phStream, cudaExecutionContext_t ctx, unsigned int flags, int priority) nogil + + + cudaError_t cudaExecutionCtxSynchronize(cudaExecutionContext_t ctx) nogil + + + cudaError_t cudaStreamGetDevResource(cudaStream_t hStream, cudaDevResource* resource, cudaDevResourceType typename) nogil + + + cudaError_t cudaExecutionCtxRecordEvent(cudaExecutionContext_t ctx, cudaEvent_t event) nogil + + + cudaError_t cudaExecutionCtxWaitEvent(cudaExecutionContext_t ctx, cudaEvent_t event) nogil + + + cudaError_t cudaDeviceGetExecutionCtx(cudaExecutionContext_t* ctx, int device) nogil + + + cudaError_t cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) nogil + + + cudaError_t cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) nogil + + +cdef extern from "cuda_runtime.h": + + + cudaPitchedPtr make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) nogil + + + cudaPos make_cudaPos(size_t x, size_t y, size_t z) nogil + + + cudaExtent make_cudaExtent(size_t w, size_t h, size_t d) nogil + + +cdef extern from "cuda_profiler_api.h": + + + cudaError_t cudaProfilerStart() nogil + + + cudaError_t cudaProfilerStop() nogil + diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime_types.pxi b/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime_types.pxi new file mode 100644 index 0000000000000000000000000000000000000000..a7ad5839ac8ff1ab7d1545bd1a69c3c6309c32b0 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/cyruntime_types.pxi @@ -0,0 +1,1777 @@ +# 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 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + +cdef extern from "vector_types.h": + + cdef struct dim3: + unsigned int x + unsigned int y + unsigned int z + +cdef extern from "driver_types.h": + + cdef enum cudaError: + cudaSuccess = 0 + cudaErrorInvalidValue = 1 + cudaErrorMemoryAllocation = 2 + cudaErrorInitializationError = 3 + cudaErrorCudartUnloading = 4 + cudaErrorProfilerDisabled = 5 + cudaErrorProfilerNotInitialized = 6 + cudaErrorProfilerAlreadyStarted = 7 + cudaErrorProfilerAlreadyStopped = 8 + cudaErrorInvalidConfiguration = 9 + cudaErrorVersionTranslation = 10 + cudaErrorInvalidPitchValue = 12 + cudaErrorInvalidSymbol = 13 + cudaErrorInvalidHostPointer = 16 + cudaErrorInvalidDevicePointer = 17 + cudaErrorInvalidTexture = 18 + cudaErrorInvalidTextureBinding = 19 + cudaErrorInvalidChannelDescriptor = 20 + cudaErrorInvalidMemcpyDirection = 21 + cudaErrorAddressOfConstant = 22 + cudaErrorTextureFetchFailed = 23 + cudaErrorTextureNotBound = 24 + cudaErrorSynchronizationError = 25 + cudaErrorInvalidFilterSetting = 26 + cudaErrorInvalidNormSetting = 27 + cudaErrorMixedDeviceExecution = 28 + cudaErrorNotYetImplemented = 31 + cudaErrorMemoryValueTooLarge = 32 + cudaErrorStubLibrary = 34 + cudaErrorInsufficientDriver = 35 + cudaErrorCallRequiresNewerDriver = 36 + cudaErrorInvalidSurface = 37 + cudaErrorDuplicateVariableName = 43 + cudaErrorDuplicateTextureName = 44 + cudaErrorDuplicateSurfaceName = 45 + cudaErrorDevicesUnavailable = 46 + cudaErrorIncompatibleDriverContext = 49 + cudaErrorMissingConfiguration = 52 + cudaErrorPriorLaunchFailure = 53 + cudaErrorLaunchMaxDepthExceeded = 65 + cudaErrorLaunchFileScopedTex = 66 + cudaErrorLaunchFileScopedSurf = 67 + cudaErrorSyncDepthExceeded = 68 + cudaErrorLaunchPendingCountExceeded = 69 + cudaErrorInvalidDeviceFunction = 98 + cudaErrorNoDevice = 100 + cudaErrorInvalidDevice = 101 + cudaErrorDeviceNotLicensed = 102 + cudaErrorSoftwareValidityNotEstablished = 103 + cudaErrorStartupFailure = 127 + cudaErrorInvalidKernelImage = 200 + cudaErrorDeviceUninitialized = 201 + cudaErrorMapBufferObjectFailed = 205 + cudaErrorUnmapBufferObjectFailed = 206 + cudaErrorArrayIsMapped = 207 + cudaErrorAlreadyMapped = 208 + cudaErrorNoKernelImageForDevice = 209 + cudaErrorAlreadyAcquired = 210 + cudaErrorNotMapped = 211 + cudaErrorNotMappedAsArray = 212 + cudaErrorNotMappedAsPointer = 213 + cudaErrorECCUncorrectable = 214 + cudaErrorUnsupportedLimit = 215 + cudaErrorDeviceAlreadyInUse = 216 + cudaErrorPeerAccessUnsupported = 217 + cudaErrorInvalidPtx = 218 + cudaErrorInvalidGraphicsContext = 219 + cudaErrorNvlinkUncorrectable = 220 + cudaErrorJitCompilerNotFound = 221 + cudaErrorUnsupportedPtxVersion = 222 + cudaErrorJitCompilationDisabled = 223 + cudaErrorUnsupportedExecAffinity = 224 + cudaErrorUnsupportedDevSideSync = 225 + cudaErrorContained = 226 + cudaErrorInvalidSource = 300 + cudaErrorFileNotFound = 301 + cudaErrorSharedObjectSymbolNotFound = 302 + cudaErrorSharedObjectInitFailed = 303 + cudaErrorOperatingSystem = 304 + cudaErrorInvalidResourceHandle = 400 + cudaErrorIllegalState = 401 + cudaErrorLossyQuery = 402 + cudaErrorSymbolNotFound = 500 + cudaErrorNotReady = 600 + cudaErrorIllegalAddress = 700 + cudaErrorLaunchOutOfResources = 701 + cudaErrorLaunchTimeout = 702 + cudaErrorLaunchIncompatibleTexturing = 703 + cudaErrorPeerAccessAlreadyEnabled = 704 + cudaErrorPeerAccessNotEnabled = 705 + cudaErrorSetOnActiveProcess = 708 + cudaErrorContextIsDestroyed = 709 + cudaErrorAssert = 710 + cudaErrorTooManyPeers = 711 + cudaErrorHostMemoryAlreadyRegistered = 712 + cudaErrorHostMemoryNotRegistered = 713 + cudaErrorHardwareStackError = 714 + cudaErrorIllegalInstruction = 715 + cudaErrorMisalignedAddress = 716 + cudaErrorInvalidAddressSpace = 717 + cudaErrorInvalidPc = 718 + cudaErrorLaunchFailure = 719 + cudaErrorCooperativeLaunchTooLarge = 720 + cudaErrorTensorMemoryLeak = 721 + cudaErrorNotPermitted = 800 + cudaErrorNotSupported = 801 + cudaErrorSystemNotReady = 802 + cudaErrorSystemDriverMismatch = 803 + cudaErrorCompatNotSupportedOnDevice = 804 + cudaErrorMpsConnectionFailed = 805 + cudaErrorMpsRpcFailure = 806 + cudaErrorMpsServerNotReady = 807 + cudaErrorMpsMaxClientsReached = 808 + cudaErrorMpsMaxConnectionsReached = 809 + cudaErrorMpsClientTerminated = 810 + cudaErrorCdpNotSupported = 811 + cudaErrorCdpVersionMismatch = 812 + cudaErrorStreamCaptureUnsupported = 900 + cudaErrorStreamCaptureInvalidated = 901 + cudaErrorStreamCaptureMerge = 902 + cudaErrorStreamCaptureUnmatched = 903 + cudaErrorStreamCaptureUnjoined = 904 + cudaErrorStreamCaptureIsolation = 905 + cudaErrorStreamCaptureImplicit = 906 + cudaErrorCapturedEvent = 907 + cudaErrorStreamCaptureWrongThread = 908 + cudaErrorTimeout = 909 + cudaErrorGraphExecUpdateFailure = 910 + cudaErrorExternalDevice = 911 + cudaErrorInvalidClusterSize = 912 + cudaErrorFunctionNotLoaded = 913 + cudaErrorInvalidResourceType = 914 + cudaErrorInvalidResourceConfiguration = 915 + cudaErrorStreamDetached = 917 + cudaErrorGraphRecaptureFailure = 918 + cudaErrorUnknown = 999 + cudaErrorApiFailureBase = 10000 + + ctypedef cudaError cudaError_t + + cdef struct CUdevResourceDesc_st: + pass + ctypedef CUdevResourceDesc_st* cudaDevResourceDesc_t + + cdef struct cudaExecutionContext_st: + pass + ctypedef cudaExecutionContext_st* cudaExecutionContext_t + + cdef struct cudaChannelFormatDesc: + int x + int y + int z + int w + cudaChannelFormatKind f + + cdef struct cudaArray: + pass + ctypedef cudaArray* cudaArray_t + + cdef struct cudaArray: + pass + ctypedef cudaArray* cudaArray_const_t + + cdef struct cudaMipmappedArray: + pass + ctypedef cudaMipmappedArray* cudaMipmappedArray_t + + cdef struct cudaMipmappedArray: + pass + ctypedef cudaMipmappedArray* cudaMipmappedArray_const_t + + cdef struct anon_struct0: + unsigned int width + unsigned int height + unsigned int depth + + cdef struct cudaArraySparseProperties: + anon_struct0 tileExtent + unsigned int miptailFirstLevel + unsigned long long miptailSize + unsigned int flags + unsigned int reserved[4] + + cdef struct cudaArrayMemoryRequirements: + size_t size + size_t alignment + unsigned int reserved[4] + + cdef struct cudaPitchedPtr: + void* ptr + size_t pitch + size_t xsize + size_t ysize + + cdef struct cudaExtent: + size_t width + size_t height + size_t depth + + cdef struct cudaPos: + size_t x + size_t y + size_t z + + cdef struct cudaMemcpy3DParms: + cudaArray_t srcArray + cudaPos srcPos + cudaPitchedPtr srcPtr + cudaArray_t dstArray + cudaPos dstPos + cudaPitchedPtr dstPtr + cudaExtent extent + cudaMemcpyKind kind + + cdef struct cudaMemcpyNodeParams: + int flags + int reserved + cudaExecutionContext_t ctx + cudaMemcpy3DParms copyParams + + cdef struct cudaMemcpy3DPeerParms: + cudaArray_t srcArray + cudaPos srcPos + cudaPitchedPtr srcPtr + int srcDevice + cudaArray_t dstArray + cudaPos dstPos + cudaPitchedPtr dstPtr + int dstDevice + cudaExtent extent + + cdef struct cudaMemsetParams: + void* dst + size_t pitch + unsigned int value + unsigned int elementSize + size_t width + size_t height + + cdef struct cudaMemsetParamsV2: + void* dst + size_t pitch + unsigned int value + unsigned int elementSize + size_t width + size_t height + cudaExecutionContext_t ctx + + cdef struct cudaAccessPolicyWindow: + void* base_ptr + size_t num_bytes + float hitRatio + cudaAccessProperty hitProp + cudaAccessProperty missProp + + ctypedef void (*cudaHostFn_t)(void* userData) + + cdef struct cudaHostNodeParams: + cudaHostFn_t fn + void* userData + + cdef struct cudaHostNodeParamsV2: + cudaHostFn_t fn + void* userData + unsigned int syncMode + + cdef struct anon_struct1: + cudaArray_t array + + cdef struct anon_struct2: + cudaMipmappedArray_t mipmap + + cdef struct anon_struct3: + void* devPtr + cudaChannelFormatDesc desc + size_t sizeInBytes + + cdef struct anon_struct4: + void* devPtr + cudaChannelFormatDesc desc + size_t width + size_t height + size_t pitchInBytes + + cdef struct anon_struct5: + int reserved[32] + + cdef union anon_union0: + anon_struct1 array + anon_struct2 mipmap + anon_struct3 linear + anon_struct4 pitch2D + anon_struct5 reserved + + cdef struct cudaResourceDesc: + cudaResourceType resType + anon_union0 res + unsigned int flags + + cdef struct cudaResourceViewDesc: + cudaResourceViewFormat format + size_t width + size_t height + size_t depth + unsigned int firstMipmapLevel + unsigned int lastMipmapLevel + unsigned int firstLayer + unsigned int lastLayer + unsigned int reserved[16] + + cdef enum cudaSharedMemoryMode: + cudaSharedMemoryModeDefault = 0 + cudaSharedMemoryModeRequirePortable = 1 + cudaSharedMemoryModeAllowNonPortable = 2 + + cdef struct cudaPointerAttributes: + cudaMemoryType type + int device + void* devicePointer + void* hostPointer + long reserved[8] + + cdef struct cudaFuncAttributes: + size_t sharedSizeBytes + size_t constSizeBytes + size_t localSizeBytes + int maxThreadsPerBlock + int numRegs + int ptxVersion + int binaryVersion + int cacheModeCA + int maxDynamicSharedSizeBytes + int preferredShmemCarveout + int clusterDimMustBeSet + int requiredClusterWidth + int requiredClusterHeight + int requiredClusterDepth + int clusterSchedulingPolicyPreference + int nonPortableClusterSizeAllowed + int deviceNodeUpdateStatus + int reserved1 + int reserved[14] + + cdef struct cudaMemLocation: + cudaMemLocationType type + int id + + cdef struct cudaMemAccessDesc: + cudaMemLocation location + cudaMemAccessFlags flags + + cdef struct cudaMemPoolProps: + cudaMemAllocationType allocType + cudaMemAllocationHandleType handleTypes + cudaMemLocation location + void* win32SecurityAttributes + size_t maxSize + unsigned short usage + unsigned char reserved[54] + + cdef struct cudaMemPoolPtrExportData: + unsigned char reserved[64] + + cdef struct cudaMemAllocNodeParams: + cudaMemPoolProps poolProps + const cudaMemAccessDesc* accessDescs + size_t accessDescCount + size_t bytesize + void* dptr + + cdef struct cudaMemAllocNodeParamsV2: + cudaMemPoolProps poolProps + const cudaMemAccessDesc* accessDescs + size_t accessDescCount + size_t bytesize + void* dptr + + cdef struct cudaMemFreeNodeParams: + void* dptr + + cdef struct cudaMemcpyAttributes: + cudaMemcpySrcAccessOrder srcAccessOrder + cudaMemLocation srcLocHint + cudaMemLocation dstLocHint + unsigned int flags + + cdef struct cudaOffset3D: + size_t x + size_t y + size_t z + + cdef struct anon_struct6: + void* ptr + size_t rowLength + size_t layerHeight + cudaMemLocation locHint + + cdef struct anon_struct7: + cudaArray_t array + cudaOffset3D offset + + cdef union anon_union2: + anon_struct6 ptr + anon_struct7 array + + cdef struct cudaMemcpy3DOperand: + cudaMemcpy3DOperandType type + anon_union2 op + + cdef struct cudaMemcpy3DBatchOp: + cudaMemcpy3DOperand src + cudaMemcpy3DOperand dst + cudaExtent extent + cudaMemcpySrcAccessOrder srcAccessOrder + unsigned int flags + + cdef struct CUuuid_st: + char bytes[16] + + ctypedef CUuuid_st CUuuid + + ctypedef CUuuid_st cudaUUID_t + + cdef struct cudaDeviceProp: + char name[256] + cudaUUID_t uuid + char luid[8] + unsigned int luidDeviceNodeMask + size_t totalGlobalMem + size_t sharedMemPerBlock + int regsPerBlock + int warpSize + size_t memPitch + int maxThreadsPerBlock + int maxThreadsDim[3] + int maxGridSize[3] + size_t totalConstMem + int major + int minor + size_t textureAlignment + size_t texturePitchAlignment + int multiProcessorCount + int integrated + int canMapHostMemory + int maxTexture1D + int maxTexture1DMipmap + int maxTexture2D[2] + int maxTexture2DMipmap[2] + int maxTexture2DLinear[3] + int maxTexture2DGather[2] + int maxTexture3D[3] + int maxTexture3DAlt[3] + int maxTextureCubemap + int maxTexture1DLayered[2] + int maxTexture2DLayered[3] + int maxTextureCubemapLayered[2] + int maxSurface1D + int maxSurface2D[2] + int maxSurface3D[3] + int maxSurface1DLayered[2] + int maxSurface2DLayered[3] + int maxSurfaceCubemap + int maxSurfaceCubemapLayered[2] + size_t surfaceAlignment + int concurrentKernels + int ECCEnabled + int pciBusID + int pciDeviceID + int pciDomainID + int tccDriver + int asyncEngineCount + int unifiedAddressing + int memoryBusWidth + int l2CacheSize + int persistingL2CacheMaxSize + int maxThreadsPerMultiProcessor + int streamPrioritiesSupported + int globalL1CacheSupported + int localL1CacheSupported + size_t sharedMemPerMultiprocessor + int regsPerMultiprocessor + int managedMemory + int isMultiGpuBoard + int multiGpuBoardGroupID + int hostNativeAtomicSupported + int pageableMemoryAccess + int concurrentManagedAccess + int computePreemptionSupported + int canUseHostPointerForRegisteredMem + int cooperativeLaunch + size_t sharedMemPerBlockOptin + int pageableMemoryAccessUsesHostPageTables + int directManagedMemAccessFromHost + int maxBlocksPerMultiProcessor + int accessPolicyMaxWindowSize + size_t reservedSharedMemPerBlock + int hostRegisterSupported + int sparseCudaArraySupported + int hostRegisterReadOnlySupported + int timelineSemaphoreInteropSupported + int memoryPoolsSupported + int gpuDirectRDMASupported + unsigned int gpuDirectRDMAFlushWritesOptions + int gpuDirectRDMAWritesOrdering + unsigned int memoryPoolSupportedHandleTypes + int deferredMappingCudaArraySupported + int ipcEventSupported + int clusterLaunch + int unifiedFunctionPointers + int deviceNumaConfig + int deviceNumaId + int mpsEnabled + int hostNumaId + unsigned int gpuPciDeviceID + unsigned int gpuPciSubsystemID + int hostNumaMultinodeIpcSupported + int reserved[56] + + cdef struct cudaIpcEventHandle_st: + char reserved[64] + + ctypedef cudaIpcEventHandle_st cudaIpcEventHandle_t + + cdef struct cudaIpcMemHandle_st: + char reserved[64] + + ctypedef cudaIpcMemHandle_st cudaIpcMemHandle_t + + cdef struct cudaMemFabricHandle_st: + char reserved[64] + + ctypedef cudaMemFabricHandle_st cudaMemFabricHandle_t + + cdef struct anon_struct8: + void* handle + const void* name + + cdef union anon_union3: + int fd + anon_struct8 win32 + const void* nvSciBufObject + + cdef struct cudaExternalMemoryHandleDesc: + cudaExternalMemoryHandleType type + anon_union3 handle + unsigned long long size + unsigned int flags + unsigned int reserved[16] + + cdef struct cudaExternalMemoryBufferDesc: + unsigned long long offset + unsigned long long size + unsigned int flags + unsigned int reserved[16] + + cdef struct cudaExternalMemoryMipmappedArrayDesc: + unsigned long long offset + cudaChannelFormatDesc formatDesc + cudaExtent extent + unsigned int flags + unsigned int numLevels + unsigned int reserved[16] + + cdef struct anon_struct9: + void* handle + const void* name + + cdef union anon_union4: + int fd + anon_struct9 win32 + const void* nvSciSyncObj + + cdef struct cudaExternalSemaphoreHandleDesc: + cudaExternalSemaphoreHandleType type + anon_union4 handle + unsigned int flags + unsigned int reserved[16] + + cdef struct anon_struct10: + unsigned long long value + + cdef union anon_union5: + void* fence + unsigned long long reserved + + cdef struct anon_struct11: + unsigned long long key + + cdef struct anon_struct12: + anon_struct10 fence + anon_union5 nvSciSync + anon_struct11 keyedMutex + unsigned int reserved[12] + + cdef struct cudaExternalSemaphoreSignalParams: + anon_struct12 params + unsigned int flags + unsigned int reserved[16] + + cdef struct anon_struct13: + unsigned long long value + + cdef union anon_union6: + void* fence + unsigned long long reserved + + cdef struct anon_struct14: + unsigned long long key + unsigned int timeoutMs + + cdef struct anon_struct15: + anon_struct13 fence + anon_union6 nvSciSync + anon_struct14 keyedMutex + unsigned int reserved[10] + + cdef struct cudaExternalSemaphoreWaitParams: + anon_struct15 params + unsigned int flags + unsigned int reserved[16] + + cdef struct cudaDevSmResource: + unsigned int smCount + unsigned int minSmPartitionSize + unsigned int smCoscheduledAlignment + unsigned int flags + + cdef struct cudaDevWorkqueueConfigResource: + int device + unsigned int wqConcurrencyLimit + cudaDevWorkqueueConfigScope sharingScope + + cdef struct cudaDevWorkqueueResource: + unsigned char reserved[40] + + cdef struct cudaDevSmResourceGroupParams_st: + unsigned int smCount + unsigned int coscheduledSmCount + unsigned int preferredCoscheduledSmCount + unsigned int flags + unsigned int reserved[12] + + ctypedef cudaDevSmResourceGroupParams_st cudaDevSmResourceGroupParams + + cdef struct cudaDevResource_st: + cudaDevResourceType type + unsigned char _internal_padding[92] + cudaDevSmResource sm + cudaDevWorkqueueConfigResource wqConfig + cudaDevWorkqueueResource wq + unsigned char _oversize[40] + cudaDevResource_st* nextResource + + ctypedef cudaDevResource_st cudaDevResource + + cdef struct CUstream_st: + pass + ctypedef CUstream_st* cudaStream_t + + cdef struct CUevent_st: + pass + ctypedef CUevent_st* cudaEvent_t + + cdef struct cudaGraphicsResource: + pass + ctypedef cudaGraphicsResource* cudaGraphicsResource_t + + cdef struct CUexternalMemory_st: + pass + ctypedef CUexternalMemory_st* cudaExternalMemory_t + + cdef struct CUexternalSemaphore_st: + pass + ctypedef CUexternalSemaphore_st* cudaExternalSemaphore_t + + cdef struct CUgraph_st: + pass + ctypedef CUgraph_st* cudaGraph_t + + cdef struct CUgraphNode_st: + pass + ctypedef CUgraphNode_st* cudaGraphNode_t + + cdef struct CUuserObject_st: + pass + ctypedef CUuserObject_st* cudaUserObject_t + + ctypedef unsigned long long cudaGraphConditionalHandle + + cdef struct CUfunc_st: + pass + ctypedef CUfunc_st* cudaFunction_t + + cdef struct CUkern_st: + pass + ctypedef CUkern_st* cudaKernel_t + + cdef struct cudalibraryHostUniversalFunctionAndDataTable: + void* functionTable + size_t functionWindowSize + void* dataTable + size_t dataWindowSize + + cdef struct CUlib_st: + pass + ctypedef CUlib_st* cudaLibrary_t + + cdef struct CUmemPoolHandle_st: + pass + ctypedef CUmemPoolHandle_st* cudaMemPool_t + + cdef struct cudaKernelNodeParams: + void* func + dim3 gridDim + dim3 blockDim + unsigned int sharedMemBytes + void** kernelParams + void** extra + + cdef struct cudaKernelNodeParamsV2: + void* func + cudaKernel_t kern + cudaFunction_t cuFunc + dim3 gridDim + dim3 blockDim + unsigned int sharedMemBytes + void** kernelParams + void** extra + cudaExecutionContext_t ctx + cudaKernelFunctionType functionType + + cdef struct cudaExternalSemaphoreSignalNodeParams: + cudaExternalSemaphore_t* extSemArray + const cudaExternalSemaphoreSignalParams* paramsArray + unsigned int numExtSems + + cdef struct cudaExternalSemaphoreSignalNodeParamsV2: + cudaExternalSemaphore_t* extSemArray + const cudaExternalSemaphoreSignalParams* paramsArray + unsigned int numExtSems + + cdef struct cudaExternalSemaphoreWaitNodeParams: + cudaExternalSemaphore_t* extSemArray + const cudaExternalSemaphoreWaitParams* paramsArray + unsigned int numExtSems + + cdef struct cudaExternalSemaphoreWaitNodeParamsV2: + cudaExternalSemaphore_t* extSemArray + const cudaExternalSemaphoreWaitParams* paramsArray + unsigned int numExtSems + + cdef struct cudaConditionalNodeParams: + cudaGraphConditionalHandle handle + cudaGraphConditionalNodeType type + unsigned int size + cudaGraph_t* phGraph_out + cudaExecutionContext_t ctx + + cdef struct cudaChildGraphNodeParams: + cudaGraph_t graph + cudaGraphChildGraphNodeOwnership ownership + + cdef struct cudaEventRecordNodeParams: + cudaEvent_t event + + cdef struct cudaEventWaitNodeParams: + cudaEvent_t event + + cdef struct cudaGraphNodeParams: + cudaGraphNodeType type + int reserved0[3] + long long reserved1[29] + cudaKernelNodeParamsV2 kernel + cudaMemcpyNodeParams memcpy + cudaMemsetParamsV2 memset + cudaHostNodeParamsV2 host + cudaChildGraphNodeParams graph + cudaEventWaitNodeParams eventWait + cudaEventRecordNodeParams eventRecord + cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal + cudaExternalSemaphoreWaitNodeParamsV2 extSemWait + cudaMemAllocNodeParamsV2 alloc + cudaMemFreeNodeParams free + cudaConditionalNodeParams conditional + long long reserved2 + + cdef enum cudaGraphDependencyType_enum: + cudaGraphDependencyTypeDefault = 0 + cudaGraphDependencyTypeProgrammatic = 1 + + ctypedef cudaGraphDependencyType_enum cudaGraphDependencyType + + cdef struct cudaGraphEdgeData_st: + unsigned char from_port + unsigned char to_port + unsigned char type + unsigned char reserved[5] + + ctypedef cudaGraphEdgeData_st cudaGraphEdgeData + + cdef struct CUgraphExec_st: + pass + ctypedef CUgraphExec_st* cudaGraphExec_t + + cdef enum cudaGraphInstantiateResult: + cudaGraphInstantiateSuccess = 0 + cudaGraphInstantiateError = 1 + cudaGraphInstantiateInvalidStructure = 2 + cudaGraphInstantiateNodeOperationNotSupported = 3 + cudaGraphInstantiateMultipleDevicesNotSupported = 4 + cudaGraphInstantiateConditionalHandleUnused = 5 + + cdef struct cudaGraphInstantiateParams_st: + unsigned long long flags + cudaStream_t uploadStream + cudaGraphNode_t errNode_out + cudaGraphInstantiateResult result_out + + ctypedef cudaGraphInstantiateParams_st cudaGraphInstantiateParams + + cdef struct cudaGraphExecUpdateResultInfo_st: + cudaGraphExecUpdateResult result + cudaGraphNode_t errorNode + cudaGraphNode_t errorFromNode + + ctypedef cudaGraphExecUpdateResultInfo_st cudaGraphExecUpdateResultInfo + + cdef struct CUgraphDeviceUpdatableNode_st: + pass + ctypedef CUgraphDeviceUpdatableNode_st* cudaGraphDeviceNode_t + + cdef struct anon_struct16: + const void* pValue + size_t offset + size_t size + + cdef union anon_union10: + dim3 gridDim + anon_struct16 param + unsigned int isEnabled + + cdef struct cudaGraphKernelNodeUpdate: + cudaGraphDeviceNode_t node + cudaGraphKernelNodeField field + anon_union10 updateData + + cdef enum cudaLaunchMemSyncDomain: + cudaLaunchMemSyncDomainDefault = 0 + cudaLaunchMemSyncDomainRemote = 1 + + cdef struct cudaLaunchMemSyncDomainMap_st: + unsigned char default_ + unsigned char remote + + ctypedef cudaLaunchMemSyncDomainMap_st cudaLaunchMemSyncDomainMap + + cdef enum cudaLaunchAttributePortableClusterMode: + cudaLaunchPortableClusterModeDefault = 0 + cudaLaunchPortableClusterModeRequirePortable = 1 + cudaLaunchPortableClusterModeAllowNonPortable = 2 + + cdef enum cudaLaunchAttributeID: + cudaLaunchAttributeIgnore = 0 + cudaLaunchAttributeAccessPolicyWindow = 1 + cudaLaunchAttributeCooperative = 2 + cudaLaunchAttributeSynchronizationPolicy = 3 + cudaLaunchAttributeClusterDimension = 4 + cudaLaunchAttributeClusterSchedulingPolicyPreference = 5 + cudaLaunchAttributeProgrammaticStreamSerialization = 6 + cudaLaunchAttributeProgrammaticEvent = 7 + cudaLaunchAttributePriority = 8 + cudaLaunchAttributeMemSyncDomainMap = 9 + cudaLaunchAttributeMemSyncDomain = 10 + cudaLaunchAttributePreferredClusterDimension = 11 + cudaLaunchAttributeLaunchCompletionEvent = 12 + cudaLaunchAttributeDeviceUpdatableKernelNode = 13 + cudaLaunchAttributePreferredSharedMemoryCarveout = 14 + cudaLaunchAttributeNvlinkUtilCentricScheduling = 16 + cudaLaunchAttributePortableClusterSizeMode = 17 + cudaLaunchAttributeSharedMemoryMode = 18 + + cdef struct anon_struct17: + unsigned int x + unsigned int y + unsigned int z + + cdef struct anon_struct18: + cudaEvent_t event + int flags + int triggerAtBlockStart + + cdef struct anon_struct19: + unsigned int x + unsigned int y + unsigned int z + + cdef struct anon_struct20: + cudaEvent_t event + int flags + + cdef struct anon_struct21: + int deviceUpdatable + cudaGraphDeviceNode_t devNode + + cdef union cudaLaunchAttributeValue: + char pad[64] + cudaAccessPolicyWindow accessPolicyWindow + int cooperative + cudaSynchronizationPolicy syncPolicy + anon_struct17 clusterDim + cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference + int programmaticStreamSerializationAllowed + anon_struct18 programmaticEvent + int priority + cudaLaunchMemSyncDomainMap memSyncDomainMap + cudaLaunchMemSyncDomain memSyncDomain + anon_struct19 preferredClusterDim + anon_struct20 launchCompletionEvent + anon_struct21 deviceUpdatableKernelNode + unsigned int sharedMemCarveout + unsigned int nvlinkUtilCentricScheduling + cudaLaunchAttributePortableClusterMode portableClusterSizeMode + cudaSharedMemoryMode sharedMemoryMode + + cdef struct cudaLaunchAttribute_st: + cudaLaunchAttributeID id + cudaLaunchAttributeValue val + + ctypedef cudaLaunchAttribute_st cudaLaunchAttribute + + cdef struct cudaAsyncCallbackEntry: + pass + ctypedef cudaAsyncCallbackEntry* cudaAsyncCallbackHandle_t + + cdef enum cudaAsyncNotificationType_enum: + cudaAsyncNotificationTypeOverBudget = 1 + + ctypedef cudaAsyncNotificationType_enum cudaAsyncNotificationType + + cdef struct anon_struct22: + unsigned long long bytesOverBudget + + cdef union anon_union11: + anon_struct22 overBudget + + cdef struct cudaAsyncNotificationInfo: + cudaAsyncNotificationType type + anon_union11 info + + ctypedef cudaAsyncNotificationInfo cudaAsyncNotificationInfo_t + + ctypedef void (*cudaAsyncCallback)(cudaAsyncNotificationInfo_t* , void* , cudaAsyncCallbackHandle_t ) + + cdef enum CUDAlogLevel_enum: + cudaLogLevelError = 0 + cudaLogLevelWarning = 1 + + ctypedef CUDAlogLevel_enum cudaLogLevel + + cdef struct CUlogsCallbackEntry_st: + pass + ctypedef CUlogsCallbackEntry_st* cudaLogsCallbackHandle + + ctypedef unsigned int cudaLogIterator + + cdef enum cudaChannelFormatKind: + cudaChannelFormatKindSigned = 0 + cudaChannelFormatKindUnsigned = 1 + cudaChannelFormatKindFloat = 2 + cudaChannelFormatKindNone = 3 + cudaChannelFormatKindNV12 = 4 + cudaChannelFormatKindUnsignedNormalized8X1 = 5 + cudaChannelFormatKindUnsignedNormalized8X2 = 6 + cudaChannelFormatKindUnsignedNormalized8X4 = 7 + cudaChannelFormatKindUnsignedNormalized16X1 = 8 + cudaChannelFormatKindUnsignedNormalized16X2 = 9 + cudaChannelFormatKindUnsignedNormalized16X4 = 10 + cudaChannelFormatKindSignedNormalized8X1 = 11 + cudaChannelFormatKindSignedNormalized8X2 = 12 + cudaChannelFormatKindSignedNormalized8X4 = 13 + cudaChannelFormatKindSignedNormalized16X1 = 14 + cudaChannelFormatKindSignedNormalized16X2 = 15 + cudaChannelFormatKindSignedNormalized16X4 = 16 + cudaChannelFormatKindUnsignedBlockCompressed1 = 17 + cudaChannelFormatKindUnsignedBlockCompressed1SRGB = 18 + cudaChannelFormatKindUnsignedBlockCompressed2 = 19 + cudaChannelFormatKindUnsignedBlockCompressed2SRGB = 20 + cudaChannelFormatKindUnsignedBlockCompressed3 = 21 + cudaChannelFormatKindUnsignedBlockCompressed3SRGB = 22 + cudaChannelFormatKindUnsignedBlockCompressed4 = 23 + cudaChannelFormatKindSignedBlockCompressed4 = 24 + cudaChannelFormatKindUnsignedBlockCompressed5 = 25 + cudaChannelFormatKindSignedBlockCompressed5 = 26 + cudaChannelFormatKindUnsignedBlockCompressed6H = 27 + cudaChannelFormatKindSignedBlockCompressed6H = 28 + cudaChannelFormatKindUnsignedBlockCompressed7 = 29 + cudaChannelFormatKindUnsignedBlockCompressed7SRGB = 30 + cudaChannelFormatKindUnsignedNormalized1010102 = 31 + cudaChannelFormatKindUnsigned8Packed422 = 32 + cudaChannelFormatKindUnsigned8Packed444 = 33 + cudaChannelFormatKindUnsigned8SemiPlanar420 = 34 + cudaChannelFormatKindUnsigned16SemiPlanar420 = 35 + cudaChannelFormatKindUnsigned8SemiPlanar422 = 36 + cudaChannelFormatKindUnsigned16SemiPlanar422 = 37 + cudaChannelFormatKindUnsigned8SemiPlanar444 = 38 + cudaChannelFormatKindUnsigned16SemiPlanar444 = 39 + cudaChannelFormatKindUnsigned8Planar420 = 40 + cudaChannelFormatKindUnsigned16Planar420 = 41 + cudaChannelFormatKindUnsigned8Planar422 = 42 + cudaChannelFormatKindUnsigned16Planar422 = 43 + cudaChannelFormatKindUnsigned8Planar444 = 44 + cudaChannelFormatKindUnsigned16Planar444 = 45 + + cdef enum cudaMemoryType: + cudaMemoryTypeUnregistered = 0 + cudaMemoryTypeHost = 1 + cudaMemoryTypeDevice = 2 + cudaMemoryTypeManaged = 3 + + cdef enum cudaMemcpyKind: + cudaMemcpyHostToHost = 0 + cudaMemcpyHostToDevice = 1 + cudaMemcpyDeviceToHost = 2 + cudaMemcpyDeviceToDevice = 3 + cudaMemcpyDefault = 4 + + cdef enum cudaAccessProperty: + cudaAccessPropertyNormal = 0 + cudaAccessPropertyStreaming = 1 + cudaAccessPropertyPersisting = 2 + + cdef enum cudaStreamCaptureStatus: + cudaStreamCaptureStatusNone = 0 + cudaStreamCaptureStatusActive = 1 + cudaStreamCaptureStatusInvalidated = 2 + + cdef enum cudaGraphRecaptureStatus: + cudaGraphRecaptureEligibleForUpdate = 0 + cudaGraphRecaptureIneligibleForUpdate = 1 + cudaGraphRecaptureError = 2 + + cdef enum cudaStreamCaptureMode: + cudaStreamCaptureModeGlobal = 0 + cudaStreamCaptureModeThreadLocal = 1 + cudaStreamCaptureModeRelaxed = 2 + + cdef enum cudaSynchronizationPolicy: + cudaSyncPolicyAuto = 1 + cudaSyncPolicySpin = 2 + cudaSyncPolicyYield = 3 + cudaSyncPolicyBlockingSync = 4 + + cdef enum cudaClusterSchedulingPolicy: + cudaClusterSchedulingPolicyDefault = 0 + cudaClusterSchedulingPolicySpread = 1 + cudaClusterSchedulingPolicyLoadBalancing = 2 + + cdef enum cudaStreamUpdateCaptureDependenciesFlags: + cudaStreamAddCaptureDependencies = 0 + cudaStreamSetCaptureDependencies = 1 + + cdef enum cudaUserObjectFlags: + cudaUserObjectNoDestructorSync = 1 + + cdef enum cudaUserObjectRetainFlags: + cudaGraphUserObjectMove = 1 + + cdef enum cudaHostTaskSyncMode: + cudaHostTaskBlocking = 0 + cudaHostTaskSpinWait = 1 + + cdef enum cudaGraphicsRegisterFlags: + cudaGraphicsRegisterFlagsNone = 0 + cudaGraphicsRegisterFlagsReadOnly = 1 + cudaGraphicsRegisterFlagsWriteDiscard = 2 + cudaGraphicsRegisterFlagsSurfaceLoadStore = 4 + cudaGraphicsRegisterFlagsTextureGather = 8 + + cdef enum cudaGraphicsMapFlags: + cudaGraphicsMapFlagsNone = 0 + cudaGraphicsMapFlagsReadOnly = 1 + cudaGraphicsMapFlagsWriteDiscard = 2 + + cdef enum cudaGraphicsCubeFace: + cudaGraphicsCubeFacePositiveX = 0 + cudaGraphicsCubeFaceNegativeX = 1 + cudaGraphicsCubeFacePositiveY = 2 + cudaGraphicsCubeFaceNegativeY = 3 + cudaGraphicsCubeFacePositiveZ = 4 + cudaGraphicsCubeFaceNegativeZ = 5 + + cdef enum cudaResourceType: + cudaResourceTypeArray = 0 + cudaResourceTypeMipmappedArray = 1 + cudaResourceTypeLinear = 2 + cudaResourceTypePitch2D = 3 + + cdef enum cudaResourceViewFormat: + cudaResViewFormatNone = 0 + cudaResViewFormatUnsignedChar1 = 1 + cudaResViewFormatUnsignedChar2 = 2 + cudaResViewFormatUnsignedChar4 = 3 + cudaResViewFormatSignedChar1 = 4 + cudaResViewFormatSignedChar2 = 5 + cudaResViewFormatSignedChar4 = 6 + cudaResViewFormatUnsignedShort1 = 7 + cudaResViewFormatUnsignedShort2 = 8 + cudaResViewFormatUnsignedShort4 = 9 + cudaResViewFormatSignedShort1 = 10 + cudaResViewFormatSignedShort2 = 11 + cudaResViewFormatSignedShort4 = 12 + cudaResViewFormatUnsignedInt1 = 13 + cudaResViewFormatUnsignedInt2 = 14 + cudaResViewFormatUnsignedInt4 = 15 + cudaResViewFormatSignedInt1 = 16 + cudaResViewFormatSignedInt2 = 17 + cudaResViewFormatSignedInt4 = 18 + cudaResViewFormatHalf1 = 19 + cudaResViewFormatHalf2 = 20 + cudaResViewFormatHalf4 = 21 + cudaResViewFormatFloat1 = 22 + cudaResViewFormatFloat2 = 23 + cudaResViewFormatFloat4 = 24 + cudaResViewFormatUnsignedBlockCompressed1 = 25 + cudaResViewFormatUnsignedBlockCompressed2 = 26 + cudaResViewFormatUnsignedBlockCompressed3 = 27 + cudaResViewFormatUnsignedBlockCompressed4 = 28 + cudaResViewFormatSignedBlockCompressed4 = 29 + cudaResViewFormatUnsignedBlockCompressed5 = 30 + cudaResViewFormatSignedBlockCompressed5 = 31 + cudaResViewFormatUnsignedBlockCompressed6H = 32 + cudaResViewFormatSignedBlockCompressed6H = 33 + cudaResViewFormatUnsignedBlockCompressed7 = 34 + + cdef enum cudaFuncAttribute: + cudaFuncAttributeMaxDynamicSharedMemorySize = 8 + cudaFuncAttributePreferredSharedMemoryCarveout = 9 + cudaFuncAttributeClusterDimMustBeSet = 10 + cudaFuncAttributeRequiredClusterWidth = 11 + cudaFuncAttributeRequiredClusterHeight = 12 + cudaFuncAttributeRequiredClusterDepth = 13 + cudaFuncAttributeNonPortableClusterSizeAllowed = 14 + cudaFuncAttributeClusterSchedulingPolicyPreference = 15 + cudaFuncAttributeMax = 16 + + cdef enum cudaFuncCache: + cudaFuncCachePreferNone = 0 + cudaFuncCachePreferShared = 1 + cudaFuncCachePreferL1 = 2 + cudaFuncCachePreferEqual = 3 + + cdef enum cudaSharedMemConfig: + cudaSharedMemBankSizeDefault = 0 + cudaSharedMemBankSizeFourByte = 1 + cudaSharedMemBankSizeEightByte = 2 + + cdef enum cudaSharedCarveout: + cudaSharedmemCarveoutDefault = -1 + cudaSharedmemCarveoutMaxL1 = 0 + cudaSharedmemCarveoutMaxShared = 100 + + cdef enum cudaComputeMode: + cudaComputeModeDefault = 0 + cudaComputeModeExclusive = 1 + cudaComputeModeProhibited = 2 + cudaComputeModeExclusiveProcess = 3 + + cdef enum cudaLimit: + cudaLimitStackSize = 0 + cudaLimitPrintfFifoSize = 1 + cudaLimitMallocHeapSize = 2 + cudaLimitDevRuntimeSyncDepth = 3 + cudaLimitDevRuntimePendingLaunchCount = 4 + cudaLimitMaxL2FetchGranularity = 5 + cudaLimitPersistingL2CacheSize = 6 + + cdef enum cudaMemoryAdvise: + cudaMemAdviseSetReadMostly = 1 + cudaMemAdviseUnsetReadMostly = 2 + cudaMemAdviseSetPreferredLocation = 3 + cudaMemAdviseUnsetPreferredLocation = 4 + cudaMemAdviseSetAccessedBy = 5 + cudaMemAdviseUnsetAccessedBy = 6 + + cdef enum cudaMemRangeAttribute: + cudaMemRangeAttributeReadMostly = 1 + cudaMemRangeAttributePreferredLocation = 2 + cudaMemRangeAttributeAccessedBy = 3 + cudaMemRangeAttributeLastPrefetchLocation = 4 + cudaMemRangeAttributePreferredLocationType = 5 + cudaMemRangeAttributePreferredLocationId = 6 + cudaMemRangeAttributeLastPrefetchLocationType = 7 + cudaMemRangeAttributeLastPrefetchLocationId = 8 + + cdef enum cudaFlushGPUDirectRDMAWritesOptions: + cudaFlushGPUDirectRDMAWritesOptionHost = 1 + cudaFlushGPUDirectRDMAWritesOptionMemOps = 2 + + cdef enum cudaGPUDirectRDMAWritesOrdering: + cudaGPUDirectRDMAWritesOrderingNone = 0 + cudaGPUDirectRDMAWritesOrderingOwner = 100 + cudaGPUDirectRDMAWritesOrderingAllDevices = 200 + + cdef enum cudaFlushGPUDirectRDMAWritesScope: + cudaFlushGPUDirectRDMAWritesToOwner = 100 + cudaFlushGPUDirectRDMAWritesToAllDevices = 200 + + cdef enum cudaFlushGPUDirectRDMAWritesTarget: + cudaFlushGPUDirectRDMAWritesTargetCurrentDevice = 0 + + cdef enum cudaDeviceAttr: + cudaDevAttrMaxThreadsPerBlock = 1 + cudaDevAttrMaxBlockDimX = 2 + cudaDevAttrMaxBlockDimY = 3 + cudaDevAttrMaxBlockDimZ = 4 + cudaDevAttrMaxGridDimX = 5 + cudaDevAttrMaxGridDimY = 6 + cudaDevAttrMaxGridDimZ = 7 + cudaDevAttrMaxSharedMemoryPerBlock = 8 + cudaDevAttrTotalConstantMemory = 9 + cudaDevAttrWarpSize = 10 + cudaDevAttrMaxPitch = 11 + cudaDevAttrMaxRegistersPerBlock = 12 + cudaDevAttrClockRate = 13 + cudaDevAttrTextureAlignment = 14 + cudaDevAttrGpuOverlap = 15 + cudaDevAttrMultiProcessorCount = 16 + cudaDevAttrKernelExecTimeout = 17 + cudaDevAttrIntegrated = 18 + cudaDevAttrCanMapHostMemory = 19 + cudaDevAttrComputeMode = 20 + cudaDevAttrMaxTexture1DWidth = 21 + cudaDevAttrMaxTexture2DWidth = 22 + cudaDevAttrMaxTexture2DHeight = 23 + cudaDevAttrMaxTexture3DWidth = 24 + cudaDevAttrMaxTexture3DHeight = 25 + cudaDevAttrMaxTexture3DDepth = 26 + cudaDevAttrMaxTexture2DLayeredWidth = 27 + cudaDevAttrMaxTexture2DLayeredHeight = 28 + cudaDevAttrMaxTexture2DLayeredLayers = 29 + cudaDevAttrSurfaceAlignment = 30 + cudaDevAttrConcurrentKernels = 31 + cudaDevAttrEccEnabled = 32 + cudaDevAttrPciBusId = 33 + cudaDevAttrPciDeviceId = 34 + cudaDevAttrTccDriver = 35 + cudaDevAttrMemoryClockRate = 36 + cudaDevAttrGlobalMemoryBusWidth = 37 + cudaDevAttrL2CacheSize = 38 + cudaDevAttrMaxThreadsPerMultiProcessor = 39 + cudaDevAttrAsyncEngineCount = 40 + cudaDevAttrUnifiedAddressing = 41 + cudaDevAttrMaxTexture1DLayeredWidth = 42 + cudaDevAttrMaxTexture1DLayeredLayers = 43 + cudaDevAttrMaxTexture2DGatherWidth = 45 + cudaDevAttrMaxTexture2DGatherHeight = 46 + cudaDevAttrMaxTexture3DWidthAlt = 47 + cudaDevAttrMaxTexture3DHeightAlt = 48 + cudaDevAttrMaxTexture3DDepthAlt = 49 + cudaDevAttrPciDomainId = 50 + cudaDevAttrTexturePitchAlignment = 51 + cudaDevAttrMaxTextureCubemapWidth = 52 + cudaDevAttrMaxTextureCubemapLayeredWidth = 53 + cudaDevAttrMaxTextureCubemapLayeredLayers = 54 + cudaDevAttrMaxSurface1DWidth = 55 + cudaDevAttrMaxSurface2DWidth = 56 + cudaDevAttrMaxSurface2DHeight = 57 + cudaDevAttrMaxSurface3DWidth = 58 + cudaDevAttrMaxSurface3DHeight = 59 + cudaDevAttrMaxSurface3DDepth = 60 + cudaDevAttrMaxSurface1DLayeredWidth = 61 + cudaDevAttrMaxSurface1DLayeredLayers = 62 + cudaDevAttrMaxSurface2DLayeredWidth = 63 + cudaDevAttrMaxSurface2DLayeredHeight = 64 + cudaDevAttrMaxSurface2DLayeredLayers = 65 + cudaDevAttrMaxSurfaceCubemapWidth = 66 + cudaDevAttrMaxSurfaceCubemapLayeredWidth = 67 + cudaDevAttrMaxSurfaceCubemapLayeredLayers = 68 + cudaDevAttrMaxTexture1DLinearWidth = 69 + cudaDevAttrMaxTexture2DLinearWidth = 70 + cudaDevAttrMaxTexture2DLinearHeight = 71 + cudaDevAttrMaxTexture2DLinearPitch = 72 + cudaDevAttrMaxTexture2DMipmappedWidth = 73 + cudaDevAttrMaxTexture2DMipmappedHeight = 74 + cudaDevAttrComputeCapabilityMajor = 75 + cudaDevAttrComputeCapabilityMinor = 76 + cudaDevAttrMaxTexture1DMipmappedWidth = 77 + cudaDevAttrStreamPrioritiesSupported = 78 + cudaDevAttrGlobalL1CacheSupported = 79 + cudaDevAttrLocalL1CacheSupported = 80 + cudaDevAttrMaxSharedMemoryPerMultiprocessor = 81 + cudaDevAttrMaxRegistersPerMultiprocessor = 82 + cudaDevAttrManagedMemory = 83 + cudaDevAttrIsMultiGpuBoard = 84 + cudaDevAttrMultiGpuBoardGroupID = 85 + cudaDevAttrHostNativeAtomicSupported = 86 + cudaDevAttrSingleToDoublePrecisionPerfRatio = 87 + cudaDevAttrPageableMemoryAccess = 88 + cudaDevAttrConcurrentManagedAccess = 89 + cudaDevAttrComputePreemptionSupported = 90 + cudaDevAttrCanUseHostPointerForRegisteredMem = 91 + cudaDevAttrReserved92 = 92 + cudaDevAttrReserved93 = 93 + cudaDevAttrReserved94 = 94 + cudaDevAttrCooperativeLaunch = 95 + cudaDevAttrReserved96 = 96 + cudaDevAttrMaxSharedMemoryPerBlockOptin = 97 + cudaDevAttrCanFlushRemoteWrites = 98 + cudaDevAttrHostRegisterSupported = 99 + cudaDevAttrPageableMemoryAccessUsesHostPageTables = 100 + cudaDevAttrDirectManagedMemAccessFromHost = 101 + cudaDevAttrMaxBlocksPerMultiprocessor = 106 + cudaDevAttrMaxPersistingL2CacheSize = 108 + cudaDevAttrMaxAccessPolicyWindowSize = 109 + cudaDevAttrReservedSharedMemoryPerBlock = 111 + cudaDevAttrSparseCudaArraySupported = 112 + cudaDevAttrHostRegisterReadOnlySupported = 113 + cudaDevAttrTimelineSemaphoreInteropSupported = 114 + cudaDevAttrMemoryPoolsSupported = 115 + cudaDevAttrGPUDirectRDMASupported = 116 + cudaDevAttrGPUDirectRDMAFlushWritesOptions = 117 + cudaDevAttrGPUDirectRDMAWritesOrdering = 118 + cudaDevAttrMemoryPoolSupportedHandleTypes = 119 + cudaDevAttrClusterLaunch = 120 + cudaDevAttrDeferredMappingCudaArraySupported = 121 + cudaDevAttrReserved122 = 122 + cudaDevAttrReserved123 = 123 + cudaDevAttrReserved124 = 124 + cudaDevAttrIpcEventSupport = 125 + cudaDevAttrMemSyncDomainCount = 126 + cudaDevAttrReserved127 = 127 + cudaDevAttrReserved128 = 128 + cudaDevAttrReserved129 = 129 + cudaDevAttrNumaConfig = 130 + cudaDevAttrNumaId = 131 + cudaDevAttrReserved132 = 132 + cudaDevAttrMpsEnabled = 133 + cudaDevAttrHostNumaId = 134 + cudaDevAttrD3D12CigSupported = 135 + cudaDevAttrVulkanCigSupported = 138 + cudaDevAttrGpuPciDeviceId = 139 + cudaDevAttrGpuPciSubsystemId = 140 + cudaDevAttrReserved141 = 141 + cudaDevAttrHostNumaMemoryPoolsSupported = 142 + cudaDevAttrHostNumaMultinodeIpcSupported = 143 + cudaDevAttrHostMemoryPoolsSupported = 144 + cudaDevAttrReserved145 = 145 + cudaDevAttrOnlyPartialHostNativeAtomicSupported = 147 + cudaDevAttrAtomicReductionSupported = 148 + cudaDevAttrCigStreamsSupported = 151 + cudaDevAttrMax = 152 + + cdef enum cudaMemPoolAttr: + cudaMemPoolReuseFollowEventDependencies = 1 + cudaMemPoolReuseAllowOpportunistic = 2 + cudaMemPoolReuseAllowInternalDependencies = 3 + cudaMemPoolAttrReleaseThreshold = 4 + cudaMemPoolAttrReservedMemCurrent = 5 + cudaMemPoolAttrReservedMemHigh = 6 + cudaMemPoolAttrUsedMemCurrent = 7 + cudaMemPoolAttrUsedMemHigh = 8 + cudaMemPoolAttrAllocationType = 9 + cudaMemPoolAttrExportHandleTypes = 10 + cudaMemPoolAttrLocationId = 11 + cudaMemPoolAttrLocationType = 12 + cudaMemPoolAttrMaxPoolSize = 13 + cudaMemPoolAttrHwDecompressEnabled = 14 + + cdef enum cudaMemLocationType: + cudaMemLocationTypeInvalid = 0 + cudaMemLocationTypeNone = 0 + cudaMemLocationTypeDevice = 1 + cudaMemLocationTypeHost = 2 + cudaMemLocationTypeHostNuma = 3 + cudaMemLocationTypeHostNumaCurrent = 4 + cudaMemLocationTypeInvisible = 5 + + cdef enum cudaMemAccessFlags: + cudaMemAccessFlagsProtNone = 0 + cudaMemAccessFlagsProtRead = 1 + cudaMemAccessFlagsProtReadWrite = 3 + + cdef enum cudaMemAllocationType: + cudaMemAllocationTypeInvalid = 0 + cudaMemAllocationTypePinned = 1 + cudaMemAllocationTypeManaged = 2 + cudaMemAllocationTypeMax = 2147483647 + + cdef enum cudaMemAllocationHandleType: + cudaMemHandleTypeNone = 0 + cudaMemHandleTypePosixFileDescriptor = 1 + cudaMemHandleTypeWin32 = 2 + cudaMemHandleTypeWin32Kmt = 4 + cudaMemHandleTypeFabric = 8 + + cdef enum cudaGraphMemAttributeType: + cudaGraphMemAttrUsedMemCurrent = 0 + cudaGraphMemAttrUsedMemHigh = 1 + cudaGraphMemAttrReservedMemCurrent = 2 + cudaGraphMemAttrReservedMemHigh = 3 + + cdef enum cudaMemcpyFlags: + cudaMemcpyFlagDefault = 0 + cudaMemcpyFlagPreferOverlapWithCompute = 1 + + cdef enum cudaMemcpySrcAccessOrder: + cudaMemcpySrcAccessOrderInvalid = 0 + cudaMemcpySrcAccessOrderStream = 1 + cudaMemcpySrcAccessOrderDuringApiCall = 2 + cudaMemcpySrcAccessOrderAny = 3 + cudaMemcpySrcAccessOrderMax = 2147483647 + + cdef enum cudaMemcpy3DOperandType: + cudaMemcpyOperandTypePointer = 1 + cudaMemcpyOperandTypeArray = 2 + cudaMemcpyOperandTypeMax = 2147483647 + + cdef enum cudaDeviceP2PAttr: + cudaDevP2PAttrPerformanceRank = 1 + cudaDevP2PAttrAccessSupported = 2 + cudaDevP2PAttrNativeAtomicSupported = 3 + cudaDevP2PAttrCudaArrayAccessSupported = 4 + cudaDevP2PAttrOnlyPartialNativeAtomicSupported = 5 + + cdef enum cudaAtomicOperation: + cudaAtomicOperationIntegerAdd = 0 + cudaAtomicOperationIntegerMin = 1 + cudaAtomicOperationIntegerMax = 2 + cudaAtomicOperationIntegerIncrement = 3 + cudaAtomicOperationIntegerDecrement = 4 + cudaAtomicOperationAnd = 5 + cudaAtomicOperationOr = 6 + cudaAtomicOperationXOR = 7 + cudaAtomicOperationExchange = 8 + cudaAtomicOperationCAS = 9 + cudaAtomicOperationFloatAdd = 10 + cudaAtomicOperationFloatMin = 11 + cudaAtomicOperationFloatMax = 12 + + cdef enum cudaAtomicOperationCapability: + cudaAtomicCapabilitySigned = 1 + cudaAtomicCapabilityUnsigned = 2 + cudaAtomicCapabilityReduction = 4 + cudaAtomicCapabilityScalar32 = 8 + cudaAtomicCapabilityScalar64 = 16 + cudaAtomicCapabilityScalar128 = 32 + cudaAtomicCapabilityVector32x4 = 64 + + cdef enum cudaExternalMemoryHandleType: + cudaExternalMemoryHandleTypeOpaqueFd = 1 + cudaExternalMemoryHandleTypeOpaqueWin32 = 2 + cudaExternalMemoryHandleTypeOpaqueWin32Kmt = 3 + cudaExternalMemoryHandleTypeD3D12Heap = 4 + cudaExternalMemoryHandleTypeD3D12Resource = 5 + cudaExternalMemoryHandleTypeD3D11Resource = 6 + cudaExternalMemoryHandleTypeD3D11ResourceKmt = 7 + cudaExternalMemoryHandleTypeNvSciBuf = 8 + + cdef enum cudaExternalSemaphoreHandleType: + cudaExternalSemaphoreHandleTypeOpaqueFd = 1 + cudaExternalSemaphoreHandleTypeOpaqueWin32 = 2 + cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt = 3 + cudaExternalSemaphoreHandleTypeD3D12Fence = 4 + cudaExternalSemaphoreHandleTypeD3D11Fence = 5 + cudaExternalSemaphoreHandleTypeNvSciSync = 6 + cudaExternalSemaphoreHandleTypeKeyedMutex = 7 + cudaExternalSemaphoreHandleTypeKeyedMutexKmt = 8 + cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd = 9 + cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = 10 + + cdef enum cudaDevSmResourceGroup_flags: + cudaDevSmResourceGroupDefault = 0 + cudaDevSmResourceGroupBackfill = 1 + + cdef enum cudaDevSmResourceSplitByCount_flags: + cudaDevSmResourceSplitIgnoreSmCoscheduling = 1 + cudaDevSmResourceSplitMaxPotentialClusterSize = 2 + + cdef enum cudaDevResourceType: + cudaDevResourceTypeInvalid = 0 + cudaDevResourceTypeSm = 1 + cudaDevResourceTypeWorkqueueConfig = 1000 + cudaDevResourceTypeWorkqueue = 10000 + + cdef enum cudaDevWorkqueueConfigScope: + cudaDevWorkqueueConfigScopeDeviceCtx = 0 + cudaDevWorkqueueConfigScopeGreenCtxBalanced = 1 + + cdef enum cudaJitOption: + cudaJitMaxRegisters = 0 + cudaJitThreadsPerBlock = 1 + cudaJitWallTime = 2 + cudaJitInfoLogBuffer = 3 + cudaJitInfoLogBufferSizeBytes = 4 + cudaJitErrorLogBuffer = 5 + cudaJitErrorLogBufferSizeBytes = 6 + cudaJitOptimizationLevel = 7 + cudaJitFallbackStrategy = 10 + cudaJitGenerateDebugInfo = 11 + cudaJitLogVerbose = 12 + cudaJitGenerateLineInfo = 13 + cudaJitCacheMode = 14 + cudaJitPositionIndependentCode = 30 + cudaJitMinCtaPerSm = 31 + cudaJitMaxThreadsPerBlock = 32 + cudaJitOverrideDirectiveValues = 33 + + cdef enum cudaLibraryOption: + cudaLibraryHostUniversalFunctionAndDataTable = 0 + cudaLibraryBinaryIsPreserved = 1 + + cdef enum cudaJit_CacheMode: + cudaJitCacheOptionNone = 0 + cudaJitCacheOptionCG = 1 + cudaJitCacheOptionCA = 2 + + cdef enum cudaJit_Fallback: + cudaPreferPtx = 0 + cudaPreferBinary = 1 + + cdef enum cudaCGScope: + cudaCGScopeInvalid = 0 + cudaCGScopeGrid = 1 + cudaCGScopeReserved = 2 + + cdef enum cudaKernelFunctionType: + cudaKernelFunctionTypeUnspecified = 0 + cudaKernelFunctionTypeDeviceEntry = 1 + cudaKernelFunctionTypeKernel = 2 + cudaKernelFunctionTypeFunction = 3 + + cdef enum cudaGraphConditionalHandleFlags: + cudaGraphCondAssignDefault = 1 + + cdef enum cudaGraphConditionalNodeType: + cudaGraphCondTypeIf = 0 + cudaGraphCondTypeWhile = 1 + cudaGraphCondTypeSwitch = 2 + + cdef enum cudaGraphNodeType: + cudaGraphNodeTypeKernel = 0 + cudaGraphNodeTypeMemcpy = 1 + cudaGraphNodeTypeMemset = 2 + cudaGraphNodeTypeHost = 3 + cudaGraphNodeTypeGraph = 4 + cudaGraphNodeTypeEmpty = 5 + cudaGraphNodeTypeWaitEvent = 6 + cudaGraphNodeTypeEventRecord = 7 + cudaGraphNodeTypeExtSemaphoreSignal = 8 + cudaGraphNodeTypeExtSemaphoreWait = 9 + cudaGraphNodeTypeMemAlloc = 10 + cudaGraphNodeTypeMemFree = 11 + cudaGraphNodeTypeConditional = 13 + cudaGraphNodeTypeReserved16 = 16 + cudaGraphNodeTypeCount = 17 + + cdef enum cudaGraphChildGraphNodeOwnership: + cudaGraphChildGraphOwnershipInvalid = -1 + cudaGraphChildGraphOwnershipClone = 0 + cudaGraphChildGraphOwnershipMove = 1 + + cdef enum cudaGraphExecUpdateResult: + cudaGraphExecUpdateSuccess = 0 + cudaGraphExecUpdateError = 1 + cudaGraphExecUpdateErrorTopologyChanged = 2 + cudaGraphExecUpdateErrorNodeTypeChanged = 3 + cudaGraphExecUpdateErrorFunctionChanged = 4 + cudaGraphExecUpdateErrorParametersChanged = 5 + cudaGraphExecUpdateErrorNotSupported = 6 + cudaGraphExecUpdateErrorUnsupportedFunctionChange = 7 + cudaGraphExecUpdateErrorAttributesChanged = 8 + + cdef enum cudaGraphKernelNodeField: + cudaGraphKernelNodeFieldInvalid = 0 + cudaGraphKernelNodeFieldGridDim = 1 + cudaGraphKernelNodeFieldParam = 2 + cudaGraphKernelNodeFieldEnabled = 3 + + cdef enum cudaGetDriverEntryPointFlags: + cudaEnableDefault = 0 + cudaEnableLegacyStream = 1 + cudaEnablePerThreadDefaultStream = 2 + + cdef enum cudaDriverEntryPointQueryResult: + cudaDriverEntryPointSuccess = 0 + cudaDriverEntryPointSymbolNotFound = 1 + cudaDriverEntryPointVersionNotSufficent = 2 + + cdef enum cudaGraphDebugDotFlags: + cudaGraphDebugDotFlagsVerbose = 1 + cudaGraphDebugDotFlagsKernelNodeParams = 4 + cudaGraphDebugDotFlagsMemcpyNodeParams = 8 + cudaGraphDebugDotFlagsMemsetNodeParams = 16 + cudaGraphDebugDotFlagsHostNodeParams = 32 + cudaGraphDebugDotFlagsEventNodeParams = 64 + cudaGraphDebugDotFlagsExtSemasSignalNodeParams = 128 + cudaGraphDebugDotFlagsExtSemasWaitNodeParams = 256 + cudaGraphDebugDotFlagsKernelNodeAttributes = 512 + cudaGraphDebugDotFlagsHandles = 1024 + cudaGraphDebugDotFlagsConditionalNodeParams = 32768 + + cdef enum cudaGraphInstantiateFlags: + cudaGraphInstantiateFlagAutoFreeOnLaunch = 1 + cudaGraphInstantiateFlagUpload = 2 + cudaGraphInstantiateFlagDeviceLaunch = 4 + cudaGraphInstantiateFlagUseNodePriority = 8 + + cdef enum cudaDeviceNumaConfig: + cudaDeviceNumaConfigNone = 0 + cudaDeviceNumaConfigNumaNode = 1 + + cdef enum cudaFabricOpStatusSource: + cudaFabricOpStatusSourceMbarrierV1 = 0 + cudaFabricOpStatusSourceMax = 2147483647 + + cdef enum cudaFabricOpStatusInfo: + cudaFabricOpStatusInfoSuccess = 0 + cudaFabricOpStatusInfoLast = 0 + cudaFabricOpStatusInfoMax = 2147483647 + +cdef extern from "surface_types.h": + + ctypedef unsigned long long cudaSurfaceObject_t + + cdef enum cudaSurfaceBoundaryMode: + cudaBoundaryModeZero = 0 + cudaBoundaryModeClamp = 1 + cudaBoundaryModeTrap = 2 + + cdef enum cudaSurfaceFormatMode: + cudaFormatModeForced = 0 + cudaFormatModeAuto = 1 + +cdef extern from "texture_types.h": + + cdef struct cudaTextureDesc: + cudaTextureAddressMode addressMode[3] + cudaTextureFilterMode filterMode + cudaTextureReadMode readMode + int sRGB + float borderColor[4] + int normalizedCoords + unsigned int maxAnisotropy + cudaTextureFilterMode mipmapFilterMode + float mipmapLevelBias + float minMipmapLevelClamp + float maxMipmapLevelClamp + int disableTrilinearOptimization + int seamlessCubemap + + ctypedef unsigned long long cudaTextureObject_t + + cdef enum cudaTextureAddressMode: + cudaAddressModeWrap = 0 + cudaAddressModeClamp = 1 + cudaAddressModeMirror = 2 + cudaAddressModeBorder = 3 + + cdef enum cudaTextureFilterMode: + cudaFilterModePoint = 0 + cudaFilterModeLinear = 1 + + cdef enum cudaTextureReadMode: + cudaReadModeElementType = 0 + cudaReadModeNormalizedFloat = 1 + +cdef extern from "library_types.h": + + cdef enum cudaDataType_t: + CUDA_R_32F = 0 + CUDA_R_64F = 1 + CUDA_R_16F = 2 + CUDA_R_8I = 3 + CUDA_C_32F = 4 + CUDA_C_64F = 5 + CUDA_C_16F = 6 + CUDA_C_8I = 7 + CUDA_R_8U = 8 + CUDA_C_8U = 9 + CUDA_R_32I = 10 + CUDA_C_32I = 11 + CUDA_R_32U = 12 + CUDA_C_32U = 13 + CUDA_R_16BF = 14 + CUDA_C_16BF = 15 + CUDA_R_4I = 16 + CUDA_C_4I = 17 + CUDA_R_4U = 18 + CUDA_C_4U = 19 + CUDA_R_16I = 20 + CUDA_C_16I = 21 + CUDA_R_16U = 22 + CUDA_C_16U = 23 + CUDA_R_64I = 24 + CUDA_C_64I = 25 + CUDA_R_64U = 26 + CUDA_C_64U = 27 + CUDA_R_8F_E4M3 = 28 + CUDA_R_8F_UE4M3 = 28 + CUDA_R_8F_E5M2 = 29 + CUDA_R_8F_UE8M0 = 30 + CUDA_R_6F_E2M3 = 31 + CUDA_R_6F_E3M2 = 32 + CUDA_R_4F_E2M1 = 33 + + ctypedef cudaDataType_t cudaDataType + + cdef enum cudaEmulationStrategy_t: + CUDA_EMULATION_STRATEGY_DEFAULT = 0 + CUDA_EMULATION_STRATEGY_PERFORMANT = 1 + CUDA_EMULATION_STRATEGY_EAGER = 2 + + ctypedef cudaEmulationStrategy_t cudaEmulationStrategy + + cdef enum cudaEmulationMantissaControl_t: + CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC = 0 + CUDA_EMULATION_MANTISSA_CONTROL_FIXED = 1 + + ctypedef cudaEmulationMantissaControl_t cudaEmulationMantissaControl + + cdef enum cudaEmulationSpecialValuesSupport_t: + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE = 0 + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY = 1 + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN = 2 + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT = 65535 + + ctypedef cudaEmulationSpecialValuesSupport_t cudaEmulationSpecialValuesSupport + + cdef enum libraryPropertyType_t: + MAJOR_VERSION = 0 + MINOR_VERSION = 1 + PATCH_LEVEL = 2 + + ctypedef libraryPropertyType_t libraryPropertyType + +cdef extern from "cuda_runtime_api.h": + + ctypedef void (*cudaStreamCallback_t)(cudaStream_t stream, cudaError_t status, void* userData) + + ctypedef cudaError_t (*cudaGraphRecaptureCallback_t)(void* data, cudaGraphNode_t node, const cudaGraphNodeParams* originalParams, const cudaGraphNodeParams* recaptureParams, cudaGraphRecaptureStatus status) + + cdef struct cudaGraphRecaptureCallbackData: + cudaGraphRecaptureCallback_t callbackFunc + void* userData + + ctypedef void (*cudaLogsCallback_t)(void* data, cudaLogLevel logLevel, char* message, size_t length) + +cdef extern from "device_types.h": + + cdef enum cudaRoundMode: + cudaRoundNearest = 0 + cudaRoundZero = 1 + cudaRoundPosInf = 2 + cudaRoundMinInf = 3 + +ctypedef cudaLaunchAttributeID cudaStreamAttrID + +ctypedef cudaLaunchAttributeID cudaKernelNodeAttrID + +ctypedef cudaLaunchAttributeValue cudaStreamAttrValue + +ctypedef cudaLaunchAttributeValue cudaKernelNodeAttrValue diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/driver.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/driver.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..b05fd3670687dbc81124849c28b41496c0fa333f --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/driver.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e897623cc50aa4762c8be3011b5c2baba816892dd70b908f3a7c5cfd0200f871 +size 7432928 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/driver.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/driver.pxd new file mode 100644 index 0000000000000000000000000000000000000000..d33979c1d9eb5e791e617d1f4425f1e7ba906552 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/driver.pxd @@ -0,0 +1,8127 @@ +# 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 13.3.0, generator version 0.3.1.dev1711+g875fec45. Do not modify it directly. +cimport cuda.bindings.cydriver as cydriver + +include "_lib/utils.pxd" + +cdef class CUcontext: + """ + + A regular context handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUcontext _pvt_val + cdef cydriver.CUcontext* _pvt_ptr + +cdef class CUmodule: + """ + + CUDA module + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUmodule _pvt_val + cdef cydriver.CUmodule* _pvt_ptr + +cdef class CUfunction: + """ + + CUDA function + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUfunction _pvt_val + cdef cydriver.CUfunction* _pvt_ptr + +cdef class CUlibrary: + """ + + CUDA library + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlibrary _pvt_val + cdef cydriver.CUlibrary* _pvt_ptr + +cdef class CUkernel: + """ + + CUDA kernel + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUkernel _pvt_val + cdef cydriver.CUkernel* _pvt_ptr + +cdef class CUarray: + """ + + CUDA array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUarray _pvt_val + cdef cydriver.CUarray* _pvt_ptr + +cdef class CUmipmappedArray: + """ + + CUDA mipmapped array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUmipmappedArray _pvt_val + cdef cydriver.CUmipmappedArray* _pvt_ptr + +cdef class CUtexref: + """ + + CUDA texture reference + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUtexref _pvt_val + cdef cydriver.CUtexref* _pvt_ptr + +cdef class CUsurfref: + """ + + CUDA surface reference + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUsurfref _pvt_val + cdef cydriver.CUsurfref* _pvt_ptr + +cdef class CUevent: + """ + + CUDA event + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUevent _pvt_val + cdef cydriver.CUevent* _pvt_ptr + +cdef class CUstream: + """ + + CUDA stream + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUstream _pvt_val + cdef cydriver.CUstream* _pvt_ptr + +cdef class CUgraphicsResource: + """ + + CUDA graphics interop resource + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphicsResource _pvt_val + cdef cydriver.CUgraphicsResource* _pvt_ptr + +cdef class CUexternalMemory: + """ + + CUDA external memory + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUexternalMemory _pvt_val + cdef cydriver.CUexternalMemory* _pvt_ptr + +cdef class CUexternalSemaphore: + """ + + CUDA external semaphore + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUexternalSemaphore _pvt_val + cdef cydriver.CUexternalSemaphore* _pvt_ptr + +cdef class CUgraph: + """ + + CUDA graph + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraph _pvt_val + cdef cydriver.CUgraph* _pvt_ptr + +cdef class CUgraphNode: + """ + + CUDA graph node + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphNode _pvt_val + cdef cydriver.CUgraphNode* _pvt_ptr + +cdef class CUgraphExec: + """ + + CUDA executable graph + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphExec _pvt_val + cdef cydriver.CUgraphExec* _pvt_ptr + +cdef class CUmemoryPool: + """ + + CUDA memory pool + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUmemoryPool _pvt_val + cdef cydriver.CUmemoryPool* _pvt_ptr + +cdef class CUuserObject: + """ + + CUDA user object for graphs + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUuserObject _pvt_val + cdef cydriver.CUuserObject* _pvt_ptr + +cdef class CUgraphDeviceNode: + """ + + CUDA graph device node handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphDeviceNode _pvt_val + cdef cydriver.CUgraphDeviceNode* _pvt_ptr + +cdef class CUasyncCallbackHandle: + """ + + CUDA async notification callback handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUasyncCallbackHandle _pvt_val + cdef cydriver.CUasyncCallbackHandle* _pvt_ptr + +cdef class CUgreenCtx: + """ + + A green context handle. This handle can be used safely from only one CPU thread at a time. Created via cuGreenCtxCreate + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgreenCtx _pvt_val + cdef cydriver.CUgreenCtx* _pvt_ptr + +cdef class CUlinkState: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlinkState _pvt_val + cdef cydriver.CUlinkState* _pvt_ptr + cdef list _keepalive + +cdef class CUcoredumpCallbackHandle: + """ Opaque handle representing a registered coredump status callback. + + This handle is returned when registering a callback and must be provided when deregistering the callback. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUcoredumpCallbackHandle _pvt_val + cdef cydriver.CUcoredumpCallbackHandle* _pvt_ptr + +cdef class CUdevResourceDesc: + """ + + An opaque descriptor handle. The descriptor encapsulates multiple created and configured resources. Created via cuDevResourceGenerateDesc + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUdevResourceDesc _pvt_val + cdef cydriver.CUdevResourceDesc* _pvt_ptr + +cdef class CUlogsCallbackHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlogsCallbackHandle _pvt_val + cdef cydriver.CUlogsCallbackHandle* _pvt_ptr + +cdef class CUeglStreamConnection: + """ + + CUDA EGLSream Connection + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUeglStreamConnection _pvt_val + cdef cydriver.CUeglStreamConnection* _pvt_ptr + +cdef class EGLImageKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.EGLImageKHR _pvt_val + cdef cydriver.EGLImageKHR* _pvt_ptr + +cdef class EGLStreamKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.EGLStreamKHR _pvt_val + cdef cydriver.EGLStreamKHR* _pvt_ptr + +cdef class EGLSyncKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.EGLSyncKHR _pvt_val + cdef cydriver.EGLSyncKHR* _pvt_ptr + +cdef class CUasyncCallback: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUasyncCallback _pvt_val + cdef cydriver.CUasyncCallback* _pvt_ptr + +cdef class CUhostFn: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUhostFn _pvt_val + cdef cydriver.CUhostFn* _pvt_ptr + +cdef class CUstreamCallback: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUstreamCallback _pvt_val + cdef cydriver.CUstreamCallback* _pvt_ptr + +cdef class CUoccupancyB2DSize: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUoccupancyB2DSize _pvt_val + cdef cydriver.CUoccupancyB2DSize* _pvt_ptr + +cdef class CUgraphRecaptureCallback: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphRecaptureCallback _pvt_val + cdef cydriver.CUgraphRecaptureCallback* _pvt_ptr + +cdef class CUcoredumpStatusCallback: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUcoredumpStatusCallback _pvt_val + cdef cydriver.CUcoredumpStatusCallback* _pvt_ptr + +cdef class CUlogsCallback: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlogsCallback _pvt_val + cdef cydriver.CUlogsCallback* _pvt_ptr + +cdef class CUuuid_st: + """ + Attributes + ---------- + bytes : bytes + < CUDA definition of UUID + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUuuid_st _pvt_val + cdef cydriver.CUuuid_st* _pvt_ptr + +cdef class CUmemFabricHandle_st: + """ + Fabric handle - An opaque handle representing a memory allocation + that can be exported to processes in same or different nodes. For + IPC between processes on different nodes they must be connected via + the NVSwitch fabric. + + Attributes + ---------- + data : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemFabricHandle_st _pvt_val + cdef cydriver.CUmemFabricHandle_st* _pvt_ptr + +cdef class CUipcEventHandle_st: + """ + CUDA IPC event handle + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUipcEventHandle_st _pvt_val + cdef cydriver.CUipcEventHandle_st* _pvt_ptr + +cdef class CUipcMemHandle_st: + """ + CUDA IPC mem handle + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUipcMemHandle_st _pvt_val + cdef cydriver.CUipcMemHandle_st* _pvt_ptr + +cdef class CUstreamMemOpWaitValueParams_st: + """ + Attributes + ---------- + operation : CUstreamBatchMemOpType + + address : CUdeviceptr + + value : cuuint32_t + + value64 : cuuint64_t + + flags : unsigned int + See CUstreamWaitValue_flags. + alias : CUdeviceptr + For driver internal use. Initial value is unimportant. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr + cdef CUdeviceptr _address + cdef cuuint32_t _value + cdef cuuint64_t _value64 + cdef CUdeviceptr _alias + +cdef class CUstreamMemOpWriteValueParams_st: + """ + Attributes + ---------- + operation : CUstreamBatchMemOpType + + address : CUdeviceptr + + value : cuuint32_t + + value64 : cuuint64_t + + flags : unsigned int + See CUstreamWriteValue_flags. + alias : CUdeviceptr + For driver internal use. Initial value is unimportant. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr + cdef CUdeviceptr _address + cdef cuuint32_t _value + cdef cuuint64_t _value64 + cdef CUdeviceptr _alias + +cdef class CUstreamMemOpFlushRemoteWritesParams_st: + """ + Attributes + ---------- + operation : CUstreamBatchMemOpType + + flags : unsigned int + Must be 0. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr + +cdef class CUstreamMemOpMemoryBarrierParams_st: + """ + Attributes + ---------- + operation : CUstreamBatchMemOpType + < Only supported in the _v2 API + flags : unsigned int + See CUstreamMemoryBarrier_flags + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr + +cdef class CUstreamMemOpAtomicReductionParams_st: + """ + Attributes + ---------- + operation : CUstreamBatchMemOpType + + flags : unsigned int + Must be 0 + reductionOp : CUstreamAtomicReductionOpType + See CUstreamAtomicReductionOpType + dataType : CUstreamAtomicReductionDataType + See CUstreamAtomicReductionDataType + address : CUdeviceptr + The address the atomic operation will be operated on + value : cuuint64_t + The operand value the atomic operation will operate with + alias : CUdeviceptr + For driver internal use. Initial value is unimportant. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr + cdef CUdeviceptr _address + cdef cuuint64_t _value + cdef CUdeviceptr _alias + +cdef class CUstreamBatchMemOpParams_union: + """ + Per-operation parameters for cuStreamBatchMemOp + + Attributes + ---------- + operation : CUstreamBatchMemOpType + Operation. This is the first field of all the union elemets and + acts as a TAG to determine which union member is valid. + waitValue : CUstreamMemOpWaitValueParams_st + Params for CU_STREAM_MEM_OP_WAIT_VALUE_32 and + CU_STREAM_MEM_OP_WAIT_VALUE_64 operations. + writeValue : CUstreamMemOpWriteValueParams_st + Params for CU_STREAM_MEM_OP_WRITE_VALUE_32 and + CU_STREAM_MEM_OP_WRITE_VALUE_64 operations. + flushRemoteWrites : CUstreamMemOpFlushRemoteWritesParams_st + Params for CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES operations. + memoryBarrier : CUstreamMemOpMemoryBarrierParams_st + Params for CU_STREAM_MEM_OP_BARRIER operations. + atomicReduction : CUstreamMemOpAtomicReductionParams_st + + pad : list[cuuint64_t] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamBatchMemOpParams_union _pvt_val + cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr + cdef CUstreamMemOpWaitValueParams_st _waitValue + cdef CUstreamMemOpWriteValueParams_st _writeValue + cdef CUstreamMemOpFlushRemoteWritesParams_st _flushRemoteWrites + cdef CUstreamMemOpMemoryBarrierParams_st _memoryBarrier + cdef CUstreamMemOpAtomicReductionParams_st _atomicReduction + +cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: + """ + Batch memory operation node parameters Used in the legacy + cuGraphAddBatchMemOpNode api. New code should use cuGraphAddNode() + + Attributes + ---------- + ctx : CUcontext + + count : unsigned int + + paramArray : CUstreamBatchMemOpParams + + flags : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st _pvt_val + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st* _pvt_ptr + cdef CUcontext _ctx + cdef size_t _paramArray_length + cdef cydriver.CUstreamBatchMemOpParams* _paramArray + +cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: + """ + Batch memory operation node parameters + + Attributes + ---------- + ctx : CUcontext + Context to use for the operations. + count : unsigned int + Number of operations in paramArray. + paramArray : CUstreamBatchMemOpParams + Array of batch memory operations. + flags : unsigned int + Flags to control the node. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st* _pvt_ptr + cdef CUcontext _ctx + cdef size_t _paramArray_length + cdef cydriver.CUstreamBatchMemOpParams* _paramArray + +cdef class anon_struct0: + """ + Attributes + ---------- + bytesOverBudget : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUasyncNotificationInfo_st* _pvt_ptr + +cdef class anon_union2: + """ + Attributes + ---------- + overBudget : anon_struct0 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUasyncNotificationInfo_st* _pvt_ptr + cdef anon_struct0 _overBudget + +cdef class CUasyncNotificationInfo_st: + """ + Information passed to the user via the async notification callback + + Attributes + ---------- + type : CUasyncNotificationType + The type of notification being sent + info : anon_union2 + Information about the notification. `typename` must be checked in + order to interpret this field. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUasyncNotificationInfo_st* _val_ptr + cdef cydriver.CUasyncNotificationInfo_st* _pvt_ptr + cdef anon_union2 _info + +cdef class CUdevprop_st: + """ + Legacy device properties + + Attributes + ---------- + maxThreadsPerBlock : int + Maximum number of threads per block + maxThreadsDim : list[int] + Maximum size of each dimension of a block + maxGridSize : list[int] + Maximum size of each dimension of a grid + sharedMemPerBlock : int + Shared memory available per block in bytes + totalConstantMemory : int + Constant memory available on device in bytes + SIMDWidth : int + Warp size in threads + memPitch : int + Maximum pitch in bytes allowed by memory copies + regsPerBlock : int + 32-bit registers available per block + clockRate : int + Clock frequency in kilohertz + textureAlign : int + Alignment requirement for textures + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUdevprop_st _pvt_val + cdef cydriver.CUdevprop_st* _pvt_ptr + +cdef class CUaccessPolicyWindow_st: + """ + Specifies an access policy for a window, a contiguous extent of + memory beginning at base_ptr and ending at base_ptr + num_bytes. + num_bytes is limited by + CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE. Partition into + many segments and assign segments such that: sum of "hit segments" + / window == approx. ratio. sum of "miss segments" / window == + approx 1-ratio. Segments and ratio specifications are fitted to the + capabilities of the architecture. Accesses in a hit segment apply + the hitProp access policy. Accesses in a miss segment apply the + missProp access policy. + + Attributes + ---------- + base_ptr : Any + Starting address of the access policy window. CUDA driver may align + it. + num_bytes : size_t + Size in bytes of the window policy. CUDA driver may restrict the + maximum size and alignment. + hitRatio : float + hitRatio specifies percentage of lines assigned hitProp, rest are + assigned missProp. + hitProp : CUaccessProperty + CUaccessProperty set for hit. + missProp : CUaccessProperty + CUaccessProperty set for miss. Must be either NORMAL or STREAMING + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUaccessPolicyWindow_st _pvt_val + cdef cydriver.CUaccessPolicyWindow_st* _pvt_ptr + cdef _HelperInputVoidPtr _cybase_ptr + +cdef class CUDA_KERNEL_NODE_PARAMS_st: + """ + GPU kernel node parameters + + Attributes + ---------- + func : CUfunction + Kernel to launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + kernelParams : Any + Array of pointers to kernel parameters + extra : Any + Extra options + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_st* _pvt_ptr + cdef CUfunction _func + cdef _HelperKernelParams _cykernelParams + +cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: + """ + GPU kernel node parameters + + Attributes + ---------- + func : CUfunction + Kernel to launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + kernelParams : Any + Array of pointers to kernel parameters + extra : Any + Extra options + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + ctx : CUcontext + Context for the kernel task to run in. The value NULL will indicate + the current context should be used by the api. This field is + ignored if func is set. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v2_st* _pvt_ptr + cdef CUfunction _func + cdef _HelperKernelParams _cykernelParams + cdef CUkernel _kern + cdef CUcontext _ctx + +cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: + """ + GPU kernel node parameters + + Attributes + ---------- + func : CUfunction + Kernel to launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + kernelParams : Any + Array of pointers to kernel parameters + extra : Any + Extra options + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + ctx : CUcontext + Context for the kernel task to run in. The value NULL will indicate + the current context should be used by the api. This field is + ignored if func is set. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v3_st _pvt_val + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v3_st* _pvt_ptr + cdef CUfunction _func + cdef _HelperKernelParams _cykernelParams + cdef CUkernel _kern + cdef CUcontext _ctx + +cdef class CUDA_MEMSET_NODE_PARAMS_st: + """ + Memset node parameters + + Attributes + ---------- + dst : CUdeviceptr + Destination device pointer + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + value : unsigned int + Value to be set + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + width : size_t + Width of the row in elements + height : size_t + Number of rows + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMSET_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_MEMSET_NODE_PARAMS_st* _pvt_ptr + cdef CUdeviceptr _dst + +cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: + """ + Memset node parameters + + Attributes + ---------- + dst : CUdeviceptr + Destination device pointer + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + value : unsigned int + Value to be set + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + width : size_t + Width of the row in elements + height : size_t + Number of rows + ctx : CUcontext + Context on which to run the node + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMSET_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_MEMSET_NODE_PARAMS_v2_st* _pvt_ptr + cdef CUdeviceptr _dst + cdef CUcontext _ctx + +cdef class CUDA_HOST_NODE_PARAMS_st: + """ + Host node parameters + + Attributes + ---------- + fn : CUhostFn + The function to call when the node executes + userData : Any + Argument to pass to the function + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_HOST_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_HOST_NODE_PARAMS_st* _pvt_ptr + cdef CUhostFn _fn + cdef _HelperInputVoidPtr _cyuserData + +cdef class CUDA_HOST_NODE_PARAMS_v2_st: + """ + Host node parameters + + Attributes + ---------- + fn : CUhostFn + The function to call when the node executes + userData : Any + Argument to pass to the function + syncMode : unsigned int + The sync mode to use for the host task + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_HOST_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_HOST_NODE_PARAMS_v2_st* _pvt_ptr + cdef CUhostFn _fn + cdef _HelperInputVoidPtr _cyuserData + +cdef class CUDA_CONDITIONAL_NODE_PARAMS: + """ + Conditional node parameters + + Attributes + ---------- + handle : CUgraphConditionalHandle + Conditional node handle. Handles must be created in advance of + creating the node using cuGraphConditionalHandleCreate. + type : CUgraphConditionalNodeType + Type of conditional node. + size : unsigned int + Size of graph output array. Allowed values are 1 for + CU_GRAPH_COND_TYPE_WHILE, 1 or 2 for CU_GRAPH_COND_TYPE_IF, or any + value greater than zero for CU_GRAPH_COND_TYPE_SWITCH. + phGraph_out : CUgraph + CUDA-owned array populated with conditional node child graphs + during creation of the node. Valid for the lifetime of the + conditional node. The contents of the graph(s) are subject to the + following constraints: - Allowed node types are kernel nodes, + empty nodes, child graphs, memsets, memcopies, and conditionals. + This applies recursively to child graphs and conditional bodies. + - All kernels, including kernels in nested conditionals or child + graphs at any level, must belong to the same CUDA context. + These graphs may be populated using graph node creation APIs or + cuStreamBeginCaptureToGraph. CU_GRAPH_COND_TYPE_IF: phGraph_out[0] + is executed when the condition is non-zero. If `size` == 2, + phGraph_out[1] will be executed when the condition is zero. + CU_GRAPH_COND_TYPE_WHILE: phGraph_out[0] is executed as long as the + condition is non-zero. CU_GRAPH_COND_TYPE_SWITCH: phGraph_out[n] is + executed when the condition is equal to n. If the condition >= + `size`, no body graph is executed. + ctx : CUcontext + Context on which to run the node. Must match context used to create + the handle and all body nodes. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_CONDITIONAL_NODE_PARAMS _pvt_val + cdef cydriver.CUDA_CONDITIONAL_NODE_PARAMS* _pvt_ptr + cdef CUgraphConditionalHandle _handle + cdef size_t _phGraph_out_length + cdef cydriver.CUgraph* _phGraph_out + cdef CUcontext _ctx + +cdef class CUgraphEdgeData_st: + """ + Optional annotation for edges in a CUDA graph. Note, all edges + implicitly have annotations and default to a zero-initialized value + if not specified. A zero-initialized struct indicates a standard + full serialization of two nodes with memory visibility. + + Attributes + ---------- + from_port : bytes + This indicates when the dependency is triggered from the upstream + node on the edge. The meaning is specfic to the node type. A value + of 0 in all cases means full completion of the upstream node, with + memory visibility to the downstream node or portion thereof + (indicated by `to_port`). Only kernel nodes define non-zero + ports. A kernel node can use the following output port types: + CU_GRAPH_KERNEL_NODE_PORT_DEFAULT, + CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC, or + CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER. + to_port : bytes + This indicates what portion of the downstream node is dependent on + the upstream node or portion thereof (indicated by `from_port`). + The meaning is specific to the node type. A value of 0 in all cases + means the entirety of the downstream node is dependent on the + upstream work. Currently no node types define non-zero ports. + Accordingly, this field must be set to zero. + type : bytes + This should be populated with a value from CUgraphDependencyType. + (It is typed as char due to compiler-specific layout of bitfields.) + See CUgraphDependencyType. + reserved : bytes + These bytes are unused and must be zeroed. This ensures + compatibility if additional fields are added in the future. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUgraphEdgeData_st _pvt_val + cdef cydriver.CUgraphEdgeData_st* _pvt_ptr + +cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: + """ + Graph instantiation parameters + + Attributes + ---------- + flags : cuuint64_t + Instantiation flags + hUploadStream : CUstream + Upload stream + hErrNode_out : CUgraphNode + The node which caused instantiation to fail, if any + result_out : CUgraphInstantiateResult + Whether instantiation was successful. If it failed, the reason why + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS_st _pvt_val + cdef cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS_st* _pvt_ptr + cdef cuuint64_t _flags + cdef CUstream _hUploadStream + cdef CUgraphNode _hErrNode_out + +cdef class CUlaunchMemSyncDomainMap_st: + """ + Memory Synchronization Domain map See ::cudaLaunchMemSyncDomain. + By default, kernels are launched in domain 0. Kernel launched with + CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE will have a different domain ID. + User may also alter the domain ID with CUlaunchMemSyncDomainMap for + a specific stream / graph node / kernel launch. See + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. Domain ID range is + available through CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT. + + Attributes + ---------- + default_ : bytes + The default domain ID to use for designated kernels + remote : bytes + The remote domain ID to use for designated kernels + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchMemSyncDomainMap_st _pvt_val + cdef cydriver.CUlaunchMemSyncDomainMap_st* _pvt_ptr + +cdef class anon_struct1: + """ + Attributes + ---------- + x : unsigned int + + y : unsigned int + + z : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + +cdef class anon_struct2: + """ + Attributes + ---------- + event : CUevent + + flags : int + + triggerAtBlockStart : int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + cdef CUevent _event + +cdef class anon_struct3: + """ + Attributes + ---------- + event : CUevent + + flags : int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + cdef CUevent _event + +cdef class anon_struct4: + """ + Attributes + ---------- + x : unsigned int + + y : unsigned int + + z : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + +cdef class anon_struct5: + """ + Attributes + ---------- + deviceUpdatable : int + + devNode : CUgraphDeviceNode + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + cdef CUgraphDeviceNode _devNode + +cdef class CUlaunchAttributeValue_union: + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + pad : bytes + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + clusterDim : anon_struct1 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION + that represents the desired cluster dimensions for the kernel. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `y` - The Y dimension of the cluster, in blocks. Must be a + divisor of the grid Y dimension. - `z` - The Z dimension of the + cluster, in blocks. Must be a divisor of the grid Z dimension. + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + launchCompletionEvent : anon_struct3 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following + fields: - `CUevent` event - Event to fire when the last block + launches - `int` flags; - Event record flags, see + cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + with the following fields: - `x` - The X dimension of the preferred + cluster, in blocks. Must be a divisor of the grid X dimension, and + must be a multiple of the `x` field of + CUlaunchAttributeValue::clusterDim. - `y` - The Y dimension of + the preferred cluster, in blocks. Must be a divisor of the grid Y + dimension, and must be a multiple of the `y` field of + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + nvlinkUtilCentricScheduling : unsigned int + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. + sharedMemoryMode : CUsharedMemoryMode + Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. + See CUsharedMemoryMode for acceptable values. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union _pvt_val + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + cdef CUaccessPolicyWindow _accessPolicyWindow + cdef anon_struct1 _clusterDim + cdef anon_struct2 _programmaticEvent + cdef anon_struct3 _launchCompletionEvent + cdef CUlaunchMemSyncDomainMap _memSyncDomainMap + cdef anon_struct4 _preferredClusterDim + cdef anon_struct5 _deviceUpdatableKernelNode + +cdef class CUlaunchAttribute_st: + """ + Launch attribute + + Attributes + ---------- + id : CUlaunchAttributeID + Attribute to set + value : CUlaunchAttributeValue + Value of the attribute + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttribute_st _pvt_val + cdef cydriver.CUlaunchAttribute_st* _pvt_ptr + cdef CUlaunchAttributeValue _value + +cdef class CUlaunchConfig_st: + """ + CUDA extensible launch configuration + + Attributes + ---------- + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + hStream : CUstream + Stream identifier + attrs : CUlaunchAttribute + List of attributes; nullable if CUlaunchConfig::numAttrs == 0 + numAttrs : unsigned int + Number of attributes populated in CUlaunchConfig::attrs + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchConfig_st _pvt_val + cdef cydriver.CUlaunchConfig_st* _pvt_ptr + cdef CUstream _hStream + cdef size_t _attrs_length + cdef cydriver.CUlaunchAttribute* _attrs + +cdef class CUexecAffinitySmCount_st: + """ + Value for CU_EXEC_AFFINITY_TYPE_SM_COUNT + + Attributes + ---------- + val : unsigned int + The number of SMs the context is limited to use. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUexecAffinitySmCount_st _pvt_val + cdef cydriver.CUexecAffinitySmCount_st* _pvt_ptr + +cdef class anon_union3: + """ + Attributes + ---------- + smCount : CUexecAffinitySmCount + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUexecAffinityParam_st* _pvt_ptr + cdef CUexecAffinitySmCount _smCount + +cdef class CUexecAffinityParam_st: + """ + Execution Affinity Parameters + + Attributes + ---------- + type : CUexecAffinityType + Type of execution affinity. + param : anon_union3 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUexecAffinityParam_st* _val_ptr + cdef cydriver.CUexecAffinityParam_st* _pvt_ptr + cdef anon_union3 _param + +cdef class CUctxCigParam_st: + """ + CIG Context Create Params + + Attributes + ---------- + sharedDataType : CUcigDataType + Type of shared data from graphics client (D3D12 or Vulkan). + sharedData : Any + Graphics client data handle (ID3D12CommandQueue or Nvidia specific + data blob). + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUctxCigParam_st _pvt_val + cdef cydriver.CUctxCigParam_st* _pvt_ptr + cdef _HelperInputVoidPtr _cysharedData + +cdef class CUctxCreateParams_st: + """ + Params for creating CUDA context. Both execAffinityParams and + cigParams cannot be non-NULL at the same time. If both are NULL, + the context will be created as a regular CUDA context. + + Attributes + ---------- + execAffinityParams : CUexecAffinityParam + Array of execution affinity parameters to limit context resources + (e.g., SM count). Only supported Volta+ MPS. Mutually exclusive + with cigParams. + numExecAffinityParams : int + Number of elements in execAffinityParams array. Must be 0 if + execAffinityParams is NULL. + cigParams : CUctxCigParam + CIG (CUDA in Graphics) parameters for sharing data from + D3D12/Vulkan graphics clients. Mutually exclusive with + execAffinityParams. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUctxCreateParams_st _pvt_val + cdef cydriver.CUctxCreateParams_st* _pvt_ptr + cdef size_t _execAffinityParams_length + cdef cydriver.CUexecAffinityParam* _execAffinityParams + cdef size_t _cigParams_length + cdef cydriver.CUctxCigParam* _cigParams + +cdef class CUstreamCigParam_st: + """ + CIG Stream Capture Params + + Attributes + ---------- + streamSharedDataType : CUstreamCigDataType + Type of shared data from graphics client (D3D12). + streamSharedData : Any + Graphics client data handle + (ID3D12CommandList/ID3D12GraphicsCommandList). + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamCigParam_st _pvt_val + cdef cydriver.CUstreamCigParam_st* _pvt_ptr + cdef _HelperInputVoidPtr _cystreamSharedData + +cdef class CUstreamCigCaptureParams_st: + """ + Params for capturing CUDA stream to CIG streamCigParams must be + non-NULL. + + Attributes + ---------- + streamCigParams : CUstreamCigParam + CIG (CUDA in Graphics) parameters for sharing command list data + from D3D12 graphics clients. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamCigCaptureParams_st _pvt_val + cdef cydriver.CUstreamCigCaptureParams_st* _pvt_ptr + cdef size_t _streamCigParams_length + cdef cydriver.CUstreamCigParam* _streamCigParams + +cdef class CUlibraryHostUniversalFunctionAndDataTable_st: + """ + Attributes + ---------- + functionTable : Any + + functionWindowSize : size_t + + dataTable : Any + + dataWindowSize : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlibraryHostUniversalFunctionAndDataTable_st _pvt_val + cdef cydriver.CUlibraryHostUniversalFunctionAndDataTable_st* _pvt_ptr + cdef _HelperInputVoidPtr _cyfunctionTable + cdef _HelperInputVoidPtr _cydataTable + +cdef class CUDA_MEMCPY2D_st: + """ + 2D memory copy parameters + + Attributes + ---------- + srcXInBytes : size_t + Source X in bytes + srcY : size_t + Source Y + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + srcHost : Any + Source host pointer + srcDevice : CUdeviceptr + Source device pointer + srcArray : CUarray + Source array reference + srcPitch : size_t + Source pitch (ignored when src is array) + dstXInBytes : size_t + Destination X in bytes + dstY : size_t + Destination Y + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + dstHost : Any + Destination host pointer + dstDevice : CUdeviceptr + Destination device pointer + dstArray : CUarray + Destination array reference + dstPitch : size_t + Destination pitch (ignored when dst is array) + WidthInBytes : size_t + Width of 2D memory copy in bytes + Height : size_t + Height of 2D memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMCPY2D_st _pvt_val + cdef cydriver.CUDA_MEMCPY2D_st* _pvt_ptr + cdef _HelperInputVoidPtr _cysrcHost + cdef CUdeviceptr _srcDevice + cdef CUarray _srcArray + cdef _HelperInputVoidPtr _cydstHost + cdef CUdeviceptr _dstDevice + cdef CUarray _dstArray + +cdef class CUDA_MEMCPY3D_st: + """ + 3D memory copy parameters + + Attributes + ---------- + srcXInBytes : size_t + Source X in bytes + srcY : size_t + Source Y + srcZ : size_t + Source Z + srcLOD : size_t + Source LOD + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + srcHost : Any + Source host pointer + srcDevice : CUdeviceptr + Source device pointer + srcArray : CUarray + Source array reference + reserved0 : Any + Must be NULL + srcPitch : size_t + Source pitch (ignored when src is array) + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + dstXInBytes : size_t + Destination X in bytes + dstY : size_t + Destination Y + dstZ : size_t + Destination Z + dstLOD : size_t + Destination LOD + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + dstHost : Any + Destination host pointer + dstDevice : CUdeviceptr + Destination device pointer + dstArray : CUarray + Destination array reference + reserved1 : Any + Must be NULL + dstPitch : size_t + Destination pitch (ignored when dst is array) + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + WidthInBytes : size_t + Width of 3D memory copy in bytes + Height : size_t + Height of 3D memory copy + Depth : size_t + Depth of 3D memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMCPY3D_st _pvt_val + cdef cydriver.CUDA_MEMCPY3D_st* _pvt_ptr + cdef _HelperInputVoidPtr _cysrcHost + cdef CUdeviceptr _srcDevice + cdef CUarray _srcArray + cdef _HelperInputVoidPtr _cyreserved0 + cdef _HelperInputVoidPtr _cydstHost + cdef CUdeviceptr _dstDevice + cdef CUarray _dstArray + cdef _HelperInputVoidPtr _cyreserved1 + +cdef class CUDA_MEMCPY3D_PEER_st: + """ + 3D memory cross-context copy parameters + + Attributes + ---------- + srcXInBytes : size_t + Source X in bytes + srcY : size_t + Source Y + srcZ : size_t + Source Z + srcLOD : size_t + Source LOD + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + srcHost : Any + Source host pointer + srcDevice : CUdeviceptr + Source device pointer + srcArray : CUarray + Source array reference + srcContext : CUcontext + Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY) + srcPitch : size_t + Source pitch (ignored when src is array) + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + dstXInBytes : size_t + Destination X in bytes + dstY : size_t + Destination Y + dstZ : size_t + Destination Z + dstLOD : size_t + Destination LOD + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + dstHost : Any + Destination host pointer + dstDevice : CUdeviceptr + Destination device pointer + dstArray : CUarray + Destination array reference + dstContext : CUcontext + Destination context (ignored with dstMemoryType is + CU_MEMORYTYPE_ARRAY) + dstPitch : size_t + Destination pitch (ignored when dst is array) + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + WidthInBytes : size_t + Width of 3D memory copy in bytes + Height : size_t + Height of 3D memory copy + Depth : size_t + Depth of 3D memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMCPY3D_PEER_st _pvt_val + cdef cydriver.CUDA_MEMCPY3D_PEER_st* _pvt_ptr + cdef _HelperInputVoidPtr _cysrcHost + cdef CUdeviceptr _srcDevice + cdef CUarray _srcArray + cdef CUcontext _srcContext + cdef _HelperInputVoidPtr _cydstHost + cdef CUdeviceptr _dstDevice + cdef CUarray _dstArray + cdef CUcontext _dstContext + +cdef class CUDA_MEMCPY_NODE_PARAMS_st: + """ + Memcpy node parameters + + Attributes + ---------- + flags : int + Must be zero + reserved : int + Must be zero + copyCtx : CUcontext + Context on which to run the node + copyParams : CUDA_MEMCPY3D + Parameters for the memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMCPY_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_MEMCPY_NODE_PARAMS_st* _pvt_ptr + cdef CUcontext _copyCtx + cdef CUDA_MEMCPY3D _copyParams + +cdef class CUDA_ARRAY_DESCRIPTOR_st: + """ + Array descriptor + + Attributes + ---------- + Width : size_t + Width of array + Height : size_t + Height of array + Format : CUarray_format + Array format + NumChannels : unsigned int + Channels per array element + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_ARRAY_DESCRIPTOR_st _pvt_val + cdef cydriver.CUDA_ARRAY_DESCRIPTOR_st* _pvt_ptr + +cdef class CUDA_ARRAY3D_DESCRIPTOR_st: + """ + 3D array descriptor + + Attributes + ---------- + Width : size_t + Width of 3D array + Height : size_t + Height of 3D array + Depth : size_t + Depth of 3D array + Format : CUarray_format + Array format + NumChannels : unsigned int + Channels per array element + Flags : unsigned int + Flags + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR_st _pvt_val + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR_st* _pvt_ptr + +cdef class anon_struct6: + """ + Attributes + ---------- + width : unsigned int + + height : unsigned int + + depth : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st* _pvt_ptr + +cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: + """ + CUDA array sparse properties + + Attributes + ---------- + tileExtent : anon_struct6 + + miptailFirstLevel : unsigned int + First mip level at which the mip tail begins. + miptailSize : unsigned long long + Total size of the mip tail. + flags : unsigned int + Flags will either be zero or + CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st _pvt_val + cdef cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st* _pvt_ptr + cdef anon_struct6 _tileExtent + +cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: + """ + CUDA array memory requirements + + Attributes + ---------- + size : size_t + Total required memory size + alignment : size_t + alignment requirement + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_st _pvt_val + cdef cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_st* _pvt_ptr + +cdef class anon_struct7: + """ + Attributes + ---------- + hArray : CUarray + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + cdef CUarray _hArray + +cdef class anon_struct8: + """ + Attributes + ---------- + hMipmappedArray : CUmipmappedArray + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + cdef CUmipmappedArray _hMipmappedArray + +cdef class anon_struct9: + """ + Attributes + ---------- + devPtr : CUdeviceptr + + format : CUarray_format + + numChannels : unsigned int + + sizeInBytes : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + cdef CUdeviceptr _devPtr + +cdef class anon_struct10: + """ + Attributes + ---------- + devPtr : CUdeviceptr + + format : CUarray_format + + numChannels : unsigned int + + width : size_t + + height : size_t + + pitchInBytes : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + cdef CUdeviceptr _devPtr + +cdef class anon_struct11: + """ + Attributes + ---------- + reserved : list[int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + +cdef class anon_union4: + """ + Attributes + ---------- + array : anon_struct7 + + mipmap : anon_struct8 + + linear : anon_struct9 + + pitch2D : anon_struct10 + + reserved : anon_struct11 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + cdef anon_struct7 _array + cdef anon_struct8 _mipmap + cdef anon_struct9 _linear + cdef anon_struct10 _pitch2D + cdef anon_struct11 _reserved + +cdef class CUDA_RESOURCE_DESC_st: + """ + CUDA Resource descriptor + + Attributes + ---------- + resType : CUresourcetype + Resource type + res : anon_union4 + + flags : unsigned int + Flags (must be zero) + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _val_ptr + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + cdef anon_union4 _res + +cdef class CUDA_TEXTURE_DESC_st: + """ + Texture descriptor + + Attributes + ---------- + addressMode : list[CUaddress_mode] + Address modes + filterMode : CUfilter_mode + Filter mode + flags : unsigned int + Flags + maxAnisotropy : unsigned int + Maximum anisotropy ratio + mipmapFilterMode : CUfilter_mode + Mipmap filter mode + mipmapLevelBias : float + Mipmap level bias + minMipmapLevelClamp : float + Mipmap minimum level clamp + maxMipmapLevelClamp : float + Mipmap maximum level clamp + borderColor : list[float] + Border Color + reserved : list[int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_TEXTURE_DESC_st _pvt_val + cdef cydriver.CUDA_TEXTURE_DESC_st* _pvt_ptr + +cdef class CUDA_RESOURCE_VIEW_DESC_st: + """ + Resource view descriptor + + Attributes + ---------- + format : CUresourceViewFormat + Resource view format + width : size_t + Width of the resource view + height : size_t + Height of the resource view + depth : size_t + Depth of the resource view + firstMipmapLevel : unsigned int + First defined mipmap level + lastMipmapLevel : unsigned int + Last defined mipmap level + firstLayer : unsigned int + First layer index + lastLayer : unsigned int + Last layer index + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_VIEW_DESC_st _pvt_val + cdef cydriver.CUDA_RESOURCE_VIEW_DESC_st* _pvt_ptr + +cdef class CUtensorMap_st: + """ + Tensor map descriptor. Requires compiler support for aligning to + 128 bytes. + + Attributes + ---------- + opaque : list[cuuint64_t] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUtensorMap_st _pvt_val + cdef cydriver.CUtensorMap_st* _pvt_ptr + +cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: + """ + GPU Direct v3 tokens + + Attributes + ---------- + p2pToken : unsigned long long + + vaSpaceToken : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st _pvt_val + cdef cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st* _pvt_ptr + +cdef class CUDA_LAUNCH_PARAMS_st: + """ + Kernel launch parameters + + Attributes + ---------- + function : CUfunction + Kernel to launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + hStream : CUstream + Stream identifier + kernelParams : Any + Array of pointers to kernel parameters + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_LAUNCH_PARAMS_st _pvt_val + cdef cydriver.CUDA_LAUNCH_PARAMS_st* _pvt_ptr + cdef CUfunction _function + cdef CUstream _hStream + cdef _HelperKernelParams _cykernelParams + +cdef class anon_struct12: + """ + Attributes + ---------- + handle : Any + + name : Any + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _pvt_ptr + cdef _HelperInputVoidPtr _cyhandle + cdef _HelperInputVoidPtr _cyname + +cdef class anon_union5: + """ + Attributes + ---------- + fd : int + + win32 : anon_struct12 + + nvSciBufObject : Any + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _pvt_ptr + cdef anon_struct12 _win32 + cdef _HelperInputVoidPtr _cynvSciBufObject + +cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: + """ + External memory handle descriptor + + Attributes + ---------- + type : CUexternalMemoryHandleType + Type of the handle + handle : anon_union5 + + size : unsigned long long + Size of the memory allocation + flags : unsigned int + Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _val_ptr + cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _pvt_ptr + cdef anon_union5 _handle + +cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: + """ + External memory buffer descriptor + + Attributes + ---------- + offset : unsigned long long + Offset into the memory object where the buffer's base is + size : unsigned long long + Size of the buffer + flags : unsigned int + Flags reserved for future use. Must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st _pvt_val + cdef cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st* _pvt_ptr + +cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: + """ + External memory mipmap descriptor + + Attributes + ---------- + offset : unsigned long long + Offset into the memory object where the base level of the mipmap + chain is. + arrayDesc : CUDA_ARRAY3D_DESCRIPTOR + Format, dimension and type of base level of the mipmap chain + numLevels : unsigned int + Total number of levels in the mipmap chain + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st _pvt_val + cdef cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st* _pvt_ptr + cdef CUDA_ARRAY3D_DESCRIPTOR _arrayDesc + +cdef class anon_struct13: + """ + Attributes + ---------- + handle : Any + + name : Any + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _pvt_ptr + cdef _HelperInputVoidPtr _cyhandle + cdef _HelperInputVoidPtr _cyname + +cdef class anon_union6: + """ + Attributes + ---------- + fd : int + + win32 : anon_struct13 + + nvSciSyncObj : Any + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _pvt_ptr + cdef anon_struct13 _win32 + cdef _HelperInputVoidPtr _cynvSciSyncObj + +cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: + """ + External semaphore handle descriptor + + Attributes + ---------- + type : CUexternalSemaphoreHandleType + Type of the handle + handle : anon_union6 + + flags : unsigned int + Flags reserved for the future. Must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _val_ptr + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _pvt_ptr + cdef anon_union6 _handle + +cdef class anon_struct14: + """ + Attributes + ---------- + value : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr + +cdef class anon_union7: + """ + Attributes + ---------- + fence : Any + + reserved : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr + cdef _HelperInputVoidPtr _cyfence + +cdef class anon_struct15: + """ + Attributes + ---------- + key : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr + +cdef class anon_struct16: + """ + Attributes + ---------- + fence : anon_struct14 + + nvSciSync : anon_union7 + + keyedMutex : anon_struct15 + + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr + cdef anon_struct14 _fence + cdef anon_union7 _nvSciSync + cdef anon_struct15 _keyedMutex + +cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: + """ + External semaphore signal parameters + + Attributes + ---------- + params : anon_struct16 + + flags : unsigned int + Only when CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal a + CUexternalSemaphore of type + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is + CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC which + indicates that while signaling the CUexternalSemaphore, no memory + synchronization operations should be performed for any external + memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. + For all other types of CUexternalSemaphore, flags must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st _pvt_val + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr + cdef anon_struct16 _params + +cdef class anon_struct17: + """ + Attributes + ---------- + value : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr + +cdef class anon_union8: + """ + Attributes + ---------- + fence : Any + + reserved : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr + cdef _HelperInputVoidPtr _cyfence + +cdef class anon_struct18: + """ + Attributes + ---------- + key : unsigned long long + + timeoutMs : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr + +cdef class anon_struct19: + """ + Attributes + ---------- + fence : anon_struct17 + + nvSciSync : anon_union8 + + keyedMutex : anon_struct18 + + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr + cdef anon_struct17 _fence + cdef anon_union8 _nvSciSync + cdef anon_struct18 _keyedMutex + +cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: + """ + External semaphore wait parameters + + Attributes + ---------- + params : anon_struct19 + + flags : unsigned int + Only when CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on a + CUexternalSemaphore of type + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is + CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC which indicates + that while waiting for the CUexternalSemaphore, no memory + synchronization operations should be performed for any external + memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. + For all other types of CUexternalSemaphore, flags must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st _pvt_val + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr + cdef anon_struct19 _params + +cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: + """ + Semaphore signal node parameters + + Attributes + ---------- + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st* _pvt_ptr + cdef size_t _extSemArray_length + cdef cydriver.CUexternalSemaphore* _extSemArray + cdef size_t _paramsArray_length + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* _paramsArray + +cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: + """ + Semaphore signal node parameters + + Attributes + ---------- + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st* _pvt_ptr + cdef size_t _extSemArray_length + cdef cydriver.CUexternalSemaphore* _extSemArray + cdef size_t _paramsArray_length + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* _paramsArray + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: + """ + Semaphore wait node parameters + + Attributes + ---------- + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_st* _pvt_ptr + cdef size_t _extSemArray_length + cdef cydriver.CUexternalSemaphore* _extSemArray + cdef size_t _paramsArray_length + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* _paramsArray + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: + """ + Semaphore wait node parameters + + Attributes + ---------- + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st* _pvt_ptr + cdef size_t _extSemArray_length + cdef cydriver.CUexternalSemaphore* _extSemArray + cdef size_t _paramsArray_length + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* _paramsArray + +cdef class anon_union9: + """ + Attributes + ---------- + mipmap : CUmipmappedArray + + array : CUarray + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + cdef CUmipmappedArray _mipmap + cdef CUarray _array + +cdef class anon_struct20: + """ + Attributes + ---------- + level : unsigned int + + layer : unsigned int + + offsetX : unsigned int + + offsetY : unsigned int + + offsetZ : unsigned int + + extentWidth : unsigned int + + extentHeight : unsigned int + + extentDepth : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + +cdef class anon_struct21: + """ + Attributes + ---------- + layer : unsigned int + + offset : unsigned long long + + size : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + +cdef class anon_union10: + """ + Attributes + ---------- + sparseLevel : anon_struct20 + + miptail : anon_struct21 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + cdef anon_struct20 _sparseLevel + cdef anon_struct21 _miptail + +cdef class anon_union11: + """ + Attributes + ---------- + memHandle : CUmemGenericAllocationHandle + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + cdef CUmemGenericAllocationHandle _memHandle + +cdef class CUarrayMapInfo_st: + """ + Specifies the CUDA array or CUDA mipmapped array memory mapping + information + + Attributes + ---------- + resourceType : CUresourcetype + Resource type + resource : anon_union9 + + subresourceType : CUarraySparseSubresourceType + Sparse subresource type + subresource : anon_union10 + + memOperationType : CUmemOperationType + Memory operation type + memHandleType : CUmemHandleType + Memory handle type + memHandle : anon_union11 + + offset : unsigned long long + Offset within mip tail Offset within the memory + deviceBitMask : unsigned int + Device ordinal bit mask + flags : unsigned int + flags for future use, must be zero now. + reserved : list[unsigned int] + Reserved for future use, must be zero now. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _val_ptr + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + cdef anon_union9 _resource + cdef anon_union10 _subresource + cdef anon_union11 _memHandle + +cdef class CUmemLocation_st: + """ + Specifies a memory location. + + Attributes + ---------- + type : CUmemLocationType + Specifies the location type, which modifies the meaning of id. + id : int + Identifier for CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemLocation_st* _val_ptr + cdef cydriver.CUmemLocation_st* _pvt_ptr + +cdef class anon_struct22: + """ + Attributes + ---------- + compressionType : bytes + + gpuDirectRDMACapable : bytes + + usage : unsigned short + + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemAllocationProp_st* _pvt_ptr + +cdef class CUmemAllocationProp_st: + """ + Specifies the allocation properties for a allocation. + + Attributes + ---------- + type : CUmemAllocationType + Allocation type + requestedHandleTypes : CUmemAllocationHandleType + requested CUmemAllocationHandleType + location : CUmemLocation + Location of allocation + win32HandleMetaData : Any + Windows-specific POBJECT_ATTRIBUTES required when + CU_MEM_HANDLE_TYPE_WIN32 is specified. This object attributes + structure includes security attributes that define the scope of + which exported allocations may be transferred to other processes. + In all other cases, this field is required to be zero. + allocFlags : anon_struct22 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemAllocationProp_st _pvt_val + cdef cydriver.CUmemAllocationProp_st* _pvt_ptr + cdef CUmemLocation _location + cdef _HelperInputVoidPtr _cywin32HandleMetaData + cdef anon_struct22 _allocFlags + +cdef class CUmulticastObjectProp_st: + """ + Specifies the properties for a multicast object. + + Attributes + ---------- + numDevices : unsigned int + The number of devices in the multicast team that will bind memory + to this object + size : size_t + The maximum amount of memory that can be bound to this multicast + object per device + handleTypes : unsigned long long + Bitmask of exportable handle types (see CUmemAllocationHandleType) + for this object + flags : unsigned long long + Flags for future use, must be zero now + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmulticastObjectProp_st _pvt_val + cdef cydriver.CUmulticastObjectProp_st* _pvt_ptr + +cdef class CUmemAccessDesc_st: + """ + Memory access descriptor + + Attributes + ---------- + location : CUmemLocation + Location on which the request is to change it's accessibility + flags : CUmemAccess_flags + ::CUmemProt accessibility flags to set on the request + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemAccessDesc_st _pvt_val + cdef cydriver.CUmemAccessDesc_st* _pvt_ptr + cdef CUmemLocation _location + +cdef class CUgraphExecUpdateResultInfo_st: + """ + Result information returned by cuGraphExecUpdate + + Attributes + ---------- + result : CUgraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + errorNode : CUgraphNode + The "to node" of the error edge when the topologies do not match. + The error node when the error is associated with a specific node. + NULL when the error is generic. + errorFromNode : CUgraphNode + The from node of error edge when the topologies do not match. + Otherwise NULL. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUgraphExecUpdateResultInfo_st _pvt_val + cdef cydriver.CUgraphExecUpdateResultInfo_st* _pvt_ptr + cdef CUgraphNode _errorNode + cdef CUgraphNode _errorFromNode + +cdef class CUmemPoolProps_st: + """ + Specifies the properties of allocations made from the pool. + + Attributes + ---------- + allocType : CUmemAllocationType + Allocation type. Currently must be specified as + CU_MEM_ALLOCATION_TYPE_PINNED + handleTypes : CUmemAllocationHandleType + Handle types that will be supported by allocations from the pool. + location : CUmemLocation + Location where allocations should reside. + win32SecurityAttributes : Any + Windows-specific LPSECURITYATTRIBUTES required when + CU_MEM_HANDLE_TYPE_WIN32 is specified. This security attribute + defines the scope of which exported allocations may be transferred + to other processes. In all other cases, this field is required to + be zero. + maxSize : size_t + Maximum pool size. When set to 0, defaults to a system dependent + value. + usage : unsigned short + Bitmask indicating intended usage for the pool. + reserved : bytes + reserved for future use, must be 0 + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemPoolProps_st _pvt_val + cdef cydriver.CUmemPoolProps_st* _pvt_ptr + cdef CUmemLocation _location + cdef _HelperInputVoidPtr _cywin32SecurityAttributes + +cdef class CUmemPoolPtrExportData_st: + """ + Opaque data for exporting a pool allocation + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemPoolPtrExportData_st _pvt_val + cdef cydriver.CUmemPoolPtrExportData_st* _pvt_ptr + +cdef class CUmemcpyAttributes_st: + """ + Attributes specific to copies within a batch. For more details on + usage see cuMemcpyBatchAsync. + + Attributes + ---------- + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copies with this + attribute. + srcLocHint : CUmemLocation + Hint location for the source operand. Ignored when the pointers are + not managed memory or memory allocated outside CUDA. + dstLocHint : CUmemLocation + Hint location for the destination operand. Ignored when the + pointers are not managed memory or memory allocated outside CUDA. + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemcpyAttributes_st _pvt_val + cdef cydriver.CUmemcpyAttributes_st* _pvt_ptr + cdef CUmemLocation _srcLocHint + cdef CUmemLocation _dstLocHint + +cdef class CUoffset3D_st: + """ + Struct representing a 3D offset + + Attributes + ---------- + x : size_t + + y : size_t + + z : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUoffset3D_st _pvt_val + cdef cydriver.CUoffset3D_st* _pvt_ptr + +cdef class CUextent3D_st: + """ + Struct representing width/height/depth of a CUarray in elements + + Attributes + ---------- + width : size_t + + height : size_t + + depth : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUextent3D_st _pvt_val + cdef cydriver.CUextent3D_st* _pvt_ptr + +cdef class anon_struct23: + """ + Attributes + ---------- + ptr : CUdeviceptr + + rowLength : size_t + + layerHeight : size_t + + locHint : CUmemLocation + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr + cdef CUdeviceptr _ptr + cdef CUmemLocation _locHint + +cdef class anon_struct24: + """ + Attributes + ---------- + array : CUarray + + offset : CUoffset3D + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr + cdef CUarray _array + cdef CUoffset3D _offset + +cdef class anon_union13: + """ + Attributes + ---------- + ptr : anon_struct23 + + array : anon_struct24 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr + cdef anon_struct23 _ptr + cdef anon_struct24 _array + +cdef class CUmemcpy3DOperand_st: + """ + Struct representing an operand for copy with cuMemcpy3DBatchAsync + + Attributes + ---------- + type : CUmemcpy3DOperandType + + op : anon_union13 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemcpy3DOperand_st* _val_ptr + cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr + cdef anon_union13 _op + +cdef class CUDA_MEMCPY3D_BATCH_OP_st: + """ + Attributes + ---------- + src : CUmemcpy3DOperand + Source memcpy operand. + dst : CUmemcpy3DOperand + Destination memcpy operand. + extent : CUextent3D + Extents of the memcpy between src and dst. The width, height and + depth components must not be 0. + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copy from src to dst. + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMCPY3D_BATCH_OP_st _pvt_val + cdef cydriver.CUDA_MEMCPY3D_BATCH_OP_st* _pvt_ptr + cdef CUmemcpy3DOperand _src + cdef CUmemcpy3DOperand _dst + cdef CUextent3D _extent + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: + """ + Memory allocation node parameters + + Attributes + ---------- + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + bytesize : size_t + in: size in bytes of the requested allocation + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v1_st _pvt_val + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v1_st* _pvt_ptr + cdef CUmemPoolProps _poolProps + cdef size_t _accessDescs_length + cdef cydriver.CUmemAccessDesc* _accessDescs + cdef CUdeviceptr _dptr + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: + """ + Memory allocation node parameters + + Attributes + ---------- + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + bytesize : size_t + in: size in bytes of the requested allocation + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v2_st* _pvt_ptr + cdef CUmemPoolProps _poolProps + cdef size_t _accessDescs_length + cdef cydriver.CUmemAccessDesc* _accessDescs + cdef CUdeviceptr _dptr + +cdef class CUDA_MEM_FREE_NODE_PARAMS_st: + """ + Memory free node parameters + + Attributes + ---------- + dptr : CUdeviceptr + in: the pointer to free + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEM_FREE_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_MEM_FREE_NODE_PARAMS_st* _pvt_ptr + cdef CUdeviceptr _dptr + +cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: + """ + Child graph node parameters + + Attributes + ---------- + graph : CUgraph + The child graph to clone into the node for node creation, or a + handle to the graph owned by the node for node query. The graph + must not contain conditional nodes. Graphs containing memory + allocation or memory free nodes must set the ownership to be moved + to the parent. + ownership : CUgraphChildGraphNodeOwnership + The ownership relationship of the child graph node. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_CHILD_GRAPH_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_CHILD_GRAPH_NODE_PARAMS_st* _pvt_ptr + cdef CUgraph _graph + +cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: + """ + Event record node parameters + + Attributes + ---------- + event : CUevent + The event to record when the node executes + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st* _pvt_ptr + cdef CUevent _event + +cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: + """ + Event wait node parameters + + Attributes + ---------- + event : CUevent + The event to wait on from the node + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EVENT_WAIT_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_EVENT_WAIT_NODE_PARAMS_st* _pvt_ptr + cdef CUevent _event + +cdef class CUgraphNodeParams_st: + """ + Graph node parameters. See cuGraphAddNode. + + Attributes + ---------- + type : CUgraphNodeType + Type of the node + reserved0 : list[int] + Reserved. Must be zero. + reserved1 : list[long long] + Padding. Unused bytes must be zero. + kernel : CUDA_KERNEL_NODE_PARAMS_v3 + Kernel node parameters. + memcpy : CUDA_MEMCPY_NODE_PARAMS + Memcpy node parameters. + memset : CUDA_MEMSET_NODE_PARAMS_v2 + Memset node parameters. + host : CUDA_HOST_NODE_PARAMS_v2 + Host node parameters. + graph : CUDA_CHILD_GRAPH_NODE_PARAMS + Child graph node parameters. + eventWait : CUDA_EVENT_WAIT_NODE_PARAMS + Event wait node parameters. + eventRecord : CUDA_EVENT_RECORD_NODE_PARAMS + Event record node parameters. + extSemSignal : CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 + External semaphore signal node parameters. + extSemWait : CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 + External semaphore wait node parameters. + alloc : CUDA_MEM_ALLOC_NODE_PARAMS_v2 + Memory allocation node parameters. + free : CUDA_MEM_FREE_NODE_PARAMS + Memory free node parameters. + memOp : CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 + MemOp node parameters. + conditional : CUDA_CONDITIONAL_NODE_PARAMS + Conditional node parameters. + asBytes : bytes + Padding as bytes + reserved2 : long long + Reserved bytes. Must be zero. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUgraphNodeParams_st* _val_ptr + cdef cydriver.CUgraphNodeParams_st* _pvt_ptr + cdef CUDA_KERNEL_NODE_PARAMS_v3 _kernel + cdef CUDA_MEMCPY_NODE_PARAMS _memcpy + cdef CUDA_MEMSET_NODE_PARAMS_v2 _memset + cdef CUDA_HOST_NODE_PARAMS_v2 _host + cdef CUDA_CHILD_GRAPH_NODE_PARAMS _graph + cdef CUDA_EVENT_WAIT_NODE_PARAMS _eventWait + cdef CUDA_EVENT_RECORD_NODE_PARAMS _eventRecord + cdef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 _extSemSignal + cdef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 _extSemWait + cdef CUDA_MEM_ALLOC_NODE_PARAMS_v2 _alloc + cdef CUDA_MEM_FREE_NODE_PARAMS _free + cdef CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 _memOp + cdef CUDA_CONDITIONAL_NODE_PARAMS _conditional + +cdef class CUcheckpointLockArgs_st: + """ + CUDA checkpoint optional lock arguments + + Attributes + ---------- + timeoutMs : unsigned int + Timeout in milliseconds to attempt to lock the process, 0 indicates + no timeout + reserved0 : unsigned int + Reserved for future use, must be zero + reserved1 : list[cuuint64_t] + Reserved for future use, must be zeroed + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointLockArgs_st _pvt_val + cdef cydriver.CUcheckpointLockArgs_st* _pvt_ptr + +cdef class CUcheckpointCheckpointArgs_st: + """ + CUDA checkpoint optional checkpoint arguments + + Attributes + ---------- + reserved : list[cuuint64_t] + Reserved for future use, must be zeroed + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointCheckpointArgs_st _pvt_val + cdef cydriver.CUcheckpointCheckpointArgs_st* _pvt_ptr + +cdef class CUcheckpointGpuPair_st: + """ + CUDA checkpoint GPU UUID pairs for device remapping during restore + + Attributes + ---------- + oldUuid : CUuuid + UUID of the GPU that was checkpointed + newUuid : CUuuid + UUID of the GPU to restore onto + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointGpuPair_st _pvt_val + cdef cydriver.CUcheckpointGpuPair_st* _pvt_ptr + cdef CUuuid _oldUuid + cdef CUuuid _newUuid + +cdef class CUcheckpointRestoreArgs_st: + """ + CUDA checkpoint optional restore arguments + + Attributes + ---------- + gpuPairs : CUcheckpointGpuPair + Pointer to array of gpu pairs that indicate how to remap GPUs + during restore + gpuPairsCount : unsigned int + Number of gpu pairs to remap + reserved : bytes + Reserved for future use, must be zeroed + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointRestoreArgs_st _pvt_val + cdef cydriver.CUcheckpointRestoreArgs_st* _pvt_ptr + cdef size_t _gpuPairs_length + cdef cydriver.CUcheckpointGpuPair* _gpuPairs + +cdef class CUcheckpointUnlockArgs_st: + """ + CUDA checkpoint optional unlock arguments + + Attributes + ---------- + reserved : list[cuuint64_t] + Reserved for future use, must be zeroed + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointUnlockArgs_st _pvt_val + cdef cydriver.CUcheckpointUnlockArgs_st* _pvt_ptr + +cdef class CUmemDecompressParams_st: + """ + Structure describing the parameters that compose a single + decompression operation. + + Attributes + ---------- + srcNumBytes : size_t + The number of bytes to be read and decompressed from + CUmemDecompressParams_st.src. + dstNumBytes : size_t + The number of bytes that the decompression operation will be + expected to write to CUmemDecompressParams_st.dst. This value is + optional; if present, it may be used by the CUDA driver as a + heuristic for scheduling the individual decompression operations. + dstActBytes : cuuint32_t + After the decompression operation has completed, the actual number + of bytes written to CUmemDecompressParams.dst will be recorded as a + 32-bit unsigned integer in the memory at this address. + src : Any + Pointer to a buffer of at least + CUmemDecompressParams_st.srcNumBytes compressed bytes. + dst : Any + Pointer to a buffer where the decompressed data will be written. + The number of bytes written to this location will be recorded in + the memory pointed to by CUmemDecompressParams_st.dstActBytes + algo : CUmemDecompressAlgorithm + The decompression algorithm to use. + padding : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemDecompressParams_st _pvt_val + cdef cydriver.CUmemDecompressParams_st* _pvt_ptr + cdef _HelperInputVoidPtr _cysrc + cdef _HelperInputVoidPtr _cydst + +cdef class CUlogicalEndpointFabricHandle_st: + """ + Fabric handle for a logical endpoint + + Attributes + ---------- + data : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlogicalEndpointFabricHandle_st _pvt_val + cdef cydriver.CUlogicalEndpointFabricHandle_st* _pvt_ptr + +cdef class anon_struct25: + """ + Attributes + ---------- + device : CUdevice + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlogicalEndpointProp_struct* _pvt_ptr + cdef CUdevice _device + +cdef class anon_struct26: + """ + Attributes + ---------- + numDevices : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlogicalEndpointProp_struct* _pvt_ptr + +cdef class CUlogicalEndpointProp_struct: + """ + Properties of a logical endpoint construction + + Attributes + ---------- + type : CUlogicalEndpointType + Type of the logical endpoint defined in CUlogicalEndpointType + unicast : anon_struct25 + + multicast : anon_struct26 + + size : unsigned long long + Size of the logical endpoint + ipcHandleTypes : unsigned int + A bitmask of IPC handle types defined in + CUlogicalEndpointIpcHandleType + flags : unsigned int + A bitmask of flags defined in CUlogicalEndpointFlag + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlogicalEndpointProp_struct* _val_ptr + cdef cydriver.CUlogicalEndpointProp_struct* _pvt_ptr + cdef anon_struct25 _unicast + cdef anon_struct26 _multicast + +cdef class CUdevSmResource_st: + """ + Attributes + ---------- + smCount : unsigned int + The amount of streaming multiprocessors available in this resource. + minSmPartitionSize : unsigned int + The minimum number of streaming multiprocessors required to + partition this resource. + smCoscheduledAlignment : unsigned int + The number of streaming multiprocessors in this resource that are + guaranteed to be co-scheduled on the same GPU processing cluster. + smCount will be a multiple of this value, unless the backfill flag + is set. + flags : unsigned int + The flags set on this SM resource. For possible values see + CUdevSmResourceGroup_flags. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUdevSmResource_st _pvt_val + cdef cydriver.CUdevSmResource_st* _pvt_ptr + +cdef class CUdevWorkqueueConfigResource_st: + """ + Attributes + ---------- + device : CUdevice + The device on which the workqueue resources are available + wqConcurrencyLimit : unsigned int + The expected maximum number of concurrent stream-ordered workloads + sharingScope : CUdevWorkqueueConfigScope + The sharing scope for the workqueue resources + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUdevWorkqueueConfigResource_st _pvt_val + cdef cydriver.CUdevWorkqueueConfigResource_st* _pvt_ptr + cdef CUdevice _device + +cdef class CUdevWorkqueueResource_st: + """ + Attributes + ---------- + reserved : bytes + Reserved for future use + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUdevWorkqueueResource_st _pvt_val + cdef cydriver.CUdevWorkqueueResource_st* _pvt_ptr + +cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: + """ + Attributes + ---------- + smCount : unsigned int + The amount of SMs available in this resource. + coscheduledSmCount : unsigned int + The amount of co-scheduled SMs grouped together for locality + purposes. + preferredCoscheduledSmCount : unsigned int + When possible, combine co-scheduled groups together into larger + groups of this size. + flags : unsigned int + The flags set on this SM resource group. For possible values see + CUdevSmResourceGroup_flags. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS_st _pvt_val + cdef cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS_st* _pvt_ptr + +cdef class CUdevResource_st: + """ + Attributes + ---------- + type : CUdevResourceType + Type of resource, dictates which union field was last set + _internal_padding : bytes + + sm : CUdevSmResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `typename`. + wqConfig : CUdevWorkqueueConfigResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG + `typename`. + wq : CUdevWorkqueueResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE + `typename`. + _oversize : bytes + + nextResource : CUdevResource_st + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUdevResource_st* _val_ptr + cdef cydriver.CUdevResource_st* _pvt_ptr + cdef CUdevSmResource _sm + cdef CUdevWorkqueueConfigResource _wqConfig + cdef CUdevWorkqueueResource _wq + cdef size_t _nextResource_length + cdef cydriver.CUdevResource_st* _nextResource + +cdef class anon_union17: + """ + Attributes + ---------- + pArray : list[CUarray] + + pPitch : list[Any] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUeglFrame_st* _pvt_ptr + +cdef class CUeglFrame_st: + """ + CUDA EGLFrame structure Descriptor - structure defining one frame + of EGL. Each frame may contain one or more planes depending on + whether the surface * is Multiplanar or not. + + Attributes + ---------- + frame : anon_union17 + + width : unsigned int + Width of first plane + height : unsigned int + Height of first plane + depth : unsigned int + Depth of first plane + pitch : unsigned int + Pitch of first plane + planeCount : unsigned int + Number of planes + numChannels : unsigned int + Number of channels for the plane + frameType : CUeglFrameType + Array or Pitch + eglColorFormat : CUeglColorFormat + CUDA EGL Color Format + cuFormat : CUarray_format + CUDA Array Format + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUeglFrame_st* _val_ptr + cdef cydriver.CUeglFrame_st* _pvt_ptr + cdef anon_union17 _frame + +cdef class CUdeviceptr: + """ + + CUDA device pointer CUdeviceptr is defined as an unsigned integer type whose size matches the size of a pointer on the target platform. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUdeviceptr _pvt_val + cdef cydriver.CUdeviceptr* _pvt_ptr + +cdef class CUdevice: + """ + + CUDA device + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUdevice _pvt_val + cdef cydriver.CUdevice* _pvt_ptr + +cdef class CUtexObject: + """ + + An opaque value that represents a CUDA texture object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUtexObject _pvt_val + cdef cydriver.CUtexObject* _pvt_ptr + +cdef class CUsurfObject: + """ + + An opaque value that represents a CUDA surface object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUsurfObject _pvt_val + cdef cydriver.CUsurfObject* _pvt_ptr + +cdef class CUgraphConditionalHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphConditionalHandle _pvt_val + cdef cydriver.CUgraphConditionalHandle* _pvt_ptr + +cdef class CUuuid(CUuuid_st): + """ + Attributes + ---------- + bytes : bytes + < CUDA definition of UUID + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemFabricHandle_v1(CUmemFabricHandle_st): + """ + Fabric handle - An opaque handle representing a memory allocation + that can be exported to processes in same or different nodes. For + IPC between processes on different nodes they must be connected via + the NVSwitch fabric. + + Attributes + ---------- + data : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemFabricHandle(CUmemFabricHandle_v1): + """ + Fabric handle - An opaque handle representing a memory allocation + that can be exported to processes in same or different nodes. For + IPC between processes on different nodes they must be connected via + the NVSwitch fabric. + + Attributes + ---------- + data : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUipcEventHandle_v1(CUipcEventHandle_st): + """ + CUDA IPC event handle + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUipcEventHandle(CUipcEventHandle_v1): + """ + CUDA IPC event handle + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUipcMemHandle_v1(CUipcMemHandle_st): + """ + CUDA IPC mem handle + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUipcMemHandle(CUipcMemHandle_v1): + """ + CUDA IPC mem handle + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUstreamBatchMemOpParams_v1(CUstreamBatchMemOpParams_union): + """ + Per-operation parameters for cuStreamBatchMemOp + + Attributes + ---------- + operation : CUstreamBatchMemOpType + Operation. This is the first field of all the union elemets and + acts as a TAG to determine which union member is valid. + waitValue : CUstreamMemOpWaitValueParams_st + Params for CU_STREAM_MEM_OP_WAIT_VALUE_32 and + CU_STREAM_MEM_OP_WAIT_VALUE_64 operations. + writeValue : CUstreamMemOpWriteValueParams_st + Params for CU_STREAM_MEM_OP_WRITE_VALUE_32 and + CU_STREAM_MEM_OP_WRITE_VALUE_64 operations. + flushRemoteWrites : CUstreamMemOpFlushRemoteWritesParams_st + Params for CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES operations. + memoryBarrier : CUstreamMemOpMemoryBarrierParams_st + Params for CU_STREAM_MEM_OP_BARRIER operations. + atomicReduction : CUstreamMemOpAtomicReductionParams_st + + pad : list[cuuint64_t] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUstreamBatchMemOpParams(CUstreamBatchMemOpParams_v1): + """ + Per-operation parameters for cuStreamBatchMemOp + + Attributes + ---------- + operation : CUstreamBatchMemOpType + Operation. This is the first field of all the union elemets and + acts as a TAG to determine which union member is valid. + waitValue : CUstreamMemOpWaitValueParams_st + Params for CU_STREAM_MEM_OP_WAIT_VALUE_32 and + CU_STREAM_MEM_OP_WAIT_VALUE_64 operations. + writeValue : CUstreamMemOpWriteValueParams_st + Params for CU_STREAM_MEM_OP_WRITE_VALUE_32 and + CU_STREAM_MEM_OP_WRITE_VALUE_64 operations. + flushRemoteWrites : CUstreamMemOpFlushRemoteWritesParams_st + Params for CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES operations. + memoryBarrier : CUstreamMemOpMemoryBarrierParams_st + Params for CU_STREAM_MEM_OP_BARRIER operations. + atomicReduction : CUstreamMemOpAtomicReductionParams_st + + pad : list[cuuint64_t] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st): + """ + Batch memory operation node parameters Used in the legacy + cuGraphAddBatchMemOpNode api. New code should use cuGraphAddNode() + + Attributes + ---------- + ctx : CUcontext + + count : unsigned int + + paramArray : CUstreamBatchMemOpParams + + flags : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1): + """ + Batch memory operation node parameters Used in the legacy + cuGraphAddBatchMemOpNode api. New code should use cuGraphAddNode() + + Attributes + ---------- + ctx : CUcontext + + count : unsigned int + + paramArray : CUstreamBatchMemOpParams + + flags : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2(CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st): + """ + Batch memory operation node parameters + + Attributes + ---------- + ctx : CUcontext + Context to use for the operations. + count : unsigned int + Number of operations in paramArray. + paramArray : CUstreamBatchMemOpParams + Array of batch memory operations. + flags : unsigned int + Flags to control the node. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUasyncNotificationInfo(CUasyncNotificationInfo_st): + """ + Information passed to the user via the async notification callback + + Attributes + ---------- + type : CUasyncNotificationType + The type of notification being sent + info : anon_union2 + Information about the notification. `typename` must be checked in + order to interpret this field. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevprop_v1(CUdevprop_st): + """ + Legacy device properties + + Attributes + ---------- + maxThreadsPerBlock : int + Maximum number of threads per block + maxThreadsDim : list[int] + Maximum size of each dimension of a block + maxGridSize : list[int] + Maximum size of each dimension of a grid + sharedMemPerBlock : int + Shared memory available per block in bytes + totalConstantMemory : int + Constant memory available on device in bytes + SIMDWidth : int + Warp size in threads + memPitch : int + Maximum pitch in bytes allowed by memory copies + regsPerBlock : int + 32-bit registers available per block + clockRate : int + Clock frequency in kilohertz + textureAlign : int + Alignment requirement for textures + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevprop(CUdevprop_v1): + """ + Legacy device properties + + Attributes + ---------- + maxThreadsPerBlock : int + Maximum number of threads per block + maxThreadsDim : list[int] + Maximum size of each dimension of a block + maxGridSize : list[int] + Maximum size of each dimension of a grid + sharedMemPerBlock : int + Shared memory available per block in bytes + totalConstantMemory : int + Constant memory available on device in bytes + SIMDWidth : int + Warp size in threads + memPitch : int + Maximum pitch in bytes allowed by memory copies + regsPerBlock : int + 32-bit registers available per block + clockRate : int + Clock frequency in kilohertz + textureAlign : int + Alignment requirement for textures + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUaccessPolicyWindow_v1(CUaccessPolicyWindow_st): + """ + Specifies an access policy for a window, a contiguous extent of + memory beginning at base_ptr and ending at base_ptr + num_bytes. + num_bytes is limited by + CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE. Partition into + many segments and assign segments such that: sum of "hit segments" + / window == approx. ratio. sum of "miss segments" / window == + approx 1-ratio. Segments and ratio specifications are fitted to the + capabilities of the architecture. Accesses in a hit segment apply + the hitProp access policy. Accesses in a miss segment apply the + missProp access policy. + + Attributes + ---------- + base_ptr : Any + Starting address of the access policy window. CUDA driver may align + it. + num_bytes : size_t + Size in bytes of the window policy. CUDA driver may restrict the + maximum size and alignment. + hitRatio : float + hitRatio specifies percentage of lines assigned hitProp, rest are + assigned missProp. + hitProp : CUaccessProperty + CUaccessProperty set for hit. + missProp : CUaccessProperty + CUaccessProperty set for miss. Must be either NORMAL or STREAMING + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUaccessPolicyWindow(CUaccessPolicyWindow_v1): + """ + Specifies an access policy for a window, a contiguous extent of + memory beginning at base_ptr and ending at base_ptr + num_bytes. + num_bytes is limited by + CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE. Partition into + many segments and assign segments such that: sum of "hit segments" + / window == approx. ratio. sum of "miss segments" / window == + approx 1-ratio. Segments and ratio specifications are fitted to the + capabilities of the architecture. Accesses in a hit segment apply + the hitProp access policy. Accesses in a miss segment apply the + missProp access policy. + + Attributes + ---------- + base_ptr : Any + Starting address of the access policy window. CUDA driver may align + it. + num_bytes : size_t + Size in bytes of the window policy. CUDA driver may restrict the + maximum size and alignment. + hitRatio : float + hitRatio specifies percentage of lines assigned hitProp, rest are + assigned missProp. + hitProp : CUaccessProperty + CUaccessProperty set for hit. + missProp : CUaccessProperty + CUaccessProperty set for miss. Must be either NORMAL or STREAMING + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_KERNEL_NODE_PARAMS_v1(CUDA_KERNEL_NODE_PARAMS_st): + """ + GPU kernel node parameters + + Attributes + ---------- + func : CUfunction + Kernel to launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + kernelParams : Any + Array of pointers to kernel parameters + extra : Any + Extra options + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_KERNEL_NODE_PARAMS_v2(CUDA_KERNEL_NODE_PARAMS_v2_st): + """ + GPU kernel node parameters + + Attributes + ---------- + func : CUfunction + Kernel to launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + kernelParams : Any + Array of pointers to kernel parameters + extra : Any + Extra options + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + ctx : CUcontext + Context for the kernel task to run in. The value NULL will indicate + the current context should be used by the api. This field is + ignored if func is set. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_KERNEL_NODE_PARAMS(CUDA_KERNEL_NODE_PARAMS_v2): + """ + GPU kernel node parameters + + Attributes + ---------- + func : CUfunction + Kernel to launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + kernelParams : Any + Array of pointers to kernel parameters + extra : Any + Extra options + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + ctx : CUcontext + Context for the kernel task to run in. The value NULL will indicate + the current context should be used by the api. This field is + ignored if func is set. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_KERNEL_NODE_PARAMS_v3(CUDA_KERNEL_NODE_PARAMS_v3_st): + """ + GPU kernel node parameters + + Attributes + ---------- + func : CUfunction + Kernel to launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + kernelParams : Any + Array of pointers to kernel parameters + extra : Any + Extra options + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + ctx : CUcontext + Context for the kernel task to run in. The value NULL will indicate + the current context should be used by the api. This field is + ignored if func is set. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMSET_NODE_PARAMS_v1(CUDA_MEMSET_NODE_PARAMS_st): + """ + Memset node parameters + + Attributes + ---------- + dst : CUdeviceptr + Destination device pointer + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + value : unsigned int + Value to be set + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + width : size_t + Width of the row in elements + height : size_t + Number of rows + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMSET_NODE_PARAMS(CUDA_MEMSET_NODE_PARAMS_v1): + """ + Memset node parameters + + Attributes + ---------- + dst : CUdeviceptr + Destination device pointer + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + value : unsigned int + Value to be set + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + width : size_t + Width of the row in elements + height : size_t + Number of rows + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMSET_NODE_PARAMS_v2(CUDA_MEMSET_NODE_PARAMS_v2_st): + """ + Memset node parameters + + Attributes + ---------- + dst : CUdeviceptr + Destination device pointer + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + value : unsigned int + Value to be set + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + width : size_t + Width of the row in elements + height : size_t + Number of rows + ctx : CUcontext + Context on which to run the node + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_HOST_NODE_PARAMS_v1(CUDA_HOST_NODE_PARAMS_st): + """ + Host node parameters + + Attributes + ---------- + fn : CUhostFn + The function to call when the node executes + userData : Any + Argument to pass to the function + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_HOST_NODE_PARAMS(CUDA_HOST_NODE_PARAMS_v1): + """ + Host node parameters + + Attributes + ---------- + fn : CUhostFn + The function to call when the node executes + userData : Any + Argument to pass to the function + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_HOST_NODE_PARAMS_v2(CUDA_HOST_NODE_PARAMS_v2_st): + """ + Host node parameters + + Attributes + ---------- + fn : CUhostFn + The function to call when the node executes + userData : Any + Argument to pass to the function + syncMode : unsigned int + The sync mode to use for the host task + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUgraphEdgeData(CUgraphEdgeData_st): + """ + Optional annotation for edges in a CUDA graph. Note, all edges + implicitly have annotations and default to a zero-initialized value + if not specified. A zero-initialized struct indicates a standard + full serialization of two nodes with memory visibility. + + Attributes + ---------- + from_port : bytes + This indicates when the dependency is triggered from the upstream + node on the edge. The meaning is specfic to the node type. A value + of 0 in all cases means full completion of the upstream node, with + memory visibility to the downstream node or portion thereof + (indicated by `to_port`). Only kernel nodes define non-zero + ports. A kernel node can use the following output port types: + CU_GRAPH_KERNEL_NODE_PORT_DEFAULT, + CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC, or + CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER. + to_port : bytes + This indicates what portion of the downstream node is dependent on + the upstream node or portion thereof (indicated by `from_port`). + The meaning is specific to the node type. A value of 0 in all cases + means the entirety of the downstream node is dependent on the + upstream work. Currently no node types define non-zero ports. + Accordingly, this field must be set to zero. + type : bytes + This should be populated with a value from CUgraphDependencyType. + (It is typed as char due to compiler-specific layout of bitfields.) + See CUgraphDependencyType. + reserved : bytes + These bytes are unused and must be zeroed. This ensures + compatibility if additional fields are added in the future. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_GRAPH_INSTANTIATE_PARAMS(CUDA_GRAPH_INSTANTIATE_PARAMS_st): + """ + Graph instantiation parameters + + Attributes + ---------- + flags : cuuint64_t + Instantiation flags + hUploadStream : CUstream + Upload stream + hErrNode_out : CUgraphNode + The node which caused instantiation to fail, if any + result_out : CUgraphInstantiateResult + Whether instantiation was successful. If it failed, the reason why + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlaunchMemSyncDomainMap(CUlaunchMemSyncDomainMap_st): + """ + Memory Synchronization Domain map See ::cudaLaunchMemSyncDomain. + By default, kernels are launched in domain 0. Kernel launched with + CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE will have a different domain ID. + User may also alter the domain ID with CUlaunchMemSyncDomainMap for + a specific stream / graph node / kernel launch. See + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. Domain ID range is + available through CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT. + + Attributes + ---------- + default_ : bytes + The default domain ID to use for designated kernels + remote : bytes + The remote domain ID to use for designated kernels + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlaunchAttributeValue(CUlaunchAttributeValue_union): + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + pad : bytes + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + clusterDim : anon_struct1 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION + that represents the desired cluster dimensions for the kernel. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `y` - The Y dimension of the cluster, in blocks. Must be a + divisor of the grid Y dimension. - `z` - The Z dimension of the + cluster, in blocks. Must be a divisor of the grid Z dimension. + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + launchCompletionEvent : anon_struct3 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following + fields: - `CUevent` event - Event to fire when the last block + launches - `int` flags; - Event record flags, see + cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + with the following fields: - `x` - The X dimension of the preferred + cluster, in blocks. Must be a divisor of the grid X dimension, and + must be a multiple of the `x` field of + CUlaunchAttributeValue::clusterDim. - `y` - The Y dimension of + the preferred cluster, in blocks. Must be a divisor of the grid Y + dimension, and must be a multiple of the `y` field of + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + nvlinkUtilCentricScheduling : unsigned int + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. + sharedMemoryMode : CUsharedMemoryMode + Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. + See CUsharedMemoryMode for acceptable values. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlaunchAttribute(CUlaunchAttribute_st): + """ + Launch attribute + + Attributes + ---------- + id : CUlaunchAttributeID + Attribute to set + value : CUlaunchAttributeValue + Value of the attribute + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlaunchConfig(CUlaunchConfig_st): + """ + CUDA extensible launch configuration + + Attributes + ---------- + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + hStream : CUstream + Stream identifier + attrs : CUlaunchAttribute + List of attributes; nullable if CUlaunchConfig::numAttrs == 0 + numAttrs : unsigned int + Number of attributes populated in CUlaunchConfig::attrs + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUkernelNodeAttrValue_v1(CUlaunchAttributeValue): + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + pad : bytes + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + clusterDim : anon_struct1 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION + that represents the desired cluster dimensions for the kernel. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `y` - The Y dimension of the cluster, in blocks. Must be a + divisor of the grid Y dimension. - `z` - The Z dimension of the + cluster, in blocks. Must be a divisor of the grid Z dimension. + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + launchCompletionEvent : anon_struct3 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following + fields: - `CUevent` event - Event to fire when the last block + launches - `int` flags; - Event record flags, see + cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + with the following fields: - `x` - The X dimension of the preferred + cluster, in blocks. Must be a divisor of the grid X dimension, and + must be a multiple of the `x` field of + CUlaunchAttributeValue::clusterDim. - `y` - The Y dimension of + the preferred cluster, in blocks. Must be a divisor of the grid Y + dimension, and must be a multiple of the `y` field of + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + nvlinkUtilCentricScheduling : unsigned int + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. + sharedMemoryMode : CUsharedMemoryMode + Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. + See CUsharedMemoryMode for acceptable values. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUkernelNodeAttrValue(CUkernelNodeAttrValue_v1): + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + pad : bytes + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + clusterDim : anon_struct1 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION + that represents the desired cluster dimensions for the kernel. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `y` - The Y dimension of the cluster, in blocks. Must be a + divisor of the grid Y dimension. - `z` - The Z dimension of the + cluster, in blocks. Must be a divisor of the grid Z dimension. + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + launchCompletionEvent : anon_struct3 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following + fields: - `CUevent` event - Event to fire when the last block + launches - `int` flags; - Event record flags, see + cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + with the following fields: - `x` - The X dimension of the preferred + cluster, in blocks. Must be a divisor of the grid X dimension, and + must be a multiple of the `x` field of + CUlaunchAttributeValue::clusterDim. - `y` - The Y dimension of + the preferred cluster, in blocks. Must be a divisor of the grid Y + dimension, and must be a multiple of the `y` field of + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + nvlinkUtilCentricScheduling : unsigned int + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. + sharedMemoryMode : CUsharedMemoryMode + Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. + See CUsharedMemoryMode for acceptable values. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUstreamAttrValue_v1(CUlaunchAttributeValue): + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + pad : bytes + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + clusterDim : anon_struct1 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION + that represents the desired cluster dimensions for the kernel. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `y` - The Y dimension of the cluster, in blocks. Must be a + divisor of the grid Y dimension. - `z` - The Z dimension of the + cluster, in blocks. Must be a divisor of the grid Z dimension. + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + launchCompletionEvent : anon_struct3 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following + fields: - `CUevent` event - Event to fire when the last block + launches - `int` flags; - Event record flags, see + cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + with the following fields: - `x` - The X dimension of the preferred + cluster, in blocks. Must be a divisor of the grid X dimension, and + must be a multiple of the `x` field of + CUlaunchAttributeValue::clusterDim. - `y` - The Y dimension of + the preferred cluster, in blocks. Must be a divisor of the grid Y + dimension, and must be a multiple of the `y` field of + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + nvlinkUtilCentricScheduling : unsigned int + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. + sharedMemoryMode : CUsharedMemoryMode + Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. + See CUsharedMemoryMode for acceptable values. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUstreamAttrValue(CUstreamAttrValue_v1): + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + pad : bytes + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + clusterDim : anon_struct1 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION + that represents the desired cluster dimensions for the kernel. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `y` - The Y dimension of the cluster, in blocks. Must be a + divisor of the grid Y dimension. - `z` - The Z dimension of the + cluster, in blocks. Must be a divisor of the grid Z dimension. + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + launchCompletionEvent : anon_struct3 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following + fields: - `CUevent` event - Event to fire when the last block + launches - `int` flags; - Event record flags, see + cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + with the following fields: - `x` - The X dimension of the preferred + cluster, in blocks. Must be a divisor of the grid X dimension, and + must be a multiple of the `x` field of + CUlaunchAttributeValue::clusterDim. - `y` - The Y dimension of + the preferred cluster, in blocks. Must be a divisor of the grid Y + dimension, and must be a multiple of the `y` field of + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + nvlinkUtilCentricScheduling : unsigned int + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. + sharedMemoryMode : CUsharedMemoryMode + Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. + See CUsharedMemoryMode for acceptable values. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUexecAffinitySmCount_v1(CUexecAffinitySmCount_st): + """ + Value for CU_EXEC_AFFINITY_TYPE_SM_COUNT + + Attributes + ---------- + val : unsigned int + The number of SMs the context is limited to use. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUexecAffinitySmCount(CUexecAffinitySmCount_v1): + """ + Value for CU_EXEC_AFFINITY_TYPE_SM_COUNT + + Attributes + ---------- + val : unsigned int + The number of SMs the context is limited to use. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUexecAffinityParam_v1(CUexecAffinityParam_st): + """ + Execution Affinity Parameters + + Attributes + ---------- + type : CUexecAffinityType + Type of execution affinity. + param : anon_union3 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUexecAffinityParam(CUexecAffinityParam_v1): + """ + Execution Affinity Parameters + + Attributes + ---------- + type : CUexecAffinityType + Type of execution affinity. + param : anon_union3 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUctxCigParam(CUctxCigParam_st): + """ + CIG Context Create Params + + Attributes + ---------- + sharedDataType : CUcigDataType + Type of shared data from graphics client (D3D12 or Vulkan). + sharedData : Any + Graphics client data handle (ID3D12CommandQueue or Nvidia specific + data blob). + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUctxCreateParams(CUctxCreateParams_st): + """ + Params for creating CUDA context. Both execAffinityParams and + cigParams cannot be non-NULL at the same time. If both are NULL, + the context will be created as a regular CUDA context. + + Attributes + ---------- + execAffinityParams : CUexecAffinityParam + Array of execution affinity parameters to limit context resources + (e.g., SM count). Only supported Volta+ MPS. Mutually exclusive + with cigParams. + numExecAffinityParams : int + Number of elements in execAffinityParams array. Must be 0 if + execAffinityParams is NULL. + cigParams : CUctxCigParam + CIG (CUDA in Graphics) parameters for sharing data from + D3D12/Vulkan graphics clients. Mutually exclusive with + execAffinityParams. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUstreamCigParam(CUstreamCigParam_st): + """ + CIG Stream Capture Params + + Attributes + ---------- + streamSharedDataType : CUstreamCigDataType + Type of shared data from graphics client (D3D12). + streamSharedData : Any + Graphics client data handle + (ID3D12CommandList/ID3D12GraphicsCommandList). + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUstreamCigCaptureParams(CUstreamCigCaptureParams_st): + """ + Params for capturing CUDA stream to CIG streamCigParams must be + non-NULL. + + Attributes + ---------- + streamCigParams : CUstreamCigParam + CIG (CUDA in Graphics) parameters for sharing command list data + from D3D12 graphics clients. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlibraryHostUniversalFunctionAndDataTable(CUlibraryHostUniversalFunctionAndDataTable_st): + """ + Attributes + ---------- + functionTable : Any + + functionWindowSize : size_t + + dataTable : Any + + dataWindowSize : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY2D_v2(CUDA_MEMCPY2D_st): + """ + 2D memory copy parameters + + Attributes + ---------- + srcXInBytes : size_t + Source X in bytes + srcY : size_t + Source Y + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + srcHost : Any + Source host pointer + srcDevice : CUdeviceptr + Source device pointer + srcArray : CUarray + Source array reference + srcPitch : size_t + Source pitch (ignored when src is array) + dstXInBytes : size_t + Destination X in bytes + dstY : size_t + Destination Y + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + dstHost : Any + Destination host pointer + dstDevice : CUdeviceptr + Destination device pointer + dstArray : CUarray + Destination array reference + dstPitch : size_t + Destination pitch (ignored when dst is array) + WidthInBytes : size_t + Width of 2D memory copy in bytes + Height : size_t + Height of 2D memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY2D(CUDA_MEMCPY2D_v2): + """ + 2D memory copy parameters + + Attributes + ---------- + srcXInBytes : size_t + Source X in bytes + srcY : size_t + Source Y + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + srcHost : Any + Source host pointer + srcDevice : CUdeviceptr + Source device pointer + srcArray : CUarray + Source array reference + srcPitch : size_t + Source pitch (ignored when src is array) + dstXInBytes : size_t + Destination X in bytes + dstY : size_t + Destination Y + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + dstHost : Any + Destination host pointer + dstDevice : CUdeviceptr + Destination device pointer + dstArray : CUarray + Destination array reference + dstPitch : size_t + Destination pitch (ignored when dst is array) + WidthInBytes : size_t + Width of 2D memory copy in bytes + Height : size_t + Height of 2D memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D_v2(CUDA_MEMCPY3D_st): + """ + 3D memory copy parameters + + Attributes + ---------- + srcXInBytes : size_t + Source X in bytes + srcY : size_t + Source Y + srcZ : size_t + Source Z + srcLOD : size_t + Source LOD + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + srcHost : Any + Source host pointer + srcDevice : CUdeviceptr + Source device pointer + srcArray : CUarray + Source array reference + reserved0 : Any + Must be NULL + srcPitch : size_t + Source pitch (ignored when src is array) + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + dstXInBytes : size_t + Destination X in bytes + dstY : size_t + Destination Y + dstZ : size_t + Destination Z + dstLOD : size_t + Destination LOD + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + dstHost : Any + Destination host pointer + dstDevice : CUdeviceptr + Destination device pointer + dstArray : CUarray + Destination array reference + reserved1 : Any + Must be NULL + dstPitch : size_t + Destination pitch (ignored when dst is array) + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + WidthInBytes : size_t + Width of 3D memory copy in bytes + Height : size_t + Height of 3D memory copy + Depth : size_t + Depth of 3D memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D(CUDA_MEMCPY3D_v2): + """ + 3D memory copy parameters + + Attributes + ---------- + srcXInBytes : size_t + Source X in bytes + srcY : size_t + Source Y + srcZ : size_t + Source Z + srcLOD : size_t + Source LOD + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + srcHost : Any + Source host pointer + srcDevice : CUdeviceptr + Source device pointer + srcArray : CUarray + Source array reference + reserved0 : Any + Must be NULL + srcPitch : size_t + Source pitch (ignored when src is array) + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + dstXInBytes : size_t + Destination X in bytes + dstY : size_t + Destination Y + dstZ : size_t + Destination Z + dstLOD : size_t + Destination LOD + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + dstHost : Any + Destination host pointer + dstDevice : CUdeviceptr + Destination device pointer + dstArray : CUarray + Destination array reference + reserved1 : Any + Must be NULL + dstPitch : size_t + Destination pitch (ignored when dst is array) + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + WidthInBytes : size_t + Width of 3D memory copy in bytes + Height : size_t + Height of 3D memory copy + Depth : size_t + Depth of 3D memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D_PEER_v1(CUDA_MEMCPY3D_PEER_st): + """ + 3D memory cross-context copy parameters + + Attributes + ---------- + srcXInBytes : size_t + Source X in bytes + srcY : size_t + Source Y + srcZ : size_t + Source Z + srcLOD : size_t + Source LOD + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + srcHost : Any + Source host pointer + srcDevice : CUdeviceptr + Source device pointer + srcArray : CUarray + Source array reference + srcContext : CUcontext + Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY) + srcPitch : size_t + Source pitch (ignored when src is array) + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + dstXInBytes : size_t + Destination X in bytes + dstY : size_t + Destination Y + dstZ : size_t + Destination Z + dstLOD : size_t + Destination LOD + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + dstHost : Any + Destination host pointer + dstDevice : CUdeviceptr + Destination device pointer + dstArray : CUarray + Destination array reference + dstContext : CUcontext + Destination context (ignored with dstMemoryType is + CU_MEMORYTYPE_ARRAY) + dstPitch : size_t + Destination pitch (ignored when dst is array) + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + WidthInBytes : size_t + Width of 3D memory copy in bytes + Height : size_t + Height of 3D memory copy + Depth : size_t + Depth of 3D memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D_PEER(CUDA_MEMCPY3D_PEER_v1): + """ + 3D memory cross-context copy parameters + + Attributes + ---------- + srcXInBytes : size_t + Source X in bytes + srcY : size_t + Source Y + srcZ : size_t + Source Z + srcLOD : size_t + Source LOD + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + srcHost : Any + Source host pointer + srcDevice : CUdeviceptr + Source device pointer + srcArray : CUarray + Source array reference + srcContext : CUcontext + Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY) + srcPitch : size_t + Source pitch (ignored when src is array) + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + dstXInBytes : size_t + Destination X in bytes + dstY : size_t + Destination Y + dstZ : size_t + Destination Z + dstLOD : size_t + Destination LOD + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + dstHost : Any + Destination host pointer + dstDevice : CUdeviceptr + Destination device pointer + dstArray : CUarray + Destination array reference + dstContext : CUcontext + Destination context (ignored with dstMemoryType is + CU_MEMORYTYPE_ARRAY) + dstPitch : size_t + Destination pitch (ignored when dst is array) + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + WidthInBytes : size_t + Width of 3D memory copy in bytes + Height : size_t + Height of 3D memory copy + Depth : size_t + Depth of 3D memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY_NODE_PARAMS(CUDA_MEMCPY_NODE_PARAMS_st): + """ + Memcpy node parameters + + Attributes + ---------- + flags : int + Must be zero + reserved : int + Must be zero + copyCtx : CUcontext + Context on which to run the node + copyParams : CUDA_MEMCPY3D + Parameters for the memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_DESCRIPTOR_v2(CUDA_ARRAY_DESCRIPTOR_st): + """ + Array descriptor + + Attributes + ---------- + Width : size_t + Width of array + Height : size_t + Height of array + Format : CUarray_format + Array format + NumChannels : unsigned int + Channels per array element + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_DESCRIPTOR(CUDA_ARRAY_DESCRIPTOR_v2): + """ + Array descriptor + + Attributes + ---------- + Width : size_t + Width of array + Height : size_t + Height of array + Format : CUarray_format + Array format + NumChannels : unsigned int + Channels per array element + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY3D_DESCRIPTOR_v2(CUDA_ARRAY3D_DESCRIPTOR_st): + """ + 3D array descriptor + + Attributes + ---------- + Width : size_t + Width of 3D array + Height : size_t + Height of 3D array + Depth : size_t + Depth of 3D array + Format : CUarray_format + Array format + NumChannels : unsigned int + Channels per array element + Flags : unsigned int + Flags + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY3D_DESCRIPTOR(CUDA_ARRAY3D_DESCRIPTOR_v2): + """ + 3D array descriptor + + Attributes + ---------- + Width : size_t + Width of 3D array + Height : size_t + Height of 3D array + Depth : size_t + Depth of 3D array + Format : CUarray_format + Array format + NumChannels : unsigned int + Channels per array element + Flags : unsigned int + Flags + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_SPARSE_PROPERTIES_v1(CUDA_ARRAY_SPARSE_PROPERTIES_st): + """ + CUDA array sparse properties + + Attributes + ---------- + tileExtent : anon_struct6 + + miptailFirstLevel : unsigned int + First mip level at which the mip tail begins. + miptailSize : unsigned long long + Total size of the mip tail. + flags : unsigned int + Flags will either be zero or + CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_SPARSE_PROPERTIES(CUDA_ARRAY_SPARSE_PROPERTIES_v1): + """ + CUDA array sparse properties + + Attributes + ---------- + tileExtent : anon_struct6 + + miptailFirstLevel : unsigned int + First mip level at which the mip tail begins. + miptailSize : unsigned long long + Total size of the mip tail. + flags : unsigned int + Flags will either be zero or + CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_v1(CUDA_ARRAY_MEMORY_REQUIREMENTS_st): + """ + CUDA array memory requirements + + Attributes + ---------- + size : size_t + Total required memory size + alignment : size_t + alignment requirement + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS(CUDA_ARRAY_MEMORY_REQUIREMENTS_v1): + """ + CUDA array memory requirements + + Attributes + ---------- + size : size_t + Total required memory size + alignment : size_t + alignment requirement + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_RESOURCE_DESC_v1(CUDA_RESOURCE_DESC_st): + """ + CUDA Resource descriptor + + Attributes + ---------- + resType : CUresourcetype + Resource type + res : anon_union4 + + flags : unsigned int + Flags (must be zero) + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_RESOURCE_DESC(CUDA_RESOURCE_DESC_v1): + """ + CUDA Resource descriptor + + Attributes + ---------- + resType : CUresourcetype + Resource type + res : anon_union4 + + flags : unsigned int + Flags (must be zero) + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_TEXTURE_DESC_v1(CUDA_TEXTURE_DESC_st): + """ + Texture descriptor + + Attributes + ---------- + addressMode : list[CUaddress_mode] + Address modes + filterMode : CUfilter_mode + Filter mode + flags : unsigned int + Flags + maxAnisotropy : unsigned int + Maximum anisotropy ratio + mipmapFilterMode : CUfilter_mode + Mipmap filter mode + mipmapLevelBias : float + Mipmap level bias + minMipmapLevelClamp : float + Mipmap minimum level clamp + maxMipmapLevelClamp : float + Mipmap maximum level clamp + borderColor : list[float] + Border Color + reserved : list[int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_TEXTURE_DESC(CUDA_TEXTURE_DESC_v1): + """ + Texture descriptor + + Attributes + ---------- + addressMode : list[CUaddress_mode] + Address modes + filterMode : CUfilter_mode + Filter mode + flags : unsigned int + Flags + maxAnisotropy : unsigned int + Maximum anisotropy ratio + mipmapFilterMode : CUfilter_mode + Mipmap filter mode + mipmapLevelBias : float + Mipmap level bias + minMipmapLevelClamp : float + Mipmap minimum level clamp + maxMipmapLevelClamp : float + Mipmap maximum level clamp + borderColor : list[float] + Border Color + reserved : list[int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_RESOURCE_VIEW_DESC_v1(CUDA_RESOURCE_VIEW_DESC_st): + """ + Resource view descriptor + + Attributes + ---------- + format : CUresourceViewFormat + Resource view format + width : size_t + Width of the resource view + height : size_t + Height of the resource view + depth : size_t + Depth of the resource view + firstMipmapLevel : unsigned int + First defined mipmap level + lastMipmapLevel : unsigned int + Last defined mipmap level + firstLayer : unsigned int + First layer index + lastLayer : unsigned int + Last layer index + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_RESOURCE_VIEW_DESC(CUDA_RESOURCE_VIEW_DESC_v1): + """ + Resource view descriptor + + Attributes + ---------- + format : CUresourceViewFormat + Resource view format + width : size_t + Width of the resource view + height : size_t + Height of the resource view + depth : size_t + Depth of the resource view + firstMipmapLevel : unsigned int + First defined mipmap level + lastMipmapLevel : unsigned int + Last defined mipmap level + firstLayer : unsigned int + First layer index + lastLayer : unsigned int + Last layer index + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUtensorMap(CUtensorMap_st): + """ + Tensor map descriptor. Requires compiler support for aligning to + 128 bytes. + + Attributes + ---------- + opaque : list[cuuint64_t] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1(CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st): + """ + GPU Direct v3 tokens + + Attributes + ---------- + p2pToken : unsigned long long + + vaSpaceToken : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS(CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1): + """ + GPU Direct v3 tokens + + Attributes + ---------- + p2pToken : unsigned long long + + vaSpaceToken : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_LAUNCH_PARAMS_v1(CUDA_LAUNCH_PARAMS_st): + """ + Kernel launch parameters + + Attributes + ---------- + function : CUfunction + Kernel to launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + hStream : CUstream + Stream identifier + kernelParams : Any + Array of pointers to kernel parameters + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_LAUNCH_PARAMS(CUDA_LAUNCH_PARAMS_v1): + """ + Kernel launch parameters + + Attributes + ---------- + function : CUfunction + Kernel to launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + hStream : CUstream + Stream identifier + kernelParams : Any + Array of pointers to kernel parameters + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st): + """ + External memory handle descriptor + + Attributes + ---------- + type : CUexternalMemoryHandleType + Type of the handle + handle : anon_union5 + + size : unsigned long long + Size of the memory allocation + flags : unsigned int + Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1): + """ + External memory handle descriptor + + Attributes + ---------- + type : CUexternalMemoryHandleType + Type of the handle + handle : anon_union5 + + size : unsigned long long + Size of the memory allocation + flags : unsigned int + Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st): + """ + External memory buffer descriptor + + Attributes + ---------- + offset : unsigned long long + Offset into the memory object where the buffer's base is + size : unsigned long long + Size of the buffer + flags : unsigned int + Flags reserved for future use. Must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1): + """ + External memory buffer descriptor + + Attributes + ---------- + offset : unsigned long long + Offset into the memory object where the buffer's base is + size : unsigned long long + Size of the buffer + flags : unsigned int + Flags reserved for future use. Must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1(CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st): + """ + External memory mipmap descriptor + + Attributes + ---------- + offset : unsigned long long + Offset into the memory object where the base level of the mipmap + chain is. + arrayDesc : CUDA_ARRAY3D_DESCRIPTOR + Format, dimension and type of base level of the mipmap chain + numLevels : unsigned int + Total number of levels in the mipmap chain + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC(CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1): + """ + External memory mipmap descriptor + + Attributes + ---------- + offset : unsigned long long + Offset into the memory object where the base level of the mipmap + chain is. + arrayDesc : CUDA_ARRAY3D_DESCRIPTOR + Format, dimension and type of base level of the mipmap chain + numLevels : unsigned int + Total number of levels in the mipmap chain + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st): + """ + External semaphore handle descriptor + + Attributes + ---------- + type : CUexternalSemaphoreHandleType + Type of the handle + handle : anon_union6 + + flags : unsigned int + Flags reserved for the future. Must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1): + """ + External semaphore handle descriptor + + Attributes + ---------- + type : CUexternalSemaphoreHandleType + Type of the handle + handle : anon_union6 + + flags : unsigned int + Flags reserved for the future. Must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st): + """ + External semaphore signal parameters + + Attributes + ---------- + params : anon_struct16 + + flags : unsigned int + Only when CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal a + CUexternalSemaphore of type + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is + CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC which + indicates that while signaling the CUexternalSemaphore, no memory + synchronization operations should be performed for any external + memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. + For all other types of CUexternalSemaphore, flags must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1): + """ + External semaphore signal parameters + + Attributes + ---------- + params : anon_struct16 + + flags : unsigned int + Only when CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal a + CUexternalSemaphore of type + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is + CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC which + indicates that while signaling the CUexternalSemaphore, no memory + synchronization operations should be performed for any external + memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. + For all other types of CUexternalSemaphore, flags must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st): + """ + External semaphore wait parameters + + Attributes + ---------- + params : anon_struct19 + + flags : unsigned int + Only when CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on a + CUexternalSemaphore of type + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is + CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC which indicates + that while waiting for the CUexternalSemaphore, no memory + synchronization operations should be performed for any external + memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. + For all other types of CUexternalSemaphore, flags must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1): + """ + External semaphore wait parameters + + Attributes + ---------- + params : anon_struct19 + + flags : unsigned int + Only when CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on a + CUexternalSemaphore of type + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is + CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC which indicates + that while waiting for the CUexternalSemaphore, no memory + synchronization operations should be performed for any external + memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. + For all other types of CUexternalSemaphore, flags must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st): + """ + Semaphore signal node parameters + + Attributes + ---------- + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1): + """ + Semaphore signal node parameters + + Attributes + ---------- + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st): + """ + Semaphore signal node parameters + + Attributes + ---------- + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1(CUDA_EXT_SEM_WAIT_NODE_PARAMS_st): + """ + Semaphore wait node parameters + + Attributes + ---------- + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1): + """ + Semaphore wait node parameters + + Attributes + ---------- + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st): + """ + Semaphore wait node parameters + + Attributes + ---------- + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemGenericAllocationHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUmemGenericAllocationHandle _pvt_val + cdef cydriver.CUmemGenericAllocationHandle* _pvt_ptr + +cdef class CUarrayMapInfo_v1(CUarrayMapInfo_st): + """ + Specifies the CUDA array or CUDA mipmapped array memory mapping + information + + Attributes + ---------- + resourceType : CUresourcetype + Resource type + resource : anon_union9 + + subresourceType : CUarraySparseSubresourceType + Sparse subresource type + subresource : anon_union10 + + memOperationType : CUmemOperationType + Memory operation type + memHandleType : CUmemHandleType + Memory handle type + memHandle : anon_union11 + + offset : unsigned long long + Offset within mip tail Offset within the memory + deviceBitMask : unsigned int + Device ordinal bit mask + flags : unsigned int + flags for future use, must be zero now. + reserved : list[unsigned int] + Reserved for future use, must be zero now. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUarrayMapInfo(CUarrayMapInfo_v1): + """ + Specifies the CUDA array or CUDA mipmapped array memory mapping + information + + Attributes + ---------- + resourceType : CUresourcetype + Resource type + resource : anon_union9 + + subresourceType : CUarraySparseSubresourceType + Sparse subresource type + subresource : anon_union10 + + memOperationType : CUmemOperationType + Memory operation type + memHandleType : CUmemHandleType + Memory handle type + memHandle : anon_union11 + + offset : unsigned long long + Offset within mip tail Offset within the memory + deviceBitMask : unsigned int + Device ordinal bit mask + flags : unsigned int + flags for future use, must be zero now. + reserved : list[unsigned int] + Reserved for future use, must be zero now. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemLocation_v1(CUmemLocation_st): + """ + Specifies a memory location. + + Attributes + ---------- + type : CUmemLocationType + Specifies the location type, which modifies the meaning of id. + id : int + Identifier for CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemLocation(CUmemLocation_v1): + """ + Specifies a memory location. + + Attributes + ---------- + type : CUmemLocationType + Specifies the location type, which modifies the meaning of id. + id : int + Identifier for CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemAllocationProp_v1(CUmemAllocationProp_st): + """ + Specifies the allocation properties for a allocation. + + Attributes + ---------- + type : CUmemAllocationType + Allocation type + requestedHandleTypes : CUmemAllocationHandleType + requested CUmemAllocationHandleType + location : CUmemLocation + Location of allocation + win32HandleMetaData : Any + Windows-specific POBJECT_ATTRIBUTES required when + CU_MEM_HANDLE_TYPE_WIN32 is specified. This object attributes + structure includes security attributes that define the scope of + which exported allocations may be transferred to other processes. + In all other cases, this field is required to be zero. + allocFlags : anon_struct22 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemAllocationProp(CUmemAllocationProp_v1): + """ + Specifies the allocation properties for a allocation. + + Attributes + ---------- + type : CUmemAllocationType + Allocation type + requestedHandleTypes : CUmemAllocationHandleType + requested CUmemAllocationHandleType + location : CUmemLocation + Location of allocation + win32HandleMetaData : Any + Windows-specific POBJECT_ATTRIBUTES required when + CU_MEM_HANDLE_TYPE_WIN32 is specified. This object attributes + structure includes security attributes that define the scope of + which exported allocations may be transferred to other processes. + In all other cases, this field is required to be zero. + allocFlags : anon_struct22 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmulticastObjectProp_v1(CUmulticastObjectProp_st): + """ + Specifies the properties for a multicast object. + + Attributes + ---------- + numDevices : unsigned int + The number of devices in the multicast team that will bind memory + to this object + size : size_t + The maximum amount of memory that can be bound to this multicast + object per device + handleTypes : unsigned long long + Bitmask of exportable handle types (see CUmemAllocationHandleType) + for this object + flags : unsigned long long + Flags for future use, must be zero now + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmulticastObjectProp(CUmulticastObjectProp_v1): + """ + Specifies the properties for a multicast object. + + Attributes + ---------- + numDevices : unsigned int + The number of devices in the multicast team that will bind memory + to this object + size : size_t + The maximum amount of memory that can be bound to this multicast + object per device + handleTypes : unsigned long long + Bitmask of exportable handle types (see CUmemAllocationHandleType) + for this object + flags : unsigned long long + Flags for future use, must be zero now + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemAccessDesc_v1(CUmemAccessDesc_st): + """ + Memory access descriptor + + Attributes + ---------- + location : CUmemLocation + Location on which the request is to change it's accessibility + flags : CUmemAccess_flags + ::CUmemProt accessibility flags to set on the request + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemAccessDesc(CUmemAccessDesc_v1): + """ + Memory access descriptor + + Attributes + ---------- + location : CUmemLocation + Location on which the request is to change it's accessibility + flags : CUmemAccess_flags + ::CUmemProt accessibility flags to set on the request + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUgraphExecUpdateResultInfo_v1(CUgraphExecUpdateResultInfo_st): + """ + Result information returned by cuGraphExecUpdate + + Attributes + ---------- + result : CUgraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + errorNode : CUgraphNode + The "to node" of the error edge when the topologies do not match. + The error node when the error is associated with a specific node. + NULL when the error is generic. + errorFromNode : CUgraphNode + The from node of error edge when the topologies do not match. + Otherwise NULL. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUgraphExecUpdateResultInfo(CUgraphExecUpdateResultInfo_v1): + """ + Result information returned by cuGraphExecUpdate + + Attributes + ---------- + result : CUgraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + errorNode : CUgraphNode + The "to node" of the error edge when the topologies do not match. + The error node when the error is associated with a specific node. + NULL when the error is generic. + errorFromNode : CUgraphNode + The from node of error edge when the topologies do not match. + Otherwise NULL. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemPoolProps_v1(CUmemPoolProps_st): + """ + Specifies the properties of allocations made from the pool. + + Attributes + ---------- + allocType : CUmemAllocationType + Allocation type. Currently must be specified as + CU_MEM_ALLOCATION_TYPE_PINNED + handleTypes : CUmemAllocationHandleType + Handle types that will be supported by allocations from the pool. + location : CUmemLocation + Location where allocations should reside. + win32SecurityAttributes : Any + Windows-specific LPSECURITYATTRIBUTES required when + CU_MEM_HANDLE_TYPE_WIN32 is specified. This security attribute + defines the scope of which exported allocations may be transferred + to other processes. In all other cases, this field is required to + be zero. + maxSize : size_t + Maximum pool size. When set to 0, defaults to a system dependent + value. + usage : unsigned short + Bitmask indicating intended usage for the pool. + reserved : bytes + reserved for future use, must be 0 + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemPoolProps(CUmemPoolProps_v1): + """ + Specifies the properties of allocations made from the pool. + + Attributes + ---------- + allocType : CUmemAllocationType + Allocation type. Currently must be specified as + CU_MEM_ALLOCATION_TYPE_PINNED + handleTypes : CUmemAllocationHandleType + Handle types that will be supported by allocations from the pool. + location : CUmemLocation + Location where allocations should reside. + win32SecurityAttributes : Any + Windows-specific LPSECURITYATTRIBUTES required when + CU_MEM_HANDLE_TYPE_WIN32 is specified. This security attribute + defines the scope of which exported allocations may be transferred + to other processes. In all other cases, this field is required to + be zero. + maxSize : size_t + Maximum pool size. When set to 0, defaults to a system dependent + value. + usage : unsigned short + Bitmask indicating intended usage for the pool. + reserved : bytes + reserved for future use, must be 0 + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemPoolPtrExportData_v1(CUmemPoolPtrExportData_st): + """ + Opaque data for exporting a pool allocation + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemPoolPtrExportData(CUmemPoolPtrExportData_v1): + """ + Opaque data for exporting a pool allocation + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemcpyAttributes_v1(CUmemcpyAttributes_st): + """ + Attributes specific to copies within a batch. For more details on + usage see cuMemcpyBatchAsync. + + Attributes + ---------- + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copies with this + attribute. + srcLocHint : CUmemLocation + Hint location for the source operand. Ignored when the pointers are + not managed memory or memory allocated outside CUDA. + dstLocHint : CUmemLocation + Hint location for the destination operand. Ignored when the + pointers are not managed memory or memory allocated outside CUDA. + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemcpyAttributes(CUmemcpyAttributes_v1): + """ + Attributes specific to copies within a batch. For more details on + usage see cuMemcpyBatchAsync. + + Attributes + ---------- + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copies with this + attribute. + srcLocHint : CUmemLocation + Hint location for the source operand. Ignored when the pointers are + not managed memory or memory allocated outside CUDA. + dstLocHint : CUmemLocation + Hint location for the destination operand. Ignored when the + pointers are not managed memory or memory allocated outside CUDA. + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUoffset3D_v1(CUoffset3D_st): + """ + Struct representing a 3D offset + + Attributes + ---------- + x : size_t + + y : size_t + + z : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUoffset3D(CUoffset3D_v1): + """ + Struct representing a 3D offset + + Attributes + ---------- + x : size_t + + y : size_t + + z : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUextent3D_v1(CUextent3D_st): + """ + Struct representing width/height/depth of a CUarray in elements + + Attributes + ---------- + width : size_t + + height : size_t + + depth : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUextent3D(CUextent3D_v1): + """ + Struct representing width/height/depth of a CUarray in elements + + Attributes + ---------- + width : size_t + + height : size_t + + depth : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemcpy3DOperand_v1(CUmemcpy3DOperand_st): + """ + Struct representing an operand for copy with cuMemcpy3DBatchAsync + + Attributes + ---------- + type : CUmemcpy3DOperandType + + op : anon_union13 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemcpy3DOperand(CUmemcpy3DOperand_v1): + """ + Struct representing an operand for copy with cuMemcpy3DBatchAsync + + Attributes + ---------- + type : CUmemcpy3DOperandType + + op : anon_union13 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D_BATCH_OP_v1(CUDA_MEMCPY3D_BATCH_OP_st): + """ + Attributes + ---------- + src : CUmemcpy3DOperand + Source memcpy operand. + dst : CUmemcpy3DOperand + Destination memcpy operand. + extent : CUextent3D + Extents of the memcpy between src and dst. The width, height and + depth components must not be 0. + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copy from src to dst. + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D_BATCH_OP(CUDA_MEMCPY3D_BATCH_OP_v1): + """ + Attributes + ---------- + src : CUmemcpy3DOperand + Source memcpy operand. + dst : CUmemcpy3DOperand + Destination memcpy operand. + extent : CUextent3D + Extents of the memcpy between src and dst. The width, height and + depth components must not be 0. + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copy from src to dst. + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1(CUDA_MEM_ALLOC_NODE_PARAMS_v1_st): + """ + Memory allocation node parameters + + Attributes + ---------- + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + bytesize : size_t + in: size in bytes of the requested allocation + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS(CUDA_MEM_ALLOC_NODE_PARAMS_v1): + """ + Memory allocation node parameters + + Attributes + ---------- + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + bytesize : size_t + in: size in bytes of the requested allocation + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2(CUDA_MEM_ALLOC_NODE_PARAMS_v2_st): + """ + Memory allocation node parameters + + Attributes + ---------- + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + bytesize : size_t + in: size in bytes of the requested allocation + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEM_FREE_NODE_PARAMS(CUDA_MEM_FREE_NODE_PARAMS_st): + """ + Memory free node parameters + + Attributes + ---------- + dptr : CUdeviceptr + in: the pointer to free + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_CHILD_GRAPH_NODE_PARAMS(CUDA_CHILD_GRAPH_NODE_PARAMS_st): + """ + Child graph node parameters + + Attributes + ---------- + graph : CUgraph + The child graph to clone into the node for node creation, or a + handle to the graph owned by the node for node query. The graph + must not contain conditional nodes. Graphs containing memory + allocation or memory free nodes must set the ownership to be moved + to the parent. + ownership : CUgraphChildGraphNodeOwnership + The ownership relationship of the child graph node. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EVENT_RECORD_NODE_PARAMS(CUDA_EVENT_RECORD_NODE_PARAMS_st): + """ + Event record node parameters + + Attributes + ---------- + event : CUevent + The event to record when the node executes + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EVENT_WAIT_NODE_PARAMS(CUDA_EVENT_WAIT_NODE_PARAMS_st): + """ + Event wait node parameters + + Attributes + ---------- + event : CUevent + The event to wait on from the node + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUgraphNodeParams(CUgraphNodeParams_st): + """ + Graph node parameters. See cuGraphAddNode. + + Attributes + ---------- + type : CUgraphNodeType + Type of the node + reserved0 : list[int] + Reserved. Must be zero. + reserved1 : list[long long] + Padding. Unused bytes must be zero. + kernel : CUDA_KERNEL_NODE_PARAMS_v3 + Kernel node parameters. + memcpy : CUDA_MEMCPY_NODE_PARAMS + Memcpy node parameters. + memset : CUDA_MEMSET_NODE_PARAMS_v2 + Memset node parameters. + host : CUDA_HOST_NODE_PARAMS_v2 + Host node parameters. + graph : CUDA_CHILD_GRAPH_NODE_PARAMS + Child graph node parameters. + eventWait : CUDA_EVENT_WAIT_NODE_PARAMS + Event wait node parameters. + eventRecord : CUDA_EVENT_RECORD_NODE_PARAMS + Event record node parameters. + extSemSignal : CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 + External semaphore signal node parameters. + extSemWait : CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 + External semaphore wait node parameters. + alloc : CUDA_MEM_ALLOC_NODE_PARAMS_v2 + Memory allocation node parameters. + free : CUDA_MEM_FREE_NODE_PARAMS + Memory free node parameters. + memOp : CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 + MemOp node parameters. + conditional : CUDA_CONDITIONAL_NODE_PARAMS + Conditional node parameters. + asBytes : bytes + Padding as bytes + reserved2 : long long + Reserved bytes. Must be zero. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcheckpointLockArgs(CUcheckpointLockArgs_st): + """ + CUDA checkpoint optional lock arguments + + Attributes + ---------- + timeoutMs : unsigned int + Timeout in milliseconds to attempt to lock the process, 0 indicates + no timeout + reserved0 : unsigned int + Reserved for future use, must be zero + reserved1 : list[cuuint64_t] + Reserved for future use, must be zeroed + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcheckpointCheckpointArgs(CUcheckpointCheckpointArgs_st): + """ + CUDA checkpoint optional checkpoint arguments + + Attributes + ---------- + reserved : list[cuuint64_t] + Reserved for future use, must be zeroed + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcheckpointGpuPair(CUcheckpointGpuPair_st): + """ + CUDA checkpoint GPU UUID pairs for device remapping during restore + + Attributes + ---------- + oldUuid : CUuuid + UUID of the GPU that was checkpointed + newUuid : CUuuid + UUID of the GPU to restore onto + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcheckpointRestoreArgs(CUcheckpointRestoreArgs_st): + """ + CUDA checkpoint optional restore arguments + + Attributes + ---------- + gpuPairs : CUcheckpointGpuPair + Pointer to array of gpu pairs that indicate how to remap GPUs + during restore + gpuPairsCount : unsigned int + Number of gpu pairs to remap + reserved : bytes + Reserved for future use, must be zeroed + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcheckpointUnlockArgs(CUcheckpointUnlockArgs_st): + """ + CUDA checkpoint optional unlock arguments + + Attributes + ---------- + reserved : list[cuuint64_t] + Reserved for future use, must be zeroed + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemDecompressParams(CUmemDecompressParams_st): + """ + Structure describing the parameters that compose a single + decompression operation. + + Attributes + ---------- + srcNumBytes : size_t + The number of bytes to be read and decompressed from + CUmemDecompressParams_st.src. + dstNumBytes : size_t + The number of bytes that the decompression operation will be + expected to write to CUmemDecompressParams_st.dst. This value is + optional; if present, it may be used by the CUDA driver as a + heuristic for scheduling the individual decompression operations. + dstActBytes : cuuint32_t + After the decompression operation has completed, the actual number + of bytes written to CUmemDecompressParams.dst will be recorded as a + 32-bit unsigned integer in the memory at this address. + src : Any + Pointer to a buffer of at least + CUmemDecompressParams_st.srcNumBytes compressed bytes. + dst : Any + Pointer to a buffer where the decompressed data will be written. + The number of bytes written to this location will be recorded in + the memory pointed to by CUmemDecompressParams_st.dstActBytes + algo : CUmemDecompressAlgorithm + The decompression algorithm to use. + padding : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlogicalEndpointId: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlogicalEndpointId _pvt_val + cdef cydriver.CUlogicalEndpointId* _pvt_ptr + +cdef class CUlogicalEndpointFabricHandle(CUlogicalEndpointFabricHandle_st): + """ + Fabric handle for a logical endpoint + + Attributes + ---------- + data : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlogicalEndpointProp(CUlogicalEndpointProp_struct): + """ + Properties of a logical endpoint construction + + Attributes + ---------- + type : CUlogicalEndpointType + Type of the logical endpoint defined in CUlogicalEndpointType + unicast : anon_struct25 + + multicast : anon_struct26 + + size : unsigned long long + Size of the logical endpoint + ipcHandleTypes : unsigned int + A bitmask of IPC handle types defined in + CUlogicalEndpointIpcHandleType + flags : unsigned int + A bitmask of flags defined in CUlogicalEndpointFlag + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevSmResource(CUdevSmResource_st): + """ + Attributes + ---------- + smCount : unsigned int + The amount of streaming multiprocessors available in this resource. + minSmPartitionSize : unsigned int + The minimum number of streaming multiprocessors required to + partition this resource. + smCoscheduledAlignment : unsigned int + The number of streaming multiprocessors in this resource that are + guaranteed to be co-scheduled on the same GPU processing cluster. + smCount will be a multiple of this value, unless the backfill flag + is set. + flags : unsigned int + The flags set on this SM resource. For possible values see + CUdevSmResourceGroup_flags. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevWorkqueueConfigResource(CUdevWorkqueueConfigResource_st): + """ + Attributes + ---------- + device : CUdevice + The device on which the workqueue resources are available + wqConcurrencyLimit : unsigned int + The expected maximum number of concurrent stream-ordered workloads + sharingScope : CUdevWorkqueueConfigScope + The sharing scope for the workqueue resources + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevWorkqueueResource(CUdevWorkqueueResource_st): + """ + Attributes + ---------- + reserved : bytes + Reserved for future use + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS(CU_DEV_SM_RESOURCE_GROUP_PARAMS_st): + """ + Attributes + ---------- + smCount : unsigned int + The amount of SMs available in this resource. + coscheduledSmCount : unsigned int + The amount of co-scheduled SMs grouped together for locality + purposes. + preferredCoscheduledSmCount : unsigned int + When possible, combine co-scheduled groups together into larger + groups of this size. + flags : unsigned int + The flags set on this SM resource group. For possible values see + CUdevSmResourceGroup_flags. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevResource_v1(CUdevResource_st): + """ + Attributes + ---------- + type : CUdevResourceType + Type of resource, dictates which union field was last set + _internal_padding : bytes + + sm : CUdevSmResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `typename`. + wqConfig : CUdevWorkqueueConfigResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG + `typename`. + wq : CUdevWorkqueueResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE + `typename`. + _oversize : bytes + + nextResource : CUdevResource_st + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevResource(CUdevResource_v1): + """ + Attributes + ---------- + type : CUdevResourceType + Type of resource, dictates which union field was last set + _internal_padding : bytes + + sm : CUdevSmResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `typename`. + wqConfig : CUdevWorkqueueConfigResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG + `typename`. + wq : CUdevWorkqueueResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE + `typename`. + _oversize : bytes + + nextResource : CUdevResource_st + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUeglFrame_v1(CUeglFrame_st): + """ + CUDA EGLFrame structure Descriptor - structure defining one frame + of EGL. Each frame may contain one or more planes depending on + whether the surface * is Multiplanar or not. + + Attributes + ---------- + frame : anon_union17 + + width : unsigned int + Width of first plane + height : unsigned int + Height of first plane + depth : unsigned int + Depth of first plane + pitch : unsigned int + Pitch of first plane + planeCount : unsigned int + Number of planes + numChannels : unsigned int + Number of channels for the plane + frameType : CUeglFrameType + Array or Pitch + eglColorFormat : CUeglColorFormat + CUDA EGL Color Format + cuFormat : CUarray_format + CUDA Array Format + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUeglFrame(CUeglFrame_v1): + """ + CUDA EGLFrame structure Descriptor - structure defining one frame + of EGL. Each frame may contain one or more planes depending on + whether the surface * is Multiplanar or not. + + Attributes + ---------- + frame : anon_union17 + + width : unsigned int + Width of first plane + height : unsigned int + Height of first plane + depth : unsigned int + Depth of first plane + pitch : unsigned int + Pitch of first plane + planeCount : unsigned int + Number of planes + numChannels : unsigned int + Number of channels for the plane + frameType : CUeglFrameType + Array or Pitch + eglColorFormat : CUeglColorFormat + CUDA EGL Color Format + cuFormat : CUarray_format + CUDA Array Format + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cuuint32_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.cuuint32_t _pvt_val + cdef cydriver.cuuint32_t* _pvt_ptr + +cdef class cuuint64_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.cuuint64_t _pvt_val + cdef cydriver.cuuint64_t* _pvt_ptr + +cdef class CUdeviceptr_v2: + """ + + CUDA device pointer CUdeviceptr is defined as an unsigned integer type whose size matches the size of a pointer on the target platform. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUdeviceptr_v2 _pvt_val + cdef cydriver.CUdeviceptr_v2* _pvt_ptr + +cdef class CUdevice_v1: + """ + + CUDA device + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUdevice_v1 _pvt_val + cdef cydriver.CUdevice_v1* _pvt_ptr + +cdef class CUtexObject_v1: + """ + + An opaque value that represents a CUDA texture object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUtexObject_v1 _pvt_val + cdef cydriver.CUtexObject_v1* _pvt_ptr + +cdef class CUsurfObject_v1: + """ + + An opaque value that represents a CUDA surface object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUsurfObject_v1 _pvt_val + cdef cydriver.CUsurfObject_v1* _pvt_ptr + +cdef class CUmemGenericAllocationHandle_v1: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUmemGenericAllocationHandle_v1 _pvt_val + cdef cydriver.CUmemGenericAllocationHandle_v1* _pvt_ptr + +cdef class CUlogIterator: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlogIterator _pvt_val + cdef cydriver.CUlogIterator* _pvt_ptr + +cdef class GLenum: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.GLenum _pvt_val + cdef cydriver.GLenum* _pvt_ptr + +cdef class GLuint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.GLuint _pvt_val + cdef cydriver.GLuint* _pvt_ptr + +cdef class EGLint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.EGLint _pvt_val + cdef cydriver.EGLint* _pvt_ptr + +cdef class VdpDevice: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.VdpDevice _pvt_val + cdef cydriver.VdpDevice* _pvt_ptr + +cdef class VdpGetProcAddress: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.VdpGetProcAddress _pvt_val + cdef cydriver.VdpGetProcAddress* _pvt_ptr + +cdef class VdpVideoSurface: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.VdpVideoSurface _pvt_val + cdef cydriver.VdpVideoSurface* _pvt_ptr + +cdef class VdpOutputSurface: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.VdpOutputSurface _pvt_val + cdef cydriver.VdpOutputSurface* _pvt_ptr diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/nvfatbin.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/nvfatbin.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..55cd55e00c271d96e0b6f14fb0e110d6e4ceb314 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/nvfatbin.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ec5a6476625d39737974d05a822c31e26bedeadbf5a039ee47f9c5a6059b929 +size 115944 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/nvfatbin.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/nvfatbin.pxd new file mode 100644 index 0000000000000000000000000000000000000000..2a080b09869396ce8a1d2feba341686c81890741 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/nvfatbin.pxd @@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.4.1 to 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + +from libc.stdint cimport intptr_t, uint32_t + +from .cynvfatbin cimport * + + +############################################################################### +# Types +############################################################################### + +ctypedef nvFatbinHandle Handle + + +############################################################################### +# Enum +############################################################################### + +ctypedef nvFatbinResult _Result + + +############################################################################### +# Functions +############################################################################### + +cpdef intptr_t create(options, size_t options_count) except -1 +cpdef add_ptx(intptr_t handle, code, size_t size, arch, identifier, options_cmd_line) +cpdef add_cubin(intptr_t handle, code, size_t size, arch, identifier) +cpdef add_ltoir(intptr_t handle, code, size_t size, arch, identifier, options_cmd_line) +cpdef size_t size(intptr_t handle) except? 0 +cpdef get(intptr_t handle, buffer) +cpdef tuple version() +cpdef add_index(intptr_t handle, code, size_t size, identifier) +cpdef add_reloc(intptr_t handle, code, size_t size) +cpdef add_tile_ir(intptr_t handle, code, size_t size, identifier, options_cmd_line) diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/nvjitlink.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/nvjitlink.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..d8789332dbad377dc3a8357592e81520a8f8f165 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/nvjitlink.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d8327924e50b7b56d2b772f65193e65f6b7e37cf040b41f05ee400297b1a0a1 +size 111880 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/nvjitlink.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/nvjitlink.pxd new file mode 100644 index 0000000000000000000000000000000000000000..7da795a45f58f9d1787504e2d1cfdbebba5cea15 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/nvjitlink.pxd @@ -0,0 +1,43 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. + +from libc.stdint cimport intptr_t, uint32_t + +from .cynvjitlink cimport * + + +############################################################################### +# Types +############################################################################### + +ctypedef nvJitLinkHandle Handle + + +############################################################################### +# Enum +############################################################################### + +ctypedef nvJitLinkResult _Result +ctypedef nvJitLinkInputType _InputType + + +############################################################################### +# Functions +############################################################################### + +cpdef intptr_t create(uint32_t num_options, options) except -1 +cpdef add_data(intptr_t handle, int input_type, data, size_t size, name) +cpdef add_file(intptr_t handle, int input_type, file_name) +cpdef complete(intptr_t handle) +cpdef size_t get_linked_cubin_size(intptr_t handle) except? 0 +cpdef get_linked_cubin(intptr_t handle, cubin) +cpdef size_t get_linked_ptx_size(intptr_t handle) except? 0 +cpdef get_linked_ptx(intptr_t handle, ptx) +cpdef size_t get_error_log_size(intptr_t handle) except? 0 +cpdef get_error_log(intptr_t handle, log) +cpdef size_t get_info_log_size(intptr_t handle) except? 0 +cpdef get_info_log(intptr_t handle, log) +cpdef tuple version() diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/nvml.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/nvml.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..e6fb5d17002ca0d9eed42b34d4e3f7652dac727f --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/nvml.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d196c36c578f2c80cdc264a0032fef6a2d9fddd15563b54a607d3ed0c5549bb0 +size 4641960 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/nvml.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/nvml.pxd new file mode 100644 index 0000000000000000000000000000000000000000..45f1d1ac084d696988c3d6a94292e8ac5b55a981 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/nvml.pxd @@ -0,0 +1,433 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.9.1 to 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. + +from libc.stdint cimport intptr_t + +from .cynvml cimport * + + +############################################################################### +# Types +############################################################################### + +ctypedef nvmlDramEncryptionInfo_v1_t DramEncryptionInfo_v1 +ctypedef nvmlMarginTemperature_v1_t MarginTemperature_v1 +ctypedef nvmlFanSpeedInfo_v1_t FanSpeedInfo_v1 +ctypedef nvmlDevicePerfModes_v1_t DevicePerfModes_v1 +ctypedef nvmlDeviceCurrentClockFreqs_v1_t DeviceCurrentClockFreqs_v1 +ctypedef nvmlVgpuHeterogeneousMode_v1_t VgpuHeterogeneousMode_v1 +ctypedef nvmlVgpuPlacementId_v1_t VgpuPlacementId_v1 +ctypedef nvmlVgpuRuntimeState_v1_t VgpuRuntimeState_v1 +ctypedef nvmlConfComputeSetKeyRotationThresholdInfo_v1_t ConfComputeSetKeyRotationThresholdInfo_v1 +ctypedef nvmlConfComputeGetKeyRotationThresholdInfo_v1_t ConfComputeGetKeyRotationThresholdInfo_v1 +ctypedef nvmlSystemDriverBranchInfo_v1_t SystemDriverBranchInfo_v1 +ctypedef nvmlTemperature_v1_t Temperature_v1 +ctypedef nvmlDeviceCapabilities_v1_t DeviceCapabilities_v1 +ctypedef nvmlPowerSmoothingProfile_v1_t PowerSmoothingProfile_v1 +ctypedef nvmlPowerSmoothingState_v1_t PowerSmoothingState_v1 +ctypedef nvmlPdi_v1_t Pdi_v1 +ctypedef nvmlDevice_t Device +ctypedef nvmlGpuInstance_t GpuInstance +ctypedef nvmlUnit_t Unit +ctypedef nvmlEventSet_t EventSet +ctypedef nvmlSystemEventSet_t SystemEventSet +ctypedef nvmlComputeInstance_t ComputeInstance +ctypedef nvmlGpmSample_t GpmSample +ctypedef nvmlEccErrorCounts_t EccErrorCounts +ctypedef nvmlProcessInfo_v1_t ProcessInfo_v1 +ctypedef nvmlProcessInfo_v2_t ProcessInfo_v2 +ctypedef nvmlNvLinkUtilizationControl_t NvLinkUtilizationControl +ctypedef nvmlViolationTime_t ViolationTime +ctypedef nvmlUUIDValue_t UUIDValue +ctypedef nvmlVgpuPlacementList_v1_t VgpuPlacementList_v1 +ctypedef nvmlNvLinkPowerThres_t NvLinkPowerThres +ctypedef nvmlGpuInstanceProfileInfo_t GpuInstanceProfileInfo +ctypedef nvmlGpuInstanceProfileInfo_v2_t GpuInstanceProfileInfo_v2 +ctypedef nvmlComputeInstanceProfileInfo_t ComputeInstanceProfileInfo +ctypedef nvmlGpmSupport_t GpmSupport +ctypedef nvmlMask255_t Mask255 +ctypedef nvmlHostname_v1_t Hostname_v1 +ctypedef nvmlUnrepairableMemoryStatus_v1_t UnrepairableMemoryStatus_v1 +ctypedef nvmlRusdSettings_v1_t RusdSettings_v1 +ctypedef nvmlBBXTimeData_v1_t BBXTimeData_v1 +ctypedef nvmlRemappedRowsInfo_v2_t RemappedRowsInfo_v2 +ctypedef nvmlAccountingStats_v2_t AccountingStats_v2 +ctypedef nvmlPowerValue_v2_t PowerValue_v2 +ctypedef nvmlVgpuTypeMaxInstance_v1_t VgpuTypeMaxInstance_v1 +ctypedef nvmlVgpuProcessUtilizationSample_t VgpuProcessUtilizationSample +ctypedef nvmlGpuFabricInfo_t GpuFabricInfo +ctypedef nvmlCPERCursor_v1_t CPERCursor_v1 +ctypedef nvmlSystemEventSetCreateRequest_v1_t SystemEventSetCreateRequest_v1 +ctypedef nvmlSystemEventSetFreeRequest_v1_t SystemEventSetFreeRequest_v1 +ctypedef nvmlSystemRegisterEventRequest_v1_t SystemRegisterEventRequest_v1 +ctypedef nvmlUUID_v1_t UUID_v1 +ctypedef nvmlSystemEventSetWaitRequest_v1_t SystemEventSetWaitRequest_v1 +ctypedef nvmlGpmMetric_t GpmMetric +ctypedef nvmlWorkloadPowerProfileInfo_v1_t WorkloadPowerProfileInfo_v1 +ctypedef nvmlWorkloadPowerProfileCurrentProfiles_v1_t WorkloadPowerProfileCurrentProfiles_v1 +ctypedef nvmlWorkloadPowerProfileRequestedProfiles_v1_t WorkloadPowerProfileRequestedProfiles_v1 +ctypedef nvmlWorkloadPowerProfileUpdateProfiles_v1_t WorkloadPowerProfileUpdateProfiles_v1 +ctypedef nvmlPRMTLV_v1_t PRMTLV_v1 +ctypedef nvmlGetCPER_v1_t GetCPER_v1 +ctypedef nvmlVgpuSchedulerSetState_t VgpuSchedulerSetState +ctypedef nvmlGpmMetricsGet_t GpmMetricsGet +ctypedef nvmlPRMCounterList_v1_t PRMCounterList_v1 +ctypedef nvmlWorkloadPowerProfileProfilesInfo_v1_t WorkloadPowerProfileProfilesInfo_v1 + + +############################################################################### +# Enum +############################################################################### + +ctypedef nvmlBridgeChipType_t _BridgeChipType +ctypedef nvmlNvLinkUtilizationCountUnits_t _NvLinkUtilizationCountUnits +ctypedef nvmlNvLinkUtilizationCountPktTypes_t _NvLinkUtilizationCountPktTypes +ctypedef nvmlNvLinkCapability_t _NvLinkCapability +ctypedef nvmlNvLinkErrorCounter_t _NvLinkErrorCounter +ctypedef nvmlIntNvLinkDeviceType_t _IntNvLinkDeviceType +ctypedef nvmlGpuTopologyLevel_t _GpuTopologyLevel +ctypedef nvmlGpuP2PStatus_t _GpuP2PStatus +ctypedef nvmlGpuP2PCapsIndex_t _GpuP2PCapsIndex +ctypedef nvmlSamplingType_t _SamplingType +ctypedef nvmlPcieUtilCounter_t _PcieUtilCounter +ctypedef nvmlValueType_t _ValueType +ctypedef nvmlPerfPolicyType_t _PerfPolicyType +ctypedef nvmlThermalTarget_t _ThermalTarget +ctypedef nvmlThermalController_t _ThermalController +ctypedef nvmlCoolerControl_t _CoolerControl +ctypedef nvmlCoolerTarget_t _CoolerTarget +ctypedef nvmlUUIDType_t _UUIDType +ctypedef nvmlEnableState_t _EnableState +ctypedef nvmlBrandType_t _BrandType +ctypedef nvmlTemperatureThresholds_t _TemperatureThresholds +ctypedef nvmlTemperatureSensors_t _TemperatureSensors +ctypedef nvmlComputeMode_t _ComputeMode +ctypedef nvmlMemoryErrorType_t _MemoryErrorType +ctypedef nvmlNvlinkVersion_t _NvlinkVersion +ctypedef nvmlEccCounterType_t _EccCounterType +ctypedef nvmlClockType_t _ClockType +ctypedef nvmlClockId_t _ClockId +ctypedef nvmlDriverModel_t _DriverModel +ctypedef nvmlPstates_t _Pstates +ctypedef nvmlGpuOperationMode_t _GpuOperationMode +ctypedef nvmlInforomObject_t _InforomObject +ctypedef nvmlReturn_t _Return +ctypedef nvmlMemoryLocation_t _MemoryLocation +ctypedef nvmlPageRetirementCause_t _PageRetirementCause +ctypedef nvmlRestrictedAPI_t _RestrictedAPI +ctypedef nvmlGpuUtilizationDomainId_t _GpuUtilizationDomainId +ctypedef nvmlGpuVirtualizationMode_t _GpuVirtualizationMode +ctypedef nvmlHostVgpuMode_t _HostVgpuMode +ctypedef nvmlVgpuVmIdType_t _VgpuVmIdType +ctypedef nvmlVgpuGuestInfoState_t _VgpuGuestInfoState +ctypedef nvmlGridLicenseFeatureCode_t _GridLicenseFeatureCode +ctypedef nvmlVgpuCapability_t _VgpuCapability +ctypedef nvmlVgpuDriverCapability_t _VgpuDriverCapability +ctypedef nvmlDeviceVgpuCapability_t _DeviceVgpuCapability +ctypedef nvmlDeviceGpuRecoveryAction_t _DeviceGpuRecoveryAction +ctypedef nvmlFanState_t _FanState +ctypedef nvmlLedColor_t _LedColor +ctypedef nvmlEncoderType_t _EncoderType +ctypedef nvmlFBCSessionType_t _FBCSessionType +ctypedef nvmlDetachGpuState_t _DetachGpuState +ctypedef nvmlPcieLinkState_t _PcieLinkState +ctypedef nvmlClockLimitId_t _ClockLimitId +ctypedef nvmlVgpuVmCompatibility_t _VgpuVmCompatibility +ctypedef nvmlVgpuPgpuCompatibilityLimitCode_t _VgpuPgpuCompatibilityLimitCode +ctypedef nvmlGpmMetricId_t _GpmMetricId +ctypedef nvmlPowerProfileType_t _PowerProfileType +ctypedef nvmlDeviceAddressingModeType_t _DeviceAddressingModeType +ctypedef nvmlPRMCounterId_t _PRMCounterId +ctypedef nvmlPowerProfileOperation_t _PowerProfileOperation +ctypedef nvmlProcessMode_t _ProcessMode +ctypedef nvmlCPERType_t _CPERType + + +############################################################################### +# Functions +############################################################################### + +cpdef init_v2() +cpdef init_with_flags(unsigned int flags) +cpdef shutdown() +cpdef str error_string(int result) +cpdef str system_get_driver_version() +cpdef str system_get_nvml_version() +cpdef int system_get_cuda_driver_version() except * +cpdef int system_get_cuda_driver_version_v2() except 0 +cpdef str system_get_process_name(unsigned int pid) +cpdef object system_get_hic_version() +cpdef unsigned int unit_get_count() except? 0 +cpdef intptr_t unit_get_handle_by_index(unsigned int index) except? 0 +cpdef object unit_get_unit_info(intptr_t unit) +cpdef object unit_get_led_state(intptr_t unit) +cpdef object unit_get_psu_info(intptr_t unit) +cpdef unsigned int unit_get_temperature(intptr_t unit, unsigned int type) except? 0 +cpdef object unit_get_fan_speed_info(intptr_t unit) +cpdef unsigned int device_get_count_v2() except? 0 +cpdef object device_get_attributes_v2(intptr_t device) +cpdef intptr_t device_get_handle_by_index_v2(unsigned int index) except? 0 +cpdef intptr_t device_get_handle_by_serial(serial) except? 0 +cpdef intptr_t device_get_handle_by_uuid(uuid) except? 0 +cpdef intptr_t device_get_handle_by_pci_bus_id_v2(pci_bus_id) except? 0 +cpdef str device_get_name(intptr_t device) +cpdef int device_get_brand(intptr_t device) except? -1 +cpdef unsigned int device_get_index(intptr_t device) except? 0 +cpdef str device_get_serial(intptr_t device) +cpdef unsigned int device_get_module_id(intptr_t device) except? 0 +cpdef object device_get_c2c_mode_info_v(intptr_t device) +cpdef object device_get_memory_affinity(intptr_t device, unsigned int node_set_size, unsigned int scope) +cpdef object device_get_cpu_affinity_within_scope(intptr_t device, unsigned int cpu_set_size, unsigned int scope) +cpdef object device_get_cpu_affinity(intptr_t device, unsigned int cpu_set_size) +cpdef device_set_cpu_affinity(intptr_t device) +cpdef device_clear_cpu_affinity(intptr_t device) +cpdef unsigned int device_get_numa_node_id(intptr_t device) except? 0 +cpdef int device_get_topology_common_ancestor(intptr_t device1, intptr_t device2) except? -1 +cpdef int device_get_p2p_status(intptr_t device1, intptr_t device2, int p2p_index) except? -1 +cpdef str device_get_uuid(intptr_t device) +cpdef unsigned int device_get_minor_number(intptr_t device) except? 0 +cpdef str device_get_board_part_number(intptr_t device) +cpdef str device_get_inforom_version(intptr_t device, int object) +cpdef str device_get_inforom_image_version(intptr_t device) +cpdef unsigned int device_get_inforom_configuration_checksum(intptr_t device) except? 0 +cpdef device_validate_inforom(intptr_t device) +cpdef tuple device_get_last_bbx_flush_time(intptr_t device) +cpdef int device_get_display_mode(intptr_t device) except? -1 +cpdef int device_get_display_active(intptr_t device) except? -1 +cpdef int device_get_persistence_mode(intptr_t device) except? -1 +cpdef object device_get_pci_info_ext(intptr_t device) +cpdef object device_get_pci_info_v3(intptr_t device) +cpdef unsigned int device_get_max_pcie_link_generation(intptr_t device) except? 0 +cpdef unsigned int device_get_gpu_max_pcie_link_generation(intptr_t device) except? 0 +cpdef unsigned int device_get_max_pcie_link_width(intptr_t device) except? 0 +cpdef unsigned int device_get_curr_pcie_link_generation(intptr_t device) except? 0 +cpdef unsigned int device_get_curr_pcie_link_width(intptr_t device) except? 0 +cpdef unsigned int device_get_pcie_throughput(intptr_t device, int counter) except? 0 +cpdef unsigned int device_get_pcie_replay_counter(intptr_t device) except? 0 +cpdef unsigned int device_get_clock_info(intptr_t device, int type) except? 0 +cpdef unsigned int device_get_max_clock_info(intptr_t device, int type) except? 0 +cpdef int device_get_gpc_clk_vf_offset(intptr_t device) except? 0 +cpdef unsigned int device_get_clock(intptr_t device, int clock_type, int clock_id) except? 0 +cpdef unsigned int device_get_max_customer_boost_clock(intptr_t device, int clock_type) except? 0 +cpdef object device_get_supported_memory_clocks(intptr_t device) +cpdef object device_get_supported_graphics_clocks(intptr_t device, unsigned int memory_clock_m_hz) +cpdef tuple device_get_auto_boosted_clocks_enabled(intptr_t device) +cpdef unsigned int device_get_fan_speed(intptr_t device) except? 0 +cpdef unsigned int device_get_fan_speed_v2(intptr_t device, unsigned int fan) except? 0 +cpdef unsigned int device_get_target_fan_speed(intptr_t device, unsigned int fan) except? 0 +cpdef tuple device_get_min_max_fan_speed(intptr_t device) +cpdef unsigned int device_get_fan_control_policy_v2(intptr_t device, unsigned int fan) except * +cpdef unsigned int device_get_num_fans(intptr_t device) except? 0 +cpdef object device_get_cooler_info(intptr_t device) +cpdef unsigned int device_get_temperature_threshold(intptr_t device, int threshold_type) except? 0 +cpdef object device_get_thermal_settings(intptr_t device, unsigned int sensor_index) +cpdef int device_get_performance_state(intptr_t device) except? -1 +cpdef unsigned long long device_get_current_clocks_event_reasons(intptr_t device) except? 0 +cpdef unsigned long long device_get_supported_clocks_event_reasons(intptr_t device) except? 0 +cpdef int device_get_power_state(intptr_t device) except? -1 +cpdef object device_get_dynamic_pstates_info(intptr_t device) +cpdef int device_get_mem_clk_vf_offset(intptr_t device) except? 0 +cpdef tuple device_get_min_max_clock_of_p_state(intptr_t device, int type, int pstate) +cpdef tuple device_get_gpc_clk_min_max_vf_offset(intptr_t device) +cpdef tuple device_get_mem_clk_min_max_vf_offset(intptr_t device) +cpdef device_set_clock_offsets(intptr_t device, intptr_t info) +cpdef unsigned int device_get_power_management_limit(intptr_t device) except? 0 +cpdef tuple device_get_power_management_limit_constraints(intptr_t device) +cpdef unsigned int device_get_power_management_default_limit(intptr_t device) except? 0 +cpdef unsigned int device_get_power_usage(intptr_t device) except? 0 +cpdef unsigned long long device_get_total_energy_consumption(intptr_t device) except? 0 +cpdef unsigned int device_get_enforced_power_limit(intptr_t device) except? 0 +cpdef tuple device_get_gpu_operation_mode(intptr_t device) +cpdef object device_get_memory_info_v2(intptr_t device) +cpdef int device_get_compute_mode(intptr_t device) except? -1 +cpdef tuple device_get_cuda_compute_capability(intptr_t device) +cpdef tuple device_get_ecc_mode(intptr_t device) +cpdef int device_get_default_ecc_mode(intptr_t device) except? -1 +cpdef unsigned int device_get_board_id(intptr_t device) except? 0 +cpdef unsigned int device_get_multi_gpu_board(intptr_t device) except? 0 +cpdef unsigned long long device_get_total_ecc_errors(intptr_t device, int error_type, int counter_type) except? 0 +cpdef unsigned long long device_get_memory_error_counter(intptr_t device, int error_type, int counter_type, int location_type) except? 0 +cpdef object device_get_utilization_rates(intptr_t device) +cpdef tuple device_get_encoder_utilization(intptr_t device) +cpdef unsigned int device_get_encoder_capacity(intptr_t device, int encoder_query_type) except? 0 +cpdef tuple device_get_encoder_stats(intptr_t device) +cpdef object device_get_encoder_sessions(intptr_t device) +cpdef tuple device_get_decoder_utilization(intptr_t device) +cpdef tuple device_get_jpg_utilization(intptr_t device) +cpdef tuple device_get_ofa_utilization(intptr_t device) +cpdef object device_get_fbc_stats(intptr_t device) +cpdef object device_get_fbc_sessions(intptr_t device) +cpdef tuple device_get_driver_model_v2(intptr_t device) +cpdef str device_get_vbios_version(intptr_t device) +cpdef object device_get_bridge_chip_info(intptr_t device) +cpdef object device_get_compute_running_processes_v3(intptr_t device) +cpdef object device_get_graphics_running_processes_v3(intptr_t device) +cpdef object device_get_mps_compute_running_processes_v3(intptr_t device) +cpdef int device_on_same_board(intptr_t device1, intptr_t device2) except? 0 +cpdef int device_get_api_restriction(intptr_t device, int api_type) except? -1 +cpdef object device_get_bar1_memory_info(intptr_t device) +cpdef unsigned int device_get_irq_num(intptr_t device) except? 0 +cpdef unsigned int device_get_num_gpu_cores(intptr_t device) except? 0 +cpdef unsigned int device_get_power_source(intptr_t device) except * +cpdef unsigned int device_get_memory_bus_width(intptr_t device) except? 0 +cpdef unsigned int device_get_pcie_link_max_speed(intptr_t device) except? 0 +cpdef unsigned int device_get_pcie_speed(intptr_t device) except? 0 +cpdef unsigned int device_get_adaptive_clock_info_status(intptr_t device) except? 0 +cpdef unsigned int device_get_bus_type(intptr_t device) except? 0 +cpdef object system_get_conf_compute_capabilities() +cpdef object system_get_conf_compute_state() +cpdef object device_get_conf_compute_mem_size_info(intptr_t device) +cpdef unsigned int system_get_conf_compute_gpus_ready_state() except? 0 +cpdef object device_get_conf_compute_protected_memory_usage(intptr_t device) +cpdef object device_get_conf_compute_gpu_certificate(intptr_t device) +cpdef device_set_conf_compute_unprotected_mem_size(intptr_t device, unsigned long long size_ki_b) +cpdef system_set_conf_compute_gpus_ready_state(unsigned int is_accepting_work) +cpdef object system_get_conf_compute_settings() +cpdef char device_get_gsp_firmware_version(intptr_t device) except? 0 +cpdef tuple device_get_gsp_firmware_mode(intptr_t device) +cpdef object device_get_sram_ecc_error_status(intptr_t device) +cpdef int device_get_accounting_mode(intptr_t device) except? -1 +cpdef object device_get_accounting_stats(intptr_t device, unsigned int pid) +cpdef object device_get_accounting_pids(intptr_t device) +cpdef unsigned int device_get_accounting_buffer_size(intptr_t device) except? 0 +cpdef object device_get_retired_pages(intptr_t device, int cause) +cpdef int device_get_retired_pages_pending_status(intptr_t device) except? -1 +cpdef tuple device_get_remapped_rows(intptr_t device) +cpdef object device_get_row_remapper_histogram(intptr_t device) +cpdef unsigned int device_get_architecture(intptr_t device) except? 0 +cpdef object device_get_clk_mon_status(intptr_t device) +cpdef object device_get_process_utilization(intptr_t device, unsigned long long last_seen_time_stamp) +cpdef unit_set_led_state(intptr_t unit, int color) +cpdef device_set_persistence_mode(intptr_t device, int mode) +cpdef device_set_compute_mode(intptr_t device, int mode) +cpdef device_set_ecc_mode(intptr_t device, int ecc) +cpdef device_clear_ecc_error_counts(intptr_t device, int counter_type) +cpdef device_set_driver_model(intptr_t device, int driver_model, unsigned int flags) +cpdef device_set_gpu_locked_clocks(intptr_t device, unsigned int min_gpu_clock_m_hz, unsigned int max_gpu_clock_m_hz) +cpdef device_reset_gpu_locked_clocks(intptr_t device) +cpdef device_set_memory_locked_clocks(intptr_t device, unsigned int min_mem_clock_m_hz, unsigned int max_mem_clock_m_hz) +cpdef device_reset_memory_locked_clocks(intptr_t device) +cpdef device_set_auto_boosted_clocks_enabled(intptr_t device, int enabled) +cpdef device_set_default_auto_boosted_clocks_enabled(intptr_t device, int enabled, unsigned int flags) +cpdef device_set_default_fan_speed_v2(intptr_t device, unsigned int fan) +cpdef device_set_fan_control_policy(intptr_t device, unsigned int fan, unsigned int policy) +cpdef device_set_gpu_operation_mode(intptr_t device, int mode) +cpdef device_set_api_restriction(intptr_t device, int api_type, int is_restricted) +cpdef device_set_fan_speed_v2(intptr_t device, unsigned int fan, unsigned int speed) +cpdef device_set_accounting_mode(intptr_t device, int mode) +cpdef device_clear_accounting_pids(intptr_t device) +cpdef int device_get_nvlink_state(intptr_t device, unsigned int link) except? -1 +cpdef unsigned int device_get_nvlink_version(intptr_t device, unsigned int link) except? 0 +cpdef unsigned int device_get_nvlink_capability(intptr_t device, unsigned int link, int capability) except? 0 +cpdef object device_get_nvlink_remote_pci_info_v2(intptr_t device, unsigned int link) +cpdef unsigned long long device_get_nvlink_error_counter(intptr_t device, unsigned int link, int counter) except? 0 +cpdef device_reset_nvlink_error_counters(intptr_t device, unsigned int link) +cpdef int device_get_nvlink_remote_device_type(intptr_t device, unsigned int link) except? -1 +cpdef system_set_nvlink_bw_mode(unsigned int nvlink_bw_mode) +cpdef unsigned int system_get_nvlink_bw_mode() except? 0 +cpdef object device_get_nvlink_supported_bw_modes(intptr_t device) +cpdef object device_get_nvlink_bw_mode(intptr_t device) +cpdef device_set_nvlink_bw_mode(intptr_t device, intptr_t set_bw_mode) +cpdef intptr_t event_set_create() except? 0 +cpdef device_register_events(intptr_t device, unsigned long long event_types, intptr_t set) +cpdef unsigned long long device_get_supported_event_types(intptr_t device) except? 0 +cpdef object event_set_wait_v2(intptr_t set, unsigned int timeoutms) +cpdef event_set_free(intptr_t set) +cpdef device_modify_drain_state(intptr_t pci_info, int new_state) +cpdef int device_query_drain_state(intptr_t pci_info) except? -1 +cpdef device_remove_gpu_v2(intptr_t pci_info, int gpu_state, int link_state) +cpdef device_discover_gpus(intptr_t pci_info) +cpdef int device_get_virtualization_mode(intptr_t device) except? -1 +cpdef int device_get_host_vgpu_mode(intptr_t device) except? -1 +cpdef device_set_virtualization_mode(intptr_t device, int virtual_mode) +cpdef unsigned long long vgpu_type_get_gsp_heap_size(unsigned int vgpu_type_id) except? 0 +cpdef unsigned long long vgpu_type_get_fb_reservation(unsigned int vgpu_type_id) except? 0 +cpdef device_set_vgpu_capabilities(intptr_t device, int capability, int state) +cpdef object device_get_grid_licensable_features_v4(intptr_t device) +cpdef unsigned int get_vgpu_driver_capabilities(int capability) except? 0 +cpdef unsigned int device_get_vgpu_capabilities(intptr_t device, int capability) except? 0 +cpdef str vgpu_type_get_class(unsigned int vgpu_type_id) +cpdef unsigned int vgpu_type_get_gpu_instance_profile_id(unsigned int vgpu_type_id) except? 0 +cpdef tuple vgpu_type_get_device_id(unsigned int vgpu_type_id) +cpdef unsigned long long vgpu_type_get_framebuffer_size(unsigned int vgpu_type_id) except? 0 +cpdef unsigned int vgpu_type_get_num_display_heads(unsigned int vgpu_type_id) except? 0 +cpdef tuple vgpu_type_get_resolution(unsigned int vgpu_type_id, unsigned int display_index) +cpdef str vgpu_type_get_license(unsigned int vgpu_type_id) +cpdef unsigned int vgpu_type_get_frame_rate_limit(unsigned int vgpu_type_id) except? 0 +cpdef unsigned int vgpu_type_get_max_instances(intptr_t device, unsigned int vgpu_type_id) except? 0 +cpdef unsigned int vgpu_type_get_max_instances_per_vm(unsigned int vgpu_type_id) except? 0 +cpdef object vgpu_type_get_bar1_info(unsigned int vgpu_type_id) +cpdef str vgpu_instance_get_uuid(unsigned int vgpu_instance) +cpdef str vgpu_instance_get_vm_driver_version(unsigned int vgpu_instance) +cpdef unsigned long long vgpu_instance_get_fb_usage(unsigned int vgpu_instance) except? 0 +cpdef unsigned int vgpu_instance_get_license_status(unsigned int vgpu_instance) except? 0 +cpdef unsigned int vgpu_instance_get_type(unsigned int vgpu_instance) except? 0 +cpdef unsigned int vgpu_instance_get_frame_rate_limit(unsigned int vgpu_instance) except? 0 +cpdef int vgpu_instance_get_ecc_mode(unsigned int vgpu_instance) except? -1 +cpdef unsigned int vgpu_instance_get_encoder_capacity(unsigned int vgpu_instance) except? 0 +cpdef vgpu_instance_set_encoder_capacity(unsigned int vgpu_instance, unsigned int encoder_capacity) +cpdef tuple vgpu_instance_get_encoder_stats(unsigned int vgpu_instance) +cpdef object vgpu_instance_get_encoder_sessions(unsigned int vgpu_instance) +cpdef object vgpu_instance_get_fbc_stats(unsigned int vgpu_instance) +cpdef object vgpu_instance_get_fbc_sessions(unsigned int vgpu_instance) +cpdef unsigned int vgpu_instance_get_gpu_instance_id(unsigned int vgpu_instance) except? 0 +cpdef str vgpu_instance_get_gpu_pci_id(unsigned int vgpu_instance) +cpdef unsigned int vgpu_type_get_capabilities(unsigned int vgpu_type_id, int capability) except? 0 +cpdef str vgpu_instance_get_mdev_uuid(unsigned int vgpu_instance) +cpdef gpu_instance_set_vgpu_scheduler_state(intptr_t gpu_instance, intptr_t p_scheduler) +cpdef object gpu_instance_get_vgpu_scheduler_state(intptr_t gpu_instance) +cpdef object gpu_instance_get_vgpu_scheduler_log(intptr_t gpu_instance) +cpdef str device_get_pgpu_metadata_string(intptr_t device) +cpdef object device_get_vgpu_scheduler_log(intptr_t device) +cpdef object device_get_vgpu_scheduler_state(intptr_t device) +cpdef object device_get_vgpu_scheduler_capabilities(intptr_t device) +cpdef device_set_vgpu_scheduler_state(intptr_t device, intptr_t p_scheduler_state) +cpdef set_vgpu_version(intptr_t vgpu_version) +cpdef tuple device_get_vgpu_process_utilization(intptr_t device, unsigned long long last_seen_time_stamp) +cpdef int vgpu_instance_get_accounting_mode(unsigned int vgpu_instance) except? -1 +cpdef object vgpu_instance_get_accounting_pids(unsigned int vgpu_instance) +cpdef object vgpu_instance_get_accounting_stats(unsigned int vgpu_instance, unsigned int pid) +cpdef vgpu_instance_clear_accounting_pids(unsigned int vgpu_instance) +cpdef object vgpu_instance_get_license_info_v2(unsigned int vgpu_instance) +cpdef unsigned int get_excluded_device_count() except? 0 +cpdef object get_excluded_device_info_by_index(unsigned int index) +cpdef int device_set_mig_mode(intptr_t device, unsigned int mode) except? -1 +cpdef tuple device_get_mig_mode(intptr_t device) +cpdef object device_get_gpu_instance_possible_placements_v2(intptr_t device, unsigned int profile_id) +cpdef unsigned int device_get_gpu_instance_remaining_capacity(intptr_t device, unsigned int profile_id) except? 0 +cpdef intptr_t device_create_gpu_instance(intptr_t device, unsigned int profile_id) except? 0 +cpdef intptr_t device_create_gpu_instance_with_placement(intptr_t device, unsigned int profile_id, intptr_t placement) except? 0 +cpdef gpu_instance_destroy(intptr_t gpu_instance) +cpdef intptr_t device_get_gpu_instance_by_id(intptr_t device, unsigned int id) except? 0 +cpdef object gpu_instance_get_info(intptr_t gpu_instance) +cpdef object gpu_instance_get_compute_instance_profile_info_v(intptr_t gpu_instance, unsigned int profile, unsigned int eng_profile) +cpdef unsigned int gpu_instance_get_compute_instance_remaining_capacity(intptr_t gpu_instance, unsigned int profile_id) except? 0 +cpdef object gpu_instance_get_compute_instance_possible_placements(intptr_t gpu_instance, unsigned int profile_id) +cpdef intptr_t gpu_instance_create_compute_instance(intptr_t gpu_instance, unsigned int profile_id) except? 0 +cpdef intptr_t gpu_instance_create_compute_instance_with_placement(intptr_t gpu_instance, unsigned int profile_id, intptr_t placement) except? 0 +cpdef compute_instance_destroy(intptr_t compute_instance) +cpdef intptr_t gpu_instance_get_compute_instance_by_id(intptr_t gpu_instance, unsigned int id) except? 0 +cpdef object compute_instance_get_info_v2(intptr_t compute_instance) +cpdef unsigned int device_is_mig_device_handle(intptr_t device) except? 0 +cpdef unsigned int device_get_gpu_instance_id(intptr_t device) except? 0 +cpdef unsigned int device_get_compute_instance_id(intptr_t device) except? 0 +cpdef unsigned int device_get_max_mig_device_count(intptr_t device) except? 0 +cpdef intptr_t device_get_mig_device_handle_by_index(intptr_t device, unsigned int index) except? 0 +cpdef intptr_t device_get_device_handle_from_mig_device_handle(intptr_t mig_device) except? 0 +cpdef device_power_smoothing_activate_preset_profile(intptr_t device, intptr_t profile) +cpdef device_power_smoothing_update_preset_profile_param(intptr_t device, intptr_t profile) +cpdef device_power_smoothing_set_state(intptr_t device, intptr_t state) +cpdef object device_get_addressing_mode(intptr_t device) +cpdef object device_get_repair_status(intptr_t device) +cpdef object device_get_power_mizer_mode_v1(intptr_t device) +cpdef device_set_power_mizer_mode_v1(intptr_t device, intptr_t power_mizer_mode) +cpdef device_vgpu_force_gsp_unload(intptr_t device) +cpdef object device_get_vgpu_scheduler_state_v2(intptr_t device) +cpdef object gpu_instance_get_vgpu_scheduler_state_v2(intptr_t gpu_instance) +cpdef object device_get_vgpu_scheduler_log_v2(intptr_t device) +cpdef object gpu_instance_get_vgpu_scheduler_log_v2(intptr_t gpu_instance) +cpdef device_set_vgpu_scheduler_state_v2(intptr_t device, intptr_t p_scheduler_state) +cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, intptr_t p_scheduler_state) diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/nvrtc.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/nvrtc.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..521c570d47f138340616cb168b229fd0df28e77f --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/nvrtc.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc5c75f7e2e3743e0be0b66aaaa505ab73e20ba90c7d8bf90be55ae854beb45f +size 447008 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/nvrtc.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/nvrtc.pxd new file mode 100644 index 0000000000000000000000000000000000000000..743c75f88379a955f5cc2e22073e541fc5e1ab0f --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/nvrtc.pxd @@ -0,0 +1,93 @@ +# 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 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. +cimport cuda.bindings.cynvrtc as cynvrtc + +include "_lib/utils.pxd" + +cdef class nvrtcProgram: + """ nvrtcProgram is the unit of compilation, and an opaque handle for a program. + + To compile a CUDA program string, an instance of nvrtcProgram must be created first with nvrtcCreateProgram, then compiled with nvrtcCompileProgram. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cynvrtc.nvrtcProgram _pvt_val + cdef cynvrtc.nvrtcProgram* _pvt_ptr + +cdef class anon_struct0: + """ + Attributes + ---------- + + available : int + + + + compressedSize : size_t + + + + uncompressedSize : size_t + + + + cudaVersionMajor : int + + + + cudaVersionMinor : int + + + + numFiles : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cynvrtc.nvrtcBundledHeadersInfo* _pvt_ptr + +cdef class nvrtcBundledHeadersInfo(anon_struct0): + """ + Attributes + ---------- + + available : int + + + + compressedSize : size_t + + + + uncompressedSize : size_t + + + + cudaVersionMajor : int + + + + cudaVersionMinor : int + + + + numFiles : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cynvrtc.nvrtcBundledHeadersInfo _pvt_val diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/nvvm.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/nvvm.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..9f8d713997fbac8c35f9b9843e074eb2f9f65f10 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/nvvm.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06637fc90fbcafd4e332da36feff645f199eb6b709cc1fbb8250177cd33f062d +size 107816 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/nvvm.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/nvvm.pxd new file mode 100644 index 0000000000000000000000000000000000000000..4cf37a3464ad05bad49ae443e5505173de9e600c --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/nvvm.pxd @@ -0,0 +1,42 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. + +from libc.stdint cimport intptr_t + +from .cynvvm cimport * + + +############################################################################### +# Types +############################################################################### + +ctypedef nvvmProgram Program + + +############################################################################### +# Enum +############################################################################### + +ctypedef nvvmResult _Result + + +############################################################################### +# Functions +############################################################################### + +cpdef str get_error_string(int result) +cpdef tuple version() +cpdef tuple ir_version() +cpdef intptr_t create_program() except? 0 +cpdef add_module_to_program(intptr_t prog, buffer, size_t size, name) +cpdef lazy_add_module_to_program(intptr_t prog, buffer, size_t size, name) +cpdef compile_program(intptr_t prog, int num_options, options) +cpdef verify_program(intptr_t prog, int num_options, options) +cpdef size_t get_compiled_result_size(intptr_t prog) except? 0 +cpdef get_compiled_result(intptr_t prog, buffer) +cpdef size_t get_program_log_size(intptr_t prog) except? 0 +cpdef get_program_log(intptr_t prog, buffer) +cpdef int llvm_version(arch) except? 0 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/runtime.cpython-312-x86_64-linux-gnu.so b/venv/lib/python3.12/site-packages/cuda/bindings/runtime.cpython-312-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..15babcef4eab3955250bab5a982b3eb60dbd57c3 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/runtime.cpython-312-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69ec677ad39c8aafde1a574ce9f6ae4ec435866dbf0d30cb87514695a218b3a3 +size 5398176 diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/runtime.pxd b/venv/lib/python3.12/site-packages/cuda/bindings/runtime.pxd new file mode 100644 index 0000000000000000000000000000000000000000..8f5723e60b6226e08ea981ccfd2c5e52b575a86a --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/runtime.pxd @@ -0,0 +1,3910 @@ +# 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 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly. +cimport cuda.bindings.cyruntime as cyruntime + +include "_lib/utils.pxd" +cimport cuda.bindings.driver as driver + +cdef class cudaDevResourceDesc_t: + """ + + An opaque descriptor handle. The descriptor encapsulates multiple created and configured resources. Created via ::cudaDeviceResourceGenerateDesc + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaDevResourceDesc_t _pvt_val + cdef cyruntime.cudaDevResourceDesc_t* _pvt_ptr + +cdef class cudaExecutionContext_t: + """ + + An opaque handle to a CUDA execution context. It represents an execution context created via CUDA Runtime APIs such as cudaGreenCtxCreate. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaExecutionContext_t _pvt_val + cdef cyruntime.cudaExecutionContext_t* _pvt_ptr + +cdef class cudaArray_t: + """ + + CUDA array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaArray_t _pvt_val + cdef cyruntime.cudaArray_t* _pvt_ptr + +cdef class cudaArray_const_t: + """ + + CUDA array (as source copy argument) + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaArray_const_t _pvt_val + cdef cyruntime.cudaArray_const_t* _pvt_ptr + +cdef class cudaMipmappedArray_t: + """ + + CUDA mipmapped array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaMipmappedArray_t _pvt_val + cdef cyruntime.cudaMipmappedArray_t* _pvt_ptr + +cdef class cudaMipmappedArray_const_t: + """ + + CUDA mipmapped array (as source argument) + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaMipmappedArray_const_t _pvt_val + cdef cyruntime.cudaMipmappedArray_const_t* _pvt_ptr + +cdef class cudaGraphicsResource_t: + """ + + CUDA graphics resource types + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaGraphicsResource_t _pvt_val + cdef cyruntime.cudaGraphicsResource_t* _pvt_ptr + +cdef class cudaExternalMemory_t: + """ + + CUDA external memory + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaExternalMemory_t _pvt_val + cdef cyruntime.cudaExternalMemory_t* _pvt_ptr + +cdef class cudaExternalSemaphore_t: + """ + + CUDA external semaphore + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaExternalSemaphore_t _pvt_val + cdef cyruntime.cudaExternalSemaphore_t* _pvt_ptr + +cdef class cudaKernel_t: + """ + + CUDA kernel + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaKernel_t _pvt_val + cdef cyruntime.cudaKernel_t* _pvt_ptr + +cdef class cudaLibrary_t: + """ + + CUDA library + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaLibrary_t _pvt_val + cdef cyruntime.cudaLibrary_t* _pvt_ptr + +cdef class cudaGraphDeviceNode_t: + """ + + CUDA device node handle for device-side node update + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaGraphDeviceNode_t _pvt_val + cdef cyruntime.cudaGraphDeviceNode_t* _pvt_ptr + +cdef class cudaAsyncCallbackHandle_t: + """ + + CUDA async callback handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaAsyncCallbackHandle_t _pvt_val + cdef cyruntime.cudaAsyncCallbackHandle_t* _pvt_ptr + +cdef class cudaLogsCallbackHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaLogsCallbackHandle _pvt_val + cdef cyruntime.cudaLogsCallbackHandle* _pvt_ptr + +cdef class EGLImageKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.EGLImageKHR _pvt_val + cdef cyruntime.EGLImageKHR* _pvt_ptr + +cdef class EGLStreamKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.EGLStreamKHR _pvt_val + cdef cyruntime.EGLStreamKHR* _pvt_ptr + +cdef class EGLSyncKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.EGLSyncKHR _pvt_val + cdef cyruntime.EGLSyncKHR* _pvt_ptr + +cdef class cudaHostFn_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaHostFn_t _pvt_val + cdef cyruntime.cudaHostFn_t* _pvt_ptr + +cdef class cudaAsyncCallback: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaAsyncCallback _pvt_val + cdef cyruntime.cudaAsyncCallback* _pvt_ptr + +cdef class cudaStreamCallback_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaStreamCallback_t _pvt_val + cdef cyruntime.cudaStreamCallback_t* _pvt_ptr + +cdef class cudaGraphRecaptureCallback_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaGraphRecaptureCallback_t _pvt_val + cdef cyruntime.cudaGraphRecaptureCallback_t* _pvt_ptr + +cdef class cudaLogsCallback_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaLogsCallback_t _pvt_val + cdef cyruntime.cudaLogsCallback_t* _pvt_ptr + +cdef class dim3: + """ + Attributes + ---------- + x : unsigned int + + y : unsigned int + + z : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.dim3 _pvt_val + cdef cyruntime.dim3* _pvt_ptr + +cdef class cudaChannelFormatDesc: + """ + CUDA Channel format descriptor + + Attributes + ---------- + x : int + x + y : int + y + z : int + z + w : int + w + f : cudaChannelFormatKind + Channel format kind + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaChannelFormatDesc _pvt_val + cdef cyruntime.cudaChannelFormatDesc* _pvt_ptr + +cdef class anon_struct0: + """ + Attributes + ---------- + width : unsigned int + + height : unsigned int + + depth : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaArraySparseProperties* _pvt_ptr + +cdef class cudaArraySparseProperties: + """ + Sparse CUDA array and CUDA mipmapped array properties + + Attributes + ---------- + tileExtent : anon_struct0 + + miptailFirstLevel : unsigned int + First mip level at which the mip tail begins + miptailSize : unsigned long long + Total size of the mip tail. + flags : unsigned int + Flags will either be zero or cudaArraySparsePropertiesSingleMipTail + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaArraySparseProperties _pvt_val + cdef cyruntime.cudaArraySparseProperties* _pvt_ptr + cdef anon_struct0 _tileExtent + +cdef class cudaArrayMemoryRequirements: + """ + CUDA array and CUDA mipmapped array memory requirements + + Attributes + ---------- + size : size_t + Total size of the array. + alignment : size_t + Alignment necessary for mapping the array. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaArrayMemoryRequirements _pvt_val + cdef cyruntime.cudaArrayMemoryRequirements* _pvt_ptr + +cdef class cudaPitchedPtr: + """ + CUDA Pitched memory pointer make_cudaPitchedPtr + + Attributes + ---------- + ptr : Any + Pointer to allocated memory + pitch : size_t + Pitch of allocated memory in bytes + xsize : size_t + Logical width of allocation in elements + ysize : size_t + Logical height of allocation in elements + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaPitchedPtr _pvt_val + cdef cyruntime.cudaPitchedPtr* _pvt_ptr + cdef _HelperInputVoidPtr _cyptr + +cdef class cudaExtent: + """ + CUDA extent make_cudaExtent + + Attributes + ---------- + width : size_t + Width in elements when referring to array memory, in bytes when + referring to linear memory + height : size_t + Height in elements + depth : size_t + Depth in elements + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExtent _pvt_val + cdef cyruntime.cudaExtent* _pvt_ptr + +cdef class cudaPos: + """ + CUDA 3D position make_cudaPos + + Attributes + ---------- + x : size_t + x + y : size_t + y + z : size_t + z + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaPos _pvt_val + cdef cyruntime.cudaPos* _pvt_ptr + +cdef class cudaMemcpy3DParms: + """ + CUDA 3D memory copying parameters + + Attributes + ---------- + srcArray : cudaArray_t + Source memory address + srcPos : cudaPos + Source position offset + srcPtr : cudaPitchedPtr + Pitched source memory address + dstArray : cudaArray_t + Destination memory address + dstPos : cudaPos + Destination position offset + dstPtr : cudaPitchedPtr + Pitched destination memory address + extent : cudaExtent + Requested memory copy size + kind : cudaMemcpyKind + Type of transfer + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DParms _pvt_val + cdef cyruntime.cudaMemcpy3DParms* _pvt_ptr + cdef cudaArray_t _srcArray + cdef cudaPos _srcPos + cdef cudaPitchedPtr _srcPtr + cdef cudaArray_t _dstArray + cdef cudaPos _dstPos + cdef cudaPitchedPtr _dstPtr + cdef cudaExtent _extent + +cdef class cudaMemcpyNodeParams: + """ + Memcpy node parameters + + Attributes + ---------- + flags : int + Must be zero + reserved : int + Must be zero + ctx : cudaExecutionContext_t + Context in which to run the memcpy. If NULL will try to use the + current context. + copyParams : cudaMemcpy3DParms + Parameters for the memory copy + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpyNodeParams _pvt_val + cdef cyruntime.cudaMemcpyNodeParams* _pvt_ptr + cdef cudaExecutionContext_t _ctx + cdef cudaMemcpy3DParms _copyParams + +cdef class cudaMemcpy3DPeerParms: + """ + CUDA 3D cross-device memory copying parameters + + Attributes + ---------- + srcArray : cudaArray_t + Source memory address + srcPos : cudaPos + Source position offset + srcPtr : cudaPitchedPtr + Pitched source memory address + srcDevice : int + Source device + dstArray : cudaArray_t + Destination memory address + dstPos : cudaPos + Destination position offset + dstPtr : cudaPitchedPtr + Pitched destination memory address + dstDevice : int + Destination device + extent : cudaExtent + Requested memory copy size + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DPeerParms _pvt_val + cdef cyruntime.cudaMemcpy3DPeerParms* _pvt_ptr + cdef cudaArray_t _srcArray + cdef cudaPos _srcPos + cdef cudaPitchedPtr _srcPtr + cdef cudaArray_t _dstArray + cdef cudaPos _dstPos + cdef cudaPitchedPtr _dstPtr + cdef cudaExtent _extent + +cdef class cudaMemsetParams: + """ + CUDA Memset node parameters + + Attributes + ---------- + dst : Any + Destination device pointer + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + value : unsigned int + Value to be set + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + width : size_t + Width of the row in elements + height : size_t + Number of rows + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemsetParams _pvt_val + cdef cyruntime.cudaMemsetParams* _pvt_ptr + cdef _HelperInputVoidPtr _cydst + +cdef class cudaMemsetParamsV2: + """ + CUDA Memset node parameters + + Attributes + ---------- + dst : Any + Destination device pointer + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + value : unsigned int + Value to be set + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + width : size_t + Width of the row in elements + height : size_t + Number of rows + ctx : cudaExecutionContext_t + Context in which to run the memset. If NULL will try to use the + current context. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemsetParamsV2 _pvt_val + cdef cyruntime.cudaMemsetParamsV2* _pvt_ptr + cdef _HelperInputVoidPtr _cydst + cdef cudaExecutionContext_t _ctx + +cdef class cudaAccessPolicyWindow: + """ + Specifies an access policy for a window, a contiguous extent of + memory beginning at base_ptr and ending at base_ptr + num_bytes. + Partition into many segments and assign segments such that. sum of + "hit segments" / window == approx. ratio. sum of "miss segments" / + window == approx 1-ratio. Segments and ratio specifications are + fitted to the capabilities of the architecture. Accesses in a hit + segment apply the hitProp access policy. Accesses in a miss segment + apply the missProp access policy. + + Attributes + ---------- + base_ptr : Any + Starting address of the access policy window. CUDA driver may align + it. + num_bytes : size_t + Size in bytes of the window policy. CUDA driver may restrict the + maximum size and alignment. + hitRatio : float + hitRatio specifies percentage of lines assigned hitProp, rest are + assigned missProp. + hitProp : cudaAccessProperty + ::CUaccessProperty set for hit. + missProp : cudaAccessProperty + ::CUaccessProperty set for miss. Must be either NORMAL or + STREAMING. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaAccessPolicyWindow _pvt_val + cdef cyruntime.cudaAccessPolicyWindow* _pvt_ptr + cdef _HelperInputVoidPtr _cybase_ptr + +cdef class cudaHostNodeParams: + """ + CUDA host node parameters + + Attributes + ---------- + fn : cudaHostFn_t + The function to call when the node executes + userData : Any + Argument to pass to the function + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaHostNodeParams _pvt_val + cdef cyruntime.cudaHostNodeParams* _pvt_ptr + cdef cudaHostFn_t _fn + cdef _HelperInputVoidPtr _cyuserData + +cdef class cudaHostNodeParamsV2: + """ + CUDA host node parameters + + Attributes + ---------- + fn : cudaHostFn_t + The function to call when the node executes + userData : Any + Argument to pass to the function + syncMode : unsigned int + The synchronization mode to use for the host task + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaHostNodeParamsV2 _pvt_val + cdef cyruntime.cudaHostNodeParamsV2* _pvt_ptr + cdef cudaHostFn_t _fn + cdef _HelperInputVoidPtr _cyuserData + +cdef class anon_struct1: + """ + Attributes + ---------- + array : cudaArray_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr + cdef cudaArray_t _array + +cdef class anon_struct2: + """ + Attributes + ---------- + mipmap : cudaMipmappedArray_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr + cdef cudaMipmappedArray_t _mipmap + +cdef class anon_struct3: + """ + Attributes + ---------- + devPtr : Any + + desc : cudaChannelFormatDesc + + sizeInBytes : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr + cdef _HelperInputVoidPtr _cydevPtr + cdef cudaChannelFormatDesc _desc + +cdef class anon_struct4: + """ + Attributes + ---------- + devPtr : Any + + desc : cudaChannelFormatDesc + + width : size_t + + height : size_t + + pitchInBytes : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr + cdef _HelperInputVoidPtr _cydevPtr + cdef cudaChannelFormatDesc _desc + +cdef class anon_struct5: + """ + Attributes + ---------- + reserved : list[int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr + +cdef class anon_union0: + """ + Attributes + ---------- + array : anon_struct1 + + mipmap : anon_struct2 + + linear : anon_struct3 + + pitch2D : anon_struct4 + + reserved : anon_struct5 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr + cdef anon_struct1 _array + cdef anon_struct2 _mipmap + cdef anon_struct3 _linear + cdef anon_struct4 _pitch2D + cdef anon_struct5 _reserved + +cdef class cudaResourceDesc: + """ + CUDA resource descriptor + + Attributes + ---------- + resType : cudaResourceType + Resource type + res : anon_union0 + + flags : unsigned int + Flags (must be zero) + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _val_ptr + cdef cyruntime.cudaResourceDesc* _pvt_ptr + cdef anon_union0 _res + +cdef class cudaResourceViewDesc: + """ + CUDA resource view descriptor + + Attributes + ---------- + format : cudaResourceViewFormat + Resource view format + width : size_t + Width of the resource view + height : size_t + Height of the resource view + depth : size_t + Depth of the resource view + firstMipmapLevel : unsigned int + First defined mipmap level + lastMipmapLevel : unsigned int + Last defined mipmap level + firstLayer : unsigned int + First layer index + lastLayer : unsigned int + Last layer index + reserved : list[unsigned int] + Must be zero + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceViewDesc _pvt_val + cdef cyruntime.cudaResourceViewDesc* _pvt_ptr + +cdef class cudaPointerAttributes: + """ + CUDA pointer attributes + + Attributes + ---------- + type : cudaMemoryType + The type of memory - cudaMemoryTypeUnregistered, + cudaMemoryTypeHost, cudaMemoryTypeDevice or cudaMemoryTypeManaged. + device : int + The device against which the memory was allocated or registered. If + the memory type is cudaMemoryTypeDevice then this identifies the + device on which the memory referred physically resides. If the + memory type is cudaMemoryTypeHost or::cudaMemoryTypeManaged then + this identifies the device which was current when the memory was + allocated or registered (and if that device is deinitialized then + this allocation will vanish with that device's state). + devicePointer : Any + The address which may be dereferenced on the current device to + access the memory or NULL if no such address exists. + hostPointer : Any + The address which may be dereferenced on the host to access the + memory or NULL if no such address exists. CUDA doesn't check if + unregistered memory is allocated so this field may contain invalid + pointer if an invalid pointer has been passed to CUDA. + reserved : list[long] + Must be zero + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaPointerAttributes _pvt_val + cdef cyruntime.cudaPointerAttributes* _pvt_ptr + cdef _HelperInputVoidPtr _cydevicePointer + cdef _HelperInputVoidPtr _cyhostPointer + +cdef class cudaFuncAttributes: + """ + CUDA function attributes + + Attributes + ---------- + sharedSizeBytes : size_t + The size in bytes of statically-allocated shared memory per block + required by this function. This does not include dynamically- + allocated shared memory requested by the user at runtime. + constSizeBytes : size_t + The size in bytes of user-allocated constant memory required by + this function. + localSizeBytes : size_t + The size in bytes of local memory used by each thread of this + function. + maxThreadsPerBlock : int + The maximum number of threads per block, beyond which a launch of + the function would fail. This number depends on both the function + and the device on which the function is currently loaded. + numRegs : int + The number of registers used by each thread of this function. + ptxVersion : int + The PTX virtual architecture version for which the function was + compiled. This value is the major PTX version * 10 + the minor PTX + version, so a PTX version 1.3 function would return the value 13. + binaryVersion : int + The binary architecture version for which the function was + compiled. This value is the major binary version * 10 + the minor + binary version, so a binary version 1.3 function would return the + value 13. + cacheModeCA : int + The attribute to indicate whether the function has been compiled + with user specified option "-Xptxas --dlcm=ca" set. + maxDynamicSharedSizeBytes : int + The maximum size in bytes of dynamic shared memory per block for + this function. Any launch must have a dynamic shared memory size + smaller than this value. + preferredShmemCarveout : int + On devices where the L1 cache and shared memory use the same + hardware resources, this sets the shared memory carveout + preference, in percent of the maximum shared memory. Refer to + cudaDevAttrMaxSharedMemoryPerMultiprocessor. This is only a hint, + and the driver can choose a different ratio if required to execute + the function. See cudaFuncSetAttribute + clusterDimMustBeSet : int + If this attribute is set, the kernel must launch with a valid + cluster dimension specified. + requiredClusterWidth : int + The required cluster width/height/depth in blocks. The values must + either all be 0 or all be positive. The validity of the cluster + dimensions is otherwise checked at launch time. If the value is + set during compile time, it cannot be set at runtime. Setting it at + runtime should return cudaErrorNotPermitted. See + cudaFuncSetAttribute + requiredClusterHeight : int + + requiredClusterDepth : int + + clusterSchedulingPolicyPreference : int + The block scheduling policy of a function. See cudaFuncSetAttribute + nonPortableClusterSizeAllowed : int + Whether the function can be launched with non-portable cluster + size. 1 is allowed, 0 is disallowed. A non-portable cluster size + may only function on the specific SKUs the program is tested on. + The launch might fail if the program is run on a different hardware + platform. CUDA API provides cudaOccupancyMaxActiveClusters to + assist with checking whether the desired size can be launched on + the current device. Portable Cluster Size A portable cluster size + is guaranteed to be functional on all compute capabilities higher + than the target compute capability. The portable cluster size for + sm_90 is 8 blocks per cluster. This value may increase for future + compute capabilities. The specific hardware unit may support + higher cluster sizes that’s not guaranteed to be portable. See + cudaFuncSetAttribute + deviceNodeUpdateStatus : int + Whether the function can be updated on device. 1 means device node + update is supported, 0 is unsupported or driver is too old to check + the value. + reserved1 : int + + reserved : list[int] + Reserved for future use. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaFuncAttributes _pvt_val + cdef cyruntime.cudaFuncAttributes* _pvt_ptr + +cdef class cudaMemLocation: + """ + Specifies a memory location. To specify a gpu, set type = + cudaMemLocationTypeDevice and set id = the gpu's device ordinal. To + specify a cpu NUMA node, set type = cudaMemLocationTypeHostNuma and + set id = host NUMA node id. + + Attributes + ---------- + type : cudaMemLocationType + Specifies the location type, which modifies the meaning of id. + id : int + Identifier for cudaMemLocationType::cudaMemLocationTypeDevice, + cudaMemLocationType::cudaMemLocationTypeHost, or + cudaMemLocationType::cudaMemLocationTypeHostNuma. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemLocation* _val_ptr + cdef cyruntime.cudaMemLocation* _pvt_ptr + +cdef class cudaMemAccessDesc: + """ + Memory access descriptor + + Attributes + ---------- + location : cudaMemLocation + Location on which the request is to change it's accessibility + flags : cudaMemAccessFlags + ::CUmemProt accessibility flags to set on the request + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemAccessDesc _pvt_val + cdef cyruntime.cudaMemAccessDesc* _pvt_ptr + cdef cudaMemLocation _location + +cdef class cudaMemPoolProps: + """ + Specifies the properties of allocations made from the pool. + + Attributes + ---------- + allocType : cudaMemAllocationType + Allocation type. Currently must be specified as + cudaMemAllocationTypePinned + handleTypes : cudaMemAllocationHandleType + Handle types that will be supported by allocations from the pool. + location : cudaMemLocation + Location allocations should reside. + win32SecurityAttributes : Any + Windows-specific LPSECURITYATTRIBUTES required when + cudaMemHandleTypeWin32 is specified. This security attribute + defines the scope of which exported allocations may be tranferred + to other processes. In all other cases, this field is required to + be zero. + maxSize : size_t + Maximum pool size. When set to 0, defaults to a system dependent + value. + usage : unsigned short + Bitmask indicating intended usage for the pool. + reserved : bytes + reserved for future use, must be 0 + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemPoolProps _pvt_val + cdef cyruntime.cudaMemPoolProps* _pvt_ptr + cdef cudaMemLocation _location + cdef _HelperInputVoidPtr _cywin32SecurityAttributes + +cdef class cudaMemPoolPtrExportData: + """ + Opaque data for exporting a pool allocation + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemPoolPtrExportData _pvt_val + cdef cyruntime.cudaMemPoolPtrExportData* _pvt_ptr + +cdef class cudaMemAllocNodeParams: + """ + Memory allocation node parameters + + Attributes + ---------- + poolProps : cudaMemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be cudaMemHandleTypeNone. IPC is + not supported. in: array of memory access descriptors. Used to + describe peer GPU access + accessDescs : cudaMemAccessDesc + in: number of memory access descriptors. Must not exceed the number + of GPUs. + accessDescCount : size_t + in: Number of `accessDescs`s + bytesize : size_t + in: size in bytes of the requested allocation + dptr : Any + out: address of the allocation returned by CUDA + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemAllocNodeParams _pvt_val + cdef cyruntime.cudaMemAllocNodeParams* _pvt_ptr + cdef cudaMemPoolProps _poolProps + cdef size_t _accessDescs_length + cdef cyruntime.cudaMemAccessDesc* _accessDescs + cdef _HelperInputVoidPtr _cydptr + +cdef class cudaMemAllocNodeParamsV2: + """ + Memory allocation node parameters + + Attributes + ---------- + poolProps : cudaMemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be cudaMemHandleTypeNone. IPC is + not supported. in: array of memory access descriptors. Used to + describe peer GPU access + accessDescs : cudaMemAccessDesc + in: number of memory access descriptors. Must not exceed the number + of GPUs. + accessDescCount : size_t + in: Number of `accessDescs`s + bytesize : size_t + in: size in bytes of the requested allocation + dptr : Any + out: address of the allocation returned by CUDA + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemAllocNodeParamsV2 _pvt_val + cdef cyruntime.cudaMemAllocNodeParamsV2* _pvt_ptr + cdef cudaMemPoolProps _poolProps + cdef size_t _accessDescs_length + cdef cyruntime.cudaMemAccessDesc* _accessDescs + cdef _HelperInputVoidPtr _cydptr + +cdef class cudaMemFreeNodeParams: + """ + Memory free node parameters + + Attributes + ---------- + dptr : Any + in: the pointer to free + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemFreeNodeParams _pvt_val + cdef cyruntime.cudaMemFreeNodeParams* _pvt_ptr + cdef _HelperInputVoidPtr _cydptr + +cdef class cudaMemcpyAttributes: + """ + Attributes specific to copies within a batch. For more details on + usage see cudaMemcpyBatchAsync. + + Attributes + ---------- + srcAccessOrder : cudaMemcpySrcAccessOrder + Source access ordering to be observed for copies with this + attribute. + srcLocHint : cudaMemLocation + Hint location for the source operand. Ignored when the pointers are + not managed memory or memory allocated outside CUDA. + dstLocHint : cudaMemLocation + Hint location for the destination operand. Ignored when the + pointers are not managed memory or memory allocated outside CUDA. + flags : unsigned int + Additional flags for copies with this attribute. See + cudaMemcpyFlags. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpyAttributes _pvt_val + cdef cyruntime.cudaMemcpyAttributes* _pvt_ptr + cdef cudaMemLocation _srcLocHint + cdef cudaMemLocation _dstLocHint + +cdef class cudaOffset3D: + """ + Struct representing offset into a cudaArray_t in elements + + Attributes + ---------- + x : size_t + + y : size_t + + z : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaOffset3D _pvt_val + cdef cyruntime.cudaOffset3D* _pvt_ptr + +cdef class anon_struct6: + """ + Attributes + ---------- + ptr : Any + + rowLength : size_t + + layerHeight : size_t + + locHint : cudaMemLocation + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr + cdef _HelperInputVoidPtr _cyptr + cdef cudaMemLocation _locHint + +cdef class anon_struct7: + """ + Attributes + ---------- + array : cudaArray_t + + offset : cudaOffset3D + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr + cdef cudaArray_t _array + cdef cudaOffset3D _offset + +cdef class anon_union2: + """ + Attributes + ---------- + ptr : anon_struct6 + + array : anon_struct7 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr + cdef anon_struct6 _ptr + cdef anon_struct7 _array + +cdef class cudaMemcpy3DOperand: + """ + Struct representing an operand for copy with cudaMemcpy3DBatchAsync + + Attributes + ---------- + type : cudaMemcpy3DOperandType + + op : anon_union2 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DOperand* _val_ptr + cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr + cdef anon_union2 _op + +cdef class cudaMemcpy3DBatchOp: + """ + Attributes + ---------- + src : cudaMemcpy3DOperand + Source memcpy operand. + dst : cudaMemcpy3DOperand + Destination memcpy operand. + extent : cudaExtent + Extents of the memcpy between src and dst. The width, height and + depth components must not be 0. + srcAccessOrder : cudaMemcpySrcAccessOrder + Source access ordering to be observed for copy from src to dst. + flags : unsigned int + Additional flags for copy from src to dst. See cudaMemcpyFlags. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DBatchOp _pvt_val + cdef cyruntime.cudaMemcpy3DBatchOp* _pvt_ptr + cdef cudaMemcpy3DOperand _src + cdef cudaMemcpy3DOperand _dst + cdef cudaExtent _extent + +cdef class CUuuid_st: + """ + Attributes + ---------- + bytes : bytes + < CUDA definition of UUID + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.CUuuid_st _pvt_val + cdef cyruntime.CUuuid_st* _pvt_ptr + +cdef class cudaDeviceProp: + """ + CUDA device properties + + Attributes + ---------- + name : bytes + ASCII string identifying device + uuid : cudaUUID_t + 16-byte unique identifier + luid : bytes + 8-byte locally unique identifier. Value is undefined on TCC and + non-Windows platforms + luidDeviceNodeMask : unsigned int + LUID device node mask. Value is undefined on TCC and non-Windows + platforms + totalGlobalMem : size_t + Global memory available on device in bytes + sharedMemPerBlock : size_t + Shared memory available per block in bytes + regsPerBlock : int + 32-bit registers available per block + warpSize : int + Warp size in threads + memPitch : size_t + Maximum pitch in bytes allowed by memory copies + maxThreadsPerBlock : int + Maximum number of threads per block + maxThreadsDim : list[int] + Maximum size of each dimension of a block + maxGridSize : list[int] + Maximum size of each dimension of a grid + totalConstMem : size_t + Constant memory available on device in bytes + major : int + Major compute capability + minor : int + Minor compute capability + textureAlignment : size_t + Alignment requirement for textures + texturePitchAlignment : size_t + Pitch alignment requirement for texture references bound to pitched + memory + multiProcessorCount : int + Number of multiprocessors on device + integrated : int + Device is integrated as opposed to discrete + canMapHostMemory : int + Device can map host memory with + cudaHostAlloc/cudaHostGetDevicePointer + maxTexture1D : int + Maximum 1D texture size + maxTexture1DMipmap : int + Maximum 1D mipmapped texture size + maxTexture2D : list[int] + Maximum 2D texture dimensions + maxTexture2DMipmap : list[int] + Maximum 2D mipmapped texture dimensions + maxTexture2DLinear : list[int] + Maximum dimensions (width, height, pitch) for 2D textures bound to + pitched memory + maxTexture2DGather : list[int] + Maximum 2D texture dimensions if texture gather operations have to + be performed + maxTexture3D : list[int] + Maximum 3D texture dimensions + maxTexture3DAlt : list[int] + Maximum alternate 3D texture dimensions + maxTextureCubemap : int + Maximum Cubemap texture dimensions + maxTexture1DLayered : list[int] + Maximum 1D layered texture dimensions + maxTexture2DLayered : list[int] + Maximum 2D layered texture dimensions + maxTextureCubemapLayered : list[int] + Maximum Cubemap layered texture dimensions + maxSurface1D : int + Maximum 1D surface size + maxSurface2D : list[int] + Maximum 2D surface dimensions + maxSurface3D : list[int] + Maximum 3D surface dimensions + maxSurface1DLayered : list[int] + Maximum 1D layered surface dimensions + maxSurface2DLayered : list[int] + Maximum 2D layered surface dimensions + maxSurfaceCubemap : int + Maximum Cubemap surface dimensions + maxSurfaceCubemapLayered : list[int] + Maximum Cubemap layered surface dimensions + surfaceAlignment : size_t + Alignment requirements for surfaces + concurrentKernels : int + Device can possibly execute multiple kernels concurrently + ECCEnabled : int + Device has ECC support enabled + pciBusID : int + PCI bus ID of the device + pciDeviceID : int + PCI device ID of the device + pciDomainID : int + PCI domain ID of the device + tccDriver : int + 1 if device is a Tesla device using TCC driver, 0 otherwise + asyncEngineCount : int + Number of asynchronous engines + unifiedAddressing : int + Device shares a unified address space with the host + memoryBusWidth : int + Global memory bus width in bits + l2CacheSize : int + Size of L2 cache in bytes + persistingL2CacheMaxSize : int + Device's maximum l2 persisting lines capacity setting in bytes + maxThreadsPerMultiProcessor : int + Maximum resident threads per multiprocessor + streamPrioritiesSupported : int + Device supports stream priorities + globalL1CacheSupported : int + Device supports caching globals in L1 + localL1CacheSupported : int + Device supports caching locals in L1 + sharedMemPerMultiprocessor : size_t + Shared memory available per multiprocessor in bytes + regsPerMultiprocessor : int + 32-bit registers available per multiprocessor + managedMemory : int + Device supports allocating managed memory on this system + isMultiGpuBoard : int + Device is on a multi-GPU board + multiGpuBoardGroupID : int + Unique identifier for a group of devices on the same multi-GPU + board + hostNativeAtomicSupported : int + Link between the device and the host supports native atomic + operations + pageableMemoryAccess : int + Device supports coherently accessing pageable memory without + calling cudaHostRegister on it + concurrentManagedAccess : int + Device can coherently access managed memory concurrently with the + CPU + computePreemptionSupported : int + Device supports Compute Preemption + canUseHostPointerForRegisteredMem : int + Device can access host registered memory at the same virtual + address as the CPU + cooperativeLaunch : int + Device supports launching cooperative kernels via + cudaLaunchCooperativeKernel + sharedMemPerBlockOptin : size_t + Per device maximum shared memory per block usable by special opt in + pageableMemoryAccessUsesHostPageTables : int + Device accesses pageable memory via the host's page tables + directManagedMemAccessFromHost : int + Host can directly access managed memory on the device without + migration. + maxBlocksPerMultiProcessor : int + Maximum number of resident blocks per multiprocessor + accessPolicyMaxWindowSize : int + The maximum value of cudaAccessPolicyWindow::num_bytes. + reservedSharedMemPerBlock : size_t + Shared memory reserved by CUDA driver per block in bytes + hostRegisterSupported : int + Device supports host memory registration via cudaHostRegister. + sparseCudaArraySupported : int + 1 if the device supports sparse CUDA arrays and sparse CUDA + mipmapped arrays, 0 otherwise + hostRegisterReadOnlySupported : int + Device supports using the cudaHostRegister flag + cudaHostRegisterReadOnly to register memory that must be mapped as + read-only to the GPU + timelineSemaphoreInteropSupported : int + External timeline semaphore interop is supported on the device + memoryPoolsSupported : int + 1 if the device supports using the cudaMallocAsync and cudaMemPool + family of APIs, 0 otherwise + gpuDirectRDMASupported : int + 1 if the device supports GPUDirect RDMA APIs, 0 otherwise + gpuDirectRDMAFlushWritesOptions : unsigned int + Bitmask to be interpreted according to the + cudaFlushGPUDirectRDMAWritesOptions enum + gpuDirectRDMAWritesOrdering : int + See the cudaGPUDirectRDMAWritesOrdering enum for numerical values + memoryPoolSupportedHandleTypes : unsigned int + Bitmask of handle types supported with mempool-based IPC + deferredMappingCudaArraySupported : int + 1 if the device supports deferred mapping CUDA arrays and CUDA + mipmapped arrays + ipcEventSupported : int + Device supports IPC Events. + clusterLaunch : int + Indicates device supports cluster launch + unifiedFunctionPointers : int + Indicates device supports unified pointers + deviceNumaConfig : int + NUMA configuration of a device: value is of type + cudaDeviceNumaConfig enum + deviceNumaId : int + NUMA node ID of the GPU memory + mpsEnabled : int + Indicates if contexts created on this device will be shared via MPS + hostNumaId : int + NUMA ID of the host node closest to the device or -1 when system + does not support NUMA + gpuPciDeviceID : unsigned int + The combined 16-bit PCI device ID and 16-bit PCI vendor ID + gpuPciSubsystemID : unsigned int + The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem + vendor ID + hostNumaMultinodeIpcSupported : int + 1 if the device supports HostNuma location IPC between nodes in a + multi-node system. + reserved : list[int] + Reserved for future use + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaDeviceProp _pvt_val + cdef cyruntime.cudaDeviceProp* _pvt_ptr + cdef cudaUUID_t _uuid + +cdef class cudaIpcEventHandle_st: + """ + CUDA IPC event handle + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaIpcEventHandle_st _pvt_val + cdef cyruntime.cudaIpcEventHandle_st* _pvt_ptr + +cdef class cudaIpcMemHandle_st: + """ + CUDA IPC memory handle + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaIpcMemHandle_st _pvt_val + cdef cyruntime.cudaIpcMemHandle_st* _pvt_ptr + +cdef class cudaMemFabricHandle_st: + """ + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemFabricHandle_st _pvt_val + cdef cyruntime.cudaMemFabricHandle_st* _pvt_ptr + +cdef class anon_struct8: + """ + Attributes + ---------- + handle : Any + + name : Any + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalMemoryHandleDesc* _pvt_ptr + cdef _HelperInputVoidPtr _cyhandle + cdef _HelperInputVoidPtr _cyname + +cdef class anon_union3: + """ + Attributes + ---------- + fd : int + + win32 : anon_struct8 + + nvSciBufObject : Any + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalMemoryHandleDesc* _pvt_ptr + cdef anon_struct8 _win32 + cdef _HelperInputVoidPtr _cynvSciBufObject + +cdef class cudaExternalMemoryHandleDesc: + """ + External memory handle descriptor + + Attributes + ---------- + type : cudaExternalMemoryHandleType + Type of the handle + handle : anon_union3 + + size : unsigned long long + Size of the memory allocation + flags : unsigned int + Flags must either be zero or cudaExternalMemoryDedicated + reserved : list[unsigned int] + Must be zero + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalMemoryHandleDesc* _val_ptr + cdef cyruntime.cudaExternalMemoryHandleDesc* _pvt_ptr + cdef anon_union3 _handle + +cdef class cudaExternalMemoryBufferDesc: + """ + External memory buffer descriptor + + Attributes + ---------- + offset : unsigned long long + Offset into the memory object where the buffer's base is + size : unsigned long long + Size of the buffer + flags : unsigned int + Flags reserved for future use. Must be zero. + reserved : list[unsigned int] + Must be zero + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalMemoryBufferDesc _pvt_val + cdef cyruntime.cudaExternalMemoryBufferDesc* _pvt_ptr + +cdef class cudaExternalMemoryMipmappedArrayDesc: + """ + External memory mipmap descriptor + + Attributes + ---------- + offset : unsigned long long + Offset into the memory object where the base level of the mipmap + chain is. + formatDesc : cudaChannelFormatDesc + Format of base level of the mipmap chain + extent : cudaExtent + Dimensions of base level of the mipmap chain + flags : unsigned int + Flags associated with CUDA mipmapped arrays. See + cudaMallocMipmappedArray + numLevels : unsigned int + Total number of levels in the mipmap chain + reserved : list[unsigned int] + Must be zero + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalMemoryMipmappedArrayDesc _pvt_val + cdef cyruntime.cudaExternalMemoryMipmappedArrayDesc* _pvt_ptr + cdef cudaChannelFormatDesc _formatDesc + cdef cudaExtent _extent + +cdef class anon_struct9: + """ + Attributes + ---------- + handle : Any + + name : Any + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreHandleDesc* _pvt_ptr + cdef _HelperInputVoidPtr _cyhandle + cdef _HelperInputVoidPtr _cyname + +cdef class anon_union4: + """ + Attributes + ---------- + fd : int + + win32 : anon_struct9 + + nvSciSyncObj : Any + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreHandleDesc* _pvt_ptr + cdef anon_struct9 _win32 + cdef _HelperInputVoidPtr _cynvSciSyncObj + +cdef class cudaExternalSemaphoreHandleDesc: + """ + External semaphore handle descriptor + + Attributes + ---------- + type : cudaExternalSemaphoreHandleType + Type of the handle + handle : anon_union4 + + flags : unsigned int + Flags reserved for the future. Must be zero. + reserved : list[unsigned int] + Must be zero + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreHandleDesc* _val_ptr + cdef cyruntime.cudaExternalSemaphoreHandleDesc* _pvt_ptr + cdef anon_union4 _handle + +cdef class anon_struct10: + """ + Attributes + ---------- + value : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr + +cdef class anon_union5: + """ + Attributes + ---------- + fence : Any + + reserved : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr + cdef _HelperInputVoidPtr _cyfence + +cdef class anon_struct11: + """ + Attributes + ---------- + key : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr + +cdef class anon_struct12: + """ + Attributes + ---------- + fence : anon_struct10 + + nvSciSync : anon_union5 + + keyedMutex : anon_struct11 + + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr + cdef anon_struct10 _fence + cdef anon_union5 _nvSciSync + cdef anon_struct11 _keyedMutex + +cdef class cudaExternalSemaphoreSignalParams: + """ + External semaphore signal parameters, compatible with driver type + + Attributes + ---------- + params : anon_struct12 + + flags : unsigned int + Only when cudaExternalSemaphoreSignalParams is used to signal a + cudaExternalSemaphore_t of type + cudaExternalSemaphoreHandleTypeNvSciSync, the valid flag is + cudaExternalSemaphoreSignalSkipNvSciBufMemSync: which indicates + that while signaling the cudaExternalSemaphore_t, no memory + synchronization operations should be performed for any external + memory object imported as cudaExternalMemoryHandleTypeNvSciBuf. For + all other types of cudaExternalSemaphore_t, flags must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalParams _pvt_val + cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr + cdef anon_struct12 _params + +cdef class anon_struct13: + """ + Attributes + ---------- + value : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr + +cdef class anon_union6: + """ + Attributes + ---------- + fence : Any + + reserved : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr + cdef _HelperInputVoidPtr _cyfence + +cdef class anon_struct14: + """ + Attributes + ---------- + key : unsigned long long + + timeoutMs : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr + +cdef class anon_struct15: + """ + Attributes + ---------- + fence : anon_struct13 + + nvSciSync : anon_union6 + + keyedMutex : anon_struct14 + + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr + cdef anon_struct13 _fence + cdef anon_union6 _nvSciSync + cdef anon_struct14 _keyedMutex + +cdef class cudaExternalSemaphoreWaitParams: + """ + External semaphore wait parameters, compatible with driver type + + Attributes + ---------- + params : anon_struct15 + + flags : unsigned int + Only when cudaExternalSemaphoreSignalParams is used to signal a + cudaExternalSemaphore_t of type + cudaExternalSemaphoreHandleTypeNvSciSync, the valid flag is + cudaExternalSemaphoreSignalSkipNvSciBufMemSync: which indicates + that while waiting for the cudaExternalSemaphore_t, no memory + synchronization operations should be performed for any external + memory object imported as cudaExternalMemoryHandleTypeNvSciBuf. For + all other types of cudaExternalSemaphore_t, flags must be zero. + reserved : list[unsigned int] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitParams _pvt_val + cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr + cdef anon_struct15 _params + +cdef class cudaDevSmResource: + """ + Data for SM-related resources All parameters in this structure are + OUTPUT only. Do not write to any of the fields in this structure. + + Attributes + ---------- + smCount : unsigned int + The amount of streaming multiprocessors available in this resource. + minSmPartitionSize : unsigned int + The minimum number of streaming multiprocessors required to + partition this resource. + smCoscheduledAlignment : unsigned int + The number of streaming multiprocessors in this resource that are + guaranteed to be co-scheduled on the same GPU processing cluster. + smCount will be a multiple of this value, unless the backfill flag + is set. + flags : unsigned int + The flags set on this SM resource. For available flags see + cudaDevSmResourceGroup_flags. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaDevSmResource _pvt_val + cdef cyruntime.cudaDevSmResource* _pvt_ptr + +cdef class cudaDevWorkqueueConfigResource: + """ + Data for workqueue configuration related resources + + Attributes + ---------- + device : int + The device on which the workqueue resources are available + wqConcurrencyLimit : unsigned int + The expected maximum number of concurrent stream-ordered workloads + sharingScope : cudaDevWorkqueueConfigScope + The sharing scope for the workqueue resources + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaDevWorkqueueConfigResource _pvt_val + cdef cyruntime.cudaDevWorkqueueConfigResource* _pvt_ptr + +cdef class cudaDevWorkqueueResource: + """ + Handle to a pre-existing workqueue related resource + + Attributes + ---------- + reserved : bytes + Reserved for future use + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaDevWorkqueueResource _pvt_val + cdef cyruntime.cudaDevWorkqueueResource* _pvt_ptr + +cdef class cudaDevSmResourceGroupParams_st: + """ + Input data for splitting SMs + + Attributes + ---------- + smCount : unsigned int + The amount of SMs available in this resource. + coscheduledSmCount : unsigned int + The amount of co-scheduled SMs grouped together for locality + purposes. + preferredCoscheduledSmCount : unsigned int + When possible, combine co-scheduled groups together into larger + groups of this size. + flags : unsigned int + Combination of `cudaDevSmResourceGroup_flags` values to indicate + this this group is created. + reserved : list[unsigned int] + Reserved for future use - ensure this is zero initialized. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaDevSmResourceGroupParams_st _pvt_val + cdef cyruntime.cudaDevSmResourceGroupParams_st* _pvt_ptr + +cdef class cudaDevResource_st: + """ + A tagged union describing different resources identified by the + type field. This structure should not be directly modified outside + of the API that created it. struct enumcudaDevResourceTypetype; + union structcudaDevSmResourcesm; + structcudaDevWorkqueueConfigResourcewqConfig; + structcudaDevWorkqueueResourcewq; ; ; - If `typename` is + `cudaDevResourceTypeInvalid`, this resoure is not valid and cannot + be further accessed. - If `typename` is `cudaDevResourceTypeSm`, + the cudaDevSmResource structure `sm` is filled in. For example, + `sm.smCount` will reflect the amount of streaming multiprocessors + available in this resource. - If `typename` is + `cudaDevResourceTypeWorkqueueConfig`, the + cudaDevWorkqueueConfigResource structure `wqConfig` is filled in. + - If `typename` is `cudaDevResourceTypeWorkqueue`, the + cudaDevWorkqueueResource structure `wq` is filled in. + + Attributes + ---------- + type : cudaDevResourceType + Type of resource, dictates which union field was last set + _internal_padding : bytes + + sm : cudaDevSmResource + Resource corresponding to cudaDevResourceTypeSm `typename`. + wqConfig : cudaDevWorkqueueConfigResource + Resource corresponding to cudaDevResourceTypeWorkqueueConfig + `typename`. + wq : cudaDevWorkqueueResource + Resource corresponding to cudaDevResourceTypeWorkqueue `typename`. + _oversize : bytes + + nextResource : cudaDevResource_st + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaDevResource_st* _val_ptr + cdef cyruntime.cudaDevResource_st* _pvt_ptr + cdef cudaDevSmResource _sm + cdef cudaDevWorkqueueConfigResource _wqConfig + cdef cudaDevWorkqueueResource _wq + cdef size_t _nextResource_length + cdef cyruntime.cudaDevResource_st* _nextResource + +cdef class cudalibraryHostUniversalFunctionAndDataTable: + """ + Attributes + ---------- + functionTable : Any + + functionWindowSize : size_t + + dataTable : Any + + dataWindowSize : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudalibraryHostUniversalFunctionAndDataTable _pvt_val + cdef cyruntime.cudalibraryHostUniversalFunctionAndDataTable* _pvt_ptr + cdef _HelperInputVoidPtr _cyfunctionTable + cdef _HelperInputVoidPtr _cydataTable + +cdef class cudaKernelNodeParams: + """ + CUDA GPU kernel node parameters + + Attributes + ---------- + func : Any + Kernel to launch + gridDim : dim3 + Grid dimensions + blockDim : dim3 + Block dimensions + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + kernelParams : Any + Array of pointers to individual kernel arguments + extra : Any + Pointer to kernel arguments in the "extra" format + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaKernelNodeParams _pvt_val + cdef cyruntime.cudaKernelNodeParams* _pvt_ptr + cdef _HelperInputVoidPtr _cyfunc + cdef dim3 _gridDim + cdef dim3 _blockDim + cdef _HelperKernelParams _cykernelParams + +cdef class cudaKernelNodeParamsV2: + """ + CUDA GPU kernel node parameters + + Attributes + ---------- + func : Any + functionType = cudaKernelFucntionTypeDevice + kern : cudaKernel_t + functionType = cudaKernelFucntionTypeKernel + cuFunc : cudaFunction_t + functionType = cudaKernelFucntionTypeFunction + gridDim : dim3 + Grid dimensions + blockDim : dim3 + Block dimensions + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + kernelParams : Any + Array of pointers to individual kernel arguments + extra : Any + Pointer to kernel arguments in the "extra" format + ctx : cudaExecutionContext_t + Context in which to run the kernel. If NULL will try to use the + current context. + functionType : cudaKernelFunctionType + Type of handle passed in the func/kern/cuFunc union above + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaKernelNodeParamsV2* _val_ptr + cdef cyruntime.cudaKernelNodeParamsV2* _pvt_ptr + cdef _HelperInputVoidPtr _cyfunc + cdef cudaKernel_t _kern + cdef cudaFunction_t _cuFunc + cdef dim3 _gridDim + cdef dim3 _blockDim + cdef _HelperKernelParams _cykernelParams + cdef cudaExecutionContext_t _ctx + +cdef class cudaExternalSemaphoreSignalNodeParams: + """ + External semaphore signal node parameters + + Attributes + ---------- + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + paramsArray : cudaExternalSemaphoreSignalParams + Array of external semaphore signal parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams _pvt_val + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* _pvt_ptr + cdef size_t _extSemArray_length + cdef cyruntime.cudaExternalSemaphore_t* _extSemArray + cdef size_t _paramsArray_length + cdef cyruntime.cudaExternalSemaphoreSignalParams* _paramsArray + +cdef class cudaExternalSemaphoreSignalNodeParamsV2: + """ + External semaphore signal node parameters + + Attributes + ---------- + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + paramsArray : cudaExternalSemaphoreSignalParams + Array of external semaphore signal parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalNodeParamsV2 _pvt_val + cdef cyruntime.cudaExternalSemaphoreSignalNodeParamsV2* _pvt_ptr + cdef size_t _extSemArray_length + cdef cyruntime.cudaExternalSemaphore_t* _extSemArray + cdef size_t _paramsArray_length + cdef cyruntime.cudaExternalSemaphoreSignalParams* _paramsArray + +cdef class cudaExternalSemaphoreWaitNodeParams: + """ + External semaphore wait node parameters + + Attributes + ---------- + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + paramsArray : cudaExternalSemaphoreWaitParams + Array of external semaphore wait parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams _pvt_val + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* _pvt_ptr + cdef size_t _extSemArray_length + cdef cyruntime.cudaExternalSemaphore_t* _extSemArray + cdef size_t _paramsArray_length + cdef cyruntime.cudaExternalSemaphoreWaitParams* _paramsArray + +cdef class cudaExternalSemaphoreWaitNodeParamsV2: + """ + External semaphore wait node parameters + + Attributes + ---------- + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + paramsArray : cudaExternalSemaphoreWaitParams + Array of external semaphore wait parameters. + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitNodeParamsV2 _pvt_val + cdef cyruntime.cudaExternalSemaphoreWaitNodeParamsV2* _pvt_ptr + cdef size_t _extSemArray_length + cdef cyruntime.cudaExternalSemaphore_t* _extSemArray + cdef size_t _paramsArray_length + cdef cyruntime.cudaExternalSemaphoreWaitParams* _paramsArray + +cdef class cudaConditionalNodeParams: + """ + CUDA conditional node parameters + + Attributes + ---------- + handle : cudaGraphConditionalHandle + Conditional node handle. Handles must be created in advance of + creating the node using cudaGraphConditionalHandleCreate. + type : cudaGraphConditionalNodeType + Type of conditional node. + size : unsigned int + Size of graph output array. Allowed values are 1 for + cudaGraphCondTypeWhile, 1 or 2 for cudaGraphCondTypeIf, or any + value greater than zero for cudaGraphCondTypeSwitch. + phGraph_out : cudaGraph_t + CUDA-owned array populated with conditional node child graphs + during creation of the node. Valid for the lifetime of the + conditional node. The contents of the graph(s) are subject to the + following constraints: - Allowed node types are kernel nodes, + empty nodes, child graphs, memsets, memcopies, and conditionals. + This applies recursively to child graphs and conditional bodies. + - All kernels, including kernels in nested conditionals or child + graphs at any level, must belong to the same CUDA context. + These graphs may be populated using graph node creation APIs or + cudaStreamBeginCaptureToGraph. cudaGraphCondTypeIf: phGraph_out[0] + is executed when the condition is non-zero. If `size` == 2, + phGraph_out[1] will be executed when the condition is zero. + cudaGraphCondTypeWhile: phGraph_out[0] is executed as long as the + condition is non-zero. cudaGraphCondTypeSwitch: phGraph_out[n] is + executed when the condition is equal to n. If the condition >= + `size`, no body graph is executed. + ctx : cudaExecutionContext_t + CUDA Execution Context + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaConditionalNodeParams _pvt_val + cdef cyruntime.cudaConditionalNodeParams* _pvt_ptr + cdef cudaGraphConditionalHandle _handle + cdef size_t _phGraph_out_length + cdef cyruntime.cudaGraph_t* _phGraph_out + cdef cudaExecutionContext_t _ctx + +cdef class cudaChildGraphNodeParams: + """ + Child graph node parameters + + Attributes + ---------- + graph : cudaGraph_t + The child graph to clone into the node for node creation, or a + handle to the graph owned by the node for node query. The graph + must not contain conditional nodes. Graphs containing memory + allocation or memory free nodes must set the ownership to be moved + to the parent. + ownership : cudaGraphChildGraphNodeOwnership + The ownership relationship of the child graph node. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaChildGraphNodeParams _pvt_val + cdef cyruntime.cudaChildGraphNodeParams* _pvt_ptr + cdef cudaGraph_t _graph + +cdef class cudaEventRecordNodeParams: + """ + Event record node parameters + + Attributes + ---------- + event : cudaEvent_t + The event to record when the node executes + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaEventRecordNodeParams _pvt_val + cdef cyruntime.cudaEventRecordNodeParams* _pvt_ptr + cdef cudaEvent_t _event + +cdef class cudaEventWaitNodeParams: + """ + Event wait node parameters + + Attributes + ---------- + event : cudaEvent_t + The event to wait on from the node + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaEventWaitNodeParams _pvt_val + cdef cyruntime.cudaEventWaitNodeParams* _pvt_ptr + cdef cudaEvent_t _event + +cdef class cudaGraphNodeParams: + """ + Graph node parameters. See cudaGraphAddNode. + + Attributes + ---------- + type : cudaGraphNodeType + Type of the node + reserved0 : list[int] + Reserved. Must be zero. + reserved1 : list[long long] + Padding. Unused bytes must be zero. + kernel : cudaKernelNodeParamsV2 + Kernel node parameters. + memcpy : cudaMemcpyNodeParams + Memcpy node parameters. + memset : cudaMemsetParamsV2 + Memset node parameters. + host : cudaHostNodeParamsV2 + Host node parameters. + graph : cudaChildGraphNodeParams + Child graph node parameters. + eventWait : cudaEventWaitNodeParams + Event wait node parameters. + eventRecord : cudaEventRecordNodeParams + Event record node parameters. + extSemSignal : cudaExternalSemaphoreSignalNodeParamsV2 + External semaphore signal node parameters. + extSemWait : cudaExternalSemaphoreWaitNodeParamsV2 + External semaphore wait node parameters. + alloc : cudaMemAllocNodeParamsV2 + Memory allocation node parameters. + free : cudaMemFreeNodeParams + Memory free node parameters. + conditional : cudaConditionalNodeParams + Conditional node parameters. + reserved2 : long long + Reserved bytes. Must be zero. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphNodeParams* _val_ptr + cdef cyruntime.cudaGraphNodeParams* _pvt_ptr + cdef cudaKernelNodeParamsV2 _kernel + cdef cudaMemcpyNodeParams _memcpy + cdef cudaMemsetParamsV2 _memset + cdef cudaHostNodeParamsV2 _host + cdef cudaChildGraphNodeParams _graph + cdef cudaEventWaitNodeParams _eventWait + cdef cudaEventRecordNodeParams _eventRecord + cdef cudaExternalSemaphoreSignalNodeParamsV2 _extSemSignal + cdef cudaExternalSemaphoreWaitNodeParamsV2 _extSemWait + cdef cudaMemAllocNodeParamsV2 _alloc + cdef cudaMemFreeNodeParams _free + cdef cudaConditionalNodeParams _conditional + +cdef class cudaGraphEdgeData_st: + """ + Optional annotation for edges in a CUDA graph. Note, all edges + implicitly have annotations and default to a zero-initialized value + if not specified. A zero-initialized struct indicates a standard + full serialization of two nodes with memory visibility. + + Attributes + ---------- + from_port : bytes + This indicates when the dependency is triggered from the upstream + node on the edge. The meaning is specfic to the node type. A value + of 0 in all cases means full completion of the upstream node, with + memory visibility to the downstream node or portion thereof + (indicated by `to_port`). Only kernel nodes define non-zero + ports. A kernel node can use the following output port types: + cudaGraphKernelNodePortDefault, + cudaGraphKernelNodePortProgrammatic, or + cudaGraphKernelNodePortLaunchCompletion. + to_port : bytes + This indicates what portion of the downstream node is dependent on + the upstream node or portion thereof (indicated by `from_port`). + The meaning is specific to the node type. A value of 0 in all cases + means the entirety of the downstream node is dependent on the + upstream work. Currently no node types define non-zero ports. + Accordingly, this field must be set to zero. + type : bytes + This should be populated with a value from cudaGraphDependencyType. + (It is typed as char due to compiler-specific layout of bitfields.) + See cudaGraphDependencyType. + reserved : bytes + These bytes are unused and must be zeroed. This ensures + compatibility if additional fields are added in the future. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphEdgeData_st _pvt_val + cdef cyruntime.cudaGraphEdgeData_st* _pvt_ptr + +cdef class cudaGraphInstantiateParams_st: + """ + Graph instantiation parameters + + Attributes + ---------- + flags : unsigned long long + Instantiation flags + uploadStream : cudaStream_t + Upload stream + errNode_out : cudaGraphNode_t + The node which caused instantiation to fail, if any + result_out : cudaGraphInstantiateResult + Whether instantiation was successful. If it failed, the reason why + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphInstantiateParams_st _pvt_val + cdef cyruntime.cudaGraphInstantiateParams_st* _pvt_ptr + cdef cudaStream_t _uploadStream + cdef cudaGraphNode_t _errNode_out + +cdef class cudaGraphExecUpdateResultInfo_st: + """ + Result information returned by cudaGraphExecUpdate + + Attributes + ---------- + result : cudaGraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + errorNode : cudaGraphNode_t + The "to node" of the error edge when the topologies do not match. + The error node when the error is associated with a specific node. + NULL when the error is generic. + errorFromNode : cudaGraphNode_t + The from node of error edge when the topologies do not match. + Otherwise NULL. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphExecUpdateResultInfo_st _pvt_val + cdef cyruntime.cudaGraphExecUpdateResultInfo_st* _pvt_ptr + cdef cudaGraphNode_t _errorNode + cdef cudaGraphNode_t _errorFromNode + +cdef class anon_struct16: + """ + Attributes + ---------- + pValue : Any + + offset : size_t + + size : size_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphKernelNodeUpdate* _pvt_ptr + cdef _HelperInputVoidPtr _cypValue + +cdef class anon_union10: + """ + Attributes + ---------- + gridDim : dim3 + + param : anon_struct16 + + isEnabled : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphKernelNodeUpdate* _pvt_ptr + cdef dim3 _gridDim + cdef anon_struct16 _param + +cdef class cudaGraphKernelNodeUpdate: + """ + Struct to specify a single node update to pass as part of a larger + array to ::cudaGraphKernelNodeUpdatesApply + + Attributes + ---------- + node : cudaGraphDeviceNode_t + Node to update + field : cudaGraphKernelNodeField + Which type of update to apply. Determines how updateData is + interpreted + updateData : anon_union10 + Update data to apply. Which field is used depends on field's value + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphKernelNodeUpdate* _val_ptr + cdef cyruntime.cudaGraphKernelNodeUpdate* _pvt_ptr + cdef cudaGraphDeviceNode_t _node + cdef anon_union10 _updateData + +cdef class cudaLaunchMemSyncDomainMap_st: + """ + Memory Synchronization Domain map See cudaLaunchMemSyncDomain. By + default, kernels are launched in domain 0. Kernel launched with + cudaLaunchMemSyncDomainRemote will have a different domain ID. User + may also alter the domain ID with cudaLaunchMemSyncDomainMap for a + specific stream / graph node / kernel launch. See + cudaLaunchAttributeMemSyncDomainMap. Domain ID range is available + through cudaDevAttrMemSyncDomainCount. + + Attributes + ---------- + default_ : bytes + The default domain ID to use for designated kernels + remote : bytes + The remote domain ID to use for designated kernels + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchMemSyncDomainMap_st _pvt_val + cdef cyruntime.cudaLaunchMemSyncDomainMap_st* _pvt_ptr + +cdef class anon_struct17: + """ + Attributes + ---------- + x : unsigned int + + y : unsigned int + + z : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr + +cdef class anon_struct18: + """ + Attributes + ---------- + event : cudaEvent_t + + flags : int + + triggerAtBlockStart : int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr + cdef cudaEvent_t _event + +cdef class anon_struct19: + """ + Attributes + ---------- + x : unsigned int + + y : unsigned int + + z : unsigned int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr + +cdef class anon_struct20: + """ + Attributes + ---------- + event : cudaEvent_t + + flags : int + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr + cdef cudaEvent_t _event + +cdef class anon_struct21: + """ + Attributes + ---------- + deviceUpdatable : int + + devNode : cudaGraphDeviceNode_t + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr + cdef cudaGraphDeviceNode_t _devNode + +cdef class cudaLaunchAttributeValue: + """ + Launch attributes union; used as value field of cudaLaunchAttribute + + Attributes + ---------- + pad : bytes + + accessPolicyWindow : cudaAccessPolicyWindow + Value of launch attribute cudaLaunchAttributeAccessPolicyWindow. + cooperative : int + Value of launch attribute cudaLaunchAttributeCooperative. Nonzero + indicates a cooperative kernel (see cudaLaunchCooperativeKernel). + syncPolicy : cudaSynchronizationPolicy + Value of launch attribute cudaLaunchAttributeSynchronizationPolicy. + cudaSynchronizationPolicy for work queued up in this stream. + clusterDim : anon_struct17 + Value of launch attribute cudaLaunchAttributeClusterDimension that + represents the desired cluster dimensions for the kernel. Opaque + type with the following fields: - `x` - The X dimension of the + cluster, in blocks. Must be a divisor of the grid X dimension. - + `y` - The Y dimension of the cluster, in blocks. Must be a divisor + of the grid Y dimension. - `z` - The Z dimension of the cluster, + in blocks. Must be a divisor of the grid Z dimension. + clusterSchedulingPolicyPreference : cudaClusterSchedulingPolicy + Value of launch attribute + cudaLaunchAttributeClusterSchedulingPolicyPreference. Cluster + scheduling policy preference for the kernel. + programmaticStreamSerializationAllowed : int + Value of launch attribute + cudaLaunchAttributeProgrammaticStreamSerialization. + programmaticEvent : anon_struct18 + Value of launch attribute cudaLaunchAttributeProgrammaticEvent with + the following fields: - `cudaEvent_t` event - Event to fire when + all blocks trigger it. - `int` flags; - Event record flags, see + cudaEventRecordWithFlags. Does not accept cudaEventRecordExternal. + - `int` triggerAtBlockStart - If this is set to non-0, each block + launch will automatically trigger the event. + priority : int + Value of launch attribute cudaLaunchAttributePriority. Execution + priority of the kernel. + memSyncDomainMap : cudaLaunchMemSyncDomainMap + Value of launch attribute cudaLaunchAttributeMemSyncDomainMap. See + cudaLaunchMemSyncDomainMap. + memSyncDomain : cudaLaunchMemSyncDomain + Value of launch attribute cudaLaunchAttributeMemSyncDomain. See + cudaLaunchMemSyncDomain. + preferredClusterDim : anon_struct19 + Value of launch attribute + cudaLaunchAttributePreferredClusterDimension that represents the + desired preferred cluster dimensions for the kernel. Opaque type + with the following fields: - `x` - The X dimension of the preferred + cluster, in blocks. Must be a divisor of the grid X dimension, and + must be a multiple of the `x` field of + ::cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension + of the preferred cluster, in blocks. Must be a divisor of the grid + Y dimension, and must be a multiple of the `y` field of + ::cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension + of the preferred cluster, in blocks. Must be equal to the `z` field + of ::cudaLaunchAttributeValue::clusterDim. + launchCompletionEvent : anon_struct20 + Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent + with the following fields: - `cudaEvent_t` event - Event to fire + when the last block launches. - `int` flags - Event record + flags, see cudaEventRecordWithFlags. Does not accept + cudaEventRecordExternal. + deviceUpdatableKernelNode : anon_struct21 + Value of launch attribute + cudaLaunchAttributeDeviceUpdatableKernelNode with the following + fields: - `int` deviceUpdatable - Whether or not the resulting + kernel node should be device-updatable. - + `cudaGraphDeviceNode_t` devNode - Returns a handle to pass to the + various device-side update functions. + sharedMemCarveout : unsigned int + Value of launch attribute + cudaLaunchAttributePreferredSharedMemoryCarveout. + nvlinkUtilCentricScheduling : unsigned int + Value of launch attribute + cudaLaunchAttributeNvlinkUtilCentricScheduling. + portableClusterSizeMode : cudaLaunchAttributePortableClusterMode + Value of launch attribute + cudaLaunchAttributePortableClusterSizeMode + sharedMemoryMode : cudaSharedMemoryMode + Value of launch attribute cudaLaunchAttributeSharedMemoryMode. See + cudaSharedMemoryMode for acceptable values. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue _pvt_val + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr + cdef cudaAccessPolicyWindow _accessPolicyWindow + cdef anon_struct17 _clusterDim + cdef anon_struct18 _programmaticEvent + cdef cudaLaunchMemSyncDomainMap _memSyncDomainMap + cdef anon_struct19 _preferredClusterDim + cdef anon_struct20 _launchCompletionEvent + cdef anon_struct21 _deviceUpdatableKernelNode + +cdef class cudaLaunchAttribute_st: + """ + Launch attribute + + Attributes + ---------- + id : cudaLaunchAttributeID + Attribute to set + val : cudaLaunchAttributeValue + Value of the attribute + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttribute_st _pvt_val + cdef cyruntime.cudaLaunchAttribute_st* _pvt_ptr + cdef cudaLaunchAttributeValue _val + +cdef class anon_struct22: + """ + Attributes + ---------- + bytesOverBudget : unsigned long long + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaAsyncNotificationInfo* _pvt_ptr + +cdef class anon_union11: + """ + Attributes + ---------- + overBudget : anon_struct22 + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaAsyncNotificationInfo* _pvt_ptr + cdef anon_struct22 _overBudget + +cdef class cudaAsyncNotificationInfo: + """ + Information describing an async notification event + + Attributes + ---------- + type : cudaAsyncNotificationType + The type of notification being sent + info : anon_union11 + Information about the notification. `typename` must be checked in + order to interpret this field. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaAsyncNotificationInfo* _val_ptr + cdef cyruntime.cudaAsyncNotificationInfo* _pvt_ptr + cdef anon_union11 _info + +cdef class cudaTextureDesc: + """ + CUDA texture descriptor + + Attributes + ---------- + addressMode : list[cudaTextureAddressMode] + Texture address mode for up to 3 dimensions + filterMode : cudaTextureFilterMode + Texture filter mode + readMode : cudaTextureReadMode + Texture read mode + sRGB : int + Perform sRGB->linear conversion during texture read + borderColor : list[float] + Texture Border Color + normalizedCoords : int + Indicates whether texture reads are normalized or not + maxAnisotropy : unsigned int + Limit to the anisotropy ratio + mipmapFilterMode : cudaTextureFilterMode + Mipmap filter mode + mipmapLevelBias : float + Offset applied to the supplied mipmap level + minMipmapLevelClamp : float + Lower end of the mipmap level range to clamp access to + maxMipmapLevelClamp : float + Upper end of the mipmap level range to clamp access to + disableTrilinearOptimization : int + Disable any trilinear filtering optimizations. + seamlessCubemap : int + Enable seamless cube map filtering. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaTextureDesc _pvt_val + cdef cyruntime.cudaTextureDesc* _pvt_ptr + +cdef class cudaGraphRecaptureCallbackData: + """ + Struct of user callback data that is invoked when node parameter + mismatches are detected while recapturing to an existing graph + + Attributes + ---------- + callbackFunc : cudaGraphRecaptureCallback_t + Callback function that will be invoked + userData : Any + Generic pointer that is passed to the callback function + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphRecaptureCallbackData _pvt_val + cdef cyruntime.cudaGraphRecaptureCallbackData* _pvt_ptr + cdef cudaGraphRecaptureCallback_t _callbackFunc + cdef _HelperInputVoidPtr _cyuserData + +cdef class cudaEglPlaneDesc_st: + """ + CUDA EGL Plane Descriptor - structure defining each plane of a CUDA + EGLFrame + + Attributes + ---------- + width : unsigned int + Width of plane + height : unsigned int + Height of plane + depth : unsigned int + Depth of plane + pitch : unsigned int + Pitch of plane + numChannels : unsigned int + Number of channels for the plane + channelDesc : cudaChannelFormatDesc + Channel Format Descriptor + reserved : list[unsigned int] + Reserved for future use + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaEglPlaneDesc_st _pvt_val + cdef cyruntime.cudaEglPlaneDesc_st* _pvt_ptr + cdef cudaChannelFormatDesc _channelDesc + +cdef class anon_union12: + """ + Attributes + ---------- + pArray : list[cudaArray_t] + + pPitch : list[cudaPitchedPtr] + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaEglFrame_st* _pvt_ptr + +cdef class cudaEglFrame_st: + """ + CUDA EGLFrame Descriptor - structure defining one frame of EGL. + Each frame may contain one or more planes depending on whether the + surface is Multiplanar or not. Each plane of EGLFrame is + represented by cudaEglPlaneDesc which is defined as: + typedefstructcudaEglPlaneDesc_st unsignedintwidth; + unsignedintheight; unsignedintdepth; unsignedintpitch; + unsignedintnumChannels; structcudaChannelFormatDescchannelDesc; + unsignedintreserved[4]; cudaEglPlaneDesc; + + Attributes + ---------- + frame : anon_union12 + + planeDesc : list[cudaEglPlaneDesc] + CUDA EGL Plane Descriptor cudaEglPlaneDesc + planeCount : unsigned int + Number of planes + frameType : cudaEglFrameType + Array or Pitch + eglColorFormat : cudaEglColorFormat + CUDA EGL Color Format + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaEglFrame_st* _val_ptr + cdef cyruntime.cudaEglFrame_st* _pvt_ptr + cdef anon_union12 _frame + +cdef class CUuuid(CUuuid_st): + """ + Attributes + ---------- + bytes : bytes + < CUDA definition of UUID + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaUUID_t(CUuuid_st): + """ + Attributes + ---------- + bytes : bytes + < CUDA definition of UUID + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaIpcEventHandle_t(cudaIpcEventHandle_st): + """ + CUDA IPC event handle + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaIpcMemHandle_t(cudaIpcMemHandle_st): + """ + CUDA IPC memory handle + + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaMemFabricHandle_t(cudaMemFabricHandle_st): + """ + Attributes + ---------- + reserved : bytes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaDevSmResourceGroupParams(cudaDevSmResourceGroupParams_st): + """ + Input data for splitting SMs + + Attributes + ---------- + smCount : unsigned int + The amount of SMs available in this resource. + coscheduledSmCount : unsigned int + The amount of co-scheduled SMs grouped together for locality + purposes. + preferredCoscheduledSmCount : unsigned int + When possible, combine co-scheduled groups together into larger + groups of this size. + flags : unsigned int + Combination of `cudaDevSmResourceGroup_flags` values to indicate + this this group is created. + reserved : list[unsigned int] + Reserved for future use - ensure this is zero initialized. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaDevResource(cudaDevResource_st): + """ + A tagged union describing different resources identified by the + type field. This structure should not be directly modified outside + of the API that created it. struct enumcudaDevResourceTypetype; + union structcudaDevSmResourcesm; + structcudaDevWorkqueueConfigResourcewqConfig; + structcudaDevWorkqueueResourcewq; ; ; - If `typename` is + `cudaDevResourceTypeInvalid`, this resoure is not valid and cannot + be further accessed. - If `typename` is `cudaDevResourceTypeSm`, + the cudaDevSmResource structure `sm` is filled in. For example, + `sm.smCount` will reflect the amount of streaming multiprocessors + available in this resource. - If `typename` is + `cudaDevResourceTypeWorkqueueConfig`, the + cudaDevWorkqueueConfigResource structure `wqConfig` is filled in. + - If `typename` is `cudaDevResourceTypeWorkqueue`, the + cudaDevWorkqueueResource structure `wq` is filled in. + + Attributes + ---------- + type : cudaDevResourceType + Type of resource, dictates which union field was last set + _internal_padding : bytes + + sm : cudaDevSmResource + Resource corresponding to cudaDevResourceTypeSm `typename`. + wqConfig : cudaDevWorkqueueConfigResource + Resource corresponding to cudaDevResourceTypeWorkqueueConfig + `typename`. + wq : cudaDevWorkqueueResource + Resource corresponding to cudaDevResourceTypeWorkqueue `typename`. + _oversize : bytes + + nextResource : cudaDevResource_st + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaGraphEdgeData(cudaGraphEdgeData_st): + """ + Optional annotation for edges in a CUDA graph. Note, all edges + implicitly have annotations and default to a zero-initialized value + if not specified. A zero-initialized struct indicates a standard + full serialization of two nodes with memory visibility. + + Attributes + ---------- + from_port : bytes + This indicates when the dependency is triggered from the upstream + node on the edge. The meaning is specfic to the node type. A value + of 0 in all cases means full completion of the upstream node, with + memory visibility to the downstream node or portion thereof + (indicated by `to_port`). Only kernel nodes define non-zero + ports. A kernel node can use the following output port types: + cudaGraphKernelNodePortDefault, + cudaGraphKernelNodePortProgrammatic, or + cudaGraphKernelNodePortLaunchCompletion. + to_port : bytes + This indicates what portion of the downstream node is dependent on + the upstream node or portion thereof (indicated by `from_port`). + The meaning is specific to the node type. A value of 0 in all cases + means the entirety of the downstream node is dependent on the + upstream work. Currently no node types define non-zero ports. + Accordingly, this field must be set to zero. + type : bytes + This should be populated with a value from cudaGraphDependencyType. + (It is typed as char due to compiler-specific layout of bitfields.) + See cudaGraphDependencyType. + reserved : bytes + These bytes are unused and must be zeroed. This ensures + compatibility if additional fields are added in the future. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaGraphInstantiateParams(cudaGraphInstantiateParams_st): + """ + Graph instantiation parameters + + Attributes + ---------- + flags : unsigned long long + Instantiation flags + uploadStream : cudaStream_t + Upload stream + errNode_out : cudaGraphNode_t + The node which caused instantiation to fail, if any + result_out : cudaGraphInstantiateResult + Whether instantiation was successful. If it failed, the reason why + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaGraphExecUpdateResultInfo(cudaGraphExecUpdateResultInfo_st): + """ + Result information returned by cudaGraphExecUpdate + + Attributes + ---------- + result : cudaGraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + errorNode : cudaGraphNode_t + The "to node" of the error edge when the topologies do not match. + The error node when the error is associated with a specific node. + NULL when the error is generic. + errorFromNode : cudaGraphNode_t + The from node of error edge when the topologies do not match. + Otherwise NULL. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaLaunchMemSyncDomainMap(cudaLaunchMemSyncDomainMap_st): + """ + Memory Synchronization Domain map See cudaLaunchMemSyncDomain. By + default, kernels are launched in domain 0. Kernel launched with + cudaLaunchMemSyncDomainRemote will have a different domain ID. User + may also alter the domain ID with cudaLaunchMemSyncDomainMap for a + specific stream / graph node / kernel launch. See + cudaLaunchAttributeMemSyncDomainMap. Domain ID range is available + through cudaDevAttrMemSyncDomainCount. + + Attributes + ---------- + default_ : bytes + The default domain ID to use for designated kernels + remote : bytes + The remote domain ID to use for designated kernels + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaLaunchAttribute(cudaLaunchAttribute_st): + """ + Launch attribute + + Attributes + ---------- + id : cudaLaunchAttributeID + Attribute to set + val : cudaLaunchAttributeValue + Value of the attribute + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaAsyncNotificationInfo_t(cudaAsyncNotificationInfo): + """ + Information describing an async notification event + + Attributes + ---------- + type : cudaAsyncNotificationType + The type of notification being sent + info : anon_union11 + Information about the notification. `typename` must be checked in + order to interpret this field. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): + """ + Launch attributes union; used as value field of cudaLaunchAttribute + + Attributes + ---------- + pad : bytes + + accessPolicyWindow : cudaAccessPolicyWindow + Value of launch attribute cudaLaunchAttributeAccessPolicyWindow. + cooperative : int + Value of launch attribute cudaLaunchAttributeCooperative. Nonzero + indicates a cooperative kernel (see cudaLaunchCooperativeKernel). + syncPolicy : cudaSynchronizationPolicy + Value of launch attribute cudaLaunchAttributeSynchronizationPolicy. + cudaSynchronizationPolicy for work queued up in this stream. + clusterDim : anon_struct17 + Value of launch attribute cudaLaunchAttributeClusterDimension that + represents the desired cluster dimensions for the kernel. Opaque + type with the following fields: - `x` - The X dimension of the + cluster, in blocks. Must be a divisor of the grid X dimension. - + `y` - The Y dimension of the cluster, in blocks. Must be a divisor + of the grid Y dimension. - `z` - The Z dimension of the cluster, + in blocks. Must be a divisor of the grid Z dimension. + clusterSchedulingPolicyPreference : cudaClusterSchedulingPolicy + Value of launch attribute + cudaLaunchAttributeClusterSchedulingPolicyPreference. Cluster + scheduling policy preference for the kernel. + programmaticStreamSerializationAllowed : int + Value of launch attribute + cudaLaunchAttributeProgrammaticStreamSerialization. + programmaticEvent : anon_struct18 + Value of launch attribute cudaLaunchAttributeProgrammaticEvent with + the following fields: - `cudaEvent_t` event - Event to fire when + all blocks trigger it. - `int` flags; - Event record flags, see + cudaEventRecordWithFlags. Does not accept cudaEventRecordExternal. + - `int` triggerAtBlockStart - If this is set to non-0, each block + launch will automatically trigger the event. + priority : int + Value of launch attribute cudaLaunchAttributePriority. Execution + priority of the kernel. + memSyncDomainMap : cudaLaunchMemSyncDomainMap + Value of launch attribute cudaLaunchAttributeMemSyncDomainMap. See + cudaLaunchMemSyncDomainMap. + memSyncDomain : cudaLaunchMemSyncDomain + Value of launch attribute cudaLaunchAttributeMemSyncDomain. See + cudaLaunchMemSyncDomain. + preferredClusterDim : anon_struct19 + Value of launch attribute + cudaLaunchAttributePreferredClusterDimension that represents the + desired preferred cluster dimensions for the kernel. Opaque type + with the following fields: - `x` - The X dimension of the preferred + cluster, in blocks. Must be a divisor of the grid X dimension, and + must be a multiple of the `x` field of + ::cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension + of the preferred cluster, in blocks. Must be a divisor of the grid + Y dimension, and must be a multiple of the `y` field of + ::cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension + of the preferred cluster, in blocks. Must be equal to the `z` field + of ::cudaLaunchAttributeValue::clusterDim. + launchCompletionEvent : anon_struct20 + Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent + with the following fields: - `cudaEvent_t` event - Event to fire + when the last block launches. - `int` flags - Event record + flags, see cudaEventRecordWithFlags. Does not accept + cudaEventRecordExternal. + deviceUpdatableKernelNode : anon_struct21 + Value of launch attribute + cudaLaunchAttributeDeviceUpdatableKernelNode with the following + fields: - `int` deviceUpdatable - Whether or not the resulting + kernel node should be device-updatable. - + `cudaGraphDeviceNode_t` devNode - Returns a handle to pass to the + various device-side update functions. + sharedMemCarveout : unsigned int + Value of launch attribute + cudaLaunchAttributePreferredSharedMemoryCarveout. + nvlinkUtilCentricScheduling : unsigned int + Value of launch attribute + cudaLaunchAttributeNvlinkUtilCentricScheduling. + portableClusterSizeMode : cudaLaunchAttributePortableClusterMode + Value of launch attribute + cudaLaunchAttributePortableClusterSizeMode + sharedMemoryMode : cudaSharedMemoryMode + Value of launch attribute cudaLaunchAttributeSharedMemoryMode. See + cudaSharedMemoryMode for acceptable values. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): + """ + Launch attributes union; used as value field of cudaLaunchAttribute + + Attributes + ---------- + pad : bytes + + accessPolicyWindow : cudaAccessPolicyWindow + Value of launch attribute cudaLaunchAttributeAccessPolicyWindow. + cooperative : int + Value of launch attribute cudaLaunchAttributeCooperative. Nonzero + indicates a cooperative kernel (see cudaLaunchCooperativeKernel). + syncPolicy : cudaSynchronizationPolicy + Value of launch attribute cudaLaunchAttributeSynchronizationPolicy. + cudaSynchronizationPolicy for work queued up in this stream. + clusterDim : anon_struct17 + Value of launch attribute cudaLaunchAttributeClusterDimension that + represents the desired cluster dimensions for the kernel. Opaque + type with the following fields: - `x` - The X dimension of the + cluster, in blocks. Must be a divisor of the grid X dimension. - + `y` - The Y dimension of the cluster, in blocks. Must be a divisor + of the grid Y dimension. - `z` - The Z dimension of the cluster, + in blocks. Must be a divisor of the grid Z dimension. + clusterSchedulingPolicyPreference : cudaClusterSchedulingPolicy + Value of launch attribute + cudaLaunchAttributeClusterSchedulingPolicyPreference. Cluster + scheduling policy preference for the kernel. + programmaticStreamSerializationAllowed : int + Value of launch attribute + cudaLaunchAttributeProgrammaticStreamSerialization. + programmaticEvent : anon_struct18 + Value of launch attribute cudaLaunchAttributeProgrammaticEvent with + the following fields: - `cudaEvent_t` event - Event to fire when + all blocks trigger it. - `int` flags; - Event record flags, see + cudaEventRecordWithFlags. Does not accept cudaEventRecordExternal. + - `int` triggerAtBlockStart - If this is set to non-0, each block + launch will automatically trigger the event. + priority : int + Value of launch attribute cudaLaunchAttributePriority. Execution + priority of the kernel. + memSyncDomainMap : cudaLaunchMemSyncDomainMap + Value of launch attribute cudaLaunchAttributeMemSyncDomainMap. See + cudaLaunchMemSyncDomainMap. + memSyncDomain : cudaLaunchMemSyncDomain + Value of launch attribute cudaLaunchAttributeMemSyncDomain. See + cudaLaunchMemSyncDomain. + preferredClusterDim : anon_struct19 + Value of launch attribute + cudaLaunchAttributePreferredClusterDimension that represents the + desired preferred cluster dimensions for the kernel. Opaque type + with the following fields: - `x` - The X dimension of the preferred + cluster, in blocks. Must be a divisor of the grid X dimension, and + must be a multiple of the `x` field of + ::cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension + of the preferred cluster, in blocks. Must be a divisor of the grid + Y dimension, and must be a multiple of the `y` field of + ::cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension + of the preferred cluster, in blocks. Must be equal to the `z` field + of ::cudaLaunchAttributeValue::clusterDim. + launchCompletionEvent : anon_struct20 + Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent + with the following fields: - `cudaEvent_t` event - Event to fire + when the last block launches. - `int` flags - Event record + flags, see cudaEventRecordWithFlags. Does not accept + cudaEventRecordExternal. + deviceUpdatableKernelNode : anon_struct21 + Value of launch attribute + cudaLaunchAttributeDeviceUpdatableKernelNode with the following + fields: - `int` deviceUpdatable - Whether or not the resulting + kernel node should be device-updatable. - + `cudaGraphDeviceNode_t` devNode - Returns a handle to pass to the + various device-side update functions. + sharedMemCarveout : unsigned int + Value of launch attribute + cudaLaunchAttributePreferredSharedMemoryCarveout. + nvlinkUtilCentricScheduling : unsigned int + Value of launch attribute + cudaLaunchAttributeNvlinkUtilCentricScheduling. + portableClusterSizeMode : cudaLaunchAttributePortableClusterMode + Value of launch attribute + cudaLaunchAttributePortableClusterSizeMode + sharedMemoryMode : cudaSharedMemoryMode + Value of launch attribute cudaLaunchAttributeSharedMemoryMode. See + cudaSharedMemoryMode for acceptable values. + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaEglPlaneDesc(cudaEglPlaneDesc_st): + """ + CUDA EGL Plane Descriptor - structure defining each plane of a CUDA + EGLFrame + + Attributes + ---------- + width : unsigned int + Width of plane + height : unsigned int + Height of plane + depth : unsigned int + Depth of plane + pitch : unsigned int + Pitch of plane + numChannels : unsigned int + Number of channels for the plane + channelDesc : cudaChannelFormatDesc + Channel Format Descriptor + reserved : list[unsigned int] + Reserved for future use + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaEglFrame(cudaEglFrame_st): + """ + CUDA EGLFrame Descriptor - structure defining one frame of EGL. + Each frame may contain one or more planes depending on whether the + surface is Multiplanar or not. Each plane of EGLFrame is + represented by cudaEglPlaneDesc which is defined as: + typedefstructcudaEglPlaneDesc_st unsignedintwidth; + unsignedintheight; unsignedintdepth; unsignedintpitch; + unsignedintnumChannels; structcudaChannelFormatDescchannelDesc; + unsignedintreserved[4]; cudaEglPlaneDesc; + + Attributes + ---------- + frame : anon_union12 + + planeDesc : list[cudaEglPlaneDesc] + CUDA EGL Plane Descriptor cudaEglPlaneDesc + planeCount : unsigned int + Number of planes + frameType : cudaEglFrameType + Array or Pitch + eglColorFormat : cudaEglColorFormat + CUDA EGL Color Format + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cudaStream_t(driver.CUstream): + """ + + CUDA stream + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass + +cdef class cudaEvent_t(driver.CUevent): + """ + + CUDA event types + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass + +cdef class cudaGraph_t(driver.CUgraph): + """ + + CUDA graph + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass + +cdef class cudaGraphNode_t(driver.CUgraphNode): + """ + + CUDA graph node. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass + +cdef class cudaUserObject_t(driver.CUuserObject): + """ + + CUDA user object for graphs + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass + +cdef class cudaFunction_t(driver.CUfunction): + """ + + CUDA function + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass + +cdef class cudaMemPool_t(driver.CUmemoryPool): + """ + + CUDA memory pool + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass + +cdef class cudaGraphExec_t(driver.CUgraphExec): + """ + + CUDA executable (launchable) graph + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass + +cdef class cudaEglStreamConnection(driver.CUeglStreamConnection): + """ + + CUDA EGLSream Connection + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass + +cdef class cudaGraphConditionalHandle: + """ + + CUDA handle for conditional graph nodes + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaGraphConditionalHandle _pvt_val + cdef cyruntime.cudaGraphConditionalHandle* _pvt_ptr + +cdef class cudaLogIterator: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaLogIterator _pvt_val + cdef cyruntime.cudaLogIterator* _pvt_ptr + +cdef class cudaSurfaceObject_t: + """ + + An opaque value that represents a CUDA Surface object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaSurfaceObject_t _pvt_val + cdef cyruntime.cudaSurfaceObject_t* _pvt_ptr + +cdef class cudaTextureObject_t: + """ + + An opaque value that represents a CUDA texture object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaTextureObject_t _pvt_val + cdef cyruntime.cudaTextureObject_t* _pvt_ptr + +cdef class GLenum: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.GLenum _pvt_val + cdef cyruntime.GLenum* _pvt_ptr + +cdef class GLuint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.GLuint _pvt_val + cdef cyruntime.GLuint* _pvt_ptr + +cdef class EGLint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.EGLint _pvt_val + cdef cyruntime.EGLint* _pvt_ptr + +cdef class VdpDevice: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.VdpDevice _pvt_val + cdef cyruntime.VdpDevice* _pvt_ptr + +cdef class VdpGetProcAddress: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.VdpGetProcAddress _pvt_val + cdef cyruntime.VdpGetProcAddress* _pvt_ptr + +cdef class VdpVideoSurface: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.VdpVideoSurface _pvt_val + cdef cyruntime.VdpVideoSurface* _pvt_ptr + +cdef class VdpOutputSurface: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.VdpOutputSurface _pvt_val + cdef cyruntime.VdpOutputSurface* _pvt_ptr diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/utils/__init__.py b/venv/lib/python3.12/site-packages/cuda/bindings/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3fe75ca13f0f400073d73ec952569620fcf74d75 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/utils/__init__.py @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +from typing import Any, Callable + +from ._nvvm_utils import check_nvvm_compiler_options +from ._ptx_utils import get_minimal_required_cuda_ver_from_ptx_ver, get_ptx_ver +from ._version_check import warn_if_cuda_major_version_mismatch + +_handle_getters: dict[type, Callable[[Any], int]] = {} + + +def _add_cuda_native_handle_getter(t: type, getter: Callable[[Any], int]) -> None: + _handle_getters[t] = getter + + +def get_cuda_native_handle(obj: Any) -> int: + """Returns the address of the provided CUDA Python object as a Python int. + + Parameters + ---------- + obj : Any + CUDA Python object + + Returns + ------- + int : The object address. + """ + obj_type = type(obj) + try: + return _handle_getters[obj_type](obj) + except KeyError: + raise TypeError("Unknown type: " + str(obj_type)) from None diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cedc4b34c0c494033e1b95be677e07159bd41f47 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/_nvvm_utils.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/_nvvm_utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cdc9fd9a3d62cc00d4c6fb59e15e74a6d1c644fd Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/_nvvm_utils.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/_ptx_utils.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/_ptx_utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74b74f6b2e637cea86411daa6ac3cf467cf1ff60 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/_ptx_utils.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/_version_check.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/_version_check.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a1d113609892ee84604eaafe863862d666fdce05 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/bindings/utils/__pycache__/_version_check.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/utils/_nvvm_utils.py b/venv/lib/python3.12/site-packages/cuda/bindings/utils/_nvvm_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..de7b111e7bfe049a2786abb83f4ca5c6ae9a20a4 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/utils/_nvvm_utils.py @@ -0,0 +1,89 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +from typing import Sequence + +_PRECHECK_NVVM_IR = """target triple = "nvptx64-unknown-cuda" +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-i128:128:128-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64" + +define void @dummy_kernel() {{ +entry: + ret void +}} + +!nvvm.annotations = !{{!0}} +!0 = !{{void ()* @dummy_kernel, !"kernel", i32 1}} + +!nvvmir.version = !{{!1}} +!1 = !{{i32 {major}, i32 {minor}, i32 {debug_major}, i32 {debug_minor}}} +""" + + +def check_nvvm_compiler_options(options: Sequence[str]) -> bool: + """ + Abstracted from https://github.com/NVIDIA/numba-cuda/pull/681 + + Check if the specified options are supported by the current libNVVM version. + + The options are a list of strings, each representing a compiler option. + + If the test program fails to compile, the options are not supported and False + is returned. + + If the test program compiles successfully, True is returned. + + cuda.bindings.nvvm returns exceptions instead of return codes. + + Parameters + ---------- + options : Sequence[str] + List of compiler options as strings (e.g., ["-arch=compute_90", "-g"]). + + Returns + ------- + bool + True if the options are supported, False otherwise. + + Examples + -------- + >>> from cuda.bindings.utils import check_nvvm_compiler_options + >>> check_nvvm_compiler_options(["-arch=compute_90", "-g"]) + True + """ + try: + from cuda.bindings import nvvm + except ModuleNotFoundError as exc: + if exc.name == "nvvm": + return False + raise + + from cuda.bindings._internal.nvvm import _inspect_function_pointer + + if _inspect_function_pointer("__nvvmCreateProgram") == 0: + return False + + program = nvvm.create_program() + try: + major, minor, debug_major, debug_minor = nvvm.ir_version() + precheck_ir = _PRECHECK_NVVM_IR.format( + major=major, + minor=minor, + debug_major=debug_major, + debug_minor=debug_minor, + ) + precheck_ir_bytes = precheck_ir.encode("utf-8") + nvvm.add_module_to_program( + program, + precheck_ir_bytes, + len(precheck_ir_bytes), + "precheck.ll", + ) + try: + nvvm.compile_program(program, len(options), options) + except nvvm.nvvmError as e: + if e.status == nvvm.Result.ERROR_INVALID_OPTION: + return False + raise + finally: + nvvm.destroy_program(program) + return True diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/utils/_ptx_utils.py b/venv/lib/python3.12/site-packages/cuda/bindings/utils/_ptx_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..5ba21c398c2b7af582f7376c9d8bdcb979a1b141 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/utils/_ptx_utils.py @@ -0,0 +1,135 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +import re + +# Mapping based on the official PTX ISA <-> CUDA Release table +# https://docs.nvidia.com/cuda/parallel-thread-execution/#release-notes-ptx-release-history +_ptx_to_cuda = { + "1.0": (1, 0), + "1.1": (1, 1), + "1.2": (2, 0), + "1.3": (2, 1), + "1.4": (2, 2), + "2.0": (3, 0), + "2.1": (3, 1), + "2.2": (3, 2), + "2.3": (4, 0), + "3.0": (4, 1), + "3.1": (5, 0), + "3.2": (5, 5), + "4.0": (6, 0), + "4.1": (6, 5), + "4.2": (7, 0), + "4.3": (7, 5), + "5.0": (8, 0), + "6.0": (9, 0), + "6.1": (9, 1), + "6.2": (9, 2), + "6.3": (10, 0), + "6.4": (10, 1), + "6.5": (10, 2), + "7.0": (11, 0), + "7.1": (11, 1), + "7.2": (11, 2), + "7.3": (11, 3), + "7.4": (11, 4), + "7.5": (11, 5), + "7.6": (11, 6), + "7.7": (11, 7), + "7.8": (11, 8), + "8.0": (12, 0), + "8.1": (12, 1), + "8.2": (12, 2), + "8.3": (12, 3), + "8.4": (12, 4), + "8.5": (12, 5), + "8.6": (12, 7), + "8.7": (12, 8), + "8.8": (12, 9), + "9.0": (13, 0), + "9.1": (13, 1), + "9.2": (13, 2), + "9.3": (13, 3), +} + + +def get_minimal_required_cuda_ver_from_ptx_ver(ptx_version: str) -> int: + """ + Maps the PTX ISA version to the minimal CUDA driver, nvPTXCompiler, or nvJitLink version + that is needed to load a PTX of the given ISA version. + + Parameters + ---------- + ptx_version : str + PTX ISA version as a string, e.g. "8.8" for PTX ISA 8.8. This is the ``.version`` + directive in the PTX header. + + Returns + ------- + int + Minimal CUDA version as 1000 * major + 10 * minor, e.g. 12090 for CUDA 12.9. + + Raises + ------ + ValueError + If the PTX version is unknown. + + Examples + -------- + >>> get_minimal_required_driver_ver_from_ptx_ver("8.8") + 12090 + >>> get_minimal_required_driver_ver_from_ptx_ver("7.0") + 11000 + """ + try: + major, minor = _ptx_to_cuda[ptx_version] + return 1000 * major + 10 * minor + except KeyError: + raise ValueError(f"Unknown or unsupported PTX ISA version: {ptx_version}") from None + + +# Regex pattern to match .version directive and capture the version number +# TODO: if import speed is a concern, consider lazy-initializing it. +_ptx_ver_pattern = re.compile(r"\.version\s+([0-9]+\.[0-9]+)") + + +def get_ptx_ver(ptx: str) -> str: + """ + Extract the PTX ISA version string from PTX source code. + + Parameters + ---------- + ptx : str + The PTX assembly source code as a string. + + Returns + ------- + str + The PTX ISA version string, e.g., "8.8". + + Raises + ------ + ValueError + If the .version directive is not found in the PTX source. + + Examples + -------- + >>> ptx = r''' + ... .version 8.8 + ... .target sm_86 + ... .address_size 64 + ... + ... .visible .entry test_kernel() + ... { + ... ret; + ... } + ... ''' + >>> get_ptx_ver(ptx) + '8.8' + """ + m = _ptx_ver_pattern.search(ptx) + if m: + return m.group(1) + else: + raise ValueError("No .version directive found in PTX source. Is it a valid PTX?") diff --git a/venv/lib/python3.12/site-packages/cuda/bindings/utils/_version_check.py b/venv/lib/python3.12/site-packages/cuda/bindings/utils/_version_check.py new file mode 100644 index 0000000000000000000000000000000000000000..1ebd7f3d924208619676dd724371adadc504b881 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/bindings/utils/_version_check.py @@ -0,0 +1,61 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +import os +import threading +import warnings + +# Track whether we've already checked major version compatibility +_major_version_compatibility_checked = False +_lock = threading.Lock() + + +def warn_if_cuda_major_version_mismatch(): + """Warn if the CUDA driver major version is older than cuda-bindings compile-time version. + + This function compares the CUDA major version that cuda-bindings was compiled + against with the CUDA major version supported by the installed driver. If the + compile-time major version is greater than the driver's major version, a warning + is issued. + + The check runs only once per process. Subsequent calls are no-ops. + + The warning can be suppressed by setting the environment variable + ``CUDA_PYTHON_DISABLE_MAJOR_VERSION_WARNING=1``. + """ + global _major_version_compatibility_checked + if _major_version_compatibility_checked: + return + with _lock: + if _major_version_compatibility_checked: + return + _major_version_compatibility_checked = True + + # Allow users to suppress the warning + if os.environ.get("CUDA_PYTHON_DISABLE_MAJOR_VERSION_WARNING"): + return + + # Import here to avoid circular imports and allow lazy loading + from cuda.bindings import driver + + # Get compile-time CUDA version from cuda-bindings + compile_version = driver.CUDA_VERSION # e.g., 13010 + compile_major = compile_version // 1000 + + # Get runtime driver version + err, runtime_version = driver.cuDriverGetVersion() + if err != driver.CUresult.CUDA_SUCCESS: + raise RuntimeError(f"Failed to query CUDA driver version: {err}") + + runtime_major = runtime_version // 1000 + + if compile_major > runtime_major: + warnings.warn( + f"cuda-bindings was built for CUDA major version {compile_major}, but the " + f"NVIDIA driver only supports up to CUDA {runtime_major}. Some cuda-bindings " + f"features may not work correctly. Consider updating your NVIDIA driver, " + f"or using a cuda-bindings version built for CUDA {runtime_major}. " + f"(Set CUDA_PYTHON_DISABLE_MAJOR_VERSION_WARNING=1 to suppress this warning.)", + UserWarning, + stacklevel=3, + ) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/README.md b/venv/lib/python3.12/site-packages/cuda/pathfinder/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c020fc6a233bcf1b1b893867200519d76e4ae8e3 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/README.md @@ -0,0 +1,3 @@ +### The `cuda.pathfinder` documentation was moved + +Please see https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/__init__.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dc818dfd08ff02f1ce45e049ea24a7afe7972982 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/__init__.py @@ -0,0 +1,91 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""cuda.pathfinder public APIs""" + +# NOTE: When adding or removing public APIs from this file, remember to update +# cuda_pathfinder/docs/source/api.rst +# to keep the documentation in sync. + +from cuda.pathfinder._binaries.find_nvidia_binary_utility import ( + find_nvidia_binary_utility as find_nvidia_binary_utility, +) +from cuda.pathfinder._binaries.supported_nvidia_binaries import SUPPORTED_BINARIES as _SUPPORTED_BINARIES +from cuda.pathfinder._dynamic_libs.load_dl_common import ( + DynamicLibNotAvailableError as DynamicLibNotAvailableError, +) +from cuda.pathfinder._dynamic_libs.load_dl_common import DynamicLibNotFoundError as DynamicLibNotFoundError +from cuda.pathfinder._dynamic_libs.load_dl_common import ( + DynamicLibUnknownError as DynamicLibUnknownError, +) +from cuda.pathfinder._dynamic_libs.load_dl_common import LoadedDL as LoadedDL +from cuda.pathfinder._dynamic_libs.load_nvidia_dynamic_lib import load_nvidia_dynamic_lib as load_nvidia_dynamic_lib +from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import ( + SUPPORTED_LIBNAMES as SUPPORTED_NVIDIA_LIBNAMES, +) +from cuda.pathfinder._headers.find_nvidia_headers import LocatedHeaderDir as LocatedHeaderDir +from cuda.pathfinder._headers.find_nvidia_headers import find_nvidia_header_directory as find_nvidia_header_directory +from cuda.pathfinder._headers.find_nvidia_headers import ( + locate_nvidia_header_directory as locate_nvidia_header_directory, +) +from cuda.pathfinder._headers.supported_nvidia_headers import SUPPORTED_HEADERS_CTK as _SUPPORTED_HEADERS_CTK +from cuda.pathfinder._static_libs.find_bitcode_lib import ( + SUPPORTED_BITCODE_LIBS as _SUPPORTED_BITCODE_LIBS, +) +from cuda.pathfinder._static_libs.find_bitcode_lib import ( + BitcodeLibNotFoundError as BitcodeLibNotFoundError, +) +from cuda.pathfinder._static_libs.find_bitcode_lib import ( + LocatedBitcodeLib as LocatedBitcodeLib, +) +from cuda.pathfinder._static_libs.find_bitcode_lib import ( + find_bitcode_lib as find_bitcode_lib, +) +from cuda.pathfinder._static_libs.find_bitcode_lib import ( + locate_bitcode_lib as locate_bitcode_lib, +) +from cuda.pathfinder._static_libs.find_static_lib import ( + SUPPORTED_STATIC_LIBS as _SUPPORTED_STATIC_LIBS, +) +from cuda.pathfinder._static_libs.find_static_lib import ( + LocatedStaticLib as LocatedStaticLib, +) +from cuda.pathfinder._static_libs.find_static_lib import ( + StaticLibNotFoundError as StaticLibNotFoundError, +) +from cuda.pathfinder._static_libs.find_static_lib import ( + find_static_lib as find_static_lib, +) +from cuda.pathfinder._static_libs.find_static_lib import ( + locate_static_lib as locate_static_lib, +) +from cuda.pathfinder._utils.env_vars import get_cuda_path_or_home as get_cuda_path_or_home + +from cuda.pathfinder._version import __version__ # isort: skip + +# Indirections to help Sphinx find the docstrings. +#: Mapping from short CUDA Toolkit (CTK) library names to their canonical +#: header basenames (used to validate a discovered include directory). +#: Example: ``"cublas" → "cublas.h"``. The key set is platform-aware +#: (e.g., ``"cufile"`` may be Linux-only). +SUPPORTED_HEADERS_CTK = _SUPPORTED_HEADERS_CTK + +#: Tuple of supported CUDA binary utility names that can be located +#: via ``find_nvidia_binary_utility()``. Platform-aware (e.g., some +#: utilities may be available only on Linux or Windows). +#: Example utilities: ``"nvdisasm"``, ``"cuobjdump"``, ``"nvcc"``. +SUPPORTED_BINARY_UTILITIES = _SUPPORTED_BINARIES + +#: Tuple of supported bitcode library names that can be resolved +#: via ``locate_bitcode_lib()`` and ``find_bitcode_lib()``. +#: Example value: ``"device"``. +SUPPORTED_BITCODE_LIBS = _SUPPORTED_BITCODE_LIBS + +#: Tuple of supported static library names that can be resolved +#: via ``locate_static_lib()`` and ``find_static_lib()``. +#: Example value: ``"cudadevrt"``. +SUPPORTED_STATIC_LIBS = _SUPPORTED_STATIC_LIBS + +# Backward compatibility: _find_nvidia_header_directory was added in release 1.2.2. +# It will be removed in release 1.2.4. +_find_nvidia_header_directory = find_nvidia_header_directory diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ee8d1ce91b281dafc7e15147403131b1ec50154 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/__pycache__/_optional_cuda_import.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/__pycache__/_optional_cuda_import.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12517e046c90d40ca98582b69965d924c3c49e74 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/__pycache__/_optional_cuda_import.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/__pycache__/_version.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/__pycache__/_version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..325cd7078907a6fdd8157f1c814006f417f4a04c Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/__pycache__/_version.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/__pycache__/find_nvidia_binary_utility.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/__pycache__/find_nvidia_binary_utility.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..546421ba350bd70bdd2a1dc41e404fe74c58c4d3 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/__pycache__/find_nvidia_binary_utility.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/__pycache__/supported_nvidia_binaries.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/__pycache__/supported_nvidia_binaries.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a9a151f6147a2e72ff6866db8a5008b2e4363cd Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/__pycache__/supported_nvidia_binaries.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py new file mode 100644 index 0000000000000000000000000000000000000000..4f857b9ac29658170f9ce3a93ed321bcd9b91f8c --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py @@ -0,0 +1,160 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import functools +import os + +from cuda.pathfinder._binaries import supported_nvidia_binaries +from cuda.pathfinder._utils.ctk_root_canary import CTK_ROOT_CANARY_ANCHOR_LIBNAMES +from cuda.pathfinder._utils.env_vars import get_cuda_path_or_home +from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs_all_sitepackages +from cuda.pathfinder._utils.platform_aware import IS_WINDOWS + + +class UnsupportedBinaryError(Exception): + def __init__(self, utility: str) -> None: + super().__init__(utility) + self.utility = utility + + def __str__(self) -> str: + supported_utilities = ", ".join(supported_nvidia_binaries.SUPPORTED_BINARIES) + return f"Binary '{self.utility}' is not supported. Supported utilities are: {supported_utilities}" + + +def _normalize_utility_name(utility_name: str) -> str: + """Normalize utility name by adding .exe on Windows if needed.""" + if IS_WINDOWS and not utility_name.lower().endswith((".exe", ".bat", ".cmd")): + return f"{utility_name}.exe" + return utility_name + + +def _is_executable_candidate(path: str) -> bool: + if not os.path.isfile(path): + return False + if IS_WINDOWS: + return True + return os.access(path, os.X_OK) + + +def _ctk_bin_subdirs(root: str) -> list[str]: + if IS_WINDOWS: + return [ + os.path.join(root, "bin", "x64"), + os.path.join(root, "bin", "x86_64"), + os.path.join(root, "bin"), + ] + return [os.path.join(root, "bin")] + + +def _resolve_ctk_root_via_canary() -> str | None: + from cuda.pathfinder._dynamic_libs.load_nvidia_dynamic_lib import resolve_ctk_root_via_canary + + ctk_root: str | None = resolve_ctk_root_via_canary(CTK_ROOT_CANARY_ANCHOR_LIBNAMES[0]) + return ctk_root + + +def _resolve_in_trusted_dirs(normalized_name: str, dirs: list[str]) -> str | None: + """Resolve ``normalized_name`` against ``dirs`` in order.""" + seen: set[str] = set() + for directory in dirs: + if directory in seen: + continue + assert directory + seen.add(directory) + candidate = os.path.join(directory, normalized_name) + if _is_executable_candidate(candidate): + return candidate + return None + + +@functools.cache +def find_nvidia_binary_utility(utility_name: str) -> str | None: + """Locate a CUDA binary utility executable. + + Args: + utility_name (str): The name of the binary utility to find + (e.g., ``"nvdisasm"``, ``"cuobjdump"``). On Windows, the ``.exe`` + extension will be automatically appended if not present. The function + also recognizes ``.bat`` and ``.cmd`` files on Windows. + + Returns: + str or None: Absolute path to the discovered executable, or ``None`` + if the utility cannot be found. The returned path is normalized + (absolute and with resolved separators). + + Raises: + UnsupportedBinaryError: If ``utility_name`` is not in the supported set + (see ``SUPPORTED_BINARY_UTILITIES``). + + Search order: + 1. **NVIDIA Python wheels** + + - Scan installed distributions (``site-packages``) for binary layouts + shipped in NVIDIA wheels (e.g., ``cuda-nvcc``). + + 2. **Conda environments** + + - Check Conda-style installation prefixes via ``CONDA_PREFIX`` + environment variable, which use platform-specific bin directory + layouts (``Library/bin`` on Windows, ``bin`` on Linux). + + 3. **CUDA Toolkit environment variables** + + - Use ``CUDA_HOME`` or ``CUDA_PATH`` (in that order), searching + ``bin/x64``, ``bin/x86_64``, and ``bin`` subdirectories on Windows, + or just ``bin`` on Linux. + + 4. **CTK-root canary fallback** + + - Only when steps 1-3 miss: resolve the ``cudart`` library through the + OS dynamic loader, derive the CUDA Toolkit root from it, and search + that root's bin layout. + + Note: + Results are cached using ``@functools.cache`` for performance. The cache + persists for the lifetime of the process. + + On Windows, executables are identified by their file extensions + (``.exe``, ``.bat``, ``.cmd``). On Unix-like systems, executables + are identified by the ``X_OK`` (execute) permission bit. + + Lookup is restricted to the trusted directories and the canary-derived + CTK root listed above. + + Example: + >>> from cuda.pathfinder import find_nvidia_binary_utility + >>> nvdisasm = find_nvidia_binary_utility("nvdisasm") + >>> if nvdisasm: + ... print(f"Found nvdisasm at: {nvdisasm}") + """ + if utility_name not in supported_nvidia_binaries.SUPPORTED_BINARIES: + raise UnsupportedBinaryError(utility_name) + + # 1. Search in site-packages (NVIDIA wheels) + candidate_dirs = supported_nvidia_binaries.SITE_PACKAGES_BINDIRS.get(utility_name, ()) + dirs = [] + + for sub_dir in candidate_dirs: + dirs.extend(find_sub_dirs_all_sitepackages(sub_dir.split(os.sep))) + + # 2. Search in Conda environment + if (conda_prefix := os.environ.get("CONDA_PREFIX")) is not None: + if IS_WINDOWS: + dirs.append(os.path.join(conda_prefix, "Library", "bin")) + else: + dirs.append(os.path.join(conda_prefix, "bin")) + + # 3. Search in CUDA Toolkit (CUDA_HOME/CUDA_PATH) + if (cuda_home := get_cuda_path_or_home()) is not None: + dirs.extend(_ctk_bin_subdirs(cuda_home)) + + normalized_name = _normalize_utility_name(utility_name) + found = _resolve_in_trusted_dirs(normalized_name, dirs) + if found is not None: + return found + + # 4. CTK-root canary fallback. + ctk_root = _resolve_ctk_root_via_canary() + if ctk_root is not None: + return _resolve_in_trusted_dirs(normalized_name, _ctk_bin_subdirs(ctk_root)) + return None diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/supported_nvidia_binaries.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/supported_nvidia_binaries.py new file mode 100644 index 0000000000000000000000000000000000000000..ac70378f112586b653759e67ca5d5b77ea61edcb --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_binaries/supported_nvidia_binaries.py @@ -0,0 +1,34 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +import os + +# Site-packages bin directories where binaries might be found +# Based on NVIDIA wheel layouts (same for Linux and Windows) +_CUDA_NVCC_BIN = os.path.join("nvidia", "cuda_nvcc", "bin") +_CUDA13_BIN = os.path.join("nvidia", "cu13", "bin") +_NSIGHT_SYSTEMS_BIN = os.path.join("nvidia", "nsight_systems", "bin") +_NSIGHT_COMPUTE_BIN = os.path.join("nvidia", "nsight_compute", "bin") + +# Common CUDA binary utilities available on both Linux and Windows +SITE_PACKAGES_BINDIRS = { + # Core compilation tools + "nvcc": (_CUDA13_BIN, _CUDA_NVCC_BIN), + "nvdisasm": (_CUDA13_BIN, _CUDA_NVCC_BIN), + "cuobjdump": (_CUDA_NVCC_BIN,), + "nvprune": (_CUDA_NVCC_BIN,), + "fatbinary": (_CUDA13_BIN, _CUDA_NVCC_BIN), + "bin2c": (_CUDA13_BIN, _CUDA_NVCC_BIN), + "nvlink": (_CUDA13_BIN, _CUDA_NVCC_BIN), + # Runtime/debugging tools + "cuda-gdb": (_CUDA_NVCC_BIN,), + "cuda-gdbserver": (_CUDA_NVCC_BIN,), + "compute-sanitizer": (_CUDA13_BIN, _CUDA_NVCC_BIN), + # Profiling tools + "nvprof": (_CUDA_NVCC_BIN,), + "nsys": (_NSIGHT_SYSTEMS_BIN,), + "nsight-sys": (_NSIGHT_SYSTEMS_BIN,), + "ncu": (_NSIGHT_COMPUTE_BIN,), + "nsight-compute": (_NSIGHT_COMPUTE_BIN,), +} + +SUPPORTED_BINARIES_ALL = SUPPORTED_BINARIES = tuple(SITE_PACKAGES_BINDIRS.keys()) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/descriptor_catalog.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/descriptor_catalog.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..35e491337b0f8cb8c34abab4bdbeb8ae934ae636 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/descriptor_catalog.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/dynamic_lib_subprocess.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/dynamic_lib_subprocess.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..830b5c6f7416fe2c6cf9abd27651f263098c8dc3 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/dynamic_lib_subprocess.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/lib_descriptor.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/lib_descriptor.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a9ea43cd372fdeb55b79e51df91507b6c23c29d Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/lib_descriptor.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_common.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_common.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..58432546a39e7c9eb04f9ff30233b0f5fac2a919 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_common.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_linux.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_linux.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ffa2be6e1f256b1eb06838369a24b703a4302595 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_linux.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_windows.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_windows.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..727e2a37f3625f52e1042bdb7cd7a7beda6e570b Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_windows.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_nvidia_dynamic_lib.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_nvidia_dynamic_lib.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d7b723efed698f808f7ad943753118a77450bfbd Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/load_nvidia_dynamic_lib.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/platform_loader.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/platform_loader.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6a9f009247c7a58094f01c89b0d45526b1c0b1c8 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/platform_loader.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/search_platform.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/search_platform.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5019b607f816e8242aace8cdbd02f2e03712cd48 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/search_platform.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/search_steps.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/search_steps.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..05bcace1c8c74cad55d12df832d66200f9661dd6 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/search_steps.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/subprocess_protocol.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/subprocess_protocol.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca2e39bf8a26cec8ea6cf4405bb0f34c5730ae26 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/subprocess_protocol.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/supported_nvidia_libs.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/supported_nvidia_libs.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ff5953e2e50215c251dae2efcb8ee46cdf77aa97 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/__pycache__/supported_nvidia_libs.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py new file mode 100644 index 0000000000000000000000000000000000000000..a26862c5435ed65569fd9a851da8bf88cbc95c85 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py @@ -0,0 +1,467 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Canonical authored descriptor catalog for dynamic libraries.""" + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Literal + +from cuda.pathfinder._utils.ctk_root_canary import CTK_ROOT_CANARY_ANCHOR_LIBNAMES + +PackagedWith = Literal["ctk", "other", "driver"] + + +@dataclass(frozen=True, slots=True) +class DescriptorSpec: + name: str + packaged_with: PackagedWith + linux_sonames: tuple[str, ...] = () + windows_dlls: tuple[str, ...] = () + site_packages_linux: tuple[str, ...] = () + site_packages_windows: tuple[str, ...] = () + dependencies: tuple[str, ...] = () + anchor_rel_dirs_linux: tuple[str, ...] = ("lib64", "lib") + anchor_rel_dirs_windows: tuple[str, ...] = ("bin/x64", "bin") + ctk_root_canary_anchor_libnames: tuple[str, ...] = () + requires_add_dll_directory: bool = False + requires_rtld_deepbind: bool = False + + +DESCRIPTOR_CATALOG: tuple[DescriptorSpec, ...] = ( + # ----------------------------------------------------------------------- + # CTK (CUDA Toolkit) libraries + # ----------------------------------------------------------------------- + DescriptorSpec( + name="cudart", + packaged_with="ctk", + linux_sonames=("libcudart.so.12", "libcudart.so.13"), + windows_dlls=("cudart64_12.dll", "cudart64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cuda_runtime/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cuda_runtime/bin"), + ), + DescriptorSpec( + name="nvfatbin", + packaged_with="ctk", + linux_sonames=("libnvfatbin.so.12", "libnvfatbin.so.13"), + windows_dlls=("nvfatbin_120_0.dll", "nvfatbin_130_0.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/nvfatbin/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/nvfatbin/bin"), + ), + DescriptorSpec( + name="nvJitLink", + packaged_with="ctk", + linux_sonames=("libnvJitLink.so.12", "libnvJitLink.so.13"), + windows_dlls=("nvJitLink_120_0.dll", "nvJitLink_130_0.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/nvjitlink/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/nvjitlink/bin"), + ), + DescriptorSpec( + name="nvrtc", + packaged_with="ctk", + linux_sonames=("libnvrtc.so.12", "libnvrtc.so.13"), + windows_dlls=("nvrtc64_120_0.dll", "nvrtc64_130_0.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cuda_nvrtc/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cuda_nvrtc/bin"), + requires_add_dll_directory=True, + ), + DescriptorSpec( + name="nvvm", + packaged_with="ctk", + linux_sonames=("libnvvm.so.4",), + windows_dlls=("nvvm64.dll", "nvvm64_40_0.dll", "nvvm70.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cuda_nvcc/nvvm/lib64"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cuda_nvcc/nvvm/bin"), + anchor_rel_dirs_linux=("nvvm/lib64",), + anchor_rel_dirs_windows=("nvvm/bin/*", "nvvm/bin"), + ctk_root_canary_anchor_libnames=CTK_ROOT_CANARY_ANCHOR_LIBNAMES, + ), + DescriptorSpec( + name="cublas", + packaged_with="ctk", + linux_sonames=("libcublas.so.12", "libcublas.so.13"), + windows_dlls=("cublas64_12.dll", "cublas64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cublas/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), + dependencies=("cublasLt",), + ), + DescriptorSpec( + name="cublasLt", + packaged_with="ctk", + linux_sonames=("libcublasLt.so.12", "libcublasLt.so.13"), + windows_dlls=("cublasLt64_12.dll", "cublasLt64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cublas/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), + ), + DescriptorSpec( + name="cufft", + packaged_with="ctk", + linux_sonames=("libcufft.so.11", "libcufft.so.12"), + windows_dlls=("cufft64_11.dll", "cufft64_12.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cufft/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cufft/bin"), + requires_add_dll_directory=True, + ), + DescriptorSpec( + name="cufftw", + packaged_with="ctk", + linux_sonames=("libcufftw.so.11", "libcufftw.so.12"), + windows_dlls=("cufftw64_11.dll", "cufftw64_12.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cufft/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cufft/bin"), + dependencies=("cufft",), + ), + DescriptorSpec( + name="curand", + packaged_with="ctk", + linux_sonames=("libcurand.so.10",), + windows_dlls=("curand64_10.dll",), + site_packages_linux=("nvidia/cu13/lib", "nvidia/curand/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/curand/bin"), + ), + DescriptorSpec( + name="cusolver", + packaged_with="ctk", + linux_sonames=("libcusolver.so.11", "libcusolver.so.12"), + windows_dlls=("cusolver64_11.dll", "cusolver64_12.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cusolver/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cusolver/bin"), + dependencies=("nvJitLink", "cusparse", "cublasLt", "cublas"), + ), + DescriptorSpec( + name="cusolverMg", + packaged_with="ctk", + linux_sonames=("libcusolverMg.so.11", "libcusolverMg.so.12"), + windows_dlls=("cusolverMg64_11.dll", "cusolverMg64_12.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cusolver/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cusolver/bin"), + dependencies=("nvJitLink", "cublasLt", "cublas"), + ), + DescriptorSpec( + name="cusparse", + packaged_with="ctk", + linux_sonames=("libcusparse.so.12",), + windows_dlls=("cusparse64_12.dll",), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cusparse/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cusparse/bin"), + dependencies=("nvJitLink",), + ), + DescriptorSpec( + name="nppc", + packaged_with="ctk", + linux_sonames=("libnppc.so.12", "libnppc.so.13"), + windows_dlls=("nppc64_12.dll", "nppc64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/npp/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + ), + DescriptorSpec( + name="nppial", + packaged_with="ctk", + linux_sonames=("libnppial.so.12", "libnppial.so.13"), + windows_dlls=("nppial64_12.dll", "nppial64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/npp/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + dependencies=("nppc",), + ), + DescriptorSpec( + name="nppicc", + packaged_with="ctk", + linux_sonames=("libnppicc.so.12", "libnppicc.so.13"), + windows_dlls=("nppicc64_12.dll", "nppicc64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/npp/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + dependencies=("nppc",), + ), + DescriptorSpec( + name="nppidei", + packaged_with="ctk", + linux_sonames=("libnppidei.so.12", "libnppidei.so.13"), + windows_dlls=("nppidei64_12.dll", "nppidei64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/npp/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + dependencies=("nppc",), + ), + DescriptorSpec( + name="nppif", + packaged_with="ctk", + linux_sonames=("libnppif.so.12", "libnppif.so.13"), + windows_dlls=("nppif64_12.dll", "nppif64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/npp/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + dependencies=("nppc",), + ), + DescriptorSpec( + name="nppig", + packaged_with="ctk", + linux_sonames=("libnppig.so.12", "libnppig.so.13"), + windows_dlls=("nppig64_12.dll", "nppig64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/npp/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + dependencies=("nppc",), + ), + DescriptorSpec( + name="nppim", + packaged_with="ctk", + linux_sonames=("libnppim.so.12", "libnppim.so.13"), + windows_dlls=("nppim64_12.dll", "nppim64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/npp/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + dependencies=("nppc",), + ), + DescriptorSpec( + name="nppist", + packaged_with="ctk", + linux_sonames=("libnppist.so.12", "libnppist.so.13"), + windows_dlls=("nppist64_12.dll", "nppist64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/npp/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + dependencies=("nppc",), + ), + DescriptorSpec( + name="nppisu", + packaged_with="ctk", + linux_sonames=("libnppisu.so.12", "libnppisu.so.13"), + windows_dlls=("nppisu64_12.dll", "nppisu64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/npp/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + dependencies=("nppc",), + ), + DescriptorSpec( + name="nppitc", + packaged_with="ctk", + linux_sonames=("libnppitc.so.12", "libnppitc.so.13"), + windows_dlls=("nppitc64_12.dll", "nppitc64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/npp/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + dependencies=("nppc",), + ), + DescriptorSpec( + name="npps", + packaged_with="ctk", + linux_sonames=("libnpps.so.12", "libnpps.so.13"), + windows_dlls=("npps64_12.dll", "npps64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/npp/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), + dependencies=("nppc",), + ), + DescriptorSpec( + name="nvblas", + packaged_with="ctk", + linux_sonames=("libnvblas.so.12", "libnvblas.so.13"), + windows_dlls=("nvblas64_12.dll", "nvblas64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cublas/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), + dependencies=("cublas", "cublasLt"), + ), + DescriptorSpec( + name="nvjpeg", + packaged_with="ctk", + linux_sonames=("libnvjpeg.so.12", "libnvjpeg.so.13"), + windows_dlls=("nvjpeg64_12.dll", "nvjpeg64_13.dll"), + site_packages_linux=("nvidia/cu13/lib", "nvidia/nvjpeg/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/nvjpeg/bin"), + ), + DescriptorSpec( + name="cufile", + packaged_with="ctk", + linux_sonames=("libcufile.so.0",), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cufile/lib"), + ), + DescriptorSpec( + name="cupti", + packaged_with="ctk", + linux_sonames=("libcupti.so.12", "libcupti.so.13"), + windows_dlls=( + "cupti64_2026.3.0.dll", + "cupti64_2026.2.1.dll", + "cupti64_2026.2.0.dll", + "cupti64_2026.1.1.dll", + "cupti64_2026.1.0.dll", + "cupti64_2025.4.1.dll", + "cupti64_2025.3.1.dll", + "cupti64_2025.2.1.dll", + "cupti64_2025.1.1.dll", + "cupti64_2024.3.2.dll", + "cupti64_2024.2.1.dll", + "cupti64_2024.1.1.dll", + "cupti64_2023.3.1.dll", + "cupti64_2023.2.2.dll", + "cupti64_2023.1.1.dll", + "cupti64_2022.4.1.dll", + ), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cuda_cupti/lib"), + site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cuda_cupti/bin"), + anchor_rel_dirs_linux=("extras/CUPTI/lib64", "lib"), + anchor_rel_dirs_windows=("extras/CUPTI/lib64", "bin"), + ctk_root_canary_anchor_libnames=CTK_ROOT_CANARY_ANCHOR_LIBNAMES, + ), + DescriptorSpec( + name="cudla", + packaged_with="ctk", + linux_sonames=("libcudla.so.1",), + windows_dlls=("cudla.dll",), + site_packages_linux=("nvidia/cu13/lib",), + # No Windows pip wheel ships cudla.dll today; it is loaded from the local + # CUDA Toolkit only, so site_packages_windows is intentionally left empty. + # The Windows CUDA Toolkit ships cudla.dll under per-architecture bin + # subdirs (e.g. bin/arm64 on N1X); search those ahead of the defaults. + anchor_rel_dirs_windows=("bin/arm64", "bin/x64", "bin"), + ), + # ----------------------------------------------------------------------- + # Third-party / separately packaged libraries + # ----------------------------------------------------------------------- + DescriptorSpec( + name="cublasmp", + packaged_with="other", + linux_sonames=("libcublasmp.so.0",), + site_packages_linux=("nvidia/cublasmp/cu13/lib", "nvidia/cublasmp/cu12/lib"), + dependencies=("cublas", "cublasLt", "nvshmem_host"), + ), + DescriptorSpec( + name="cufftMp", + packaged_with="other", + linux_sonames=("libcufftMp.so.12", "libcufftMp.so.11"), + site_packages_linux=("nvidia/cufftmp/cu13/lib", "nvidia/cufftmp/cu12/lib"), + dependencies=("nvshmem_host",), + requires_rtld_deepbind=True, + ), + DescriptorSpec( + name="cusolverMp", + packaged_with="other", + linux_sonames=("libcusolverMp.so.0",), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cu12/lib"), + dependencies=("cublas", "cudart", "cusolver", "nccl"), + ), + DescriptorSpec( + name="mathdx", + packaged_with="other", + linux_sonames=("libmathdx.so.0",), + windows_dlls=("mathdx64_0.dll",), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cu12/lib"), + site_packages_windows=("nvidia/cu13/bin", "nvidia/cu12/bin"), + dependencies=("nvrtc",), + ), + DescriptorSpec( + name="cudss", + packaged_with="other", + linux_sonames=("libcudss.so.0",), + windows_dlls=("cudss64_0.dll",), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cu12/lib"), + site_packages_windows=("nvidia/cu13/bin", "nvidia/cu12/bin"), + dependencies=("cublas", "cublasLt"), + ), + DescriptorSpec( + name="cusparseLt", + packaged_with="other", + linux_sonames=("libcusparseLt.so.0",), + windows_dlls=("cusparseLt.dll",), + site_packages_linux=("nvidia/cu13/lib", "nvidia/cusparselt/lib"), + site_packages_windows=("nvidia/cu13/bin/x64", "nvidia/cusparselt/bin"), + ), + DescriptorSpec( + name="cutensor", + packaged_with="other", + linux_sonames=("libcutensor.so.2",), + windows_dlls=("cutensor.dll",), + site_packages_linux=("cutensor/lib",), + site_packages_windows=("cutensor/bin",), + dependencies=("cublasLt",), + ), + DescriptorSpec( + name="cutensorMg", + packaged_with="other", + linux_sonames=("libcutensorMg.so.2",), + windows_dlls=("cutensorMg.dll",), + site_packages_linux=("cutensor/lib",), + site_packages_windows=("cutensor/bin",), + dependencies=("cutensor", "cublasLt"), + ), + DescriptorSpec( + name="cutensorMp", + packaged_with="other", + linux_sonames=("libcutensorMp.so.2",), + site_packages_linux=("cutensor/lib",), + dependencies=("cutensor", "cublasLt", "cudart", "nccl"), + ), + DescriptorSpec( + name="cudensitymat", + packaged_with="other", + linux_sonames=("libcudensitymat.so.0",), + site_packages_linux=("cuquantum/lib",), + dependencies=( + "cutensornet", + "cutensor", + "cusolver", + "cublasLt", + "cublas", + "curand", + "cusparse", + "nvJitLink", + ), + ), + DescriptorSpec( + name="cupauliprop", + packaged_with="other", + linux_sonames=("libcupauliprop.so.0",), + site_packages_linux=("cuquantum/lib",), + ), + DescriptorSpec( + name="cutensornet", + packaged_with="other", + linux_sonames=("libcutensornet.so.2",), + site_packages_linux=("cuquantum/lib",), + dependencies=("cutensor", "cublas", "cusolver"), + ), + DescriptorSpec( + name="custabilizer", + packaged_with="other", + linux_sonames=("libcustabilizer.so.0",), + site_packages_linux=("cuquantum/lib",), + ), + DescriptorSpec( + name="custatevec", + packaged_with="other", + linux_sonames=("libcustatevec.so.1",), + site_packages_linux=("cuquantum/lib",), + dependencies=("cublas", "cublasLt"), + ), + DescriptorSpec( + name="nccl", + packaged_with="other", + linux_sonames=("libnccl.so.2",), + site_packages_linux=("nvidia/nccl/lib",), + ), + DescriptorSpec( + name="nvpl_fftw", + packaged_with="other", + linux_sonames=("libnvpl_fftw.so.0",), + site_packages_linux=("nvpl/lib",), + ), + DescriptorSpec( + name="nvshmem_host", + packaged_with="other", + linux_sonames=("libnvshmem_host.so.3",), + site_packages_linux=("nvidia/nvshmem/lib",), + ), + # ----------------------------------------------------------------------- + # Driver libraries (system-search only, no CTK cascade) + # ----------------------------------------------------------------------- + DescriptorSpec( + name="cuda", + packaged_with="driver", + linux_sonames=("libcuda.so.1",), + windows_dlls=("nvcuda.dll",), + ), + DescriptorSpec( + name="nvcudla", + packaged_with="driver", + linux_sonames=("libnvcudla.so",), + ), + DescriptorSpec( + name="nvml", + packaged_with="driver", + linux_sonames=("libnvidia-ml.so.1",), + windows_dlls=("nvml.dll",), + ), +) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/dynamic_lib_subprocess.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/dynamic_lib_subprocess.py new file mode 100644 index 0000000000000000000000000000000000000000..ba5d05242f2f8913f9133cdfadfefd13ec7b4878 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/dynamic_lib_subprocess.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import os +import sys +from collections.abc import Sequence + +from cuda.pathfinder._dynamic_libs.lib_descriptor import LIB_DESCRIPTORS +from cuda.pathfinder._dynamic_libs.load_dl_common import DynamicLibNotFoundError, LoadedDL +from cuda.pathfinder._dynamic_libs.platform_loader import LOADER +from cuda.pathfinder._dynamic_libs.subprocess_protocol import ( + MODE_CANARY, + MODE_LOAD, + STATUS_NOT_FOUND, + STATUS_OK, + VALID_MODES, + format_dynamic_lib_subprocess_payload, +) + +# NOTE: The main entrypoint (below) serves both production (canary probe) +# and tests (full loader). Keeping them together ensures a single subprocess +# protocol and CLI surface, so the test subprocess stays aligned with the +# production flow while avoiding a separate test-only module. +# Any production-code impact is negligible since the extra logic only runs +# in the subprocess entrypoint and only in test mode. + + +def _probe_canary_abs_path(libname: str) -> str | None: + desc = LIB_DESCRIPTORS.get(libname) + if desc is None: + raise ValueError(f"Unsupported canary library name: {libname!r}") + try: + loaded: LoadedDL | None = LOADER.load_with_system_search(desc) + except DynamicLibNotFoundError: + return None + if loaded is None: + return None + abs_path: str | None = loaded.abs_path + return abs_path + + +def _validate_abs_path(abs_path: str) -> None: + assert abs_path, f"empty path: {abs_path=!r}" + assert os.path.isabs(abs_path), f"not absolute: {abs_path=!r}" + assert os.path.isfile(abs_path), f"not a file: {abs_path=!r}" + + +def _load_nvidia_dynamic_lib_for_test(libname: str) -> str: + """Test-only loader used by the subprocess entrypoint.""" + # Keep imports inside the subprocess body so startup stays focused on the + # code under test rather than the parent test module. + from cuda.pathfinder import load_nvidia_dynamic_lib + from cuda.pathfinder._dynamic_libs.load_nvidia_dynamic_lib import _load_lib_no_cache + from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import ( + SUPPORTED_LINUX_SONAMES, + SUPPORTED_WINDOWS_DLLS, + ) + from cuda.pathfinder._utils.platform_aware import IS_WINDOWS + + loaded_dl_fresh = load_nvidia_dynamic_lib(libname) + if loaded_dl_fresh.was_already_loaded_from_elsewhere: + raise RuntimeError("loaded_dl_fresh.was_already_loaded_from_elsewhere") + + abs_path = loaded_dl_fresh.abs_path + if not isinstance(abs_path, str): + raise RuntimeError(f"loaded_dl_fresh.abs_path is not a string: {abs_path!r}") + _validate_abs_path(abs_path) + assert loaded_dl_fresh.found_via is not None + + loaded_dl_from_cache = load_nvidia_dynamic_lib(libname) + if loaded_dl_from_cache is not loaded_dl_fresh: + raise RuntimeError("loaded_dl_from_cache is not loaded_dl_fresh") + + loaded_dl_no_cache = _load_lib_no_cache(libname) + supported_libs = SUPPORTED_WINDOWS_DLLS if IS_WINDOWS else SUPPORTED_LINUX_SONAMES + if not loaded_dl_no_cache.was_already_loaded_from_elsewhere and libname in supported_libs: + raise RuntimeError("not loaded_dl_no_cache.was_already_loaded_from_elsewhere") + abs_path_no_cache = loaded_dl_no_cache.abs_path + if not isinstance(abs_path_no_cache, str): + raise RuntimeError(f"loaded_dl_no_cache.abs_path is not a string: {abs_path_no_cache!r}") + if not os.path.samefile(abs_path_no_cache, abs_path): + raise RuntimeError(f"not os.path.samefile({abs_path_no_cache=!r}, {abs_path=!r})") + _validate_abs_path(abs_path_no_cache) + return abs_path + + +def probe_dynamic_lib_and_print_json(libname: str, mode: str) -> None: + if mode == MODE_CANARY: + abs_path = _probe_canary_abs_path(libname) + status = STATUS_OK if abs_path is not None else STATUS_NOT_FOUND + print(format_dynamic_lib_subprocess_payload(status, abs_path)) + return + + if mode == MODE_LOAD: + # Test-only path: exercises full loader behavior in isolation. + try: + abs_path = _load_nvidia_dynamic_lib_for_test(libname) + except DynamicLibNotFoundError as exc: + error = { + "type": exc.__class__.__name__, + "message": str(exc), + } + print(format_dynamic_lib_subprocess_payload(STATUS_NOT_FOUND, None, error=error)) + return + print(format_dynamic_lib_subprocess_payload(STATUS_OK, abs_path)) + return + + raise ValueError(f"Unsupported subprocess probe mode: {mode!r}") + + +def main(argv: Sequence[str] | None = None) -> int: + args = list(sys.argv[1:] if argv is None else argv) + if len(args) != 2 or args[0] not in VALID_MODES: + modes = ", ".join(VALID_MODES) + raise SystemExit( + f"Usage: python -m cuda.pathfinder._dynamic_libs.dynamic_lib_subprocess \nModes: {modes}" + ) + mode, libname = args + probe_dynamic_lib_and_print_json(libname, mode) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/lib_descriptor.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/lib_descriptor.py new file mode 100644 index 0000000000000000000000000000000000000000..f5e643e28fae3d7d766dd7ee3acc3019933ed6dd --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/lib_descriptor.py @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Per-library descriptor and registry. + +The canonical authored data lives in :mod:`descriptor_catalog`. This module +provides a name-keyed registry consumed by the runtime search/load path. +""" + +from __future__ import annotations + +from typing import TypeAlias + +from cuda.pathfinder._dynamic_libs.descriptor_catalog import ( + DESCRIPTOR_CATALOG, + DescriptorSpec, +) + +# Keep the historical type name for downstream imports. +LibDescriptor: TypeAlias = DescriptorSpec + + +#: Canonical registry of all known libraries. +LIB_DESCRIPTORS: dict[str, LibDescriptor] = {desc.name: desc for desc in DESCRIPTOR_CATALOG} diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_dl_common.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_dl_common.py new file mode 100644 index 0000000000000000000000000000000000000000..8d7987d00e2b9982365de200ab1626ca3658477f --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_dl_common.py @@ -0,0 +1,36 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from collections.abc import Callable +from dataclasses import dataclass +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from cuda.pathfinder._dynamic_libs.lib_descriptor import LibDescriptor + + +class DynamicLibNotFoundError(RuntimeError): + pass + + +class DynamicLibNotAvailableError(DynamicLibNotFoundError): + pass + + +class DynamicLibUnknownError(DynamicLibNotFoundError): + pass + + +@dataclass +class LoadedDL: + abs_path: str | None + was_already_loaded_from_elsewhere: bool + _handle_uint: int # Platform-agnostic unsigned pointer value + found_via: str # "CUDA_PATH" covers both CUDA_PATH and CUDA_HOME env vars + + +def load_dependencies(desc: LibDescriptor, load_func: Callable[[str], LoadedDL]) -> None: + for dep in desc.dependencies: + load_func(dep) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_dl_linux.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_dl_linux.py new file mode 100644 index 0000000000000000000000000000000000000000..10a92c20830b08e538697dba556c8afc4b5deb14 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_dl_linux.py @@ -0,0 +1,218 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import contextlib +import ctypes +import ctypes.util +import os +from typing import TYPE_CHECKING, cast + +from cuda.pathfinder._dynamic_libs.load_dl_common import LoadedDL + +if TYPE_CHECKING: + from cuda.pathfinder._dynamic_libs.lib_descriptor import LibDescriptor + +CDLL_MODE = os.RTLD_NOW | os.RTLD_GLOBAL + + +def _load_libdl() -> ctypes.CDLL: + # In normal glibc-based Linux environments, find_library("dl") should return + # something like "libdl.so.2". In minimal or stripped-down environments + # (no ldconfig/gcc, incomplete linker cache), this can return None even + # though libdl is present. In that case, we fall back to the stable SONAME. + name = ctypes.util.find_library("dl") or "libdl.so.2" + try: + return ctypes.CDLL(name) + except OSError as e: + raise RuntimeError(f"Could not load {name!r} (required for dlinfo/dlerror on Linux)") from e + + +LIBDL = _load_libdl() + +# dlinfo +LIBDL.dlinfo.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p] +LIBDL.dlinfo.restype = ctypes.c_int + +# dlerror (thread-local error string; cleared after read) +LIBDL.dlerror.argtypes = [] +LIBDL.dlerror.restype = ctypes.c_char_p + +# First appeared in 2004-era glibc. Universally correct on Linux for all practical purposes. +RTLD_DI_LINKMAP = 2 +RTLD_DI_ORIGIN = 6 + + +class _LinkMapLNameView(ctypes.Structure): + """ + Prefix-only view of glibc's `struct link_map` used **solely** to read `l_name`. + + Background: + - `dlinfo(handle, RTLD_DI_LINKMAP, ...)` returns a `struct link_map*`. + - The first few members of `struct link_map` (including `l_name`) have been + stable on glibc for decades and are documented as debugger-visible. + - We only need the offset/layout of `l_name`, not the full struct. + + Safety constraints: + - This is a **partial** definition (prefix). It must only be used via a pointer + returned by `dlinfo(...)`. + - Do **not** instantiate it or pass it **by value** to any C function. + - Do **not** access any members beyond those declared here. + - Do **not** rely on `ctypes.sizeof(LinkMapPrefix)` for allocation. + + Rationale: + - Defining only the leading fields avoids depending on internal/unstable + tail members while keeping code more readable than raw pointer arithmetic. + """ + + _fields_ = ( + ("l_addr", ctypes.c_void_p), # ElfW(Addr) + ("l_name", ctypes.c_char_p), # char* + ) + + +# Defensive assertions, mainly to document the invariants we depend on +assert _LinkMapLNameView.l_addr.offset == 0 +assert _LinkMapLNameView.l_name.offset == ctypes.sizeof(ctypes.c_void_p) + + +def _dl_last_error() -> str | None: + msg_bytes = cast(bytes | None, LIBDL.dlerror()) + if not msg_bytes: + return None # no pending error + # Never raises; undecodable bytes are mapped to U+DC80..U+DCFF + return msg_bytes.decode("utf-8", "surrogateescape") + + +def l_name_for_dynamic_library(libname: str, handle: ctypes.CDLL) -> str: + lm_view = ctypes.POINTER(_LinkMapLNameView)() + rc = LIBDL.dlinfo(ctypes.c_void_p(handle._handle), RTLD_DI_LINKMAP, ctypes.byref(lm_view)) + if rc != 0: + err = _dl_last_error() + raise OSError(f"dlinfo failed for {libname=!r} (rc={rc})" + (f": {err}" if err else "")) + if not lm_view: # NULL link_map** + raise OSError(f"dlinfo returned NULL link_map pointer for {libname=!r}") + + l_name_bytes = lm_view.contents.l_name + if not l_name_bytes: + raise OSError(f"dlinfo returned empty link_map->l_name for {libname=!r}") + + path = os.fsdecode(l_name_bytes) + if not path: + raise OSError(f"dlinfo returned empty l_name string for {libname=!r}") + + return path + + +def l_origin_for_dynamic_library(libname: str, handle: ctypes.CDLL) -> str: + l_origin_buf = ctypes.create_string_buffer(4096) + rc = LIBDL.dlinfo(ctypes.c_void_p(handle._handle), RTLD_DI_ORIGIN, l_origin_buf) + if rc != 0: + err = _dl_last_error() + raise OSError(f"dlinfo failed for {libname=!r} (rc={rc})" + (f": {err}" if err else "")) + + path = os.fsdecode(l_origin_buf.value) + if not path: + raise OSError(f"dlinfo returned empty l_origin string for {libname=!r}") + + return path + + +def abs_path_for_dynamic_library(libname: str, handle: ctypes.CDLL) -> str: + l_name = l_name_for_dynamic_library(libname, handle) + l_origin = l_origin_for_dynamic_library(libname, handle) + return os.path.join(l_origin, os.path.basename(l_name)) + + +def _candidate_sonames(desc: LibDescriptor) -> list[str]: + # Reverse tabulated names to achieve new -> old search order. + candidates = list(reversed(desc.linux_sonames)) + candidates.append(f"lib{desc.name}.so") + return candidates + + +def check_if_already_loaded_from_elsewhere(desc: LibDescriptor, _have_abs_path: bool) -> LoadedDL | None: + for soname in _candidate_sonames(desc): + try: + handle = ctypes.CDLL(soname, mode=os.RTLD_NOLOAD) + except OSError: + continue + else: + return LoadedDL( + abs_path_for_dynamic_library(desc.name, handle), + True, + handle._handle, + "was-already-loaded-from-elsewhere", + ) + return None + + +def _load_lib(desc: LibDescriptor, filename: str) -> ctypes.CDLL: + cdll_mode = CDLL_MODE + if desc.requires_rtld_deepbind: + cdll_mode |= os.RTLD_DEEPBIND + return ctypes.CDLL(filename, cdll_mode) + + +def load_with_system_search(desc: LibDescriptor) -> LoadedDL | None: + """Try to load a library using the native Linux dynamic-loader search path. + + Args: + desc: Descriptor for the library to load + + Returns: + A LoadedDL object if successful, None if the library cannot be loaded + + """ + for soname in _candidate_sonames(desc): + try: + handle = _load_lib(desc, soname) + except OSError: + pass + else: + abs_path = abs_path_for_dynamic_library(desc.name, handle) + assert abs_path + return LoadedDL(abs_path, False, handle._handle, "system-search") + return None + + +def _work_around_known_bugs(libname: str, found_path: str) -> None: + if libname == "nvrtc": + # Work around bug/oversight in + # nvidia_cuda_nvrtc-13.0.48-py3-none-manylinux2010_x86_64.manylinux_2_12_x86_64.whl + # Issue: libnvrtc.so.13 RUNPATH is not set. + # This workaround is highly specific + # - for simplicity. + # - to not mask bugs in future nvidia-cuda-nvrtc releases. + # - because a more general workaround is complicated. + dirname, basename = os.path.split(found_path) + if basename == "libnvrtc.so.13": + dep_basename = "libnvrtc-builtins.so.13.0" + dep_path = os.path.join(dirname, dep_basename) + if os.path.isfile(dep_path): + # In case of failure, defer to primary load, which is almost certain to fail, too. + with contextlib.suppress(OSError): + ctypes.CDLL(dep_path, CDLL_MODE) + + +def load_with_abs_path(desc: LibDescriptor, found_path: str, found_via: str | None = None) -> LoadedDL: + """Load a dynamic library from the given path. + + Args: + desc: Descriptor for the library to load. + found_path: The absolute path to the library file. + found_via: Label indicating how the path was discovered. + + Returns: + A LoadedDL object representing the loaded library. + + Raises: + RuntimeError: If the library cannot be loaded. + """ + _work_around_known_bugs(desc.name, found_path) + try: + handle = _load_lib(desc, found_path) + except OSError as e: + raise RuntimeError(f"Failed to dlopen {found_path}: {e}") from e + return LoadedDL(found_path, False, handle._handle, found_via) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_dl_windows.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_dl_windows.py new file mode 100644 index 0000000000000000000000000000000000000000..5069a6247906daa11b365c5d0eaaa24fe01040d5 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_dl_windows.py @@ -0,0 +1,166 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import ctypes +import ctypes.wintypes +import os +import struct +from typing import TYPE_CHECKING + +from cuda.pathfinder._dynamic_libs.load_dl_common import LoadedDL + +if TYPE_CHECKING: + from cuda.pathfinder._dynamic_libs.lib_descriptor import LibDescriptor + +# Mirrors WinBase.h (unfortunately not defined already elsewhere) +WINBASE_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 +WINBASE_LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 + +POINTER_ADDRESS_SPACE = 2 ** (struct.calcsize("P") * 8) + +# Set up kernel32 functions with proper types +kernel32 = ctypes.windll.kernel32 # type: ignore[attr-defined] + +# GetModuleHandleW +kernel32.GetModuleHandleW.argtypes = [ctypes.wintypes.LPCWSTR] +kernel32.GetModuleHandleW.restype = ctypes.wintypes.HMODULE + +# LoadLibraryExW +kernel32.LoadLibraryExW.argtypes = [ + ctypes.wintypes.LPCWSTR, # lpLibFileName + ctypes.wintypes.HANDLE, # hFile (reserved, must be NULL) + ctypes.wintypes.DWORD, # dwFlags +] +kernel32.LoadLibraryExW.restype = ctypes.wintypes.HMODULE + +# GetModuleFileNameW +kernel32.GetModuleFileNameW.argtypes = [ + ctypes.wintypes.HMODULE, # hModule + ctypes.wintypes.LPWSTR, # lpFilename + ctypes.wintypes.DWORD, # nSize +] +kernel32.GetModuleFileNameW.restype = ctypes.wintypes.DWORD + +# AddDllDirectory (Windows 7+) +kernel32.AddDllDirectory.argtypes = [ctypes.wintypes.LPCWSTR] +kernel32.AddDllDirectory.restype = ctypes.c_void_p # DLL_DIRECTORY_COOKIE + + +def ctypes_handle_to_unsigned_int(handle: ctypes.wintypes.HMODULE) -> int: + """Convert ctypes HMODULE to unsigned int.""" + handle_uint = int(handle) + if handle_uint < 0: + # Convert from signed to unsigned representation + handle_uint += POINTER_ADDRESS_SPACE + return handle_uint + + +def add_dll_directory(dll_abs_path: str) -> None: + """Add a DLL directory to the search path and update PATH environment variable. + + Args: + dll_abs_path: Absolute path to the DLL file + + Raises: + AssertionError: If the directory containing the DLL does not exist + """ + dirpath = os.path.dirname(dll_abs_path) + assert os.path.isdir(dirpath), dll_abs_path + + # Add the DLL directory to the native search path. AddDllDirectory only + # affects the LOAD_LIBRARY_SEARCH_USER_DIRS search; PATH is updated + # unconditionally below to also cover legacy dependent-DLL resolution. + kernel32.AddDllDirectory(dirpath) + + # Update PATH as a fallback for dependent DLL resolution + curr_path = os.environ.get("PATH") + os.environ["PATH"] = dirpath if curr_path is None else os.pathsep.join((curr_path, dirpath)) + + +def abs_path_for_dynamic_library(libname: str, handle: ctypes.wintypes.HMODULE) -> str: + """Get the absolute path of a loaded dynamic library on Windows.""" + # Create buffer for the path + buffer = ctypes.create_unicode_buffer(260) # MAX_PATH + length = kernel32.GetModuleFileNameW(handle, buffer, len(buffer)) + + if length == 0: + error_code = ctypes.GetLastError() # type: ignore[attr-defined] + raise RuntimeError(f"GetModuleFileNameW failed for {libname!r} (error code: {error_code})") + + # If buffer was too small, try with larger buffer + if length == len(buffer): + buffer = ctypes.create_unicode_buffer(32768) # Extended path length + length = kernel32.GetModuleFileNameW(handle, buffer, len(buffer)) + if length == 0: + error_code = ctypes.GetLastError() # type: ignore[attr-defined] + raise RuntimeError(f"GetModuleFileNameW failed for {libname!r} (error code: {error_code})") + + return buffer.value + + +def check_if_already_loaded_from_elsewhere(desc: LibDescriptor, have_abs_path: bool) -> LoadedDL | None: + for dll_name in desc.windows_dlls: + handle = kernel32.GetModuleHandleW(dll_name) + if handle: + abs_path = abs_path_for_dynamic_library(desc.name, handle) + if have_abs_path and desc.requires_add_dll_directory: + # This is a side-effect if the pathfinder loads the library via + # load_with_abs_path(). To make the side-effect more deterministic, + # activate it even if the library was already loaded from elsewhere. + add_dll_directory(abs_path) + return LoadedDL(abs_path, True, ctypes_handle_to_unsigned_int(handle), "was-already-loaded-from-elsewhere") + return None + + +def load_with_system_search(desc: LibDescriptor) -> LoadedDL | None: + """Try to load a DLL using the native Windows process DLL search path. + + This calls ``LoadLibraryExW(dll_name, NULL, 0)`` directly. Under Python + 3.8+, CPython configures the process with + ``SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)``, so this + search does **not** include the system ``PATH``. Directories added via + ``AddDllDirectory()`` still participate. + + Args: + desc: Descriptor for the library to load + + Returns: + A LoadedDL object if successful, None if the library cannot be loaded + """ + # Reverse tabulated names to achieve new -> old search order. + for dll_name in reversed(desc.windows_dlls): + handle = kernel32.LoadLibraryExW(dll_name, None, 0) + if handle: + abs_path = abs_path_for_dynamic_library(desc.name, handle) + return LoadedDL(abs_path, False, ctypes_handle_to_unsigned_int(handle), "system-search") + + return None + + +def load_with_abs_path(desc: LibDescriptor, found_path: str, found_via: str | None = None) -> LoadedDL: + """Load a dynamic library from the given path. + + Args: + desc: Descriptor for the library to load. + found_path: The absolute path to the DLL file. + found_via: Label indicating how the path was discovered. + + Returns: + A LoadedDL object representing the loaded library. + + Raises: + RuntimeError: If the DLL cannot be loaded. + """ + if desc.requires_add_dll_directory: + add_dll_directory(found_path) + + flags = WINBASE_LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | WINBASE_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR + handle = kernel32.LoadLibraryExW(found_path, None, flags) + + if not handle: + error_code = ctypes.GetLastError() # type: ignore[attr-defined] + raise RuntimeError(f"Failed to load DLL at {found_path}: Windows error {error_code}") + + return LoadedDL(found_path, False, ctypes_handle_to_unsigned_int(handle), found_via) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py new file mode 100644 index 0000000000000000000000000000000000000000..95a7182579333ad9e2624862c3f03945937abfcb --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py @@ -0,0 +1,316 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import functools +import struct +import subprocess +import sys +from typing import TYPE_CHECKING + +from cuda.pathfinder._dynamic_libs.lib_descriptor import LIB_DESCRIPTORS +from cuda.pathfinder._dynamic_libs.load_dl_common import ( + DynamicLibNotAvailableError, + DynamicLibNotFoundError, + DynamicLibUnknownError, + LoadedDL, + load_dependencies, +) +from cuda.pathfinder._dynamic_libs.platform_loader import LOADER +from cuda.pathfinder._dynamic_libs.search_steps import ( + EARLY_FIND_STEPS, + LATE_FIND_STEPS, + SearchContext, + derive_ctk_root, + find_via_ctk_root, + run_find_steps, +) +from cuda.pathfinder._dynamic_libs.subprocess_protocol import ( + DYNAMIC_LIB_SUBPROCESS_CWD, + MODE_CANARY, + STATUS_OK, + DynamicLibSubprocessPayload, + build_dynamic_lib_subprocess_command, + parse_dynamic_lib_subprocess_payload, +) +from cuda.pathfinder._utils.platform_aware import IS_WINDOWS + +if TYPE_CHECKING: + from cuda.pathfinder._dynamic_libs.lib_descriptor import LibDescriptor + +# All libnames recognized by load_nvidia_dynamic_lib, across all categories +# (CTK, third-party, driver). +_ALL_KNOWN_LIBNAMES: frozenset[str] = frozenset(LIB_DESCRIPTORS) +_ALL_SUPPORTED_LIBNAMES: frozenset[str] = frozenset( + name for name, desc in LIB_DESCRIPTORS.items() if (desc.windows_dlls if IS_WINDOWS else desc.linux_sonames) +) +_PLATFORM_NAME = "Windows" if IS_WINDOWS else "Linux" +_CANARY_PROBE_TIMEOUT_SECONDS = 10.0 + +# Driver libraries: shipped with the NVIDIA display driver, always on the +# system linker path. These skip all CTK search steps (site-packages, +# conda, CUDA_PATH, canary) and go straight to system search. +_DRIVER_ONLY_LIBNAMES = frozenset(name for name, desc in LIB_DESCRIPTORS.items() if desc.packaged_with == "driver") + + +def _load_driver_lib_no_cache(desc: LibDescriptor) -> LoadedDL: + """Load an NVIDIA driver library (system-search only). + + Driver libs (libcuda, libnvidia-ml) are part of the display driver, not + the CUDA Toolkit. They are expected to be discoverable via the platform's + native loader mechanisms, so the full CTK search cascade (site-packages, + conda, CUDA_PATH, canary) is unnecessary. + """ + loaded = LOADER.check_if_already_loaded_from_elsewhere(desc, False) + if loaded is not None: + return loaded + loaded = LOADER.load_with_system_search(desc) + if loaded is not None: + return loaded + raise DynamicLibNotFoundError( + f'"{desc.name}" is an NVIDIA driver library and can only be found via' + f" system search. Ensure the NVIDIA display driver is installed." + ) + + +def _coerce_subprocess_output(output: str | bytes | None) -> str: + if isinstance(output, bytes): + return output.decode(errors="replace") + return "" if output is None else output + + +def _raise_canary_probe_child_process_error( + *, + returncode: int | None = None, + timeout: float | None = None, + stderr: str | bytes | None = None, +) -> None: + if timeout is None: + error_line = f"Canary probe child process exited with code {returncode}." + else: + error_line = f"Canary probe child process timed out after {timeout} seconds." + raise ChildProcessError( + f"{error_line}\n" + "--- stderr-from-child-process ---\n" + f"{_coerce_subprocess_output(stderr)}" + "\n" + ) + + +@functools.cache +def _resolve_system_loaded_abs_path_in_subprocess( + libname: str, + *, + timeout: float = _CANARY_PROBE_TIMEOUT_SECONDS, +) -> str | None: + """Resolve a canary library's absolute path in a fresh Python subprocess.""" + try: + result = subprocess.run( # noqa: S603 - trusted argv: current interpreter + internal probe module + build_dynamic_lib_subprocess_command(MODE_CANARY, libname), + capture_output=True, + text=True, + timeout=timeout, + check=False, + cwd=DYNAMIC_LIB_SUBPROCESS_CWD, + ) + except subprocess.TimeoutExpired as exc: + _raise_canary_probe_child_process_error(timeout=exc.timeout, stderr=exc.stderr) + + if result.returncode != 0: + _raise_canary_probe_child_process_error(returncode=result.returncode, stderr=result.stderr) + + payload: DynamicLibSubprocessPayload = parse_dynamic_lib_subprocess_payload( + result.stdout, + libname=libname, + error_label="Canary probe child process", + ) + abs_path: str | None = payload.abs_path + if payload.status == STATUS_OK: + return abs_path + return None + + +def _loadable_via_canary_subprocess(libname: str, *, timeout: float = _CANARY_PROBE_TIMEOUT_SECONDS) -> bool: + """Return True if the canary subprocess can resolve ``libname`` via system search.""" + return _resolve_system_loaded_abs_path_in_subprocess(libname, timeout=timeout) is not None + + +def resolve_ctk_root_via_canary(canary_libname: str) -> str | None: + """Resolve the CUDA Toolkit root from a system-loadable canary library. + + The canary library's absolute path is resolved by the OS dynamic loader in + an isolated subprocess, which honors ``LD_LIBRARY_PATH`` on Linux and the + native DLL search on Windows. The toolkit root is then derived from that + path. Returns ``None`` if the canary cannot be resolved or no root can be + derived. + """ + canary_abs_path = _resolve_system_loaded_abs_path_in_subprocess(canary_libname) + if canary_abs_path is None: + return None + ctk_root: str | None = derive_ctk_root(canary_abs_path) + return ctk_root + + +def _try_ctk_root_canary(ctx: SearchContext) -> str | None: + """Try CTK-root canary fallback for descriptor-configured libraries.""" + for canary_libname in ctx.desc.ctk_root_canary_anchor_libnames: + ctk_root = resolve_ctk_root_via_canary(canary_libname) + if ctk_root is None: + continue + find = find_via_ctk_root(ctx, ctk_root) + if find is not None: + return str(find.abs_path) + return None + + +def _load_lib_no_cache(libname: str) -> LoadedDL: + desc = LIB_DESCRIPTORS[libname] + + if libname in _DRIVER_ONLY_LIBNAMES: + return _load_driver_lib_no_cache(desc) + + ctx = SearchContext(desc) + + # Phase 1: Try to find the library file on disk (pip wheels, conda). + find = run_find_steps(ctx, EARLY_FIND_STEPS) + + # Phase 2: Cross-cutting — already-loaded check and dependency loading. + # The already-loaded check on Windows uses the "have we found a path?" + # flag to decide whether to apply AddDllDirectory side-effects. + loaded = LOADER.check_if_already_loaded_from_elsewhere(desc, find is not None) + load_dependencies(desc, load_nvidia_dynamic_lib) + if loaded is not None: + return loaded + + # Phase 3: Load from found path, or fall back to system search + late find. + if find is not None: + return LOADER.load_with_abs_path(desc, find.abs_path, find.found_via) + + loaded = LOADER.load_with_system_search(desc) + if loaded is not None: + return loaded + + find = run_find_steps(ctx, LATE_FIND_STEPS) + if find is not None: + return LOADER.load_with_abs_path(desc, find.abs_path, find.found_via) + + if desc.ctk_root_canary_anchor_libnames: + canary_abs_path = _try_ctk_root_canary(ctx) + if canary_abs_path is not None: + return LOADER.load_with_abs_path(desc, canary_abs_path, "system-ctk-root") + + ctx.raise_not_found() + + +@functools.cache +def load_nvidia_dynamic_lib(libname: str) -> LoadedDL: + """Load an NVIDIA dynamic library by name. + + Args: + libname (str): The short name of the library to load (e.g., ``"cudart"``, + ``"nvvm"``, etc.). + + Returns: + LoadedDL: Object containing the OS library handle and absolute path. + + **Important:** + + **Never close the returned handle.** Do **not** call ``dlclose`` (Linux) or + ``FreeLibrary`` (Windows) on the ``LoadedDL._handle_uint``. + + **Why:** the return value is cached (``functools.cache``) and shared across the + process. Closing the handle can unload the module while other code still uses + it, leading to crashes or subtle failures. + + This applies to Linux and Windows. For context, see issue #1011: + https://github.com/NVIDIA/cuda-python/issues/1011 + + Raises: + DynamicLibUnknownError: If ``libname`` is not a recognized library name. + DynamicLibNotAvailableError: If ``libname`` is recognized but not + supported on this platform. + DynamicLibNotFoundError: If the library cannot be found or loaded. + RuntimeError: If Python is not 64-bit. + + Search order: + 0. **Already loaded in the current process** + + - If a matching library is already loaded by some other component, + return its absolute path and handle and skip the rest of the search. + + 1. **NVIDIA Python wheels** + + - Scan installed distributions (``site-packages``) to find libraries + shipped in NVIDIA wheels. + + 2. **Conda environment** + + - Conda installations are discovered via ``CONDA_PREFIX``, which is + defined automatically in activated conda environments (see + https://docs.conda.io/projects/conda-build/en/stable/user-guide/environment-variables.html). + + 3. **OS default mechanisms** + + - Fall back to the native loader: + + - Linux: ``dlopen()`` + + - Windows: ``LoadLibraryExW()`` + + On Linux, CUDA Toolkit (CTK) system installs with system config updates are + usually discovered via ``/etc/ld.so.conf.d/*cuda*.conf``. + + On Windows, under Python 3.8+, CPython configures the process with + ``SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)``. + As a result, the native DLL search used here does **not** include + the system ``PATH``. + + 4. **Environment variables** + + - If set, use ``CUDA_PATH`` or ``CUDA_HOME`` (in that order). + On Windows, this is the typical way system-installed CTK DLLs are + located. Note that the NVIDIA CTK installer automatically + adds ``CUDA_PATH`` to the system-wide environment. + + 5. **CTK root canary probe (discoverable libs only)** + + - For selected libraries whose shared object doesn't reside on the + standard linker path (currently ``nvvm``), attempt to derive CTK + root by system-loading a well-known CTK canary library in a + subprocess and then searching relative to that root. On Windows, + the canary uses the same native ``LoadLibraryExW`` semantics as + step 3, so there is also no ``PATH``-based discovery. + + **Driver libraries** (``"cuda"``, ``"nvml"``): + + These are part of the NVIDIA display driver (not the CUDA Toolkit) and + are expected to be reachable via the native OS loader path. For these + libraries the search is simplified to: + + 0. Already loaded in the current process + 1. OS default mechanisms (``dlopen`` / ``LoadLibraryExW``) + + The CTK-specific steps (site-packages, conda, ``CUDA_PATH``, canary + probe) are skipped entirely. + + Notes: + The search is performed **per library**. There is currently no mechanism to + guarantee that multiple libraries are all resolved from the same location. + + """ + pointer_size_bits = struct.calcsize("P") * 8 + if pointer_size_bits != 64: + raise RuntimeError( + f"cuda.pathfinder.load_nvidia_dynamic_lib() requires 64-bit Python." + f" Currently running: {pointer_size_bits}-bit Python" + f" {sys.version_info.major}.{sys.version_info.minor}" + ) + if libname not in _ALL_KNOWN_LIBNAMES: + raise DynamicLibUnknownError(f"Unknown library name: {libname!r}. Known names: {sorted(_ALL_KNOWN_LIBNAMES)}") + if libname not in _ALL_SUPPORTED_LIBNAMES: + raise DynamicLibNotAvailableError( + f"Library name {libname!r} is known but not available on {_PLATFORM_NAME}. " + f"Supported names on {_PLATFORM_NAME}: {sorted(_ALL_SUPPORTED_LIBNAMES)}" + ) + return _load_lib_no_cache(libname) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/platform_loader.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/platform_loader.py new file mode 100644 index 0000000000000000000000000000000000000000..9b108a57acc80dc1067fb66c310996bec7c27208 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/platform_loader.py @@ -0,0 +1,41 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Platform loader seam for OS-specific dynamic linking. + +This module provides a small interface that hides the Linux vs Windows +implementation details of: + +- already-loaded checks +- system-search loading +- absolute-path loading + +The orchestration logic in :mod:`load_nvidia_dynamic_lib` should not need to +branch on platform; it calls through the loader instance exported here. +""" + +from __future__ import annotations + +from typing import Protocol + +from cuda.pathfinder._dynamic_libs.lib_descriptor import LibDescriptor +from cuda.pathfinder._dynamic_libs.load_dl_common import LoadedDL +from cuda.pathfinder._utils.platform_aware import IS_WINDOWS + + +class PlatformLoader(Protocol): + def check_if_already_loaded_from_elsewhere(self, desc: LibDescriptor, have_abs_path: bool) -> LoadedDL | None: ... + + def load_with_system_search(self, desc: LibDescriptor) -> LoadedDL | None: ... + + def load_with_abs_path(self, desc: LibDescriptor, found_path: str, found_via: str | None = None) -> LoadedDL: ... + + +if IS_WINDOWS: + from cuda.pathfinder._dynamic_libs import load_dl_windows as _impl +else: + from cuda.pathfinder._dynamic_libs import load_dl_linux as _impl + +# The platform modules already expose functions matching the PlatformLoader +# protocol. Wrap in a simple namespace so callers use LOADER.method() syntax. +LOADER: PlatformLoader = _impl diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/search_platform.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/search_platform.py new file mode 100644 index 0000000000000000000000000000000000000000..37fd6eb17005996db579945ac8e91fb93d5c71cc --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/search_platform.py @@ -0,0 +1,219 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Platform abstraction for filesystem search steps. + +The goal is to keep :mod:`search_steps` platform-agnostic: it should not branch +on OS flags like ``IS_WINDOWS``. Instead, it calls through the single +``PLATFORM`` instance exported here. +""" + +from __future__ import annotations + +import glob +import os +from collections.abc import Sequence +from dataclasses import dataclass +from typing import Protocol, cast + +from cuda.pathfinder._dynamic_libs.lib_descriptor import LibDescriptor +from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import is_suppressed_dll_file +from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs_all_sitepackages +from cuda.pathfinder._utils.platform_aware import IS_WINDOWS + + +def _no_such_file_in_sub_dirs( + sub_dirs: Sequence[str], file_wild: str, error_messages: list[str], attachments: list[str] +) -> None: + error_messages.append(f"No such file: {file_wild}") + for sub_dir in find_sub_dirs_all_sitepackages(sub_dirs): + attachments.append(f' listdir("{sub_dir}"):') + for node in sorted(os.listdir(sub_dir)): + attachments.append(f" {node}") + + +def _find_so_in_rel_dirs( + rel_dirs: tuple[str, ...], + so_basename: str, + error_messages: list[str], + attachments: list[str], +) -> str | None: + sub_dirs_searched: list[tuple[str, ...]] = [] + file_wild = so_basename + "*" + for rel_dir in rel_dirs: + sub_dir = tuple(rel_dir.split(os.path.sep)) + for abs_dir in find_sub_dirs_all_sitepackages(sub_dir): + # Exact unversioned match first; fall back to versioned names because some + # distros only ship lib.so. (e.g. conda libcupti). Only one match + # is expected in practice. Sort in reverse so the newest-sorting name wins if + # multiple coexist, matching the newest-first bias elsewhere in pathfinder + # (see LinuxSearchPlatform.find_in_lib_dir and load_dl_linux._candidate_sonames). + # Issue #1732 tracks the deferred question of raising on true ambiguity. + so_name = os.path.join(abs_dir, so_basename) + if os.path.isfile(so_name): + return so_name + for so_name in sorted(glob.glob(os.path.join(abs_dir, file_wild)), reverse=True): + if os.path.isfile(so_name): + return so_name + sub_dirs_searched.append(sub_dir) + for sub_dir in sub_dirs_searched: + _no_such_file_in_sub_dirs(sub_dir, file_wild, error_messages, attachments) + return None + + +def _find_dll_under_dir(dirpath: str, file_wild: str) -> str | None: + for path in sorted(glob.glob(os.path.join(dirpath, file_wild))): + if not os.path.isfile(path): + continue + if not is_suppressed_dll_file(os.path.basename(path)): + return path + return None + + +def _find_dll_in_rel_dirs( + rel_dirs: tuple[str, ...], + lib_searched_for: str, + error_messages: list[str], + attachments: list[str], +) -> str | None: + sub_dirs_searched: list[tuple[str, ...]] = [] + for rel_dir in rel_dirs: + sub_dir = tuple(rel_dir.split(os.path.sep)) + for abs_dir in find_sub_dirs_all_sitepackages(sub_dir): + dll_name = _find_dll_under_dir(abs_dir, lib_searched_for) + if dll_name is not None: + return dll_name + sub_dirs_searched.append(sub_dir) + for sub_dir in sub_dirs_searched: + _no_such_file_in_sub_dirs(sub_dir, lib_searched_for, error_messages, attachments) + return None + + +class SearchPlatform(Protocol): + def lib_searched_for(self, libname: str) -> str: ... + + def site_packages_rel_dirs(self, desc: LibDescriptor) -> tuple[str, ...]: ... + + def conda_anchor_point(self, conda_prefix: str) -> str: ... + + def anchor_rel_dirs(self, desc: LibDescriptor) -> tuple[str, ...]: ... + + def find_in_site_packages( + self, + rel_dirs: tuple[str, ...], + lib_searched_for: str, + error_messages: list[str], + attachments: list[str], + ) -> str | None: ... + + def find_in_lib_dir( + self, + lib_dir: str, + libname: str, + lib_searched_for: str, + error_messages: list[str], + attachments: list[str], + ) -> str | None: ... + + +@dataclass(frozen=True, slots=True) +class LinuxSearchPlatform: + def lib_searched_for(self, libname: str) -> str: + return f"lib{libname}.so" + + def site_packages_rel_dirs(self, desc: LibDescriptor) -> tuple[str, ...]: + return cast(tuple[str, ...], desc.site_packages_linux) + + def conda_anchor_point(self, conda_prefix: str) -> str: + return conda_prefix + + def anchor_rel_dirs(self, desc: LibDescriptor) -> tuple[str, ...]: + return cast(tuple[str, ...], desc.anchor_rel_dirs_linux) + + def find_in_site_packages( + self, + rel_dirs: tuple[str, ...], + lib_searched_for: str, + error_messages: list[str], + attachments: list[str], + ) -> str | None: + return _find_so_in_rel_dirs(rel_dirs, lib_searched_for, error_messages, attachments) + + def find_in_lib_dir( + self, + lib_dir: str, + _libname: str, + lib_searched_for: str, + error_messages: list[str], + attachments: list[str], + ) -> str | None: + # Most libraries have both unversioned and versioned files/symlinks (exact match first) + so_name = os.path.join(lib_dir, lib_searched_for) + if os.path.isfile(so_name): + return so_name + # Some libraries only exist as versioned files (e.g., libcupti.so.13 in conda), + # so the glob fallback is needed + file_wild = lib_searched_for + "*" + # Only one match is expected, but to ensure deterministic behavior in unexpected + # situations, and to be internally consistent, we sort in reverse order with the + # intent to return the newest version first. Issue #1732 tracks the deferred + # question of raising on true ambiguity. + for so_name in sorted(glob.glob(os.path.join(lib_dir, file_wild)), reverse=True): + if os.path.isfile(so_name): + return so_name + error_messages.append(f"No such file: {file_wild}") + attachments.append(f' listdir("{lib_dir}"):') + if not os.path.isdir(lib_dir): + attachments.append(" DIRECTORY DOES NOT EXIST") + else: + for node in sorted(os.listdir(lib_dir)): + attachments.append(f" {node}") + return None + + +@dataclass(frozen=True, slots=True) +class WindowsSearchPlatform: + def lib_searched_for(self, libname: str) -> str: + return f"{libname}*.dll" + + def site_packages_rel_dirs(self, desc: LibDescriptor) -> tuple[str, ...]: + return cast(tuple[str, ...], desc.site_packages_windows) + + def conda_anchor_point(self, conda_prefix: str) -> str: + return os.path.join(conda_prefix, "Library") + + def anchor_rel_dirs(self, desc: LibDescriptor) -> tuple[str, ...]: + return cast(tuple[str, ...], desc.anchor_rel_dirs_windows) + + def find_in_site_packages( + self, + rel_dirs: tuple[str, ...], + lib_searched_for: str, + error_messages: list[str], + attachments: list[str], + ) -> str | None: + return _find_dll_in_rel_dirs(rel_dirs, lib_searched_for, error_messages, attachments) + + def find_in_lib_dir( + self, + lib_dir: str, + libname: str, + _lib_searched_for: str, + error_messages: list[str], + attachments: list[str], + ) -> str | None: + file_wild = libname + "*.dll" + dll_name = _find_dll_under_dir(lib_dir, file_wild) + if dll_name is not None: + return dll_name + error_messages.append(f"No such file: {file_wild}") + attachments.append(f' listdir("{lib_dir}"):') + if not os.path.isdir(lib_dir): + attachments.append(" DIRECTORY DOES NOT EXIST") + else: + for node in sorted(os.listdir(lib_dir)): + attachments.append(f" {node}") + return None + + +PLATFORM: SearchPlatform = WindowsSearchPlatform() if IS_WINDOWS else LinuxSearchPlatform() diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/search_steps.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/search_steps.py new file mode 100644 index 0000000000000000000000000000000000000000..55d8a8aa6748f939d8ebfca7541b406303d985e8 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/search_steps.py @@ -0,0 +1,228 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Composable search steps for locating NVIDIA libraries. + +Each find step is a callable with signature:: + + (SearchContext) -> FindResult | None + +Find steps locate a library file on disk without loading it. The +orchestrator in :mod:`load_nvidia_dynamic_lib` handles loading, the +already-loaded check, and dependency resolution. + +Step sequences are defined per search strategy so that adding a new +step or strategy only requires adding a function and a tuple entry. + +This module is intentionally platform-agnostic: it does not branch on the +current operating system. Platform differences are routed through the +:data:`~cuda.pathfinder._dynamic_libs.search_platform.PLATFORM` instance. +""" + +import glob +import os +from collections.abc import Callable +from dataclasses import dataclass, field +from typing import NoReturn, cast + +from cuda.pathfinder._dynamic_libs.lib_descriptor import LibDescriptor +from cuda.pathfinder._dynamic_libs.load_dl_common import DynamicLibNotFoundError +from cuda.pathfinder._dynamic_libs.search_platform import PLATFORM, SearchPlatform +from cuda.pathfinder._utils.env_vars import get_cuda_path_or_home + +# --------------------------------------------------------------------------- +# Data types +# --------------------------------------------------------------------------- + + +@dataclass +class FindResult: + """A library file located on disk (not yet loaded).""" + + abs_path: str + found_via: str + + +@dataclass +class SearchContext: + """Mutable state accumulated during the search cascade.""" + + desc: LibDescriptor + platform: SearchPlatform = PLATFORM + error_messages: list[str] = field(default_factory=list) + attachments: list[str] = field(default_factory=list) + + @property + def libname(self) -> str: + return self.desc.name # type: ignore[no-any-return] # mypy can't resolve new sibling module + + @property + def lib_searched_for(self) -> str: + return cast(str, self.platform.lib_searched_for(self.libname)) + + def raise_not_found(self) -> NoReturn: + err = ", ".join(self.error_messages) + att = "\n".join(self.attachments) + raise DynamicLibNotFoundError(f'Failure finding "{self.lib_searched_for}": {err}\n{att}') + + +#: Type alias for a find step callable. +FindStep = Callable[[SearchContext], FindResult | None] + + +def _find_lib_dir_using_anchor(desc: LibDescriptor, platform: SearchPlatform, anchor_point: str) -> str | None: + """Find the library directory under *anchor_point* using the descriptor's relative paths.""" + rel_dirs = platform.anchor_rel_dirs(desc) + for rel_path in rel_dirs: + for dirname in sorted(glob.glob(os.path.join(anchor_point, rel_path))): + if os.path.isdir(dirname): + return os.path.normpath(dirname) + return None + + +def _find_using_lib_dir(ctx: SearchContext, lib_dir: str | None) -> str | None: + """Find a library file in a resolved lib directory.""" + if lib_dir is None: + return None + return cast( + str | None, + ctx.platform.find_in_lib_dir( + lib_dir, + ctx.libname, + ctx.lib_searched_for, + ctx.error_messages, + ctx.attachments, + ), + ) + + +def _derive_ctk_root_linux(resolved_lib_path: str) -> str | None: + """Derive CTK root from Linux canary path. + + Supports: + - ``$CTK_ROOT/lib64/libfoo.so.*`` + - ``$CTK_ROOT/lib/libfoo.so.*`` + - ``$CTK_ROOT/targets//lib64/libfoo.so.*`` + - ``$CTK_ROOT/targets//lib/libfoo.so.*`` + """ + lib_dir = os.path.dirname(resolved_lib_path) + basename = os.path.basename(lib_dir) + if basename in ("lib64", "lib"): + parent = os.path.dirname(lib_dir) + grandparent = os.path.dirname(parent) + if os.path.basename(grandparent) == "targets": + return os.path.dirname(grandparent) + return parent + return None + + +def _derive_ctk_root_windows(resolved_lib_path: str) -> str | None: + """Derive CTK root from Windows canary path. + + Supports: + - ``$CTK_ROOT/bin/x64/foo.dll`` (CTK 13 style) + - ``$CTK_ROOT/bin/foo.dll`` (CTK 12 style) + """ + import ntpath + + lib_dir = ntpath.dirname(resolved_lib_path) + basename = ntpath.basename(lib_dir).lower() + if basename == "x64": + parent = ntpath.dirname(lib_dir) + if ntpath.basename(parent).lower() == "bin": + return ntpath.dirname(parent) + elif basename == "bin": + return ntpath.dirname(lib_dir) + return None + + +def derive_ctk_root(resolved_lib_path: str) -> str | None: + """Derive CTK root from a resolved canary library path.""" + ctk_root = _derive_ctk_root_linux(resolved_lib_path) + if ctk_root is not None: + return ctk_root + return _derive_ctk_root_windows(resolved_lib_path) + + +def find_via_ctk_root(ctx: SearchContext, ctk_root: str) -> FindResult | None: + """Find a library under a previously derived CTK root.""" + lib_dir = _find_lib_dir_using_anchor(ctx.desc, ctx.platform, ctk_root) + abs_path = _find_using_lib_dir(ctx, lib_dir) + if abs_path is None: + return None + return FindResult(abs_path, "system-ctk-root") + + +# --------------------------------------------------------------------------- +# Find steps +# --------------------------------------------------------------------------- + + +def find_in_site_packages(ctx: SearchContext) -> FindResult | None: + """Search pip wheel install locations.""" + rel_dirs = ctx.platform.site_packages_rel_dirs(ctx.desc) + if not rel_dirs: + return None + abs_path = ctx.platform.find_in_site_packages(rel_dirs, ctx.lib_searched_for, ctx.error_messages, ctx.attachments) + if abs_path is not None: + return FindResult(abs_path, "site-packages") + return None + + +def find_in_conda(ctx: SearchContext) -> FindResult | None: + """Search ``$CONDA_PREFIX``.""" + conda_prefix = os.environ.get("CONDA_PREFIX") + if not conda_prefix: + return None + anchor = ctx.platform.conda_anchor_point(conda_prefix) + lib_dir = _find_lib_dir_using_anchor(ctx.desc, ctx.platform, anchor) + abs_path = _find_using_lib_dir(ctx, lib_dir) + if abs_path is not None: + return FindResult(abs_path, "conda") + return None + + +def find_in_cuda_path(ctx: SearchContext) -> FindResult | None: + """Search ``$CUDA_PATH`` / ``$CUDA_HOME``. + + On Windows, this is the normal fallback for system-installed CTK DLLs when + they are not already discoverable via the native ``LoadLibraryExW(..., 0)`` + path used by :func:`cuda.pathfinder._dynamic_libs.load_dl_windows.load_with_system_search`. + Python 3.8+ does not include ``PATH`` in that native DLL search. + + The returned ``found_via`` is always ``"CUDA_PATH"`` regardless of which + environment variable actually provided the value. + """ + cuda_home = get_cuda_path_or_home() + if cuda_home is None: + return None + lib_dir = _find_lib_dir_using_anchor(ctx.desc, ctx.platform, cuda_home) + abs_path = _find_using_lib_dir(ctx, lib_dir) + if abs_path is not None: + return FindResult(abs_path, "CUDA_PATH") + return None + + +# --------------------------------------------------------------------------- +# Step sequences per strategy +# --------------------------------------------------------------------------- + +#: Find steps that run before the already-loaded check and system search. +EARLY_FIND_STEPS: tuple[FindStep, ...] = (find_in_site_packages, find_in_conda) + +#: Find steps that run after system search fails. +LATE_FIND_STEPS: tuple[FindStep, ...] = (find_in_cuda_path,) + + +# --------------------------------------------------------------------------- +# Cascade runner +# --------------------------------------------------------------------------- + + +def run_find_steps(ctx: SearchContext, steps: tuple[FindStep, ...]) -> FindResult | None: + """Run find steps in order, returning the first hit.""" + for step in steps: + result = step(ctx) + if result is not None: + return result + return None diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/subprocess_protocol.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/subprocess_protocol.py new file mode 100644 index 0000000000000000000000000000000000000000..4404d667f5f756df15f1233dd12cde794b41d112 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/subprocess_protocol.py @@ -0,0 +1,71 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import json +import sys +from dataclasses import dataclass +from pathlib import Path +from typing import Literal + +MODE_CANARY: Literal["canary"] = "canary" +MODE_LOAD: Literal["load"] = "load" +VALID_MODES: tuple[Literal["canary"], Literal["load"]] = (MODE_CANARY, MODE_LOAD) + +STATUS_OK: Literal["ok"] = "ok" +STATUS_NOT_FOUND: Literal["not-found"] = "not-found" + +DYNAMIC_LIB_SUBPROCESS_MODULE = "cuda.pathfinder._dynamic_libs.dynamic_lib_subprocess" +DYNAMIC_LIB_SUBPROCESS_CWD = Path(__file__).resolve().parents[3] + + +@dataclass(frozen=True) +class DynamicLibSubprocessPayload: + status: Literal["ok", "not-found"] + abs_path: str | None + + +def format_dynamic_lib_subprocess_payload( + status: Literal["ok", "not-found"], + abs_path: str | None, + *, + error: dict[str, str] | None = None, +) -> str: + payload: dict[str, object] = {"status": status, "abs_path": abs_path} + if error is not None: + payload["error"] = error + return json.dumps(payload) + + +def build_dynamic_lib_subprocess_command(mode: str, libname: str) -> list[str]: + return [sys.executable, "-m", DYNAMIC_LIB_SUBPROCESS_MODULE, mode, libname] + + +def parse_dynamic_lib_subprocess_payload( + stdout: str, + *, + libname: str, + error_label: str, +) -> DynamicLibSubprocessPayload: + # Use the final non-empty line in case earlier output lines are emitted. + lines = [line for line in stdout.splitlines() if line.strip()] + if not lines: + raise RuntimeError(f"{error_label} produced no stdout payload for {libname!r}") + try: + payload = json.loads(lines[-1]) + except json.JSONDecodeError: + raise RuntimeError(f"{error_label} emitted invalid JSON payload for {libname!r}: {lines[-1]!r}") from None + if not isinstance(payload, dict): + raise RuntimeError(f"{error_label} emitted unexpected payload for {libname!r}: {payload!r}") + status = payload.get("status") + abs_path = payload.get("abs_path") + if status == STATUS_OK: + if not isinstance(abs_path, str): + raise RuntimeError(f"{error_label} emitted unexpected payload for {libname!r}: {payload!r}") + return DynamicLibSubprocessPayload(status=STATUS_OK, abs_path=abs_path) + if status == STATUS_NOT_FOUND: + if abs_path is not None: + raise RuntimeError(f"{error_label} emitted unexpected payload for {libname!r}: {payload!r}") + return DynamicLibSubprocessPayload(status=STATUS_NOT_FOUND, abs_path=None) + raise RuntimeError(f"{error_label} emitted unexpected payload for {libname!r}: {payload!r}") diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py new file mode 100644 index 0000000000000000000000000000000000000000..db06411c6d0314995fde8831ecf3349ab1874413 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py @@ -0,0 +1,80 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Legacy table exports derived from the authored descriptor catalog. + +The canonical data entry point is :mod:`descriptor_catalog`. This module keeps +historical constant names for backward compatibility by deriving them from the +catalog. +""" + +from __future__ import annotations + +from cuda.pathfinder._dynamic_libs.descriptor_catalog import DESCRIPTOR_CATALOG +from cuda.pathfinder._utils.platform_aware import IS_WINDOWS + +_CTK_DESCRIPTORS = tuple(desc for desc in DESCRIPTOR_CATALOG if desc.packaged_with == "ctk") +_OTHER_DESCRIPTORS = tuple(desc for desc in DESCRIPTOR_CATALOG if desc.packaged_with == "other") +_DRIVER_DESCRIPTORS = tuple(desc for desc in DESCRIPTOR_CATALOG if desc.packaged_with == "driver") +_NON_CTK_DESCRIPTORS = _OTHER_DESCRIPTORS + _DRIVER_DESCRIPTORS + +SUPPORTED_LIBNAMES_COMMON = tuple(desc.name for desc in _CTK_DESCRIPTORS if desc.linux_sonames and desc.windows_dlls) +SUPPORTED_LIBNAMES_LINUX_ONLY = tuple( + desc.name for desc in _CTK_DESCRIPTORS if desc.linux_sonames and not desc.windows_dlls +) +SUPPORTED_LIBNAMES_WINDOWS_ONLY = tuple( + desc.name for desc in _CTK_DESCRIPTORS if desc.windows_dlls and not desc.linux_sonames +) + +SUPPORTED_LIBNAMES_LINUX = SUPPORTED_LIBNAMES_COMMON + SUPPORTED_LIBNAMES_LINUX_ONLY +SUPPORTED_LIBNAMES_WINDOWS = SUPPORTED_LIBNAMES_COMMON + SUPPORTED_LIBNAMES_WINDOWS_ONLY +SUPPORTED_LIBNAMES_ALL = SUPPORTED_LIBNAMES_COMMON + SUPPORTED_LIBNAMES_LINUX_ONLY + SUPPORTED_LIBNAMES_WINDOWS_ONLY +SUPPORTED_LIBNAMES = SUPPORTED_LIBNAMES_WINDOWS if IS_WINDOWS else SUPPORTED_LIBNAMES_LINUX + +DIRECT_DEPENDENCIES_CTK = {desc.name: desc.dependencies for desc in _CTK_DESCRIPTORS if desc.dependencies} +DIRECT_DEPENDENCIES = {desc.name: desc.dependencies for desc in DESCRIPTOR_CATALOG if desc.dependencies} + +SUPPORTED_LINUX_SONAMES_CTK = {desc.name: desc.linux_sonames for desc in _CTK_DESCRIPTORS if desc.linux_sonames} +SUPPORTED_LINUX_SONAMES_OTHER = {desc.name: desc.linux_sonames for desc in _OTHER_DESCRIPTORS if desc.linux_sonames} +SUPPORTED_LINUX_SONAMES_DRIVER = {desc.name: desc.linux_sonames for desc in _DRIVER_DESCRIPTORS if desc.linux_sonames} +SUPPORTED_LINUX_SONAMES = SUPPORTED_LINUX_SONAMES_CTK | SUPPORTED_LINUX_SONAMES_OTHER | SUPPORTED_LINUX_SONAMES_DRIVER + +SUPPORTED_WINDOWS_DLLS_CTK = {desc.name: desc.windows_dlls for desc in _CTK_DESCRIPTORS if desc.windows_dlls} +SUPPORTED_WINDOWS_DLLS_OTHER = {desc.name: desc.windows_dlls for desc in _OTHER_DESCRIPTORS if desc.windows_dlls} +SUPPORTED_WINDOWS_DLLS_DRIVER = {desc.name: desc.windows_dlls for desc in _DRIVER_DESCRIPTORS if desc.windows_dlls} +SUPPORTED_WINDOWS_DLLS = SUPPORTED_WINDOWS_DLLS_CTK | SUPPORTED_WINDOWS_DLLS_OTHER | SUPPORTED_WINDOWS_DLLS_DRIVER + +LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY = tuple( + desc.name for desc in DESCRIPTOR_CATALOG if desc.requires_add_dll_directory and desc.windows_dlls +) +LIBNAMES_REQUIRING_RTLD_DEEPBIND = tuple( + desc.name for desc in DESCRIPTOR_CATALOG if desc.requires_rtld_deepbind and desc.linux_sonames +) + +# Based on output of toolshed/make_site_packages_libdirs_linux.py +SITE_PACKAGES_LIBDIRS_LINUX_CTK = { + desc.name: desc.site_packages_linux for desc in _CTK_DESCRIPTORS if desc.site_packages_linux +} +SITE_PACKAGES_LIBDIRS_LINUX_OTHER = { + desc.name: desc.site_packages_linux for desc in _NON_CTK_DESCRIPTORS if desc.site_packages_linux +} +SITE_PACKAGES_LIBDIRS_LINUX = SITE_PACKAGES_LIBDIRS_LINUX_CTK | SITE_PACKAGES_LIBDIRS_LINUX_OTHER + +SITE_PACKAGES_LIBDIRS_WINDOWS_CTK = { + desc.name: desc.site_packages_windows for desc in _CTK_DESCRIPTORS if desc.site_packages_windows +} +SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER = { + desc.name: desc.site_packages_windows for desc in _NON_CTK_DESCRIPTORS if desc.site_packages_windows +} +SITE_PACKAGES_LIBDIRS_WINDOWS = SITE_PACKAGES_LIBDIRS_WINDOWS_CTK | SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER + + +def is_suppressed_dll_file(path_basename: str) -> bool: + if path_basename.startswith("nvrtc"): + # nvidia_cuda_nvrtc_cu12-12.8.93-py3-none-win_amd64.whl: + # nvidia\cuda_nvrtc\bin\ + # nvrtc-builtins64_128.dll + # nvrtc64_120_0.alt.dll + # nvrtc64_120_0.dll + return path_basename.endswith(".alt.dll") or "-builtins" in path_basename + return path_basename.startswith(("cudart32_", "nvvm32")) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/find_nvidia_headers.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/find_nvidia_headers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e4eff2a076fca221301740ed44cd4dfa0ee74b7c Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/find_nvidia_headers.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/header_descriptor.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/header_descriptor.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..40e632d8a52883f4458fd82459b3fac1f84daad6 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/header_descriptor.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/header_descriptor_catalog.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/header_descriptor_catalog.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b74be077957a3770f8e5d708cbf444b41b5a0e3 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/header_descriptor_catalog.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/supported_nvidia_headers.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/supported_nvidia_headers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3b19bf6eee69d35d2afa07d6375c6002e9ba114 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/__pycache__/supported_nvidia_headers.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/find_nvidia_headers.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/find_nvidia_headers.py new file mode 100644 index 0000000000000000000000000000000000000000..f5f568171411af08145d9f00e99e296a0bb7f530 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/find_nvidia_headers.py @@ -0,0 +1,227 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import functools +import glob +import os +from collections.abc import Callable +from dataclasses import dataclass +from typing import TYPE_CHECKING + +from cuda.pathfinder._dynamic_libs.load_nvidia_dynamic_lib import ( + _resolve_system_loaded_abs_path_in_subprocess, +) +from cuda.pathfinder._dynamic_libs.search_steps import derive_ctk_root +from cuda.pathfinder._headers.header_descriptor import ( + HEADER_DESCRIPTORS, + platform_include_subdirs, + resolve_conda_anchor, +) +from cuda.pathfinder._utils.ctk_root_canary import CTK_ROOT_CANARY_ANCHOR_LIBNAMES +from cuda.pathfinder._utils.env_vars import get_cuda_path_or_home +from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs_all_sitepackages + +if TYPE_CHECKING: + from cuda.pathfinder._headers.header_descriptor import HeaderDescriptor + +# --------------------------------------------------------------------------- +# Data types +# --------------------------------------------------------------------------- + + +@dataclass +class LocatedHeaderDir: + abs_path: str | None + found_via: str + + def __post_init__(self) -> None: + self.abs_path = _abs_norm(self.abs_path) + + +#: Type alias for a header find step callable. +HeaderFindStep = Callable[["HeaderDescriptor"], LocatedHeaderDir | None] + +# --------------------------------------------------------------------------- +# Helpers +# --------------------------------------------------------------------------- + + +def _abs_norm(path: str | None) -> str | None: + if path: + return os.path.normpath(os.path.abspath(path)) + return None + + +def _joined_isfile(dirpath: str, basename: str) -> bool: + return os.path.isfile(os.path.join(dirpath, basename)) + + +def _locate_in_anchor_layout(desc: HeaderDescriptor, anchor_point: str) -> str | None: + """Search for a header under *anchor_point* using the descriptor's layout fields.""" + h_basename = desc.header_basename + for rel_dir in desc.anchor_include_rel_dirs: + idir = os.path.join(anchor_point, rel_dir) + for subdir in platform_include_subdirs(desc): + cdir = os.path.join(idir, subdir) + if _joined_isfile(cdir, h_basename): + return cdir + if _joined_isfile(idir, h_basename): + return idir + return None + + +# --------------------------------------------------------------------------- +# Find steps +# --------------------------------------------------------------------------- + + +def find_in_site_packages(desc: HeaderDescriptor) -> LocatedHeaderDir | None: + """Search pip wheel install locations.""" + for sub_dir in desc.site_packages_dirs: + hdr_dir: str # help mypy + for hdr_dir in find_sub_dirs_all_sitepackages(tuple(sub_dir.split("/"))): + if _joined_isfile(hdr_dir, desc.header_basename): + return LocatedHeaderDir(abs_path=hdr_dir, found_via="site-packages") + return None + + +def find_in_conda(desc: HeaderDescriptor) -> LocatedHeaderDir | None: + """Search ``$CONDA_PREFIX``.""" + conda_prefix = os.environ.get("CONDA_PREFIX") + if not conda_prefix: + return None + anchor_point = resolve_conda_anchor(desc, conda_prefix) + if anchor_point is None: + return None + found_header_path = _locate_in_anchor_layout(desc, anchor_point) + if found_header_path: + return LocatedHeaderDir(abs_path=found_header_path, found_via="conda") + return None + + +def find_in_cuda_path(desc: HeaderDescriptor) -> LocatedHeaderDir | None: + """Search ``$CUDA_PATH`` / ``$CUDA_HOME``.""" + cuda_home = get_cuda_path_or_home() + if cuda_home is None: + return None + result = _locate_in_anchor_layout(desc, cuda_home) + if result is not None: + return LocatedHeaderDir(abs_path=result, found_via="CUDA_PATH") + return None + + +def find_via_ctk_root_canary(desc: HeaderDescriptor) -> LocatedHeaderDir | None: + """Try CTK header lookup via CTK-root canary probing. + + Skips immediately if the descriptor does not opt in (``use_ctk_root_canary``). + Otherwise, system-loads ``cudart`` in a fully isolated Python subprocess, derives + CTK root from the resolved library path, and searches the expected include + layout under that root. + """ + if not desc.use_ctk_root_canary: + return None + canary_abs_path = _resolve_system_loaded_abs_path_in_subprocess(CTK_ROOT_CANARY_ANCHOR_LIBNAMES[0]) + if canary_abs_path is None: + return None + ctk_root = derive_ctk_root(canary_abs_path) + if ctk_root is None: + return None + result = _locate_in_anchor_layout(desc, ctk_root) + if result is not None: + return LocatedHeaderDir(abs_path=result, found_via="system-ctk-root") + return None + + +def find_in_system_install_dirs(desc: HeaderDescriptor) -> LocatedHeaderDir | None: + """Search system install directories (glob patterns).""" + for pattern in desc.system_install_dirs: + for hdr_dir in sorted(glob.glob(pattern), reverse=True): + if _joined_isfile(hdr_dir, desc.header_basename): + return LocatedHeaderDir(abs_path=hdr_dir, found_via="supported_install_dir") + return None + + +# --------------------------------------------------------------------------- +# Step sequence and cascade runner +# --------------------------------------------------------------------------- + +#: Unified find steps — each step self-gates based on descriptor fields. +FIND_STEPS: tuple[HeaderFindStep, ...] = ( + find_in_site_packages, + find_in_conda, + find_in_cuda_path, + find_via_ctk_root_canary, + find_in_system_install_dirs, +) + + +def run_find_steps(desc: HeaderDescriptor, steps: tuple[HeaderFindStep, ...]) -> LocatedHeaderDir | None: + """Run find steps in order, returning the first hit.""" + for step in steps: + result = step(desc) + if result is not None: + return result + return None + + +# --------------------------------------------------------------------------- +# Public API +# --------------------------------------------------------------------------- + + +@functools.cache +def locate_nvidia_header_directory(libname: str) -> LocatedHeaderDir | None: + """Locate the header directory for a supported NVIDIA library. + + Args: + libname (str): The short name of the library whose headers are needed + (e.g., ``"nvrtc"``, ``"cusolver"``, ``"nvshmem"``). + + Returns: + LocatedHeaderDir or None: A LocatedHeaderDir object containing the absolute path + to the discovered header directory and information about where it was found, + or ``None`` if the headers cannot be found. + + Raises: + RuntimeError: If ``libname`` is not in the supported set. + + Search order: + 1. **NVIDIA Python wheels** — site-packages directories from the descriptor. + 2. **Conda environments** — platform-specific conda include layouts. + 3. **CUDA Toolkit environment variables** — ``CUDA_PATH`` / ``CUDA_HOME``. + 4. **CTK root canary probe** — subprocess canary (descriptors with + ``use_ctk_root_canary=True`` only). + 5. **System install directories** — glob patterns from the descriptor. + """ + desc = HEADER_DESCRIPTORS.get(libname) + if desc is None: + raise RuntimeError(f"UNKNOWN {libname=}") + return run_find_steps(desc, FIND_STEPS) + + +def find_nvidia_header_directory(libname: str) -> str | None: + """Locate the header directory for a supported NVIDIA library. + + Args: + libname (str): The short name of the library whose headers are needed + (e.g., ``"nvrtc"``, ``"cusolver"``, ``"nvshmem"``). + + Returns: + str or None: Absolute path to the discovered header directory, or ``None`` + if the headers cannot be found. + + Raises: + RuntimeError: If ``libname`` is not in the supported set. + + Search order: + 1. **NVIDIA Python wheels** — site-packages directories from the descriptor. + 2. **Conda environments** — platform-specific conda include layouts. + 3. **CUDA Toolkit environment variables** — ``CUDA_PATH`` / ``CUDA_HOME``. + 4. **CTK root canary probe** — subprocess canary (descriptors with + ``use_ctk_root_canary=True`` only). + 5. **System install directories** — glob patterns from the descriptor. + """ + found = locate_nvidia_header_directory(libname) + return found.abs_path if found else None diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/header_descriptor.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/header_descriptor.py new file mode 100644 index 0000000000000000000000000000000000000000..609dcab71845e8c76ce96e8e1105635d4207dcec --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/header_descriptor.py @@ -0,0 +1,54 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Per-header descriptor, registry, and platform-aware accessors. + +The canonical authored data lives in :mod:`header_descriptor_catalog`. This +module provides a name-keyed registry and platform-dispatch helpers consumed +by the runtime search path — keeping the search code itself platform-agnostic. +""" + +from __future__ import annotations + +import glob +import os +from typing import TypeAlias, cast + +from cuda.pathfinder._headers.header_descriptor_catalog import ( + HEADER_DESCRIPTOR_CATALOG, + HeaderDescriptorSpec, +) +from cuda.pathfinder._utils.platform_aware import IS_WINDOWS + +HeaderDescriptor: TypeAlias = HeaderDescriptorSpec + +#: Canonical registry of all known header libraries. +HEADER_DESCRIPTORS: dict[str, HeaderDescriptor] = {desc.name: desc for desc in HEADER_DESCRIPTOR_CATALOG} + + +def platform_include_subdirs(desc: HeaderDescriptor) -> tuple[str, ...]: + """Return the effective include subdirectory search list for the current platform. + + On Windows, Windows-specific subdirs are checked first, followed by the + common subdirs. On Linux, only the common subdirs are returned. + """ + if IS_WINDOWS: + return cast(tuple[str, ...], desc.include_subdirs_windows + desc.include_subdirs) + return cast(tuple[str, ...], desc.include_subdirs) + + +def resolve_conda_anchor(desc: HeaderDescriptor, conda_prefix: str) -> str | None: + """Resolve the conda anchor point for header search on the current platform. + + Returns the directory that ``_locate_in_anchor_layout`` should use as + *anchor_point*, or ``None`` if the conda layout is not usable. + """ + if IS_WINDOWS: + anchor = os.path.join(conda_prefix, "Library") + return anchor if os.path.isdir(anchor) else None + if desc.conda_targets_layout: + targets_include_path = glob.glob(os.path.join(conda_prefix, "targets", "*", "include")) + if not targets_include_path or len(targets_include_path) != 1: + return None + return os.path.dirname(targets_include_path[0]) + return conda_prefix diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/header_descriptor_catalog.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/header_descriptor_catalog.py new file mode 100644 index 0000000000000000000000000000000000000000..b364e224e7e1d4e560fc14cec8d927213615d1ee --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/header_descriptor_catalog.py @@ -0,0 +1,257 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Canonical authored descriptor catalog for header directories.""" + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Literal + +HeaderPackagedWith = Literal["ctk", "other"] + + +@dataclass(frozen=True, slots=True) +class HeaderDescriptorSpec: + name: str + packaged_with: HeaderPackagedWith + header_basename: str + site_packages_dirs: tuple[str, ...] = () + available_on_linux: bool = True + available_on_windows: bool = True + # Relative path(s) from anchor point to the include directory. + anchor_include_rel_dirs: tuple[str, ...] = ("include",) + # Subdirectories within the include dir to check before the include dir itself. + include_subdirs: tuple[str, ...] = () + # Windows-only additional subdirectories within the include dir. + include_subdirs_windows: tuple[str, ...] = () + # System install directories (glob patterns). + system_install_dirs: tuple[str, ...] = () + # Whether to use targets//include layout for conda on Linux. + conda_targets_layout: bool = True + # Whether to attempt CTK-root canary probing (spawns a subprocess). + use_ctk_root_canary: bool = True + + +HEADER_DESCRIPTOR_CATALOG: tuple[HeaderDescriptorSpec, ...] = ( + # ----------------------------------------------------------------------- + # CTK (CUDA Toolkit) headers + # ----------------------------------------------------------------------- + HeaderDescriptorSpec( + name="cccl", + packaged_with="ctk", + header_basename="cuda/std/version", + site_packages_dirs=( + "nvidia/cu13/include/cccl", # cuda-toolkit[cccl]==13.* + "nvidia/cuda_cccl/include", # cuda-toolkit[cccl]==12.* + ), + include_subdirs=("cccl",), + include_subdirs_windows=("targets/x64/cccl", "targets/x64"), + ), + HeaderDescriptorSpec( + name="cublas", + packaged_with="ctk", + header_basename="cublas.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cublas/include"), + ), + HeaderDescriptorSpec( + name="cudart", + packaged_with="ctk", + header_basename="cuda_runtime.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cuda_runtime/include"), + ), + HeaderDescriptorSpec( + name="cufft", + packaged_with="ctk", + header_basename="cufft.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cufft/include"), + ), + HeaderDescriptorSpec( + name="cufile", + packaged_with="ctk", + header_basename="cufile.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cufile/include"), + available_on_windows=False, + ), + HeaderDescriptorSpec( + name="curand", + packaged_with="ctk", + header_basename="curand.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/curand/include"), + ), + HeaderDescriptorSpec( + name="cusolver", + packaged_with="ctk", + header_basename="cusolverDn.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cusolver/include"), + ), + HeaderDescriptorSpec( + name="cusparse", + packaged_with="ctk", + header_basename="cusparse.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cusparse/include"), + ), + HeaderDescriptorSpec( + name="npp", + packaged_with="ctk", + header_basename="npp.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/npp/include"), + ), + HeaderDescriptorSpec( + name="profiler", + packaged_with="ctk", + header_basename="cuda_profiler_api.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cuda_profiler_api/include"), + ), + HeaderDescriptorSpec( + name="nvcc", + packaged_with="ctk", + header_basename="fatbinary_section.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cuda_nvcc/include"), + ), + HeaderDescriptorSpec( + name="nvfatbin", + packaged_with="ctk", + header_basename="nvFatbin.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/nvfatbin/include"), + ), + HeaderDescriptorSpec( + name="nvjitlink", + packaged_with="ctk", + header_basename="nvJitLink.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/nvjitlink/include"), + ), + HeaderDescriptorSpec( + name="nvjpeg", + packaged_with="ctk", + header_basename="nvjpeg.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/nvjpeg/include"), + ), + HeaderDescriptorSpec( + name="nvrtc", + packaged_with="ctk", + header_basename="nvrtc.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cuda_nvrtc/include"), + ), + HeaderDescriptorSpec( + name="nvvm", + packaged_with="ctk", + header_basename="nvvm.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cuda_nvcc/nvvm/include"), + anchor_include_rel_dirs=("nvvm/include",), + ), + HeaderDescriptorSpec( + name="cudla", + packaged_with="ctk", + header_basename="cudla.h", + site_packages_dirs=("nvidia/cu13/include",), + available_on_windows=False, + ), + # ----------------------------------------------------------------------- + # Third-party / separately packaged headers + # ----------------------------------------------------------------------- + HeaderDescriptorSpec( + name="cusolverMp", + packaged_with="other", + header_basename="cusolverMp.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cu12/include"), + available_on_windows=False, + conda_targets_layout=False, + use_ctk_root_canary=False, + ), + HeaderDescriptorSpec( + name="cusparseLt", + packaged_with="other", + header_basename="cusparseLt.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cusparselt/include"), + conda_targets_layout=False, + use_ctk_root_canary=False, + ), + HeaderDescriptorSpec( + name="cute", + packaged_with="other", + header_basename="cute/tensor.hpp", + site_packages_dirs=("cutlass_library/source/include",), + conda_targets_layout=False, + use_ctk_root_canary=False, + ), + HeaderDescriptorSpec( + name="cutensor", + packaged_with="other", + header_basename="cutensor.h", + site_packages_dirs=("cutensor/include",), + conda_targets_layout=False, + use_ctk_root_canary=False, + ), + HeaderDescriptorSpec( + name="cudensitymat", + packaged_with="other", + header_basename="cudensitymat.h", + site_packages_dirs=("cuquantum/include",), + available_on_windows=False, + conda_targets_layout=False, + use_ctk_root_canary=False, + ), + HeaderDescriptorSpec( + name="cupauliprop", + packaged_with="other", + header_basename="cupauliprop.h", + site_packages_dirs=("cuquantum/include",), + available_on_windows=False, + conda_targets_layout=False, + use_ctk_root_canary=False, + ), + HeaderDescriptorSpec( + name="cutensornet", + packaged_with="other", + header_basename="cutensornet.h", + site_packages_dirs=("cuquantum/include",), + available_on_windows=False, + conda_targets_layout=False, + use_ctk_root_canary=False, + ), + HeaderDescriptorSpec( + name="custabilizer", + packaged_with="other", + header_basename="custabilizer.h", + site_packages_dirs=("cuquantum/include",), + available_on_windows=False, + conda_targets_layout=False, + use_ctk_root_canary=False, + ), + HeaderDescriptorSpec( + name="custatevec", + packaged_with="other", + header_basename="custatevec.h", + site_packages_dirs=("cuquantum/include",), + available_on_windows=False, + conda_targets_layout=False, + use_ctk_root_canary=False, + ), + HeaderDescriptorSpec( + name="cutlass", + packaged_with="other", + header_basename="cutlass/cutlass.h", + site_packages_dirs=("cutlass_library/source/include",), + conda_targets_layout=False, + use_ctk_root_canary=False, + ), + HeaderDescriptorSpec( + name="mathdx", + packaged_with="other", + header_basename="libmathdx.h", + site_packages_dirs=("nvidia/cu13/include", "nvidia/cu12/include"), + conda_targets_layout=False, + use_ctk_root_canary=False, + ), + HeaderDescriptorSpec( + name="nvshmem", + packaged_with="other", + header_basename="nvshmem.h", + site_packages_dirs=("nvidia/nvshmem/include",), + available_on_windows=False, + system_install_dirs=("/usr/include/nvshmem_*",), + conda_targets_layout=False, + use_ctk_root_canary=False, + ), +) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/supported_nvidia_headers.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/supported_nvidia_headers.py new file mode 100644 index 0000000000000000000000000000000000000000..c7b40834e676ef854507304deb28b4e371bd1997 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_headers/supported_nvidia_headers.py @@ -0,0 +1,81 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Legacy table exports derived from the authored header descriptor catalog. + +The canonical data entry point is :mod:`header_descriptor_catalog`. This module +keeps historical constant names for backward compatibility by deriving them +from the catalog. +""" + +from __future__ import annotations + +from typing import Final + +from cuda.pathfinder._headers.header_descriptor_catalog import HEADER_DESCRIPTOR_CATALOG +from cuda.pathfinder._utils.platform_aware import IS_WINDOWS + +_CTK_DESCRIPTORS = tuple(desc for desc in HEADER_DESCRIPTOR_CATALOG if desc.packaged_with == "ctk") +_NON_CTK_DESCRIPTORS = tuple(desc for desc in HEADER_DESCRIPTOR_CATALOG if desc.packaged_with == "other") + +SUPPORTED_HEADERS_CTK_COMMON: Final[dict[str, str]] = { + desc.name: desc.header_basename + for desc in _CTK_DESCRIPTORS + if desc.available_on_linux and desc.available_on_windows +} +SUPPORTED_HEADERS_CTK_LINUX_ONLY: Final[dict[str, str]] = { + desc.name: desc.header_basename + for desc in _CTK_DESCRIPTORS + if desc.available_on_linux and not desc.available_on_windows +} +SUPPORTED_HEADERS_CTK_WINDOWS_ONLY: Final[dict[str, str]] = { + desc.name: desc.header_basename + for desc in _CTK_DESCRIPTORS + if desc.available_on_windows and not desc.available_on_linux +} + +SUPPORTED_HEADERS_CTK_LINUX = SUPPORTED_HEADERS_CTK_COMMON | SUPPORTED_HEADERS_CTK_LINUX_ONLY +SUPPORTED_HEADERS_CTK_WINDOWS = SUPPORTED_HEADERS_CTK_COMMON | SUPPORTED_HEADERS_CTK_WINDOWS_ONLY +SUPPORTED_HEADERS_CTK_ALL = ( + SUPPORTED_HEADERS_CTK_COMMON | SUPPORTED_HEADERS_CTK_LINUX_ONLY | SUPPORTED_HEADERS_CTK_WINDOWS_ONLY +) +SUPPORTED_HEADERS_CTK: Final[dict[str, str]] = ( + SUPPORTED_HEADERS_CTK_WINDOWS if IS_WINDOWS else SUPPORTED_HEADERS_CTK_LINUX +) + +SUPPORTED_SITE_PACKAGE_HEADER_DIRS_CTK: Final[dict[str, tuple[str, ...]]] = { + desc.name: desc.site_packages_dirs for desc in _CTK_DESCRIPTORS if desc.site_packages_dirs +} + +SUPPORTED_HEADERS_NON_CTK_COMMON: Final[dict[str, str]] = { + desc.name: desc.header_basename + for desc in _NON_CTK_DESCRIPTORS + if desc.available_on_linux and desc.available_on_windows +} +SUPPORTED_HEADERS_NON_CTK_LINUX_ONLY: Final[dict[str, str]] = { + desc.name: desc.header_basename + for desc in _NON_CTK_DESCRIPTORS + if desc.available_on_linux and not desc.available_on_windows +} +SUPPORTED_HEADERS_NON_CTK_WINDOWS_ONLY: Final[dict[str, str]] = { + desc.name: desc.header_basename + for desc in _NON_CTK_DESCRIPTORS + if desc.available_on_windows and not desc.available_on_linux +} + +SUPPORTED_HEADERS_NON_CTK_LINUX = SUPPORTED_HEADERS_NON_CTK_COMMON | SUPPORTED_HEADERS_NON_CTK_LINUX_ONLY +SUPPORTED_HEADERS_NON_CTK_WINDOWS = SUPPORTED_HEADERS_NON_CTK_COMMON | SUPPORTED_HEADERS_NON_CTK_WINDOWS_ONLY +SUPPORTED_HEADERS_NON_CTK_ALL = ( + SUPPORTED_HEADERS_NON_CTK_COMMON | SUPPORTED_HEADERS_NON_CTK_LINUX_ONLY | SUPPORTED_HEADERS_NON_CTK_WINDOWS_ONLY +) +SUPPORTED_HEADERS_NON_CTK: Final[dict[str, str]] = ( + SUPPORTED_HEADERS_NON_CTK_WINDOWS if IS_WINDOWS else SUPPORTED_HEADERS_NON_CTK_LINUX +) + +SUPPORTED_SITE_PACKAGE_HEADER_DIRS_NON_CTK: Final[dict[str, tuple[str, ...]]] = { + desc.name: desc.site_packages_dirs for desc in _NON_CTK_DESCRIPTORS if desc.site_packages_dirs +} + +SUPPORTED_INSTALL_DIRS_NON_CTK: Final[dict[str, tuple[str, ...]]] = { + desc.name: desc.system_install_dirs for desc in _NON_CTK_DESCRIPTORS if desc.system_install_dirs +} diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_optional_cuda_import.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_optional_cuda_import.py new file mode 100644 index 0000000000000000000000000000000000000000..0a3cc27b5956d5321cec3a5aaa7ea264f7631321 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_optional_cuda_import.py @@ -0,0 +1,43 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import importlib +from collections.abc import Callable +from types import ModuleType + +from cuda.pathfinder._dynamic_libs.load_dl_common import DynamicLibNotFoundError + + +def _optional_cuda_import( + fully_qualified_modname: str, + *, + probe_function: Callable[[ModuleType], object] | None = None, +) -> ModuleType | None: + """Import an optional CUDA module without masking unrelated import bugs. + + Returns: + The imported module if available and the optional probe succeeds, + otherwise ``None`` when the requested module is unavailable. + + Raises: + ModuleNotFoundError: If the import fails because a dependency of the + target module is missing (instead of the target module itself). + Exception: Any exception raised by ``probe_function`` except + :class:`DynamicLibNotFoundError`, which is treated as "unavailable". + """ + try: + module = importlib.import_module(fully_qualified_modname) + except ModuleNotFoundError as err: + if err.name != fully_qualified_modname: + raise + return None + + if probe_function is not None: + try: + probe_function(module) + except DynamicLibNotFoundError: + return None + + return module diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/__pycache__/find_bitcode_lib.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/__pycache__/find_bitcode_lib.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c0274a4a6cd5d9db3d48a73b272034884c405a0 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/__pycache__/find_bitcode_lib.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/__pycache__/find_static_lib.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/__pycache__/find_static_lib.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6cea397c9d222a3a4362fb3c9b94ec4ec89fc50b Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/__pycache__/find_static_lib.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/find_bitcode_lib.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/find_bitcode_lib.py new file mode 100644 index 0000000000000000000000000000000000000000..ac038aadfe71739acb4190e10dfeb2fce340023d --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/find_bitcode_lib.py @@ -0,0 +1,180 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import functools +import os +from dataclasses import dataclass +from typing import NoReturn, TypedDict + +from cuda.pathfinder._utils.env_vars import get_cuda_path_or_home +from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs_all_sitepackages +from cuda.pathfinder._utils.platform_aware import IS_WINDOWS + + +class BitcodeLibNotFoundError(RuntimeError): + """Raised when a bitcode library cannot be found.""" + + +@dataclass(frozen=True) +class LocatedBitcodeLib: + """Information about a located bitcode library.""" + + name: str + abs_path: str + filename: str + found_via: str + + +class _BitcodeLibInfo(TypedDict): + filename: str + rel_path: str + site_packages_dirs: tuple[str, ...] + available_on_windows: bool + + +_SUPPORTED_BITCODE_LIBS_INFO: dict[str, _BitcodeLibInfo] = { + "device": { + "filename": "libdevice.10.bc", + "rel_path": os.path.join("nvvm", "libdevice"), + "site_packages_dirs": ( + "nvidia/cu13/nvvm/libdevice", + "nvidia/cuda_nvcc/nvvm/libdevice", + ), + "available_on_windows": True, + }, + "nccl_device": { + "filename": "libnccl_device.bc", + "rel_path": "lib", + "site_packages_dirs": ("nvidia/nccl/lib",), + "available_on_windows": False, + }, + "nvshmem_device": { + "filename": "libnvshmem_device.bc", + "rel_path": "lib", + "site_packages_dirs": ("nvidia/nvshmem/lib",), + "available_on_windows": False, + }, +} + +# Public API: just the supported library names +SUPPORTED_BITCODE_LIBS: tuple[str, ...] = tuple( + sorted( + name for name, info in _SUPPORTED_BITCODE_LIBS_INFO.items() if not IS_WINDOWS or info["available_on_windows"] + ) +) + + +def _no_such_file_in_dir(dir_path: str, filename: str, error_messages: list[str], attachments: list[str]) -> None: + error_messages.append(f"No such file: {os.path.join(dir_path, filename)}") + if os.path.isdir(dir_path): + attachments.append(f' listdir("{dir_path}"):') + for node in sorted(os.listdir(dir_path)): + attachments.append(f" {node}") + else: + attachments.append(f' Directory does not exist: "{dir_path}"') + + +class _FindBitcodeLib: + def __init__(self, name: str) -> None: + if name not in _SUPPORTED_BITCODE_LIBS_INFO: # Updated reference + raise ValueError(f"Unknown bitcode library: '{name}'. Supported: {', '.join(SUPPORTED_BITCODE_LIBS)}") + self.name: str = name + self.config: _BitcodeLibInfo = _SUPPORTED_BITCODE_LIBS_INFO[name] # Updated reference + self.filename: str = self.config["filename"] + self.rel_path: str = self.config["rel_path"] + self.site_packages_dirs: tuple[str, ...] = self.config["site_packages_dirs"] + self.error_messages: list[str] = [] + self.attachments: list[str] = [] + + def try_site_packages(self) -> str | None: + for rel_dir in self.site_packages_dirs: + sub_dir = tuple(rel_dir.split("/")) + for abs_dir in find_sub_dirs_all_sitepackages(sub_dir): + file_path = os.path.join(abs_dir, self.filename) + if os.path.isfile(file_path): + return file_path + return None + + def try_with_conda_prefix(self) -> str | None: + conda_prefix = os.environ.get("CONDA_PREFIX") + if not conda_prefix: + return None + + anchor = os.path.join(conda_prefix, "Library") if IS_WINDOWS else conda_prefix + file_path = os.path.join(anchor, self.rel_path, self.filename) + if os.path.isfile(file_path): + return file_path + return None + + def try_with_cuda_home(self) -> str | None: + cuda_home = get_cuda_path_or_home() + if cuda_home is None: + self.error_messages.append("CUDA_HOME/CUDA_PATH not set") + return None + + file_path = os.path.join(cuda_home, self.rel_path, self.filename) + if os.path.isfile(file_path): + return file_path + + _no_such_file_in_dir( + os.path.join(cuda_home, self.rel_path), + self.filename, + self.error_messages, + self.attachments, + ) + return None + + def raise_not_found_error(self) -> NoReturn: + err = ", ".join(self.error_messages) if self.error_messages else "No search paths available" + att = "\n".join(self.attachments) if self.attachments else "" + raise BitcodeLibNotFoundError(f'Failure finding "{self.filename}": {err}\n{att}') + + +def locate_bitcode_lib(name: str) -> LocatedBitcodeLib: + """Locate a bitcode library by name. + + Raises: + ValueError: If ``name`` is not a supported bitcode library. + BitcodeLibNotFoundError: If the bitcode library cannot be found. + """ + finder = _FindBitcodeLib(name) + + abs_path = finder.try_site_packages() + if abs_path is not None: + return LocatedBitcodeLib( + name=name, + abs_path=abs_path, + filename=finder.filename, + found_via="site-packages", + ) + + abs_path = finder.try_with_conda_prefix() + if abs_path is not None: + return LocatedBitcodeLib( + name=name, + abs_path=abs_path, + filename=finder.filename, + found_via="conda", + ) + + abs_path = finder.try_with_cuda_home() + if abs_path is not None: + return LocatedBitcodeLib( + name=name, + abs_path=abs_path, + filename=finder.filename, + found_via="CUDA_PATH", + ) + + finder.raise_not_found_error() + + +@functools.cache +def find_bitcode_lib(name: str) -> str: + """Find the absolute path to a bitcode library. + + Raises: + ValueError: If ``name`` is not a supported bitcode library. + BitcodeLibNotFoundError: If the bitcode library cannot be found. + """ + return locate_bitcode_lib(name).abs_path diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/find_static_lib.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/find_static_lib.py new file mode 100644 index 0000000000000000000000000000000000000000..804b1c04be70926b866c763d7abc0ff6be8713de --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_static_libs/find_static_lib.py @@ -0,0 +1,167 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import functools +import os +from dataclasses import dataclass +from typing import NoReturn, TypedDict + +from cuda.pathfinder._utils.env_vars import get_cuda_path_or_home +from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs_all_sitepackages +from cuda.pathfinder._utils.platform_aware import IS_WINDOWS + + +class StaticLibNotFoundError(RuntimeError): + """Raised when a static library cannot be found.""" + + +@dataclass(frozen=True) +class LocatedStaticLib: + """Information about a located static library.""" + + name: str + abs_path: str + filename: str + found_via: str + + +class _StaticLibInfo(TypedDict): + filename: str + ctk_rel_paths: tuple[str, ...] + conda_rel_paths: tuple[str, ...] + site_packages_dirs: tuple[str, ...] + + +_SUPPORTED_STATIC_LIBS_INFO: dict[str, _StaticLibInfo] = { + "cudadevrt": { + "filename": "cudadevrt.lib" if IS_WINDOWS else "libcudadevrt.a", + "ctk_rel_paths": (os.path.join("lib", "x64"),) if IS_WINDOWS else ("lib64", "lib"), + "conda_rel_paths": ((os.path.join("lib", "x64"), "lib") if IS_WINDOWS else ("lib",)), + "site_packages_dirs": ( + ("nvidia/cu13/lib/x64", "nvidia/cuda_runtime/lib/x64") + if IS_WINDOWS + else ("nvidia/cu13/lib", "nvidia/cuda_runtime/lib") + ), + }, +} + +SUPPORTED_STATIC_LIBS: tuple[str, ...] = tuple(sorted(_SUPPORTED_STATIC_LIBS_INFO.keys())) + + +def _no_such_file_in_dir(dir_path: str, filename: str, error_messages: list[str], attachments: list[str]) -> None: + error_messages.append(f"No such file: {os.path.join(dir_path, filename)}") + if os.path.isdir(dir_path): + attachments.append(f' listdir("{dir_path}"):') + for node in sorted(os.listdir(dir_path)): + attachments.append(f" {node}") + else: + attachments.append(f' Directory does not exist: "{dir_path}"') + + +class _FindStaticLib: + def __init__(self, name: str) -> None: + if name not in _SUPPORTED_STATIC_LIBS_INFO: + raise ValueError(f"Unknown static library: '{name}'. Supported: {', '.join(SUPPORTED_STATIC_LIBS)}") + self.name: str = name + self.config: _StaticLibInfo = _SUPPORTED_STATIC_LIBS_INFO[name] + self.filename: str = self.config["filename"] + self.ctk_rel_paths: tuple[str, ...] = self.config["ctk_rel_paths"] + self.conda_rel_paths: tuple[str, ...] = self.config["conda_rel_paths"] + self.site_packages_dirs: tuple[str, ...] = self.config["site_packages_dirs"] + self.error_messages: list[str] = [] + self.attachments: list[str] = [] + + def try_site_packages(self) -> str | None: + for rel_dir in self.site_packages_dirs: + sub_dir = tuple(rel_dir.split("/")) + for abs_dir in find_sub_dirs_all_sitepackages(sub_dir): + file_path = os.path.join(abs_dir, self.filename) + if os.path.isfile(file_path): + return file_path + return None + + def try_with_conda_prefix(self) -> str | None: + conda_prefix = os.environ.get("CONDA_PREFIX") + if not conda_prefix: + return None + + anchor = os.path.join(conda_prefix, "Library") if IS_WINDOWS else conda_prefix + for rel_path in self.conda_rel_paths: + file_path = os.path.join(anchor, rel_path, self.filename) + if os.path.isfile(file_path): + return file_path + return None + + def try_with_cuda_home(self) -> str | None: + cuda_home = get_cuda_path_or_home() + if cuda_home is None: + self.error_messages.append("CUDA_HOME/CUDA_PATH not set") + return None + + for rel_path in self.ctk_rel_paths: + file_path = os.path.join(cuda_home, rel_path, self.filename) + if os.path.isfile(file_path): + return file_path + + _no_such_file_in_dir( + os.path.join(cuda_home, self.ctk_rel_paths[0]), + self.filename, + self.error_messages, + self.attachments, + ) + return None + + def raise_not_found_error(self) -> NoReturn: + err = ", ".join(self.error_messages) if self.error_messages else "No search paths available" + att = "\n".join(self.attachments) if self.attachments else "" + raise StaticLibNotFoundError(f'Failure finding "{self.filename}": {err}\n{att}') + + +def locate_static_lib(name: str) -> LocatedStaticLib: + """Locate a static library by name. + + Raises: + ValueError: If ``name`` is not a supported static library. + StaticLibNotFoundError: If the static library cannot be found. + """ + finder = _FindStaticLib(name) + + abs_path = finder.try_site_packages() + if abs_path is not None: + return LocatedStaticLib( + name=name, + abs_path=abs_path, + filename=finder.filename, + found_via="site-packages", + ) + + abs_path = finder.try_with_conda_prefix() + if abs_path is not None: + return LocatedStaticLib( + name=name, + abs_path=abs_path, + filename=finder.filename, + found_via="conda", + ) + + abs_path = finder.try_with_cuda_home() + if abs_path is not None: + return LocatedStaticLib( + name=name, + abs_path=abs_path, + filename=finder.filename, + found_via="CUDA_PATH", + ) + + finder.raise_not_found_error() + + +@functools.cache +def find_static_lib(name: str) -> str: + """Find the absolute path to a static library. + + Raises: + ValueError: If ``name`` is not a supported static library. + StaticLibNotFoundError: If the static library cannot be found. + """ + return locate_static_lib(name).abs_path diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/ctk_root_canary.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/ctk_root_canary.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c772885acba83fbd62c907c0222a9933ac83c1bd Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/ctk_root_canary.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/driver_info.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/driver_info.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fecae38a2b5712e97e09a5d663cd4505f201b659 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/driver_info.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/env_vars.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/env_vars.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5dd8c293769aa578a1db8686e53c2601ff6390a0 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/env_vars.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/find_site_packages_dll.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/find_site_packages_dll.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a0fb12d299646d2153deb85dd7aa0ceca4dcf6c1 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/find_site_packages_dll.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/find_site_packages_so.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/find_site_packages_so.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fabf8747092e1f2321f40c3eebb51b41cc425d1d Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/find_site_packages_so.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/find_sub_dirs.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/find_sub_dirs.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca9a3742dffc51d94285fdcbb99ea47edf74b141 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/find_sub_dirs.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/platform_aware.cpython-312.pyc b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/platform_aware.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..792e3f8b21cb4b56cfae21b48678adfdedb3e287 Binary files /dev/null and b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/__pycache__/platform_aware.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/ctk_root_canary.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/ctk_root_canary.py new file mode 100644 index 0000000000000000000000000000000000000000..80122f517ee1062ffa8adf081b945f0b3bea0113 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/ctk_root_canary.py @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +CTK_ROOT_CANARY_ANCHOR_LIBNAMES = ("cudart",) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/driver_info.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/driver_info.py new file mode 100644 index 0000000000000000000000000000000000000000..a5d4d167d33968f1c70427686fa7b6555a062e5c --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/driver_info.py @@ -0,0 +1,80 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import ctypes +import functools +from collections.abc import Callable +from dataclasses import dataclass + +from cuda.pathfinder._dynamic_libs.load_nvidia_dynamic_lib import ( + load_nvidia_dynamic_lib as _load_nvidia_dynamic_lib, +) +from cuda.pathfinder._utils.platform_aware import IS_WINDOWS + + +class QueryDriverCudaVersionError(RuntimeError): + """Raised when ``query_driver_cuda_version()`` cannot determine the CUDA driver version.""" + + +@dataclass(frozen=True, slots=True) +class DriverCudaVersion: + """ + CUDA-facing driver version reported by ``cuDriverGetVersion()``. + + The name ``DriverCudaVersion`` is intentionally specific: this dataclass + models the version shown as ``CUDA Version`` in ``nvidia-smi``, not the + graphics driver release shown as ``Driver Version``. More specifically, + it reflects the CUDA user-mode driver (UMD) interface version reported by + ``cuDriverGetVersion()``, not the kernel-mode driver (KMD) package + version. + + Example ``nvidia-smi`` output:: + + +---------------------------------------------------------------------+ + | NVIDIA-SMI 595.58.03 Driver Version: 595.58.03 CUDA Version: 13.2 | + +---------------------------------------------------------------------+ + + For the example above, ``DriverCudaVersion(encoded=13020, major=13, + minor=2)`` corresponds to ``CUDA Version: 13.2``. It does not correspond + to ``Driver Version: 595.58.03``. + """ + + encoded: int + major: int + minor: int + + +@functools.cache +def query_driver_cuda_version() -> DriverCudaVersion: + """Return the CUDA driver version parsed into its major/minor components.""" + try: + encoded = _query_driver_cuda_version_int() + return DriverCudaVersion( + encoded=encoded, + major=encoded // 1000, + minor=(encoded % 1000) // 10, + ) + except Exception as exc: + raise QueryDriverCudaVersionError("Failed to query the CUDA driver version.") from exc + + +def _query_driver_cuda_version_int() -> int: + """Return the encoded CUDA driver version from ``cuDriverGetVersion()``.""" + loaded_cuda = _load_nvidia_dynamic_lib("cuda") + if IS_WINDOWS: + # `ctypes.WinDLL` exists on Windows at runtime. The ignore is only for + # Linux mypy runs, where the platform stubs do not define that attribute. + loader_cls: Callable[[str], ctypes.CDLL] = ctypes.WinDLL # type: ignore[attr-defined] + else: + loader_cls = ctypes.CDLL + driver_lib = loader_cls(loaded_cuda.abs_path) + cu_driver_get_version = driver_lib.cuDriverGetVersion + cu_driver_get_version.argtypes = [ctypes.POINTER(ctypes.c_int)] + cu_driver_get_version.restype = ctypes.c_int + version = ctypes.c_int() + status = cu_driver_get_version(ctypes.byref(version)) + if status != 0: + raise RuntimeError(f"Failed to query CUDA driver version via cuDriverGetVersion() (status={status}).") + return version.value diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/env_vars.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/env_vars.py new file mode 100644 index 0000000000000000000000000000000000000000..12198ac9f7f8714f399e7de68bc7fc4c9594134d --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/env_vars.py @@ -0,0 +1,105 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Centralized CUDA environment variable handling. + +This module defines the canonical search order for CUDA Toolkit environment variables +used throughout cuda-python packages (cuda.pathfinder, cuda.core, cuda.bindings). + +Search Order Priority: + 1. CUDA_PATH (higher priority) + 2. CUDA_HOME (lower priority) + +If both are set and differ, CUDA_PATH takes precedence and a warning is issued. + +Important Note on Caching: + The result of get_cuda_path_or_home() is cached for the process lifetime. The first + call determines the CUDA Toolkit path, and all subsequent calls return the cached + value, even if environment variables change later. This ensures consistent behavior + throughout the application lifecycle. +""" + +import functools +import os +import warnings + +_CUDA_PATH_ENV_VARS_ORDERED = ("CUDA_PATH", "CUDA_HOME") + + +def _paths_differ(a: str, b: str) -> bool: + """ + Return True if paths are observably different. + + Strategy: + 1) Compare os.path.normcase(os.path.normpath(...)) for quick, robust textual equality. + - Handles trailing slashes and case-insensitivity on Windows. + 2) If still different AND both exist, use os.path.samefile to resolve symlinks/junctions. + 3) Otherwise (nonexistent paths or samefile unavailable), treat as different. + """ + norm_a = os.path.normcase(os.path.normpath(a)) + norm_b = os.path.normcase(os.path.normpath(b)) + if norm_a == norm_b: + return False + + try: + if os.path.exists(a) and os.path.exists(b): + # samefile raises on non-existent paths; only call when both exist. + return not os.path.samefile(a, b) + except OSError: + # Fall through to "different" if samefile isn't applicable/available. + pass + + # If normalized strings differ and we couldn't prove they're the same entry, treat as different. + return True + + +@functools.cache +def get_cuda_path_or_home() -> str | None: + """Get CUDA Toolkit path from environment variables. + + Returns the value of CUDA_PATH or CUDA_HOME. If both are set and differ, + CUDA_PATH takes precedence and a warning is issued. + + The result is cached for the process lifetime. The first call determines the CUDA + Toolkit path, and subsequent calls return the cached value. + + Returns: + Path to CUDA Toolkit, or None if neither variable is set or all are empty. + + Warnings: + UserWarning: If multiple CUDA environment variables are set but point to + different locations (only on the first call). + + """ + # Collect non-empty environment variables in priority order. + # Empty strings are treated as undefined — no valid CUDA path is empty. + set_vars = {} + for var in _CUDA_PATH_ENV_VARS_ORDERED: + val = os.environ.get(var) + if val: + set_vars[var] = val + + if not set_vars: + return None + + # If multiple variables are set, check if they differ and warn + if len(set_vars) > 1: + values = list(set_vars.items()) + values_differ = False + for i in range(len(values) - 1): + if _paths_differ(values[i][1], values[i + 1][1]): + values_differ = True + break + + if values_differ: + var_list = "\n".join(f" {var}={val}" for var, val in set_vars.items()) + warnings.warn( + f"Multiple CUDA environment variables are set but differ:\n" + f"{var_list}\n" + f"Using {_CUDA_PATH_ENV_VARS_ORDERED[0]} (highest priority).", + UserWarning, + stacklevel=2, + ) + + # Return the first (highest priority) set variable + return next(iter(set_vars.values())) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/find_site_packages_dll.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/find_site_packages_dll.py new file mode 100644 index 0000000000000000000000000000000000000000..507355727f98ece01d53398d0154113abe8061f5 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/find_site_packages_dll.py @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import collections +import functools +import importlib.metadata + + +@functools.cache +def find_all_dll_files_via_metadata() -> dict[str, tuple[str, ...]]: + results: collections.defaultdict[str, list[str]] = collections.defaultdict(list) + + # sort dists for deterministic output + + for dist in sorted( + importlib.metadata.distributions(), + # `get` exists before 3.12, even though the hints only exist for Python >=3.12 + key=lambda d: (d.metadata.get("Name", ""), d.version), # type: ignore[attr-defined] + ): + files = dist.files + if not files: + continue + for relpath in sorted(files, key=lambda p: str(p)): # deterministic + relname = relpath.name.lower() + if not relname.endswith(".dll"): + continue + abs_path = str(dist.locate_file(relpath)) + results[relname].append(abs_path) + + # plain dicts; sort inner list for stability + return {k: tuple(sorted(v)) for k, v in results.items()} diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/find_site_packages_so.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/find_site_packages_so.py new file mode 100644 index 0000000000000000000000000000000000000000..33ee1f1bcfb07cc22000b732090ecb535f5335a7 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/find_site_packages_so.py @@ -0,0 +1,43 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import collections +import functools +import importlib.metadata +import re + +_SO_RE = re.compile(r"\.so(?:$|\.)") # matches libfoo.so or libfoo.so.1.2.3 + + +def split_so_version_suffix(so_filename: str) -> tuple[str, str]: + idx = so_filename.rfind(".so") + assert idx > 0, so_filename + idx += 3 + return (so_filename[:idx], so_filename[idx:]) + + +@functools.cache +def find_all_so_files_via_metadata() -> dict[str, dict[str, tuple[str, ...]]]: + results: collections.defaultdict[str, collections.defaultdict[str, list[str]]] = collections.defaultdict( + lambda: collections.defaultdict(list) + ) + + # sort dists for deterministic output + for dist in sorted( + importlib.metadata.distributions(), + # `get` exists before 3.12, even though the hints only exist for Python >=3.12 + key=lambda d: (d.metadata.get("Name", ""), d.version), # type: ignore[attr-defined] + ): + files = dist.files + if not files: + continue + for relpath in sorted(files, key=lambda p: str(p)): # deterministic + relname = relpath.name + if not _SO_RE.search(relname): + continue + so_basename, so_version_suffix = split_so_version_suffix(relname) + abs_path = str(dist.locate_file(relpath)) + results[so_basename][so_version_suffix].append(abs_path) + + # plain dicts; sort inner lists for stability + return {k: {kk: tuple(sorted(vv)) for kk, vv in v.items()} for k, v in results.items()} diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/find_sub_dirs.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/find_sub_dirs.py new file mode 100644 index 0000000000000000000000000000000000000000..ebb7b13f488f25432c014d16b44811b31a3d0254 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/find_sub_dirs.py @@ -0,0 +1,65 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import functools +import os +import site +import sys +from collections.abc import Sequence + + +def find_sub_dirs_no_cache(parent_dirs: Sequence[str], sub_dirs: Sequence[str]) -> list[str]: + results = [] + for base in parent_dirs: + stack = [(base, 0)] # (current_path, index into sub_dirs) + while stack: + current_path, idx = stack.pop() + if idx == len(sub_dirs): + if os.path.isdir(current_path): + results.append(current_path) + continue + + sub = sub_dirs[idx] + if sub == "*": + try: + entries = sorted(os.listdir(current_path)) + except OSError: + continue + for entry in entries: + entry_path = os.path.join(current_path, entry) + if os.path.isdir(entry_path): + stack.append((entry_path, idx + 1)) + else: + next_path = os.path.join(current_path, sub) + if os.path.isdir(next_path): + stack.append((next_path, idx + 1)) + return results + + +@functools.cache +def find_sub_dirs_cached(parent_dirs: Sequence[str], sub_dirs: Sequence[str]) -> list[str]: + return find_sub_dirs_no_cache(parent_dirs, sub_dirs) + + +def find_sub_dirs(parent_dirs: Sequence[str], sub_dirs: Sequence[str]) -> list[str]: + return find_sub_dirs_cached(tuple(parent_dirs), tuple(sub_dirs)) + + +def find_sub_dirs_sys_path(sub_dirs: Sequence[str]) -> list[str]: + return find_sub_dirs(sys.path, sub_dirs) + + +def find_sub_dirs_all_sitepackages(sub_dirs: Sequence[str]) -> list[str]: + parent_dirs = list(site.getsitepackages()) + if site.ENABLE_USER_SITE: + user_site = site.getusersitepackages() + if user_site: + # Determine insertion index based on whether we're in a virtual environment (fixes #1716): + # - In venv (PEP 405): venv site-packages should come first, then user-site-packages, + # then system site-packages. Insert at index 1 (after venv, before system). + # - Not in venv (PEP 370): user-site-packages should come before system site-packages. + # Insert at index 0. + # Detect venv by checking if sys.prefix differs from sys.base_prefix + insert_idx = 1 if sys.prefix != sys.base_prefix else 0 + parent_dirs.insert(insert_idx, user_site) + return find_sub_dirs(parent_dirs, sub_dirs) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/platform_aware.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/platform_aware.py new file mode 100644 index 0000000000000000000000000000000000000000..72ecbc535932a7aa4252bdc6f4973326a8706cb6 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_utils/platform_aware.py @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import sys + +IS_WINDOWS = sys.platform == "win32" + + +def quote_for_shell(s: str) -> str: + if IS_WINDOWS: + # This is a relatively heavy import; keep pathfinder lean if possible. + from subprocess import list2cmdline + + return list2cmdline([s]) + else: + import shlex + + return shlex.quote(s) diff --git a/venv/lib/python3.12/site-packages/cuda/pathfinder/_version.py b/venv/lib/python3.12/site-packages/cuda/pathfinder/_version.py new file mode 100644 index 0000000000000000000000000000000000000000..2caf6b5e75dcf817c662ddabcf76d349e3573044 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda/pathfinder/_version.py @@ -0,0 +1,24 @@ +# file generated by vcs-versioning +# don't change, don't track in version control +from __future__ import annotations + +__all__ = [ + "__version__", + "__version_tuple__", + "version", + "version_tuple", + "__commit_id__", + "commit_id", +] + +version: str +__version__: str +__version_tuple__: tuple[int | str, ...] +version_tuple: tuple[int | str, ...] +commit_id: str | None +__commit_id__: str | None + +__version__ = version = '1.6.0' +__version_tuple__ = version_tuple = (1, 6, 0) + +__commit_id__ = commit_id = 'gdb347c90' diff --git a/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/INSTALLER b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/METADATA b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..94a3745ef0beb7d3e603c0900c08189aa17076d6 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/METADATA @@ -0,0 +1,48 @@ +Metadata-Version: 2.4 +Name: cuda-bindings +Version: 13.3.1 +Summary: Python bindings for CUDA +Author-email: NVIDIA Corporation +License-Expression: LicenseRef-NVIDIA-SOFTWARE-LICENSE +Project-URL: Repository, https://github.com/NVIDIA/cuda-python +Project-URL: Documentation, https://nvidia.github.io/cuda-python/ +Classifier: Intended Audience :: Developers +Classifier: Topic :: Database +Classifier: Topic :: Scientific/Engineering +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Environment :: GPU :: NVIDIA CUDA +Requires-Python: >=3.10 +Description-Content-Type: text/x-rst +License-File: LICENSE +Requires-Dist: cuda-pathfinder>=1.4.2 +Provides-Extra: all +Requires-Dist: cuda-toolkit[nvfatbin,nvjitlink,nvrtc,nvvm]==13.*; extra == "all" +Requires-Dist: cuda-toolkit[cufile]==13.*; sys_platform == "linux" and extra == "all" +Requires-Dist: cuda-toolkit==13.*; extra == "all" +Requires-Dist: nvidia-cudla==13.*; (platform_system == "Linux" and platform_machine == "aarch64") and extra == "all" +Dynamic: license-file + +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +**************************************** +cuda-bindings: Low-level CUDA interfaces +**************************************** + +.. image:: https://img.shields.io/badge/NVIDIA-black?logo=nvidia + :target: https://www.nvidia.com/ + :alt: NVIDIA + +`cuda.bindings `_ is a standard set of low-level interfaces, providing full coverage of and 1:1 access to the CUDA host APIs from Python. Checkout the `Overview `_ for the workflow and performance results. + +* `Repository `_ +* `Documentation `_ +* `Examples `_ +* `Issue tracker `_ + +For the installation instruction, please refer to the `Installation `_ page. diff --git a/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/RECORD b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..a1cc35cb63a1cbcb7a560178a8b592fead1da575 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/RECORD @@ -0,0 +1,113 @@ +cuda/bindings/__init__.pxd,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +cuda/bindings/__init__.py,sha256=MwaiGzsnjQRwjtwFMGS36SnuaElYmFDh_VOT5vAvzhI,246 +cuda/bindings/__pycache__/__init__.cpython-312.pyc,, +cuda/bindings/__pycache__/_version.cpython-312.pyc,, +cuda/bindings/_bindings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +cuda/bindings/_bindings/__pycache__/__init__.cpython-312.pyc,, +cuda/bindings/_bindings/cydriver.cpython-312-x86_64-linux-gnu.so,sha256=4fyugW-kC7-U7L14O1jlrGmHCUubAiqgrrXbHHQDQ6I,483944 +cuda/bindings/_bindings/cydriver.pxd,sha256=oTrFyd_6QMSX9lQqRsY1LfGSBw0gncrSBTkNAiY4J-E,70792 +cuda/bindings/_bindings/cyruntime.cpython-312-x86_64-linux-gnu.so,sha256=avksyPwTo42Vrd-Pnr8N4DidHhutbMKFIbJuC-fbPqg,941968 +cuda/bindings/_bindings/cyruntime.pxd,sha256=aH6elKxMqncPpW_bJIxpO4dopP-AV_E2s8rx1Vjrpjs,51558 +cuda/bindings/_bindings/cyruntime_ptds.cpython-312-x86_64-linux-gnu.so,sha256=NmOGpE6v-HNv7aY8SHPjKpowR1s6v4FFmygSJdWM2HA,799824 +cuda/bindings/_bindings/cyruntime_ptds.pxd,sha256=vr8zjo9X2w_k7zWtpQTRPqPxwCTD5qKyZD1RIiTsBmc,51600 +cuda/bindings/_bindings/loader.h,sha256=nv8OzG_tSP4jszgK5o4-ELSW6K1iZEwaEekIECjP1dA,545 +cuda/bindings/_bindings/loader.pxd,sha256=vBMdQU-VrGguCEW58Y8V2HRzaUh5DDC0NkNWLJ_silI,252 +cuda/bindings/_example_helpers/__init__.py,sha256=2yAp7RQ628MIzxkonridznKqD7AY6vDDiqckq9U11fo,646 +cuda/bindings/_example_helpers/__pycache__/__init__.cpython-312.pyc,, +cuda/bindings/_example_helpers/__pycache__/common.cpython-312.pyc,, +cuda/bindings/_example_helpers/__pycache__/helper_cuda.cpython-312.pyc,, +cuda/bindings/_example_helpers/__pycache__/helper_string.cpython-312.pyc,, +cuda/bindings/_example_helpers/common.py,sha256=h-32yuSEcWdaGq150LgbbGSsgYG6xUxh3FoNE_DLSXQ,3581 +cuda/bindings/_example_helpers/helper_cuda.py,sha256=nXHcYQnV7rWTQiQ3oKUcElAdFEPU3KRqoU1p9F9U-0c,1571 +cuda/bindings/_example_helpers/helper_string.py,sha256=VOsvf2Uhv2e6bEl4K29dTZZrLV29bBuq8oGOXGWzFeA,491 +cuda/bindings/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +cuda/bindings/_internal/__pycache__/__init__.cpython-312.pyc,, +cuda/bindings/_internal/__pycache__/_fast_enum.cpython-312.pyc,, +cuda/bindings/_internal/_fast_enum.py,sha256=aGuilcCYfZPJzgF-mJr78yP3C9HLNHD1NMmy3P0vSB4,2331 +cuda/bindings/_internal/cudla.cpython-312-x86_64-linux-gnu.so,sha256=l2x8AoQ_ohajP4bk8HdZx1FnbhSw2Puol84fPpx-6oo,82536 +cuda/bindings/_internal/cudla.pxd,sha256=dI1lAeHpT9Y9XnQpkxyFLKb3mQVw4jGtP26uY_ZTbaQ,2627 +cuda/bindings/_internal/cufile.cpython-312-x86_64-linux-gnu.so,sha256=h2HjEx-ciqCKeFYv9o95l_qoW4P6tULHqXfwyU3WMgA,103368 +cuda/bindings/_internal/cufile.pxd,sha256=clPeFlOq2gPfnUd_DutLeqfLB7u3e2t7sskXiQSnrR8,6000 +cuda/bindings/_internal/nvfatbin.cpython-312-x86_64-linux-gnu.so,sha256=LiAZuwaInk0Nwnp7UN2tguQoRLTQREXMWzb4ZcQnMTg,78440 +cuda/bindings/_internal/nvfatbin.pxd,sha256=_2QAI1XZvp6eou1FC0nZHw47gilH0Nfs2fTIQhkUwFA,2392 +cuda/bindings/_internal/nvjitlink.cpython-312-x86_64-linux-gnu.so,sha256=MWWorQEZ0k3sZsWcgLtxaB54L8G4n5bpb6OUQqwGGmU,82536 +cuda/bindings/_internal/nvjitlink.pxd,sha256=QALxlm14SzNiT2X-XxrGYjWLmmJ8F7VIHzdKHSs3_es,2517 +cuda/bindings/_internal/nvml.cpython-312-x86_64-linux-gnu.so,sha256=1hOqqoWBKUKP1emQVNPywM-vpym8ots1NuRjx0dypos,437608 +cuda/bindings/_internal/nvml.pxd,sha256=onoRORIRyZ6VWyUJB7t1TOohzG7KuQQPK--FyLMhKNI,57555 +cuda/bindings/_internal/nvrtc.cpython-312-x86_64-linux-gnu.so,sha256=42S4PxiDTiZc-QPHmqfqdSFFVqFGMqWBkbLE17ppZG4,98920 +cuda/bindings/_internal/nvrtc.pxd,sha256=6_Sy073J8JnGZcDAjum4ItBmI_SlnUgJWG1TxMgAJaE,3914 +cuda/bindings/_internal/nvvm.cpython-312-x86_64-linux-gnu.so,sha256=W7rEVYYJHaxLd8MarV9_R4uOw4RPpJ63xzVndrREjZA,82536 +cuda/bindings/_internal/nvvm.pxd,sha256=4kl55jzYjC3wvQUqx9JwOxS600nq_nGPvwwy7PFubV0,2257 +cuda/bindings/_internal/utils.cpython-312-x86_64-linux-gnu.so,sha256=xun5Y6TrB1E8VIFg6eRsB16ahHHLjqd33kHNyLd0ldA,127936 +cuda/bindings/_internal/utils.pxd,sha256=LlAp7vAy5_7XqZ8IIc0dCW0duu01V3aPt8seqgx37VM,4669 +cuda/bindings/_lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +cuda/bindings/_lib/__pycache__/__init__.cpython-312.pyc,, +cuda/bindings/_lib/cyruntime/cyruntime.pxd,sha256=icR65C-YpWJ59uyCRMRg_wGbqNGt6qPQLh2ksFkuTis,4785 +cuda/bindings/_lib/cyruntime/cyruntime.pxi,sha256=xQGllvLx76JE8WEeKS3LjOungvwj335nP6QNmKulr8c,88191 +cuda/bindings/_lib/dlfcn.pxd,sha256=Hey780RLtX6IQwca7kzsBnoMJ6CsizjfaKtcY240GrE,406 +cuda/bindings/_lib/param_packer.h,sha256=ITzzEtJ4ykPY1Py7_SPlf8u1gY9tUlAelvQ6Z3b0vkc,6031 +cuda/bindings/_lib/param_packer.pxd,sha256=9dAhnMLzwYbdDhdiTW6EFXRPfIE5wvfnKwoZTVIhjgs,374 +cuda/bindings/_lib/utils.pxd,sha256=qfQEdfliVG6zsRFQBDejkCkDHHdgP5yyxTd_9nqwIsA,4031 +cuda/bindings/_lib/utils.pxi,sha256=xn5s7LWNpF3hzlr0rVO2Eh1LEDg-J2p0gf_hH6YSug4,32642 +cuda/bindings/_lib/windll.pxd,sha256=oOzOOJ_hpQNVnqareRx3h_ctJI_zpebBDfaRhxtpSk8,1445 +cuda/bindings/_test_helpers/__init__.py,sha256=cgHj5gSAhwMG-0TGW_v4V-rrqaPQqtshVyKh_WiQpEg,401 +cuda/bindings/_test_helpers/__pycache__/__init__.cpython-312.pyc,, +cuda/bindings/_test_helpers/__pycache__/arch_check.cpython-312.pyc,, +cuda/bindings/_test_helpers/__pycache__/mempool.cpython-312.pyc,, +cuda/bindings/_test_helpers/__pycache__/pep723.cpython-312.pyc,, +cuda/bindings/_test_helpers/arch_check.py,sha256=ZWbEVKDBbRymAo3H0JdjUdrEWsckBsFQUtRo5k086QE,2778 +cuda/bindings/_test_helpers/mempool.py,sha256=5WqnSHXbY4EpUGrSk3Eui9rszzkSc3rhXZ1sqsnnSjw,1958 +cuda/bindings/_test_helpers/pep723.py,sha256=7tZF33TizFxzqXEv88lYPunLQFhXv7vw5HSQxs0FEoQ,1553 +cuda/bindings/_version.py,sha256=R4wvDAeqktxDMPKHGOVLsN4KzhUbbzrexxVa2eyQbbM,530 +cuda/bindings/cudla.cpython-312-x86_64-linux-gnu.so,sha256=-hLJSgJ5Z95G1v0h9G_3HNW-uPbPj4gaG3fQeEsihag,471432 +cuda/bindings/cudla.pxd,sha256=srZchWRd3JlPRj7LqOcvBZNRyBzx7s6dh9iAE9C7VFs,2218 +cuda/bindings/cufile.cpython-312-x86_64-linux-gnu.so,sha256=kI3AGGLLfSN9I_Lu8y62x6wq8R7mCM99X6JFMoW0bdk,761576 +cuda/bindings/cufile.pxd,sha256=JaxsKd4tUFr-_PO7HNlHq41uEWBP8cwZz197EzoH4-w,3921 +cuda/bindings/cycudla.cpython-312-x86_64-linux-gnu.so,sha256=b1wGTF1LXLW7eLe19G0fUKqWSpUX9fup4jQdXdh6Sto,23424 +cuda/bindings/cycudla.pxd,sha256=6P8whaVmvamjn_Y0sQETwpKqPYWjrwJeIUX5CIIlr-I,8166 +cuda/bindings/cycufile.cpython-312-x86_64-linux-gnu.so,sha256=6YQhHxHG2PAiSyXgsq3oY6HcEhiKoqwEcQTbkZbs7b8,32320 +cuda/bindings/cycufile.pxd,sha256=YGJlI6kGM3600QF0XCsjCMGLt8pBAJ_cFyCX3CSY4Bw,18414 +cuda/bindings/cydriver.cpython-312-x86_64-linux-gnu.so,sha256=KZn8eG9fqGKceanrF1SyJg36icgBxir1jcR05J76ZDc,166688 +cuda/bindings/cydriver.pxd,sha256=ib4ptxEbUkZFv79AgcY5fjWPiZbVKCsA_ykGPbnT1fI,172390 +cuda/bindings/cynvfatbin.cpython-312-x86_64-linux-gnu.so,sha256=AteT3a32X1ZbqiDowKoug18Q-0Wmxca76aSI4j6Q6r8,23424 +cuda/bindings/cynvfatbin.pxd,sha256=fVOKBxJ24unjJ9uABsWEgTPROGhCtpmtvBZAIgh8NeU,4001 +cuda/bindings/cynvjitlink.cpython-312-x86_64-linux-gnu.so,sha256=ZRWtqaUB9VAcSWcMMYMy4-wfms3WVQv-8BXUJ7GGqcw,23424 +cuda/bindings/cynvjitlink.pxd,sha256=fWFnC2hPWNUslvAtJWeNad7-qj5xSj2noNrW90WWxBk,4698 +cuda/bindings/cynvml.cpython-312-x86_64-linux-gnu.so,sha256=pywUN9om_3XYOKC3rSl_klx7OPRVZ95sDLWLmOi9C0k,119168 +cuda/bindings/cynvml.pxd,sha256=91gyPoI0AVFsa9jQrSDJpdkGj5sQZQu8mGfEvdWK5Lc,152180 +cuda/bindings/cynvrtc.cpython-312-x86_64-linux-gnu.so,sha256=kwdkRWxuwWqyKvDEBO9cAoSci5mN4jCNCmlzrphi9p4,31616 +cuda/bindings/cynvrtc.pxd,sha256=iK94S8MJspoECP8uNWwNxBSYbXtamAntacBmST728T8,5109 +cuda/bindings/cynvvm.cpython-312-x86_64-linux-gnu.so,sha256=vy4ehpyvEWqQ-6cDwW1aCHbtZ9uoqJMmzSBF0UJq-3w,23424 +cuda/bindings/cynvvm.pxd,sha256=F31ruUDOiUwNerwe9WwyhuAmWw-Nb6dl1j-luduWNUg,3256 +cuda/bindings/cyruntime.cpython-312-x86_64-linux-gnu.so,sha256=KqPl-TzfpVJSVkzRwOkpd0BXYJD0fn0J-dkIEtu_h3w,127360 +cuda/bindings/cyruntime.pxd,sha256=5lQ7JPjVKoRhnIUJNld0a5snnOq7O7jmkOpK6m_RNq8,65095 +cuda/bindings/cyruntime_functions.pxi,sha256=GysOTFP9qdsr_-HFhV9iJtjZyBGORp3lWT7YmA29lI0,38307 +cuda/bindings/cyruntime_types.pxi,sha256=xVvoSje4Co1BXHTHxrevIUs6WhTNx-tkM5QlzGP-3aY,59652 +cuda/bindings/driver.cpython-312-x86_64-linux-gnu.so,sha256=6JdiPMUKpHYsi-MBG1wrq6gWiS3XC5CPOnxc_QIA-HE,7432928 +cuda/bindings/driver.pxd,sha256=sSII06VJDF6uf5xBrVvwNHzIL5o9psbNJnM0zhyfXeg,219135 +cuda/bindings/nvfatbin.cpython-312-x86_64-linux-gnu.so,sha256=fsWmR2Yl05c3l00FqCLDHia-3q2_WgOe5H-cWmBZuSk,115944 +cuda/bindings/nvfatbin.pxd,sha256=idR_YzNHCmh7XWOvDBDDDoE8jJI_cbe8LFtKoLbt2Wc,1576 +cuda/bindings/nvjitlink.cpython-312-x86_64-linux-gnu.so,sha256=HYMnkk5Qt7VtK3cvZRk-Zfa343zwQLQfBe5AApexoKE,111880 +cuda/bindings/nvjitlink.pxd,sha256=3j6iTR6Cpq0QHfgzIhHr89SkWubbiMKOMU_rD2zfio0,1685 +cuda/bindings/nvml.cpython-312-x86_64-linux-gnu.so,sha256=0ZbDbFePLIDNwmSgAy_vai2f3dFVY7VKYH0-0MVUm7A,4641960 +cuda/bindings/nvml.pxd,sha256=u1uDek9LMTK1DkDARdvXFbZuKQIy_Mz-iKCPus9ynPQ,27771 +cuda/bindings/nvrtc.cpython-312-x86_64-linux-gnu.so,sha256=vFx19-LjdD4L4LZqqqUFq3PiC6kMfYv5C-Va6FS-tF8,447008 +cuda/bindings/nvrtc.pxd,sha256=wKbEf2IdfjZHfvQ0wrtaVfMfD8pGMV6fGMlZb9QxFAw,1595 +cuda/bindings/nvvm.cpython-312-x86_64-linux-gnu.so,sha256=BmN_yQ-8r9TjMto2_v9kXxmetrcJzB-7glAXfNM_Bi0,107816 +cuda/bindings/nvvm.pxd,sha256=iVHGSAgqQVpmCMYvi1sqCHJ3LVMeB1jkhZOx4DPVvZY,1615 +cuda/bindings/runtime.cpython-312-x86_64-linux-gnu.so,sha256=aexnetOciq_eGldM6fauTsQ1hm2_DTDLh1FGlaIYs6M,5398176 +cuda/bindings/runtime.pxd,sha256=UVk6QDONtBNfemSnQhT7vAcYY-TvPkD5SnWQjJW8CNE,112142 +cuda/bindings/utils/__init__.py,sha256=PoBge2GNGWEr89V0jYfqLdziOE_elDqmvFMcNif8atM,1000 +cuda/bindings/utils/__pycache__/__init__.cpython-312.pyc,, +cuda/bindings/utils/__pycache__/_nvvm_utils.cpython-312.pyc,, +cuda/bindings/utils/__pycache__/_ptx_utils.cpython-312.pyc,, +cuda/bindings/utils/__pycache__/_version_check.cpython-312.pyc,, +cuda/bindings/utils/_nvvm_utils.py,sha256=-YCS8fnjiOxouPkGJ7SLZ1QHphPnOddHFlsuZYA-hhg,2712 +cuda/bindings/utils/_ptx_utils.py,sha256=VAN6_Rpj5os1I5Pr9oK9N94kZO5XDLprYD2wJK3cULw,3245 +cuda/bindings/utils/_version_check.py,sha256=Wr-o20azz3b2wiWUrhUyzwd3RHEFBMpkbgz-6sPf_mE,2397 +cuda_bindings-13.3.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +cuda_bindings-13.3.1.dist-info/METADATA,sha256=C_y-d9reYbHLqfIBwEZfI1P1tQrfTk9VS8o1o1AzFm8,2498 +cuda_bindings-13.3.1.dist-info/RECORD,, +cuda_bindings-13.3.1.dist-info/WHEEL,sha256=kwoiEryvcXaFuNx_Uio7nY8KGSgylboLMQiCeh2OfQ8,152 +cuda_bindings-13.3.1.dist-info/licenses/LICENSE,sha256=gHsN94kFVQ3-fC6hFBTLdOonjuxnrXrsJxtPC3MAy9M,11076 +cuda_bindings-13.3.1.dist-info/top_level.txt,sha256=U5vpnvwNpaJF8bl4KnoUluMDTRt0J972FipwXjgNQ3A,5 diff --git a/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/WHEEL b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..30a73d70479c04f52f963cc9e93ed0fc018e49f7 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: setuptools (13.3.1) +Root-Is-Purelib: false +Tag: cp312-cp312-manylinux_2_24_x86_64 +Tag: cp312-cp312-manylinux_2_28_x86_64 + diff --git a/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/licenses/LICENSE b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a5a65097cdc5e452ffd79974f1d7621c06ddbd1f --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/licenses/LICENSE @@ -0,0 +1,48 @@ +NVIDIA SOFTWARE LICENSE + +This license is a legal agreement between you and NVIDIA Corporation ("NVIDIA") and governs your use of the NVIDIA CUDA Python software and materials provided hereunder ("SOFTWARE"). + +This license can be accepted only by an adult of legal age of majority in the country in which the SOFTWARE is used. If you are under the legal age of majority, you must ask your parent or legal guardian to consent to this license. By taking delivery of the SOFTWARE, you affirm that you have reached the legal age of majority, you accept the terms of this license, and you take legal and financial responsibility for the actions of your permitted users. + +You agree to use the SOFTWARE only for purposes that are permitted by (a) this license, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions. + +1. LICENSE. Subject to the terms of this license, NVIDIA grants you a non-exclusive limited license to: (a) install and use the SOFTWARE, and (b) distribute the SOFTWARE subject to the distribution requirements described in this license. NVIDIA reserves all rights, title and interest in and to the SOFTWARE not expressly granted to you under this license. + +2. DISTRIBUTION REQUIREMENTS. These are the distribution requirements for you to exercise the distribution grant: +a. The terms under which you distribute the SOFTWARE must be consistent with the terms of this license, including (without limitation) terms relating to the license grant and license restrictions and protection of NVIDIA's intellectual property rights. +b. You agree to notify NVIDIA in writing of any known or suspected distribution or use of the SOFTWARE not in compliance with the requirements of this license, and to enforce the terms of your agreements with respect to distributed SOFTWARE. + +3. LIMITATIONS. Your license to use the SOFTWARE is restricted as follows: +a. The SOFTWARE is licensed for you to develop applications only for use in systems with NVIDIA GPUs. +b. You may not reverse engineer, decompile or disassemble, or remove copyright or other proprietary notices from any portion of the SOFTWARE or copies of the SOFTWARE. +c. You may not modify or create derivative works of any portion of the SOFTWARE. +d. You may not bypass, disable, or circumvent any technical measure, encryption, security, digital rights management or authentication mechanism in the SOFTWARE. +e. You may not use the SOFTWARE in any manner that would cause it to become subject to an open source software license. As examples, licenses that require as a condition of use, modification, and/or distribution that the SOFTWARE be (i) disclosed or distributed in source code form; (ii) licensed for the purpose of making derivative works; or (iii) redistributable at no charge. +f. Unless you have an agreement with NVIDIA for this purpose, you may not use the SOFTWARE with any system or application where the use or failure of the system or application can reasonably be expected to threaten or result in personal injury, death, or catastrophic loss. Examples include use in avionics, navigation, military, medical, life support or other life critical applications. NVIDIA does not design, test or manufacture the SOFTWARE for these critical uses and NVIDIA shall not be liable to you or any third party, in whole or in part, for any claims or damages arising from such uses. +g. You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, and their respective employees, contractors, agents, officers and directors, from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, fines, restitutions and expenses (including but not limited to attorney's fees and costs incident to establishing the right of indemnification) arising out of or related to use of the SOFTWARE outside of the scope of this Agreement, or not in compliance with its terms. + +4. PRE-RELEASE. SOFTWARE versions identified as alpha, beta, preview, early access or otherwise as pre-release may not be fully functional, may contain errors or design flaws, and may have reduced or different security, privacy, availability, and reliability standards relative to commercial versions of NVIDIA software and materials. You may use a pre-release SOFTWARE version at your own risk, understanding that these versions are not intended for use in production or business-critical systems. + +5. OWNERSHIP. The SOFTWARE and the related intellectual property rights therein are and will remain the sole and exclusive property of NVIDIA or its licensors. The SOFTWARE is copyrighted and protected by the laws of the United States and other countries, and international treaty provisions. NVIDIA may make changes to the SOFTWARE, at any time without notice, but is not obligated to support or update the SOFTWARE. + +6. COMPONENTS UNDER OTHER LICENSES. The SOFTWARE may include NVIDIA or third-party components with separate legal notices or terms as may be described in proprietary notices accompanying the SOFTWARE. If and to the extent there is a conflict between the terms in this license and the license terms associated with a component, the license terms associated with the components control only to the extent necessary to resolve the conflict. + +7. FEEDBACK. You may, but don't have to, provide to NVIDIA any Feedback. "Feedback" means any suggestions, bug fixes, enhancements, modifications, feature requests or other feedback regarding the SOFTWARE. For any Feedback that you voluntarily provide, you hereby grant NVIDIA and its affiliates a perpetual, non-exclusive, worldwide, irrevocable license to use, reproduce, modify, license, sublicense (through multiple tiers of sublicensees), and distribute (through multiple tiers of distributors) the Feedback without the payment of any royalties or fees to you. NVIDIA will use Feedback at its choice. + +8. NO WARRANTIES. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. NVIDIA DOES NOT WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION THEREOF WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ALL ERRORS WILL BE CORRECTED. + +9. LIMITATIONS OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, PROJECT DELAYS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE USE OR PERFORMANCE OF THE SOFTWARE, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY, EVEN IF NVIDIA HAS PREVIOUSLY BEEN ADVISED OF, OR COULD REASONABLY HAVE FORESEEN, THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL NVIDIA'S AND ITS AFFILIATES TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS LICENSE EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS LIMIT. + +10. TERMINATION. Your rights under this license will terminate automatically without notice from NVIDIA if you fail to comply with any term and condition of this license or if you commence or participate in any legal proceeding against NVIDIA with respect to the SOFTWARE. NVIDIA may terminate this license with advance written notice to you if NVIDIA decides to no longer provide the SOFTWARE in a country or, in NVIDIA's sole discretion, the continued use of it is no longer commercially viable. Upon any termination of this license, you agree to promptly discontinue use of the SOFTWARE and destroy all copies in your possession or control. Your prior distributions in accordance with this license are not affected by the termination of this license. All provisions of this license will survive termination, except for the license granted to you. + +11. APPLICABLE LAW. This license will be governed in all respects by the laws of the United States and of the State of Delaware as those laws are applied to contracts entered into and performed entirely within Delaware by Delaware residents, without regard to the conflicts of laws principles. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed. You agree to all terms of this Agreement in the English language. The state or federal courts residing in Santa Clara County, California shall have exclusive jurisdiction over any dispute or claim arising out of this license. Notwithstanding this, you agree that NVIDIA shall still be allowed to apply for injunctive remedies or an equivalent type of urgent legal relief in any jurisdiction. + +12. NO ASSIGNMENT. This license and your rights and obligations thereunder may not be assigned by you by any means or operation of law without NVIDIA's permission. Any attempted assignment not approved by NVIDIA in writing shall be void and of no effect. + +13. EXPORT. The SOFTWARE is subject to United States export laws and regulations. You agree that you will not ship, transfer or export the SOFTWARE into any country, or use the SOFTWARE in any manner, prohibited by the United States Bureau of Industry and Security or economic sanctions regulations administered by the U.S. Department of Treasury's Office of Foreign Assets Control (OFAC), or any applicable export laws, restrictions or regulations. These laws include restrictions on destinations, end users and end use. By accepting this license, you confirm that you are not a resident or citizen of any country currently embargoed by the U.S. and that you are not otherwise prohibited from receiving the SOFTWARE. + +14. GOVERNMENT USE. The SOFTWARE has been developed entirely at private expense and is "commercial items" consisting of "commercial computer software" and "commercial computer software documentation" provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the restrictions in this license pursuant to DFARS 227.7202-3(a) or as set forth in subparagraphs (b)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at FAR 52.227-19, as applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas Expressway, Santa Clara, CA 95051. + +15. ENTIRE AGREEMENT. This license is the final, complete and exclusive agreement between the parties relating to the subject matter of this license and supersedes all prior or contemporaneous understandings and agreements relating to this subject matter, whether oral or written. If any court of competent jurisdiction determines that any provision of this license is illegal, invalid or unenforceable, the remaining provisions will remain in full force and effect. This license may only be modified in a writing signed by an authorized representative of each party. + +(v. May 12, 2021) diff --git a/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/top_level.txt b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..089f044f442ab95aabf9de9eb52b63efbac9f7b9 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_bindings-13.3.1.dist-info/top_level.txt @@ -0,0 +1 @@ +cuda diff --git a/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/INSTALLER b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/METADATA b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..e620d58291e0a3da8988d22cd31c748bc6996dd2 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/METADATA @@ -0,0 +1,47 @@ +Metadata-Version: 2.4 +Name: cuda-pathfinder +Version: 1.6.0 +Summary: Pathfinder for CUDA components +Author-email: NVIDIA Corporation +License-Expression: Apache-2.0 +Project-URL: Repository, https://github.com/NVIDIA/cuda-python +Project-URL: Documentation, https://nvidia.github.io/cuda-python/ +Requires-Python: >=3.10 +Description-Content-Type: text/x-rst +License-File: LICENSE +Dynamic: license-file + +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +******************************************************* +cuda-pathfinder: Utilities for locating CUDA components +******************************************************* + +.. image:: https://img.shields.io/badge/NVIDIA-black?logo=nvidia + :target: https://www.nvidia.com/ + :alt: NVIDIA + +`cuda.pathfinder `_ +aims to be a one-stop solution for locating CUDA components. Currently +it supports locating and loading dynamic libraries (``.so``, ``.dll``), and +locating CTK header directories. Support for other artifacts is in progress. + +* `Documentation `_ +* `Releases `_ +* `Repository `_ +* `Issue tracker `_ (select component ``cuda.pathfinder``) + +``cuda.pathfinder`` is under active development. Feedback and suggestions are welcome. + + +Installation +============ + +.. code-block:: bash + + pip install cuda-pathfinder + +``cuda-pathfinder`` is `CUDA Toolkit (CTK) `_ +version-agnostic. It follows the general CUDA Toolkit support policy: the +two most recent major versions are supported simultaneously. diff --git a/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/RECORD b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..3ca0c312b387da49dd8455b74e0e8fb1875c7fc6 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/RECORD @@ -0,0 +1,69 @@ +cuda/pathfinder/README.md,sha256=JPbUfq3xYFMGa1ZlnpHkKsGXjJi4Zr1nNU3SzWJIviw,123 +cuda/pathfinder/__init__.py,sha256=N88Ky8JCENHM0Bj5rv9kKKMswPm2BIWG2uhQIuE41ns,4203 +cuda/pathfinder/__pycache__/__init__.cpython-312.pyc,, +cuda/pathfinder/__pycache__/_optional_cuda_import.cpython-312.pyc,, +cuda/pathfinder/__pycache__/_version.cpython-312.pyc,, +cuda/pathfinder/_binaries/__pycache__/find_nvidia_binary_utility.cpython-312.pyc,, +cuda/pathfinder/_binaries/__pycache__/supported_nvidia_binaries.cpython-312.pyc,, +cuda/pathfinder/_binaries/find_nvidia_binary_utility.py,sha256=Oeyq7G6BwScoI98pa_XNxX3vlU_RpKq4qeawwJRbWYw,5984 +cuda/pathfinder/_binaries/supported_nvidia_binaries.py,sha256=E6ed_ZL8EQy-zJYNjsUQC0hGBSN4zDgaMbFaEeca89M,1409 +cuda/pathfinder/_dynamic_libs/__pycache__/descriptor_catalog.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/__pycache__/dynamic_lib_subprocess.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/__pycache__/lib_descriptor.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_common.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_linux.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/__pycache__/load_dl_windows.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/__pycache__/load_nvidia_dynamic_lib.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/__pycache__/platform_loader.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/__pycache__/search_platform.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/__pycache__/search_steps.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/__pycache__/subprocess_protocol.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/__pycache__/supported_nvidia_libs.cpython-312.pyc,, +cuda/pathfinder/_dynamic_libs/descriptor_catalog.py,sha256=ySY4B2SDwcpytDIbp_G-D17kVqdqTUl4UGz6DGxuJNU,18455 +cuda/pathfinder/_dynamic_libs/dynamic_lib_subprocess.py,sha256=-jgshHMUUXwvPt49K1R4GcXMK0XhgNRRtyKKFczsoIc,5165 +cuda/pathfinder/_dynamic_libs/lib_descriptor.py,sha256=4TuEXVowm8Oq149M_tQvTgjWJGTQ_AJgouLz-x0I-Wg,753 +cuda/pathfinder/_dynamic_libs/load_dl_common.py,sha256=tQfuSm0VKEUzaYU7Y4HEHuHyU_Z4zYU2QQBYIxlvoU8,957 +cuda/pathfinder/_dynamic_libs/load_dl_linux.py,sha256=yDz8wNM-FM2hDsUzohpkQ9s2uwMtO_UhbxCeiBGsdOk,7953 +cuda/pathfinder/_dynamic_libs/load_dl_windows.py,sha256=mh95zdwa_0ZMxyBR6b8y9ikikeL22W00rD0t9QTvm9Q,6514 +cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py,sha256=n6ZKe6UprWu1Kd2QinlJlxmu6f35gntfQwiUo0TDngE,12377 +cuda/pathfinder/_dynamic_libs/platform_loader.py,sha256=9dwZFmVlWxsnmlpH3w23B99JxE1O-h0hFJKoiRiRbIE,1490 +cuda/pathfinder/_dynamic_libs/search_platform.py,sha256=eb7f1ayFpTgtbAdo5pst82wivaktkXwSEBNXhrXqylY,8250 +cuda/pathfinder/_dynamic_libs/search_steps.py,sha256=vMHCamMaLFQkn2w6KFGx8o82R4mG0JJAG4Dwc9deF7M,8122 +cuda/pathfinder/_dynamic_libs/subprocess_protocol.py,sha256=bieP_U7UujgbePzxvykszai1Xpn9tueO_qVv62_8CQA,2713 +cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py,sha256=L1IYyAzaIbV3CLPhTactV_YEGDoBcsLY7GAQhUAv7AM,4419 +cuda/pathfinder/_headers/__pycache__/find_nvidia_headers.cpython-312.pyc,, +cuda/pathfinder/_headers/__pycache__/header_descriptor.cpython-312.pyc,, +cuda/pathfinder/_headers/__pycache__/header_descriptor_catalog.cpython-312.pyc,, +cuda/pathfinder/_headers/__pycache__/supported_nvidia_headers.cpython-312.pyc,, +cuda/pathfinder/_headers/find_nvidia_headers.py,sha256=prbMNxxZMKAce33XRx-WGXpPMxEa0-vFuqglWUvxr2o,8538 +cuda/pathfinder/_headers/header_descriptor.py,sha256=fdU_rg293TQqYxRJRPaHrPa1a5WDhgjHqTlGwAUNIcA,2172 +cuda/pathfinder/_headers/header_descriptor_catalog.py,sha256=T8KOscEpMdcvnrWI4I4Axqx8V54LnWpOfx3naIGzUOo,8956 +cuda/pathfinder/_headers/supported_nvidia_headers.py,sha256=DT5JHhBY59Q4CJz4iCMLcHyMRNM8rgesjYfGpX8FITs,3519 +cuda/pathfinder/_optional_cuda_import.py,sha256=1Vjsv3DvBmz7-yqeaxHD-TDe-Fzwdyu88S1df-CfRBo,1424 +cuda/pathfinder/_static_libs/__pycache__/find_bitcode_lib.cpython-312.pyc,, +cuda/pathfinder/_static_libs/__pycache__/find_static_lib.cpython-312.pyc,, +cuda/pathfinder/_static_libs/find_bitcode_lib.py,sha256=Ke0b3KmApVeF6QjVw5r020L6B_DiPG8qvvsdFRacuRo,6006 +cuda/pathfinder/_static_libs/find_static_lib.py,sha256=OF8N4CqCphPYilvkr_xM31H-0s3OoyucxLngCmYexrs,5837 +cuda/pathfinder/_utils/__pycache__/ctk_root_canary.cpython-312.pyc,, +cuda/pathfinder/_utils/__pycache__/driver_info.cpython-312.pyc,, +cuda/pathfinder/_utils/__pycache__/env_vars.cpython-312.pyc,, +cuda/pathfinder/_utils/__pycache__/find_site_packages_dll.cpython-312.pyc,, +cuda/pathfinder/_utils/__pycache__/find_site_packages_so.cpython-312.pyc,, +cuda/pathfinder/_utils/__pycache__/find_sub_dirs.cpython-312.pyc,, +cuda/pathfinder/_utils/__pycache__/platform_aware.cpython-312.pyc,, +cuda/pathfinder/_utils/ctk_root_canary.py,sha256=fMwpBqFBgOkLCwiqAR85aA9de9A23Wkha6PGAHrzI0g,184 +cuda/pathfinder/_utils/driver_info.py,sha256=KYg8EXMdlJg9tn0VGk0cVzURholCHnFQAcyhGGcVV5g,3118 +cuda/pathfinder/_utils/env_vars.py,sha256=9VspktZnl7oQyGHVP85n61Snj6eXSqbqs6aiQsYxzqg,3813 +cuda/pathfinder/_utils/find_site_packages_dll.py,sha256=HixAy-Ubd5Gu9DZwCLAu2jvlEr1nfolOSZ_7GX3ZgbM,1143 +cuda/pathfinder/_utils/find_site_packages_so.py,sha256=_udOAI8RtTXRJWz-X6TUy-g9W_nW8PeAcG61k1AVSLw,1638 +cuda/pathfinder/_utils/find_sub_dirs.py,sha256=lr2Ls7COGIorf8H3snxLm66ClXkPNYb5f7g5ZBl5yBQ,2614 +cuda/pathfinder/_utils/platform_aware.py,sha256=oOCqy_VyNdEdISVM2ilde8Kl6rOeElItvsAnw0WD9b8,463 +cuda/pathfinder/_version.py,sha256=wykEcfGCnKe-lc3KX6GOfWnMy-TGbXkdmGemFAdVyFc,527 +cuda_pathfinder-1.6.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +cuda_pathfinder-1.6.0.dist-info/METADATA,sha256=CyJNjfSJl80tM22_nevHp6-gAMwkLhVVxckKxlTMy38,1906 +cuda_pathfinder-1.6.0.dist-info/RECORD,, +cuda_pathfinder-1.6.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91 +cuda_pathfinder-1.6.0.dist-info/licenses/LICENSE,sha256=K5UVtFgFcOzjfFOXZQsPlQ3i9GWHOhaaZ-QMCMEhMH0,10252 +cuda_pathfinder-1.6.0.dist-info/scm_file_list.json,sha256=-8vU46dDghSbX-FLozMmCXWknGZF6zjm_5hxWm1Qbww,3985 +cuda_pathfinder-1.6.0.dist-info/scm_version.json,sha256=S4Jobk3vEEM4srxkVP-ftEIyBtwSMSBgtdJQQyD048M,128 +cuda_pathfinder-1.6.0.dist-info/top_level.txt,sha256=U5vpnvwNpaJF8bl4KnoUluMDTRt0J972FipwXjgNQ3A,5 diff --git a/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/WHEEL b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..1d472b6c22838de58d1c3c0dd2c795a5cde9e415 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (83.0.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/licenses/LICENSE b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a4baaa2d3fac94bf64abceee419eda739fe3e98a --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/licenses/LICENSE @@ -0,0 +1,178 @@ +Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/scm_file_list.json b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/scm_file_list.json new file mode 100644 index 0000000000000000000000000000000000000000..90c3b4bc293a9aaee79e4393f06a230f4144fe99 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/scm_file_list.json @@ -0,0 +1,98 @@ +{ + "files": [ + "CLAUDE.md", + "AGENTS.md", + "LICENSE", + "pixi.toml", + "pyproject.toml", + "DESCRIPTION.rst", + "pixi.lock", + ".git_archival.txt", + "docs/nv-versions.json", + "docs/README.md", + "docs/Makefile", + "docs/build_docs.sh", + "docs/source/conf.py", + "docs/source/install.rst", + "docs/source/contribute.rst", + "docs/source/index.rst", + "docs/source/license.rst", + "docs/source/api.rst", + "docs/source/release.rst", + "docs/source/_templates/main.html", + "docs/source/release/1.2.2-notes.rst", + "docs/source/release/1.3.2-notes.rst", + "docs/source/release/1.3.3-notes.rst", + "docs/source/release/1.5.2-notes.rst", + "docs/source/release/1.0.0-notes.rst", + "docs/source/release/1.4.0-notes.rst", + "docs/source/release/1.5.3-notes.rst", + "docs/source/release/1.3.1-notes.rst", + "docs/source/release/1.2.0-notes.rst", + "docs/source/release/1.4.1-notes.rst", + "docs/source/release/1.3.4-notes.rst", + "docs/source/release/1.5.0-notes.rst", + "docs/source/release/1.2.3-notes.rst", + "docs/source/release/1.3.5-notes.rst", + "docs/source/release/1.3.0-notes.rst", + "docs/source/release/1.6.0-notes.rst", + "docs/source/release/1.5.6-notes.rst", + "docs/source/release/1.4.2-notes.rst", + "docs/source/release/1.4.4-notes.rst", + "docs/source/release/1.4.3-notes.rst", + "docs/source/release/1.5.5-notes.rst", + "docs/source/release/1.1.0-notes.rst", + "docs/source/release/1.5.1-notes.rst", + "docs/source/release/1.5.4-notes.rst", + "docs/source/release/1.2.1-notes.rst", + "cuda/pathfinder/__init__.py", + "cuda/pathfinder/README.md", + "cuda/pathfinder/_optional_cuda_import.py", + "cuda/pathfinder/_static_libs/find_bitcode_lib.py", + "cuda/pathfinder/_static_libs/find_static_lib.py", + "cuda/pathfinder/_utils/ctk_root_canary.py", + "cuda/pathfinder/_utils/find_site_packages_dll.py", + "cuda/pathfinder/_utils/driver_info.py", + "cuda/pathfinder/_utils/env_vars.py", + "cuda/pathfinder/_utils/find_sub_dirs.py", + "cuda/pathfinder/_utils/platform_aware.py", + "cuda/pathfinder/_utils/find_site_packages_so.py", + "cuda/pathfinder/_headers/supported_nvidia_headers.py", + "cuda/pathfinder/_headers/find_nvidia_headers.py", + "cuda/pathfinder/_headers/header_descriptor_catalog.py", + "cuda/pathfinder/_headers/header_descriptor.py", + "cuda/pathfinder/_binaries/supported_nvidia_binaries.py", + "cuda/pathfinder/_binaries/find_nvidia_binary_utility.py", + "cuda/pathfinder/_dynamic_libs/search_platform.py", + "cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py", + "cuda/pathfinder/_dynamic_libs/load_dl_common.py", + "cuda/pathfinder/_dynamic_libs/platform_loader.py", + "cuda/pathfinder/_dynamic_libs/load_dl_windows.py", + "cuda/pathfinder/_dynamic_libs/descriptor_catalog.py", + "cuda/pathfinder/_dynamic_libs/load_dl_linux.py", + "cuda/pathfinder/_dynamic_libs/lib_descriptor.py", + "cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py", + "cuda/pathfinder/_dynamic_libs/dynamic_lib_subprocess.py", + "cuda/pathfinder/_dynamic_libs/search_steps.py", + "cuda/pathfinder/_dynamic_libs/subprocess_protocol.py", + "tests/test_find_nvidia_binaries.py", + "tests/test_load_nvidia_dynamic_lib_using_mocker.py", + "tests/test_utils_find_sub_dirs.py", + "tests/test_load_nvidia_dynamic_lib.py", + "tests/test_utils_env_vars.py", + "tests/test_find_bitcode_lib.py", + "tests/test_descriptor_catalog.py", + "tests/test_ctk_root_discovery.py", + "tests/test_optional_cuda_import.py", + "tests/test_find_nvidia_headers.py", + "tests/test_lib_descriptor.py", + "tests/test_search_steps.py", + "tests/child_load_nvidia_dynamic_lib_helper.py", + "tests/conftest.py", + "tests/test_find_static_lib.py", + "tests/test_utils_driver_info.py", + "tests/local_helpers.py", + "tests/test_driver_lib_loading.py", + "tests/test_load_nvidia_dynamic_lib_subprocess.py" + ] +} diff --git a/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/scm_version.json b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/scm_version.json new file mode 100644 index 0000000000000000000000000000000000000000..be1e8dee4842ade8147266df23abb7f590565bac --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/scm_version.json @@ -0,0 +1,8 @@ +{ + "tag": "1.6.0", + "distance": 0, + "node": "gdb347c90", + "dirty": false, + "branch": "HEAD", + "node_date": "2026-07-21" +} diff --git a/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/top_level.txt b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..089f044f442ab95aabf9de9eb52b63efbac9f7b9 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_pathfinder-1.6.0.dist-info/top_level.txt @@ -0,0 +1 @@ +cuda diff --git a/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/INSTALLER b/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/METADATA b/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..11775af4f8bc770fdfb35f127722efe7d09ce7fd --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/METADATA @@ -0,0 +1,160 @@ +Metadata-Version: 2.4 +Name: cuda-toolkit +Version: 13.0.3.0 +Summary: CUDA Toolkit meta-package +Project-URL: homepage, https://developer.nvidia.com/cuda-toolkit +Project-URL: documentation, https://docs.nvidia.com/cuda/ +Author-email: NVIDIA Kitmaker Team +Keywords: cuda,nvidia +Classifier: Development Status :: 6 - Mature +Classifier: Environment :: GPU +Classifier: Environment :: GPU :: NVIDIA CUDA +Provides-Extra: all +Requires-Dist: nvidia-cublas==13.1.1.3.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cuda-cccl==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cuda-crt==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cuda-culibos==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64') and extra == 'all' +Requires-Dist: nvidia-cuda-cupti==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cuda-cuxxfilt==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cuda-nvcc==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cuda-nvrtc==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cuda-opencl==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cuda-profiler-api==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cuda-runtime==13.0.96.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cuda-sanitizer-api==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cufft==12.0.0.61.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cufile==1.15.1.6.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64') and extra == 'all' +Requires-Dist: nvidia-curand==10.4.0.35.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cusolver==12.0.4.66.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-cusparse==12.6.3.3.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-npp==13.0.1.2.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-nvfatbin==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-nvjitlink<14,>=13.0.88; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-nvjpeg==13.0.1.86.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-nvml-dev==13.0.87.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-nvptxcompiler==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-nvtx==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Requires-Dist: nvidia-nvvm==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'all' +Provides-Extra: cccl +Requires-Dist: nvidia-cuda-cccl==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cccl' +Provides-Extra: crt +Requires-Dist: nvidia-cuda-crt==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'crt' +Provides-Extra: cublas +Requires-Dist: nvidia-cublas==13.1.1.3.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cublas' +Requires-Dist: nvidia-cuda-nvrtc==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cublas' +Provides-Extra: cudart +Requires-Dist: nvidia-cuda-runtime==13.0.96.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cudart' +Provides-Extra: cufft +Requires-Dist: nvidia-cufft==12.0.0.61.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cufft' +Requires-Dist: nvidia-nvjitlink<14,>=13.0.88; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cufft' +Provides-Extra: cufile +Requires-Dist: nvidia-cufile==1.15.1.6.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64') and extra == 'cufile' +Provides-Extra: culibos +Requires-Dist: nvidia-cuda-culibos==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64') and extra == 'culibos' +Provides-Extra: cupti +Requires-Dist: nvidia-cuda-cupti==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cupti' +Provides-Extra: curand +Requires-Dist: nvidia-curand==10.4.0.35.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'curand' +Provides-Extra: cusolver +Requires-Dist: nvidia-cublas==13.1.1.3.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cusolver' +Requires-Dist: nvidia-cusolver==12.0.4.66.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cusolver' +Requires-Dist: nvidia-cusparse==12.6.3.3.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cusolver' +Requires-Dist: nvidia-nvjitlink<14,>=13.0.88; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cusolver' +Provides-Extra: cusparse +Requires-Dist: nvidia-cusparse==12.6.3.3.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cusparse' +Requires-Dist: nvidia-nvjitlink<14,>=13.0.88; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cusparse' +Provides-Extra: cuxxfilt +Requires-Dist: nvidia-cuda-cuxxfilt==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'cuxxfilt' +Provides-Extra: npp +Requires-Dist: nvidia-npp==13.0.1.2.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'npp' +Provides-Extra: nvcc +Requires-Dist: nvidia-cuda-crt==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvcc' +Requires-Dist: nvidia-cuda-nvcc==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvcc' +Requires-Dist: nvidia-cuda-runtime==13.0.96.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvcc' +Requires-Dist: nvidia-nvvm==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvcc' +Provides-Extra: nvfatbin +Requires-Dist: nvidia-nvfatbin==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvfatbin' +Provides-Extra: nvjitlink +Requires-Dist: nvidia-nvjitlink<14,>=13.0.88; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvjitlink' +Provides-Extra: nvjpeg +Requires-Dist: nvidia-nvjpeg==13.0.1.86.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvjpeg' +Provides-Extra: nvml +Requires-Dist: nvidia-nvml-dev==13.0.87.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvml' +Provides-Extra: nvptxcompiler +Requires-Dist: nvidia-nvptxcompiler==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvptxcompiler' +Provides-Extra: nvrtc +Requires-Dist: nvidia-cuda-nvrtc==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvrtc' +Provides-Extra: nvtx +Requires-Dist: nvidia-nvtx==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvtx' +Provides-Extra: nvvm +Requires-Dist: nvidia-nvvm==13.0.88.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'nvvm' +Provides-Extra: opencl +Requires-Dist: nvidia-cuda-opencl==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'opencl' +Provides-Extra: profiler +Requires-Dist: nvidia-cuda-profiler-api==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'profiler' +Provides-Extra: sanitizer +Requires-Dist: nvidia-cuda-sanitizer-api==13.0.85.*; (sys_platform == 'linux' and platform_machine == 'aarch64' or sys_platform == 'linux' and platform_machine == 'x86_64' or sys_platform == 'win32' and platform_machine == 'AMD64') and extra == 'sanitizer' +Description-Content-Type: text/markdown + +# cuda-toolkit 13.0.3 + +### [NVIDIA CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) + +> The NVIDIA CUDA Toolkit provides a development environment for creating high-performance, GPU-accelerated applications. With it, you can develop, optimize, and deploy your applications on GPU-accelerated embedded systems, desktop workstations, enterprise data centers, cloud-based platforms, and supercomputers. The toolkit includes GPU-accelerated libraries, debugging and optimization tools, a C/C++ compiler, and a runtime library. + +### `cuda-toolkit` package + +The `cuda-toolkit` package is a meta-package (a package that contains no software and only installs other packages) to install all or part of the NVIDIA CUDA Toolkit. + +For instructions on how to use the `cuda-toolkit` package, please refer to the [NVIDIA CUDA Toolkit documentation](https://docs.nvidia.com/cuda/) and follow the installation guide for your platform. A summary of usage is also available below. + +### Using the `cuda-toolkit` package + +The `cuda-toolkit` package uses package extras to install all or part of the CUDA Toolkit. +Some examples of using the `cuda-toolkit` meta-package with extras: + +Install all of the CUDA Toolkit +``` +pip install cuda-toolkit[all] +``` + +Install just the CUDA Runtime +``` +pip install cuda-toolkit[cudart] +``` + +Install cuBLAS, cuSOLVER, and cuSPARSE +``` +pip install cuda-toolkit[cublas,cusolver,cusparse] +``` + +### Available extras + +| Extra | Package | Version | +|-------|---------|---------| +| `all` | All packages below | | +| cccl | nvidia-cuda-cccl | 13.0.85. | +| crt | nvidia-cuda-crt | 13.0.88. | +| cublas | nvidia-cublas | 13.1.1.3. | +| cudart | nvidia-cuda-runtime | 13.0.96. | +| cufft | nvidia-cufft | 12.0.0.61. | +| cufile | nvidia-cufile | 1.15.1.6. | +| culibos | nvidia-cuda-culibos | 13.0.85. | +| cupti | nvidia-cuda-cupti | 13.0.85. | +| curand | nvidia-curand | 10.4.0.35. | +| cusolver | nvidia-cusolver | 12.0.4.66. | +| cusparse | nvidia-cusparse | 12.6.3.3. | +| cuxxfilt | nvidia-cuda-cuxxfilt | 13.0.85. | +| npp | nvidia-npp | 13.0.1.2. | +| nvcc | nvidia-cuda-nvcc | 13.0.88. | +| nvfatbin | nvidia-nvfatbin | 13.0.85. | +| nvjitlink | nvidia-nvjitlink | 13.0.88 | +| nvjpeg | nvidia-nvjpeg | 13.0.1.86. | +| nvml | nvidia-nvml-dev | 13.0.87. | +| nvptxcompiler | nvidia-nvptxcompiler | 13.0.88. | +| nvrtc | nvidia-cuda-nvrtc | 13.0.88. | +| nvtx | nvidia-nvtx | 13.0.85. | +| nvvm | nvidia-nvvm | 13.0.88. | +| opencl | nvidia-cuda-opencl | 13.0.85. | +| profiler | nvidia-cuda-profiler-api | 13.0.85. | +| sanitizer | nvidia-cuda-sanitizer-api | 13.0.85. | \ No newline at end of file diff --git a/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/RECORD b/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..68f429a9f259fb2c974078ce0fd82098a930aa32 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/RECORD @@ -0,0 +1,4 @@ +cuda_toolkit-13.0.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +cuda_toolkit-13.0.3.0.dist-info/METADATA,sha256=Pii_ABOujbjPhjrjkolySPSh_2yUb-lmVH_UtsRMAFc,17687 +cuda_toolkit-13.0.3.0.dist-info/RECORD,, +cuda_toolkit-13.0.3.0.dist-info/WHEEL,sha256=e22IIVjxDyt0lABi4WpktFIGsmO_ebSDXLnPUbPK0E0,105 diff --git a/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/WHEEL b/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..d35cde4d0dc1dfd99182b6d7ca0ea087860a3b10 --- /dev/null +++ b/venv/lib/python3.12/site-packages/cuda_toolkit-13.0.3.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.29.0 +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any diff --git a/venv/lib/python3.12/site-packages/dateutil/__init__.py b/venv/lib/python3.12/site-packages/dateutil/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a2c19c06fe14476a9bfa4f1f60de7a997a41191c --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +import sys + +try: + from ._version import version as __version__ +except ImportError: + __version__ = 'unknown' + +__all__ = ['easter', 'parser', 'relativedelta', 'rrule', 'tz', + 'utils', 'zoneinfo'] + +def __getattr__(name): + import importlib + + if name in __all__: + return importlib.import_module("." + name, __name__) + raise AttributeError( + "module {!r} has not attribute {!r}".format(__name__, name) + ) + + +def __dir__(): + # __dir__ should include all the lazy-importable modules as well. + return [x for x in globals() if x not in sys.modules] + __all__ diff --git a/venv/lib/python3.12/site-packages/dateutil/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d0b3f2a73b85a348612a96b59e7b448144ceb1bf Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/__pycache__/_common.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/__pycache__/_common.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2a9973172d382ad5a4e3fa79399200293870820 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/__pycache__/_common.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/__pycache__/_version.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/__pycache__/_version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..749a1ef6101e8eb4d32b33d7541849b768b929d4 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/__pycache__/_version.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/__pycache__/easter.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/__pycache__/easter.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f91881eda67945540d1bb61e2d17c5bb40e2fba Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/__pycache__/easter.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/__pycache__/relativedelta.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/__pycache__/relativedelta.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44ede8e3ece59eec9a3946eb9bad0c69a8ff9117 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/__pycache__/relativedelta.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/__pycache__/rrule.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/__pycache__/rrule.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27187e263c9de6c634ece8e705236cb07c9106b0 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/__pycache__/rrule.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/__pycache__/tzwin.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/__pycache__/tzwin.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ba0727e4d5d42cb5ba0b817bd2a0f296a3a175d7 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/__pycache__/tzwin.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/__pycache__/utils.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/__pycache__/utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1f1654114dacb2a3d9612cc2dbfd6579d113521 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/__pycache__/utils.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/_common.py b/venv/lib/python3.12/site-packages/dateutil/_common.py new file mode 100644 index 0000000000000000000000000000000000000000..4eb2659bd2986125fcfb4afea5bae9efc2dcd1a0 --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/_common.py @@ -0,0 +1,43 @@ +""" +Common code used in multiple modules. +""" + + +class weekday(object): + __slots__ = ["weekday", "n"] + + def __init__(self, weekday, n=None): + self.weekday = weekday + self.n = n + + def __call__(self, n): + if n == self.n: + return self + else: + return self.__class__(self.weekday, n) + + def __eq__(self, other): + try: + if self.weekday != other.weekday or self.n != other.n: + return False + except AttributeError: + return False + return True + + def __hash__(self): + return hash(( + self.weekday, + self.n, + )) + + def __ne__(self, other): + return not (self == other) + + def __repr__(self): + s = ("MO", "TU", "WE", "TH", "FR", "SA", "SU")[self.weekday] + if not self.n: + return s + else: + return "%s(%+d)" % (s, self.n) + +# vim:ts=4:sw=4:et diff --git a/venv/lib/python3.12/site-packages/dateutil/_version.py b/venv/lib/python3.12/site-packages/dateutil/_version.py new file mode 100644 index 0000000000000000000000000000000000000000..ddda98098527a73348e694c2edb691fd625475fc --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/_version.py @@ -0,0 +1,4 @@ +# file generated by setuptools_scm +# don't change, don't track in version control +__version__ = version = '2.9.0.post0' +__version_tuple__ = version_tuple = (2, 9, 0) diff --git a/venv/lib/python3.12/site-packages/dateutil/easter.py b/venv/lib/python3.12/site-packages/dateutil/easter.py new file mode 100644 index 0000000000000000000000000000000000000000..f74d1f7442473997245ac683b8a269a3574d1ba4 --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/easter.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +""" +This module offers a generic Easter computing method for any given year, using +Western, Orthodox or Julian algorithms. +""" + +import datetime + +__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"] + +EASTER_JULIAN = 1 +EASTER_ORTHODOX = 2 +EASTER_WESTERN = 3 + + +def easter(year, method=EASTER_WESTERN): + """ + This method was ported from the work done by GM Arts, + on top of the algorithm by Claus Tondering, which was + based in part on the algorithm of Ouding (1940), as + quoted in "Explanatory Supplement to the Astronomical + Almanac", P. Kenneth Seidelmann, editor. + + This algorithm implements three different Easter + calculation methods: + + 1. Original calculation in Julian calendar, valid in + dates after 326 AD + 2. Original method, with date converted to Gregorian + calendar, valid in years 1583 to 4099 + 3. Revised method, in Gregorian calendar, valid in + years 1583 to 4099 as well + + These methods are represented by the constants: + + * ``EASTER_JULIAN = 1`` + * ``EASTER_ORTHODOX = 2`` + * ``EASTER_WESTERN = 3`` + + The default method is method 3. + + More about the algorithm may be found at: + + `GM Arts: Easter Algorithms `_ + + and + + `The Calendar FAQ: Easter `_ + + """ + + if not (1 <= method <= 3): + raise ValueError("invalid method") + + # g - Golden year - 1 + # c - Century + # h - (23 - Epact) mod 30 + # i - Number of days from March 21 to Paschal Full Moon + # j - Weekday for PFM (0=Sunday, etc) + # p - Number of days from March 21 to Sunday on or before PFM + # (-6 to 28 methods 1 & 3, to 56 for method 2) + # e - Extra days to add for method 2 (converting Julian + # date to Gregorian date) + + y = year + g = y % 19 + e = 0 + if method < 3: + # Old method + i = (19*g + 15) % 30 + j = (y + y//4 + i) % 7 + if method == 2: + # Extra dates to convert Julian to Gregorian date + e = 10 + if y > 1600: + e = e + y//100 - 16 - (y//100 - 16)//4 + else: + # New method + c = y//100 + h = (c - c//4 - (8*c + 13)//25 + 19*g + 15) % 30 + i = h - (h//28)*(1 - (h//28)*(29//(h + 1))*((21 - g)//11)) + j = (y + y//4 + i + 2 - c + c//4) % 7 + + # p can be from -6 to 56 corresponding to dates 22 March to 23 May + # (later dates apply to method 2, although 23 May never actually occurs) + p = i - j + e + d = 1 + (p + 27 + (p + 6)//40) % 31 + m = 3 + (p + 26)//30 + return datetime.date(int(y), int(m), int(d)) diff --git a/venv/lib/python3.12/site-packages/dateutil/parser/__init__.py b/venv/lib/python3.12/site-packages/dateutil/parser/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d174b0e4dcc472999b75e55ebb88af320ae38081 --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/parser/__init__.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +from ._parser import parse, parser, parserinfo, ParserError +from ._parser import DEFAULTPARSER, DEFAULTTZPARSER +from ._parser import UnknownTimezoneWarning + +from ._parser import __doc__ + +from .isoparser import isoparser, isoparse + +__all__ = ['parse', 'parser', 'parserinfo', + 'isoparse', 'isoparser', + 'ParserError', + 'UnknownTimezoneWarning'] + + +### +# Deprecate portions of the private interface so that downstream code that +# is improperly relying on it is given *some* notice. + + +def __deprecated_private_func(f): + from functools import wraps + import warnings + + msg = ('{name} is a private function and may break without warning, ' + 'it will be moved and or renamed in future versions.') + msg = msg.format(name=f.__name__) + + @wraps(f) + def deprecated_func(*args, **kwargs): + warnings.warn(msg, DeprecationWarning) + return f(*args, **kwargs) + + return deprecated_func + +def __deprecate_private_class(c): + import warnings + + msg = ('{name} is a private class and may break without warning, ' + 'it will be moved and or renamed in future versions.') + msg = msg.format(name=c.__name__) + + class private_class(c): + __doc__ = c.__doc__ + + def __init__(self, *args, **kwargs): + warnings.warn(msg, DeprecationWarning) + super(private_class, self).__init__(*args, **kwargs) + + private_class.__name__ = c.__name__ + + return private_class + + +from ._parser import _timelex, _resultbase +from ._parser import _tzparser, _parsetz + +_timelex = __deprecate_private_class(_timelex) +_tzparser = __deprecate_private_class(_tzparser) +_resultbase = __deprecate_private_class(_resultbase) +_parsetz = __deprecated_private_func(_parsetz) diff --git a/venv/lib/python3.12/site-packages/dateutil/parser/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/parser/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94af9c576f0c5173ad47f0afd5c0b6f9b84307d9 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/parser/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/parser/__pycache__/_parser.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/parser/__pycache__/_parser.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6aa7f548d0db1b457ffa3d06cafb9f59f3d84b8e Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/parser/__pycache__/_parser.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/parser/__pycache__/isoparser.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/parser/__pycache__/isoparser.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..120418dd5adfad5968c7048595078fbf3d18af66 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/parser/__pycache__/isoparser.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/parser/_parser.py b/venv/lib/python3.12/site-packages/dateutil/parser/_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..37d1663b2f72447800d9a553929e3de932244289 --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/parser/_parser.py @@ -0,0 +1,1613 @@ +# -*- coding: utf-8 -*- +""" +This module offers a generic date/time string parser which is able to parse +most known formats to represent a date and/or time. + +This module attempts to be forgiving with regards to unlikely input formats, +returning a datetime object even for dates which are ambiguous. If an element +of a date/time stamp is omitted, the following rules are applied: + +- If AM or PM is left unspecified, a 24-hour clock is assumed, however, an hour + on a 12-hour clock (``0 <= hour <= 12``) *must* be specified if AM or PM is + specified. +- If a time zone is omitted, a timezone-naive datetime is returned. + +If any other elements are missing, they are taken from the +:class:`datetime.datetime` object passed to the parameter ``default``. If this +results in a day number exceeding the valid number of days per month, the +value falls back to the end of the month. + +Additional resources about date/time string formats can be found below: + +- `A summary of the international standard date and time notation + `_ +- `W3C Date and Time Formats `_ +- `Time Formats (Planetary Rings Node) `_ +- `CPAN ParseDate module + `_ +- `Java SimpleDateFormat Class + `_ +""" +from __future__ import unicode_literals + +import datetime +import re +import string +import time +import warnings + +from calendar import monthrange +from io import StringIO + +import six +from six import integer_types, text_type + +from decimal import Decimal + +from warnings import warn + +from .. import relativedelta +from .. import tz + +__all__ = ["parse", "parserinfo", "ParserError"] + + +# TODO: pandas.core.tools.datetimes imports this explicitly. Might be worth +# making public and/or figuring out if there is something we can +# take off their plate. +class _timelex(object): + # Fractional seconds are sometimes split by a comma + _split_decimal = re.compile("([.,])") + + def __init__(self, instream): + if isinstance(instream, (bytes, bytearray)): + instream = instream.decode() + + if isinstance(instream, text_type): + instream = StringIO(instream) + elif getattr(instream, 'read', None) is None: + raise TypeError('Parser must be a string or character stream, not ' + '{itype}'.format(itype=instream.__class__.__name__)) + + self.instream = instream + self.charstack = [] + self.tokenstack = [] + self.eof = False + + def get_token(self): + """ + This function breaks the time string into lexical units (tokens), which + can be parsed by the parser. Lexical units are demarcated by changes in + the character set, so any continuous string of letters is considered + one unit, any continuous string of numbers is considered one unit. + + The main complication arises from the fact that dots ('.') can be used + both as separators (e.g. "Sep.20.2009") or decimal points (e.g. + "4:30:21.447"). As such, it is necessary to read the full context of + any dot-separated strings before breaking it into tokens; as such, this + function maintains a "token stack", for when the ambiguous context + demands that multiple tokens be parsed at once. + """ + if self.tokenstack: + return self.tokenstack.pop(0) + + seenletters = False + token = None + state = None + + while not self.eof: + # We only realize that we've reached the end of a token when we + # find a character that's not part of the current token - since + # that character may be part of the next token, it's stored in the + # charstack. + if self.charstack: + nextchar = self.charstack.pop(0) + else: + nextchar = self.instream.read(1) + while nextchar == '\x00': + nextchar = self.instream.read(1) + + if not nextchar: + self.eof = True + break + elif not state: + # First character of the token - determines if we're starting + # to parse a word, a number or something else. + token = nextchar + if self.isword(nextchar): + state = 'a' + elif self.isnum(nextchar): + state = '0' + elif self.isspace(nextchar): + token = ' ' + break # emit token + else: + break # emit token + elif state == 'a': + # If we've already started reading a word, we keep reading + # letters until we find something that's not part of a word. + seenletters = True + if self.isword(nextchar): + token += nextchar + elif nextchar == '.': + token += nextchar + state = 'a.' + else: + self.charstack.append(nextchar) + break # emit token + elif state == '0': + # If we've already started reading a number, we keep reading + # numbers until we find something that doesn't fit. + if self.isnum(nextchar): + token += nextchar + elif nextchar == '.' or (nextchar == ',' and len(token) >= 2): + token += nextchar + state = '0.' + else: + self.charstack.append(nextchar) + break # emit token + elif state == 'a.': + # If we've seen some letters and a dot separator, continue + # parsing, and the tokens will be broken up later. + seenletters = True + if nextchar == '.' or self.isword(nextchar): + token += nextchar + elif self.isnum(nextchar) and token[-1] == '.': + token += nextchar + state = '0.' + else: + self.charstack.append(nextchar) + break # emit token + elif state == '0.': + # If we've seen at least one dot separator, keep going, we'll + # break up the tokens later. + if nextchar == '.' or self.isnum(nextchar): + token += nextchar + elif self.isword(nextchar) and token[-1] == '.': + token += nextchar + state = 'a.' + else: + self.charstack.append(nextchar) + break # emit token + + if (state in ('a.', '0.') and (seenletters or token.count('.') > 1 or + token[-1] in '.,')): + l = self._split_decimal.split(token) + token = l[0] + for tok in l[1:]: + if tok: + self.tokenstack.append(tok) + + if state == '0.' and token.count('.') == 0: + token = token.replace(',', '.') + + return token + + def __iter__(self): + return self + + def __next__(self): + token = self.get_token() + if token is None: + raise StopIteration + + return token + + def next(self): + return self.__next__() # Python 2.x support + + @classmethod + def split(cls, s): + return list(cls(s)) + + @classmethod + def isword(cls, nextchar): + """ Whether or not the next character is part of a word """ + return nextchar.isalpha() + + @classmethod + def isnum(cls, nextchar): + """ Whether the next character is part of a number """ + return nextchar.isdigit() + + @classmethod + def isspace(cls, nextchar): + """ Whether the next character is whitespace """ + return nextchar.isspace() + + +class _resultbase(object): + + def __init__(self): + for attr in self.__slots__: + setattr(self, attr, None) + + def _repr(self, classname): + l = [] + for attr in self.__slots__: + value = getattr(self, attr) + if value is not None: + l.append("%s=%s" % (attr, repr(value))) + return "%s(%s)" % (classname, ", ".join(l)) + + def __len__(self): + return (sum(getattr(self, attr) is not None + for attr in self.__slots__)) + + def __repr__(self): + return self._repr(self.__class__.__name__) + + +class parserinfo(object): + """ + Class which handles what inputs are accepted. Subclass this to customize + the language and acceptable values for each parameter. + + :param dayfirst: + Whether to interpret the first value in an ambiguous 3-integer date + (e.g. 01/05/09) as the day (``True``) or month (``False``). If + ``yearfirst`` is set to ``True``, this distinguishes between YDM + and YMD. Default is ``False``. + + :param yearfirst: + Whether to interpret the first value in an ambiguous 3-integer date + (e.g. 01/05/09) as the year. If ``True``, the first number is taken + to be the year, otherwise the last number is taken to be the year. + Default is ``False``. + """ + + # m from a.m/p.m, t from ISO T separator + JUMP = [" ", ".", ",", ";", "-", "/", "'", + "at", "on", "and", "ad", "m", "t", "of", + "st", "nd", "rd", "th"] + + WEEKDAYS = [("Mon", "Monday"), + ("Tue", "Tuesday"), # TODO: "Tues" + ("Wed", "Wednesday"), + ("Thu", "Thursday"), # TODO: "Thurs" + ("Fri", "Friday"), + ("Sat", "Saturday"), + ("Sun", "Sunday")] + MONTHS = [("Jan", "January"), + ("Feb", "February"), # TODO: "Febr" + ("Mar", "March"), + ("Apr", "April"), + ("May", "May"), + ("Jun", "June"), + ("Jul", "July"), + ("Aug", "August"), + ("Sep", "Sept", "September"), + ("Oct", "October"), + ("Nov", "November"), + ("Dec", "December")] + HMS = [("h", "hour", "hours"), + ("m", "minute", "minutes"), + ("s", "second", "seconds")] + AMPM = [("am", "a"), + ("pm", "p")] + UTCZONE = ["UTC", "GMT", "Z", "z"] + PERTAIN = ["of"] + TZOFFSET = {} + # TODO: ERA = ["AD", "BC", "CE", "BCE", "Stardate", + # "Anno Domini", "Year of Our Lord"] + + def __init__(self, dayfirst=False, yearfirst=False): + self._jump = self._convert(self.JUMP) + self._weekdays = self._convert(self.WEEKDAYS) + self._months = self._convert(self.MONTHS) + self._hms = self._convert(self.HMS) + self._ampm = self._convert(self.AMPM) + self._utczone = self._convert(self.UTCZONE) + self._pertain = self._convert(self.PERTAIN) + + self.dayfirst = dayfirst + self.yearfirst = yearfirst + + self._year = time.localtime().tm_year + self._century = self._year // 100 * 100 + + def _convert(self, lst): + dct = {} + for i, v in enumerate(lst): + if isinstance(v, tuple): + for v in v: + dct[v.lower()] = i + else: + dct[v.lower()] = i + return dct + + def jump(self, name): + return name.lower() in self._jump + + def weekday(self, name): + try: + return self._weekdays[name.lower()] + except KeyError: + pass + return None + + def month(self, name): + try: + return self._months[name.lower()] + 1 + except KeyError: + pass + return None + + def hms(self, name): + try: + return self._hms[name.lower()] + except KeyError: + return None + + def ampm(self, name): + try: + return self._ampm[name.lower()] + except KeyError: + return None + + def pertain(self, name): + return name.lower() in self._pertain + + def utczone(self, name): + return name.lower() in self._utczone + + def tzoffset(self, name): + if name in self._utczone: + return 0 + + return self.TZOFFSET.get(name) + + def convertyear(self, year, century_specified=False): + """ + Converts two-digit years to year within [-50, 49] + range of self._year (current local time) + """ + + # Function contract is that the year is always positive + assert year >= 0 + + if year < 100 and not century_specified: + # assume current century to start + year += self._century + + if year >= self._year + 50: # if too far in future + year -= 100 + elif year < self._year - 50: # if too far in past + year += 100 + + return year + + def validate(self, res): + # move to info + if res.year is not None: + res.year = self.convertyear(res.year, res.century_specified) + + if ((res.tzoffset == 0 and not res.tzname) or + (res.tzname == 'Z' or res.tzname == 'z')): + res.tzname = "UTC" + res.tzoffset = 0 + elif res.tzoffset != 0 and res.tzname and self.utczone(res.tzname): + res.tzoffset = 0 + return True + + +class _ymd(list): + def __init__(self, *args, **kwargs): + super(self.__class__, self).__init__(*args, **kwargs) + self.century_specified = False + self.dstridx = None + self.mstridx = None + self.ystridx = None + + @property + def has_year(self): + return self.ystridx is not None + + @property + def has_month(self): + return self.mstridx is not None + + @property + def has_day(self): + return self.dstridx is not None + + def could_be_day(self, value): + if self.has_day: + return False + elif not self.has_month: + return 1 <= value <= 31 + elif not self.has_year: + # Be permissive, assume leap year + month = self[self.mstridx] + return 1 <= value <= monthrange(2000, month)[1] + else: + month = self[self.mstridx] + year = self[self.ystridx] + return 1 <= value <= monthrange(year, month)[1] + + def append(self, val, label=None): + if hasattr(val, '__len__'): + if val.isdigit() and len(val) > 2: + self.century_specified = True + if label not in [None, 'Y']: # pragma: no cover + raise ValueError(label) + label = 'Y' + elif val > 100: + self.century_specified = True + if label not in [None, 'Y']: # pragma: no cover + raise ValueError(label) + label = 'Y' + + super(self.__class__, self).append(int(val)) + + if label == 'M': + if self.has_month: + raise ValueError('Month is already set') + self.mstridx = len(self) - 1 + elif label == 'D': + if self.has_day: + raise ValueError('Day is already set') + self.dstridx = len(self) - 1 + elif label == 'Y': + if self.has_year: + raise ValueError('Year is already set') + self.ystridx = len(self) - 1 + + def _resolve_from_stridxs(self, strids): + """ + Try to resolve the identities of year/month/day elements using + ystridx, mstridx, and dstridx, if enough of these are specified. + """ + if len(self) == 3 and len(strids) == 2: + # we can back out the remaining stridx value + missing = [x for x in range(3) if x not in strids.values()] + key = [x for x in ['y', 'm', 'd'] if x not in strids] + assert len(missing) == len(key) == 1 + key = key[0] + val = missing[0] + strids[key] = val + + assert len(self) == len(strids) # otherwise this should not be called + out = {key: self[strids[key]] for key in strids} + return (out.get('y'), out.get('m'), out.get('d')) + + def resolve_ymd(self, yearfirst, dayfirst): + len_ymd = len(self) + year, month, day = (None, None, None) + + strids = (('y', self.ystridx), + ('m', self.mstridx), + ('d', self.dstridx)) + + strids = {key: val for key, val in strids if val is not None} + if (len(self) == len(strids) > 0 or + (len(self) == 3 and len(strids) == 2)): + return self._resolve_from_stridxs(strids) + + mstridx = self.mstridx + + if len_ymd > 3: + raise ValueError("More than three YMD values") + elif len_ymd == 1 or (mstridx is not None and len_ymd == 2): + # One member, or two members with a month string + if mstridx is not None: + month = self[mstridx] + # since mstridx is 0 or 1, self[mstridx-1] always + # looks up the other element + other = self[mstridx - 1] + else: + other = self[0] + + if len_ymd > 1 or mstridx is None: + if other > 31: + year = other + else: + day = other + + elif len_ymd == 2: + # Two members with numbers + if self[0] > 31: + # 99-01 + year, month = self + elif self[1] > 31: + # 01-99 + month, year = self + elif dayfirst and self[1] <= 12: + # 13-01 + day, month = self + else: + # 01-13 + month, day = self + + elif len_ymd == 3: + # Three members + if mstridx == 0: + if self[1] > 31: + # Apr-2003-25 + month, year, day = self + else: + month, day, year = self + elif mstridx == 1: + if self[0] > 31 or (yearfirst and self[2] <= 31): + # 99-Jan-01 + year, month, day = self + else: + # 01-Jan-01 + # Give precedence to day-first, since + # two-digit years is usually hand-written. + day, month, year = self + + elif mstridx == 2: + # WTF!? + if self[1] > 31: + # 01-99-Jan + day, year, month = self + else: + # 99-01-Jan + year, day, month = self + + else: + if (self[0] > 31 or + self.ystridx == 0 or + (yearfirst and self[1] <= 12 and self[2] <= 31)): + # 99-01-01 + if dayfirst and self[2] <= 12: + year, day, month = self + else: + year, month, day = self + elif self[0] > 12 or (dayfirst and self[1] <= 12): + # 13-01-01 + day, month, year = self + else: + # 01-13-01 + month, day, year = self + + return year, month, day + + +class parser(object): + def __init__(self, info=None): + self.info = info or parserinfo() + + def parse(self, timestr, default=None, + ignoretz=False, tzinfos=None, **kwargs): + """ + Parse the date/time string into a :class:`datetime.datetime` object. + + :param timestr: + Any date/time string using the supported formats. + + :param default: + The default datetime object, if this is a datetime object and not + ``None``, elements specified in ``timestr`` replace elements in the + default object. + + :param ignoretz: + If set ``True``, time zones in parsed strings are ignored and a + naive :class:`datetime.datetime` object is returned. + + :param tzinfos: + Additional time zone names / aliases which may be present in the + string. This argument maps time zone names (and optionally offsets + from those time zones) to time zones. This parameter can be a + dictionary with timezone aliases mapping time zone names to time + zones or a function taking two parameters (``tzname`` and + ``tzoffset``) and returning a time zone. + + The timezones to which the names are mapped can be an integer + offset from UTC in seconds or a :class:`tzinfo` object. + + .. doctest:: + :options: +NORMALIZE_WHITESPACE + + >>> from dateutil.parser import parse + >>> from dateutil.tz import gettz + >>> tzinfos = {"BRST": -7200, "CST": gettz("America/Chicago")} + >>> parse("2012-01-19 17:21:00 BRST", tzinfos=tzinfos) + datetime.datetime(2012, 1, 19, 17, 21, tzinfo=tzoffset(u'BRST', -7200)) + >>> parse("2012-01-19 17:21:00 CST", tzinfos=tzinfos) + datetime.datetime(2012, 1, 19, 17, 21, + tzinfo=tzfile('/usr/share/zoneinfo/America/Chicago')) + + This parameter is ignored if ``ignoretz`` is set. + + :param \\*\\*kwargs: + Keyword arguments as passed to ``_parse()``. + + :return: + Returns a :class:`datetime.datetime` object or, if the + ``fuzzy_with_tokens`` option is ``True``, returns a tuple, the + first element being a :class:`datetime.datetime` object, the second + a tuple containing the fuzzy tokens. + + :raises ParserError: + Raised for invalid or unknown string format, if the provided + :class:`tzinfo` is not in a valid format, or if an invalid date + would be created. + + :raises TypeError: + Raised for non-string or character stream input. + + :raises OverflowError: + Raised if the parsed date exceeds the largest valid C integer on + your system. + """ + + if default is None: + default = datetime.datetime.now().replace(hour=0, minute=0, + second=0, microsecond=0) + + res, skipped_tokens = self._parse(timestr, **kwargs) + + if res is None: + raise ParserError("Unknown string format: %s", timestr) + + if len(res) == 0: + raise ParserError("String does not contain a date: %s", timestr) + + try: + ret = self._build_naive(res, default) + except ValueError as e: + six.raise_from(ParserError(str(e) + ": %s", timestr), e) + + if not ignoretz: + ret = self._build_tzaware(ret, res, tzinfos) + + if kwargs.get('fuzzy_with_tokens', False): + return ret, skipped_tokens + else: + return ret + + class _result(_resultbase): + __slots__ = ["year", "month", "day", "weekday", + "hour", "minute", "second", "microsecond", + "tzname", "tzoffset", "ampm","any_unused_tokens"] + + def _parse(self, timestr, dayfirst=None, yearfirst=None, fuzzy=False, + fuzzy_with_tokens=False): + """ + Private method which performs the heavy lifting of parsing, called from + ``parse()``, which passes on its ``kwargs`` to this function. + + :param timestr: + The string to parse. + + :param dayfirst: + Whether to interpret the first value in an ambiguous 3-integer date + (e.g. 01/05/09) as the day (``True``) or month (``False``). If + ``yearfirst`` is set to ``True``, this distinguishes between YDM + and YMD. If set to ``None``, this value is retrieved from the + current :class:`parserinfo` object (which itself defaults to + ``False``). + + :param yearfirst: + Whether to interpret the first value in an ambiguous 3-integer date + (e.g. 01/05/09) as the year. If ``True``, the first number is taken + to be the year, otherwise the last number is taken to be the year. + If this is set to ``None``, the value is retrieved from the current + :class:`parserinfo` object (which itself defaults to ``False``). + + :param fuzzy: + Whether to allow fuzzy parsing, allowing for string like "Today is + January 1, 2047 at 8:21:00AM". + + :param fuzzy_with_tokens: + If ``True``, ``fuzzy`` is automatically set to True, and the parser + will return a tuple where the first element is the parsed + :class:`datetime.datetime` datetimestamp and the second element is + a tuple containing the portions of the string which were ignored: + + .. doctest:: + + >>> from dateutil.parser import parse + >>> parse("Today is January 1, 2047 at 8:21:00AM", fuzzy_with_tokens=True) + (datetime.datetime(2047, 1, 1, 8, 21), (u'Today is ', u' ', u'at ')) + + """ + if fuzzy_with_tokens: + fuzzy = True + + info = self.info + + if dayfirst is None: + dayfirst = info.dayfirst + + if yearfirst is None: + yearfirst = info.yearfirst + + res = self._result() + l = _timelex.split(timestr) # Splits the timestr into tokens + + skipped_idxs = [] + + # year/month/day list + ymd = _ymd() + + len_l = len(l) + i = 0 + try: + while i < len_l: + + # Check if it's a number + value_repr = l[i] + try: + value = float(value_repr) + except ValueError: + value = None + + if value is not None: + # Numeric token + i = self._parse_numeric_token(l, i, info, ymd, res, fuzzy) + + # Check weekday + elif info.weekday(l[i]) is not None: + value = info.weekday(l[i]) + res.weekday = value + + # Check month name + elif info.month(l[i]) is not None: + value = info.month(l[i]) + ymd.append(value, 'M') + + if i + 1 < len_l: + if l[i + 1] in ('-', '/'): + # Jan-01[-99] + sep = l[i + 1] + ymd.append(l[i + 2]) + + if i + 3 < len_l and l[i + 3] == sep: + # Jan-01-99 + ymd.append(l[i + 4]) + i += 2 + + i += 2 + + elif (i + 4 < len_l and l[i + 1] == l[i + 3] == ' ' and + info.pertain(l[i + 2])): + # Jan of 01 + # In this case, 01 is clearly year + if l[i + 4].isdigit(): + # Convert it here to become unambiguous + value = int(l[i + 4]) + year = str(info.convertyear(value)) + ymd.append(year, 'Y') + else: + # Wrong guess + pass + # TODO: not hit in tests + i += 4 + + # Check am/pm + elif info.ampm(l[i]) is not None: + value = info.ampm(l[i]) + val_is_ampm = self._ampm_valid(res.hour, res.ampm, fuzzy) + + if val_is_ampm: + res.hour = self._adjust_ampm(res.hour, value) + res.ampm = value + + elif fuzzy: + skipped_idxs.append(i) + + # Check for a timezone name + elif self._could_be_tzname(res.hour, res.tzname, res.tzoffset, l[i]): + res.tzname = l[i] + res.tzoffset = info.tzoffset(res.tzname) + + # Check for something like GMT+3, or BRST+3. Notice + # that it doesn't mean "I am 3 hours after GMT", but + # "my time +3 is GMT". If found, we reverse the + # logic so that timezone parsing code will get it + # right. + if i + 1 < len_l and l[i + 1] in ('+', '-'): + l[i + 1] = ('+', '-')[l[i + 1] == '+'] + res.tzoffset = None + if info.utczone(res.tzname): + # With something like GMT+3, the timezone + # is *not* GMT. + res.tzname = None + + # Check for a numbered timezone + elif res.hour is not None and l[i] in ('+', '-'): + signal = (-1, 1)[l[i] == '+'] + len_li = len(l[i + 1]) + + # TODO: check that l[i + 1] is integer? + if len_li == 4: + # -0300 + hour_offset = int(l[i + 1][:2]) + min_offset = int(l[i + 1][2:]) + elif i + 2 < len_l and l[i + 2] == ':': + # -03:00 + hour_offset = int(l[i + 1]) + min_offset = int(l[i + 3]) # TODO: Check that l[i+3] is minute-like? + i += 2 + elif len_li <= 2: + # -[0]3 + hour_offset = int(l[i + 1][:2]) + min_offset = 0 + else: + raise ValueError(timestr) + + res.tzoffset = signal * (hour_offset * 3600 + min_offset * 60) + + # Look for a timezone name between parenthesis + if (i + 5 < len_l and + info.jump(l[i + 2]) and l[i + 3] == '(' and + l[i + 5] == ')' and + 3 <= len(l[i + 4]) and + self._could_be_tzname(res.hour, res.tzname, + None, l[i + 4])): + # -0300 (BRST) + res.tzname = l[i + 4] + i += 4 + + i += 1 + + # Check jumps + elif not (info.jump(l[i]) or fuzzy): + raise ValueError(timestr) + + else: + skipped_idxs.append(i) + i += 1 + + # Process year/month/day + year, month, day = ymd.resolve_ymd(yearfirst, dayfirst) + + res.century_specified = ymd.century_specified + res.year = year + res.month = month + res.day = day + + except (IndexError, ValueError): + return None, None + + if not info.validate(res): + return None, None + + if fuzzy_with_tokens: + skipped_tokens = self._recombine_skipped(l, skipped_idxs) + return res, tuple(skipped_tokens) + else: + return res, None + + def _parse_numeric_token(self, tokens, idx, info, ymd, res, fuzzy): + # Token is a number + value_repr = tokens[idx] + try: + value = self._to_decimal(value_repr) + except Exception as e: + six.raise_from(ValueError('Unknown numeric token'), e) + + len_li = len(value_repr) + + len_l = len(tokens) + + if (len(ymd) == 3 and len_li in (2, 4) and + res.hour is None and + (idx + 1 >= len_l or + (tokens[idx + 1] != ':' and + info.hms(tokens[idx + 1]) is None))): + # 19990101T23[59] + s = tokens[idx] + res.hour = int(s[:2]) + + if len_li == 4: + res.minute = int(s[2:]) + + elif len_li == 6 or (len_li > 6 and tokens[idx].find('.') == 6): + # YYMMDD or HHMMSS[.ss] + s = tokens[idx] + + if not ymd and '.' not in tokens[idx]: + ymd.append(s[:2]) + ymd.append(s[2:4]) + ymd.append(s[4:]) + else: + # 19990101T235959[.59] + + # TODO: Check if res attributes already set. + res.hour = int(s[:2]) + res.minute = int(s[2:4]) + res.second, res.microsecond = self._parsems(s[4:]) + + elif len_li in (8, 12, 14): + # YYYYMMDD + s = tokens[idx] + ymd.append(s[:4], 'Y') + ymd.append(s[4:6]) + ymd.append(s[6:8]) + + if len_li > 8: + res.hour = int(s[8:10]) + res.minute = int(s[10:12]) + + if len_li > 12: + res.second = int(s[12:]) + + elif self._find_hms_idx(idx, tokens, info, allow_jump=True) is not None: + # HH[ ]h or MM[ ]m or SS[.ss][ ]s + hms_idx = self._find_hms_idx(idx, tokens, info, allow_jump=True) + (idx, hms) = self._parse_hms(idx, tokens, info, hms_idx) + if hms is not None: + # TODO: checking that hour/minute/second are not + # already set? + self._assign_hms(res, value_repr, hms) + + elif idx + 2 < len_l and tokens[idx + 1] == ':': + # HH:MM[:SS[.ss]] + res.hour = int(value) + value = self._to_decimal(tokens[idx + 2]) # TODO: try/except for this? + (res.minute, res.second) = self._parse_min_sec(value) + + if idx + 4 < len_l and tokens[idx + 3] == ':': + res.second, res.microsecond = self._parsems(tokens[idx + 4]) + + idx += 2 + + idx += 2 + + elif idx + 1 < len_l and tokens[idx + 1] in ('-', '/', '.'): + sep = tokens[idx + 1] + ymd.append(value_repr) + + if idx + 2 < len_l and not info.jump(tokens[idx + 2]): + if tokens[idx + 2].isdigit(): + # 01-01[-01] + ymd.append(tokens[idx + 2]) + else: + # 01-Jan[-01] + value = info.month(tokens[idx + 2]) + + if value is not None: + ymd.append(value, 'M') + else: + raise ValueError() + + if idx + 3 < len_l and tokens[idx + 3] == sep: + # We have three members + value = info.month(tokens[idx + 4]) + + if value is not None: + ymd.append(value, 'M') + else: + ymd.append(tokens[idx + 4]) + idx += 2 + + idx += 1 + idx += 1 + + elif idx + 1 >= len_l or info.jump(tokens[idx + 1]): + if idx + 2 < len_l and info.ampm(tokens[idx + 2]) is not None: + # 12 am + hour = int(value) + res.hour = self._adjust_ampm(hour, info.ampm(tokens[idx + 2])) + idx += 1 + else: + # Year, month or day + ymd.append(value) + idx += 1 + + elif info.ampm(tokens[idx + 1]) is not None and (0 <= value < 24): + # 12am + hour = int(value) + res.hour = self._adjust_ampm(hour, info.ampm(tokens[idx + 1])) + idx += 1 + + elif ymd.could_be_day(value): + ymd.append(value) + + elif not fuzzy: + raise ValueError() + + return idx + + def _find_hms_idx(self, idx, tokens, info, allow_jump): + len_l = len(tokens) + + if idx+1 < len_l and info.hms(tokens[idx+1]) is not None: + # There is an "h", "m", or "s" label following this token. We take + # assign the upcoming label to the current token. + # e.g. the "12" in 12h" + hms_idx = idx + 1 + + elif (allow_jump and idx+2 < len_l and tokens[idx+1] == ' ' and + info.hms(tokens[idx+2]) is not None): + # There is a space and then an "h", "m", or "s" label. + # e.g. the "12" in "12 h" + hms_idx = idx + 2 + + elif idx > 0 and info.hms(tokens[idx-1]) is not None: + # There is a "h", "m", or "s" preceding this token. Since neither + # of the previous cases was hit, there is no label following this + # token, so we use the previous label. + # e.g. the "04" in "12h04" + hms_idx = idx-1 + + elif (1 < idx == len_l-1 and tokens[idx-1] == ' ' and + info.hms(tokens[idx-2]) is not None): + # If we are looking at the final token, we allow for a + # backward-looking check to skip over a space. + # TODO: Are we sure this is the right condition here? + hms_idx = idx - 2 + + else: + hms_idx = None + + return hms_idx + + def _assign_hms(self, res, value_repr, hms): + # See GH issue #427, fixing float rounding + value = self._to_decimal(value_repr) + + if hms == 0: + # Hour + res.hour = int(value) + if value % 1: + res.minute = int(60*(value % 1)) + + elif hms == 1: + (res.minute, res.second) = self._parse_min_sec(value) + + elif hms == 2: + (res.second, res.microsecond) = self._parsems(value_repr) + + def _could_be_tzname(self, hour, tzname, tzoffset, token): + return (hour is not None and + tzname is None and + tzoffset is None and + len(token) <= 5 and + (all(x in string.ascii_uppercase for x in token) + or token in self.info.UTCZONE)) + + def _ampm_valid(self, hour, ampm, fuzzy): + """ + For fuzzy parsing, 'a' or 'am' (both valid English words) + may erroneously trigger the AM/PM flag. Deal with that + here. + """ + val_is_ampm = True + + # If there's already an AM/PM flag, this one isn't one. + if fuzzy and ampm is not None: + val_is_ampm = False + + # If AM/PM is found and hour is not, raise a ValueError + if hour is None: + if fuzzy: + val_is_ampm = False + else: + raise ValueError('No hour specified with AM or PM flag.') + elif not 0 <= hour <= 12: + # If AM/PM is found, it's a 12 hour clock, so raise + # an error for invalid range + if fuzzy: + val_is_ampm = False + else: + raise ValueError('Invalid hour specified for 12-hour clock.') + + return val_is_ampm + + def _adjust_ampm(self, hour, ampm): + if hour < 12 and ampm == 1: + hour += 12 + elif hour == 12 and ampm == 0: + hour = 0 + return hour + + def _parse_min_sec(self, value): + # TODO: Every usage of this function sets res.second to the return + # value. Are there any cases where second will be returned as None and + # we *don't* want to set res.second = None? + minute = int(value) + second = None + + sec_remainder = value % 1 + if sec_remainder: + second = int(60 * sec_remainder) + return (minute, second) + + def _parse_hms(self, idx, tokens, info, hms_idx): + # TODO: Is this going to admit a lot of false-positives for when we + # just happen to have digits and "h", "m" or "s" characters in non-date + # text? I guess hex hashes won't have that problem, but there's plenty + # of random junk out there. + if hms_idx is None: + hms = None + new_idx = idx + elif hms_idx > idx: + hms = info.hms(tokens[hms_idx]) + new_idx = hms_idx + else: + # Looking backwards, increment one. + hms = info.hms(tokens[hms_idx]) + 1 + new_idx = idx + + return (new_idx, hms) + + # ------------------------------------------------------------------ + # Handling for individual tokens. These are kept as methods instead + # of functions for the sake of customizability via subclassing. + + def _parsems(self, value): + """Parse a I[.F] seconds value into (seconds, microseconds).""" + if "." not in value: + return int(value), 0 + else: + i, f = value.split(".") + return int(i), int(f.ljust(6, "0")[:6]) + + def _to_decimal(self, val): + try: + decimal_value = Decimal(val) + # See GH 662, edge case, infinite value should not be converted + # via `_to_decimal` + if not decimal_value.is_finite(): + raise ValueError("Converted decimal value is infinite or NaN") + except Exception as e: + msg = "Could not convert %s to decimal" % val + six.raise_from(ValueError(msg), e) + else: + return decimal_value + + # ------------------------------------------------------------------ + # Post-Parsing construction of datetime output. These are kept as + # methods instead of functions for the sake of customizability via + # subclassing. + + def _build_tzinfo(self, tzinfos, tzname, tzoffset): + if callable(tzinfos): + tzdata = tzinfos(tzname, tzoffset) + else: + tzdata = tzinfos.get(tzname) + # handle case where tzinfo is paased an options that returns None + # eg tzinfos = {'BRST' : None} + if isinstance(tzdata, datetime.tzinfo) or tzdata is None: + tzinfo = tzdata + elif isinstance(tzdata, text_type): + tzinfo = tz.tzstr(tzdata) + elif isinstance(tzdata, integer_types): + tzinfo = tz.tzoffset(tzname, tzdata) + else: + raise TypeError("Offset must be tzinfo subclass, tz string, " + "or int offset.") + return tzinfo + + def _build_tzaware(self, naive, res, tzinfos): + if (callable(tzinfos) or (tzinfos and res.tzname in tzinfos)): + tzinfo = self._build_tzinfo(tzinfos, res.tzname, res.tzoffset) + aware = naive.replace(tzinfo=tzinfo) + aware = self._assign_tzname(aware, res.tzname) + + elif res.tzname and res.tzname in time.tzname: + aware = naive.replace(tzinfo=tz.tzlocal()) + + # Handle ambiguous local datetime + aware = self._assign_tzname(aware, res.tzname) + + # This is mostly relevant for winter GMT zones parsed in the UK + if (aware.tzname() != res.tzname and + res.tzname in self.info.UTCZONE): + aware = aware.replace(tzinfo=tz.UTC) + + elif res.tzoffset == 0: + aware = naive.replace(tzinfo=tz.UTC) + + elif res.tzoffset: + aware = naive.replace(tzinfo=tz.tzoffset(res.tzname, res.tzoffset)) + + elif not res.tzname and not res.tzoffset: + # i.e. no timezone information was found. + aware = naive + + elif res.tzname: + # tz-like string was parsed but we don't know what to do + # with it + warnings.warn("tzname {tzname} identified but not understood. " + "Pass `tzinfos` argument in order to correctly " + "return a timezone-aware datetime. In a future " + "version, this will raise an " + "exception.".format(tzname=res.tzname), + category=UnknownTimezoneWarning) + aware = naive + + return aware + + def _build_naive(self, res, default): + repl = {} + for attr in ("year", "month", "day", "hour", + "minute", "second", "microsecond"): + value = getattr(res, attr) + if value is not None: + repl[attr] = value + + if 'day' not in repl: + # If the default day exceeds the last day of the month, fall back + # to the end of the month. + cyear = default.year if res.year is None else res.year + cmonth = default.month if res.month is None else res.month + cday = default.day if res.day is None else res.day + + if cday > monthrange(cyear, cmonth)[1]: + repl['day'] = monthrange(cyear, cmonth)[1] + + naive = default.replace(**repl) + + if res.weekday is not None and not res.day: + naive = naive + relativedelta.relativedelta(weekday=res.weekday) + + return naive + + def _assign_tzname(self, dt, tzname): + if dt.tzname() != tzname: + new_dt = tz.enfold(dt, fold=1) + if new_dt.tzname() == tzname: + return new_dt + + return dt + + def _recombine_skipped(self, tokens, skipped_idxs): + """ + >>> tokens = ["foo", " ", "bar", " ", "19June2000", "baz"] + >>> skipped_idxs = [0, 1, 2, 5] + >>> _recombine_skipped(tokens, skipped_idxs) + ["foo bar", "baz"] + """ + skipped_tokens = [] + for i, idx in enumerate(sorted(skipped_idxs)): + if i > 0 and idx - 1 == skipped_idxs[i - 1]: + skipped_tokens[-1] = skipped_tokens[-1] + tokens[idx] + else: + skipped_tokens.append(tokens[idx]) + + return skipped_tokens + + +DEFAULTPARSER = parser() + + +def parse(timestr, parserinfo=None, **kwargs): + """ + + Parse a string in one of the supported formats, using the + ``parserinfo`` parameters. + + :param timestr: + A string containing a date/time stamp. + + :param parserinfo: + A :class:`parserinfo` object containing parameters for the parser. + If ``None``, the default arguments to the :class:`parserinfo` + constructor are used. + + The ``**kwargs`` parameter takes the following keyword arguments: + + :param default: + The default datetime object, if this is a datetime object and not + ``None``, elements specified in ``timestr`` replace elements in the + default object. + + :param ignoretz: + If set ``True``, time zones in parsed strings are ignored and a naive + :class:`datetime` object is returned. + + :param tzinfos: + Additional time zone names / aliases which may be present in the + string. This argument maps time zone names (and optionally offsets + from those time zones) to time zones. This parameter can be a + dictionary with timezone aliases mapping time zone names to time + zones or a function taking two parameters (``tzname`` and + ``tzoffset``) and returning a time zone. + + The timezones to which the names are mapped can be an integer + offset from UTC in seconds or a :class:`tzinfo` object. + + .. doctest:: + :options: +NORMALIZE_WHITESPACE + + >>> from dateutil.parser import parse + >>> from dateutil.tz import gettz + >>> tzinfos = {"BRST": -7200, "CST": gettz("America/Chicago")} + >>> parse("2012-01-19 17:21:00 BRST", tzinfos=tzinfos) + datetime.datetime(2012, 1, 19, 17, 21, tzinfo=tzoffset(u'BRST', -7200)) + >>> parse("2012-01-19 17:21:00 CST", tzinfos=tzinfos) + datetime.datetime(2012, 1, 19, 17, 21, + tzinfo=tzfile('/usr/share/zoneinfo/America/Chicago')) + + This parameter is ignored if ``ignoretz`` is set. + + :param dayfirst: + Whether to interpret the first value in an ambiguous 3-integer date + (e.g. 01/05/09) as the day (``True``) or month (``False``). If + ``yearfirst`` is set to ``True``, this distinguishes between YDM and + YMD. If set to ``None``, this value is retrieved from the current + :class:`parserinfo` object (which itself defaults to ``False``). + + :param yearfirst: + Whether to interpret the first value in an ambiguous 3-integer date + (e.g. 01/05/09) as the year. If ``True``, the first number is taken to + be the year, otherwise the last number is taken to be the year. If + this is set to ``None``, the value is retrieved from the current + :class:`parserinfo` object (which itself defaults to ``False``). + + :param fuzzy: + Whether to allow fuzzy parsing, allowing for string like "Today is + January 1, 2047 at 8:21:00AM". + + :param fuzzy_with_tokens: + If ``True``, ``fuzzy`` is automatically set to True, and the parser + will return a tuple where the first element is the parsed + :class:`datetime.datetime` datetimestamp and the second element is + a tuple containing the portions of the string which were ignored: + + .. doctest:: + + >>> from dateutil.parser import parse + >>> parse("Today is January 1, 2047 at 8:21:00AM", fuzzy_with_tokens=True) + (datetime.datetime(2047, 1, 1, 8, 21), (u'Today is ', u' ', u'at ')) + + :return: + Returns a :class:`datetime.datetime` object or, if the + ``fuzzy_with_tokens`` option is ``True``, returns a tuple, the + first element being a :class:`datetime.datetime` object, the second + a tuple containing the fuzzy tokens. + + :raises ParserError: + Raised for invalid or unknown string formats, if the provided + :class:`tzinfo` is not in a valid format, or if an invalid date would + be created. + + :raises OverflowError: + Raised if the parsed date exceeds the largest valid C integer on + your system. + """ + if parserinfo: + return parser(parserinfo).parse(timestr, **kwargs) + else: + return DEFAULTPARSER.parse(timestr, **kwargs) + + +class _tzparser(object): + + class _result(_resultbase): + + __slots__ = ["stdabbr", "stdoffset", "dstabbr", "dstoffset", + "start", "end"] + + class _attr(_resultbase): + __slots__ = ["month", "week", "weekday", + "yday", "jyday", "day", "time"] + + def __repr__(self): + return self._repr("") + + def __init__(self): + _resultbase.__init__(self) + self.start = self._attr() + self.end = self._attr() + + def parse(self, tzstr): + res = self._result() + l = [x for x in re.split(r'([,:.]|[a-zA-Z]+|[0-9]+)',tzstr) if x] + used_idxs = list() + try: + + len_l = len(l) + + i = 0 + while i < len_l: + # BRST+3[BRDT[+2]] + j = i + while j < len_l and not [x for x in l[j] + if x in "0123456789:,-+"]: + j += 1 + if j != i: + if not res.stdabbr: + offattr = "stdoffset" + res.stdabbr = "".join(l[i:j]) + else: + offattr = "dstoffset" + res.dstabbr = "".join(l[i:j]) + + for ii in range(j): + used_idxs.append(ii) + i = j + if (i < len_l and (l[i] in ('+', '-') or l[i][0] in + "0123456789")): + if l[i] in ('+', '-'): + # Yes, that's right. See the TZ variable + # documentation. + signal = (1, -1)[l[i] == '+'] + used_idxs.append(i) + i += 1 + else: + signal = -1 + len_li = len(l[i]) + if len_li == 4: + # -0300 + setattr(res, offattr, (int(l[i][:2]) * 3600 + + int(l[i][2:]) * 60) * signal) + elif i + 1 < len_l and l[i + 1] == ':': + # -03:00 + setattr(res, offattr, + (int(l[i]) * 3600 + + int(l[i + 2]) * 60) * signal) + used_idxs.append(i) + i += 2 + elif len_li <= 2: + # -[0]3 + setattr(res, offattr, + int(l[i][:2]) * 3600 * signal) + else: + return None + used_idxs.append(i) + i += 1 + if res.dstabbr: + break + else: + break + + + if i < len_l: + for j in range(i, len_l): + if l[j] == ';': + l[j] = ',' + + assert l[i] == ',' + + i += 1 + + if i >= len_l: + pass + elif (8 <= l.count(',') <= 9 and + not [y for x in l[i:] if x != ',' + for y in x if y not in "0123456789+-"]): + # GMT0BST,3,0,30,3600,10,0,26,7200[,3600] + for x in (res.start, res.end): + x.month = int(l[i]) + used_idxs.append(i) + i += 2 + if l[i] == '-': + value = int(l[i + 1]) * -1 + used_idxs.append(i) + i += 1 + else: + value = int(l[i]) + used_idxs.append(i) + i += 2 + if value: + x.week = value + x.weekday = (int(l[i]) - 1) % 7 + else: + x.day = int(l[i]) + used_idxs.append(i) + i += 2 + x.time = int(l[i]) + used_idxs.append(i) + i += 2 + if i < len_l: + if l[i] in ('-', '+'): + signal = (-1, 1)[l[i] == "+"] + used_idxs.append(i) + i += 1 + else: + signal = 1 + used_idxs.append(i) + res.dstoffset = (res.stdoffset + int(l[i]) * signal) + + # This was a made-up format that is not in normal use + warn(('Parsed time zone "%s"' % tzstr) + + 'is in a non-standard dateutil-specific format, which ' + + 'is now deprecated; support for parsing this format ' + + 'will be removed in future versions. It is recommended ' + + 'that you switch to a standard format like the GNU ' + + 'TZ variable format.', tz.DeprecatedTzFormatWarning) + elif (l.count(',') == 2 and l[i:].count('/') <= 2 and + not [y for x in l[i:] if x not in (',', '/', 'J', 'M', + '.', '-', ':') + for y in x if y not in "0123456789"]): + for x in (res.start, res.end): + if l[i] == 'J': + # non-leap year day (1 based) + used_idxs.append(i) + i += 1 + x.jyday = int(l[i]) + elif l[i] == 'M': + # month[-.]week[-.]weekday + used_idxs.append(i) + i += 1 + x.month = int(l[i]) + used_idxs.append(i) + i += 1 + assert l[i] in ('-', '.') + used_idxs.append(i) + i += 1 + x.week = int(l[i]) + if x.week == 5: + x.week = -1 + used_idxs.append(i) + i += 1 + assert l[i] in ('-', '.') + used_idxs.append(i) + i += 1 + x.weekday = (int(l[i]) - 1) % 7 + else: + # year day (zero based) + x.yday = int(l[i]) + 1 + + used_idxs.append(i) + i += 1 + + if i < len_l and l[i] == '/': + used_idxs.append(i) + i += 1 + # start time + len_li = len(l[i]) + if len_li == 4: + # -0300 + x.time = (int(l[i][:2]) * 3600 + + int(l[i][2:]) * 60) + elif i + 1 < len_l and l[i + 1] == ':': + # -03:00 + x.time = int(l[i]) * 3600 + int(l[i + 2]) * 60 + used_idxs.append(i) + i += 2 + if i + 1 < len_l and l[i + 1] == ':': + used_idxs.append(i) + i += 2 + x.time += int(l[i]) + elif len_li <= 2: + # -[0]3 + x.time = (int(l[i][:2]) * 3600) + else: + return None + used_idxs.append(i) + i += 1 + + assert i == len_l or l[i] == ',' + + i += 1 + + assert i >= len_l + + except (IndexError, ValueError, AssertionError): + return None + + unused_idxs = set(range(len_l)).difference(used_idxs) + res.any_unused_tokens = not {l[n] for n in unused_idxs}.issubset({",",":"}) + return res + + +DEFAULTTZPARSER = _tzparser() + + +def _parsetz(tzstr): + return DEFAULTTZPARSER.parse(tzstr) + + +class ParserError(ValueError): + """Exception subclass used for any failure to parse a datetime string. + + This is a subclass of :py:exc:`ValueError`, and should be raised any time + earlier versions of ``dateutil`` would have raised ``ValueError``. + + .. versionadded:: 2.8.1 + """ + def __str__(self): + try: + return self.args[0] % self.args[1:] + except (TypeError, IndexError): + return super(ParserError, self).__str__() + + def __repr__(self): + args = ", ".join("'%s'" % arg for arg in self.args) + return "%s(%s)" % (self.__class__.__name__, args) + + +class UnknownTimezoneWarning(RuntimeWarning): + """Raised when the parser finds a timezone it cannot parse into a tzinfo. + + .. versionadded:: 2.7.0 + """ +# vim:ts=4:sw=4:et diff --git a/venv/lib/python3.12/site-packages/dateutil/parser/isoparser.py b/venv/lib/python3.12/site-packages/dateutil/parser/isoparser.py new file mode 100644 index 0000000000000000000000000000000000000000..7060087df4776a07347cbb60127a70db393e3a65 --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/parser/isoparser.py @@ -0,0 +1,416 @@ +# -*- coding: utf-8 -*- +""" +This module offers a parser for ISO-8601 strings + +It is intended to support all valid date, time and datetime formats per the +ISO-8601 specification. + +..versionadded:: 2.7.0 +""" +from datetime import datetime, timedelta, time, date +import calendar +from dateutil import tz + +from functools import wraps + +import re +import six + +__all__ = ["isoparse", "isoparser"] + + +def _takes_ascii(f): + @wraps(f) + def func(self, str_in, *args, **kwargs): + # If it's a stream, read the whole thing + str_in = getattr(str_in, 'read', lambda: str_in)() + + # If it's unicode, turn it into bytes, since ISO-8601 only covers ASCII + if isinstance(str_in, six.text_type): + # ASCII is the same in UTF-8 + try: + str_in = str_in.encode('ascii') + except UnicodeEncodeError as e: + msg = 'ISO-8601 strings should contain only ASCII characters' + six.raise_from(ValueError(msg), e) + + return f(self, str_in, *args, **kwargs) + + return func + + +class isoparser(object): + def __init__(self, sep=None): + """ + :param sep: + A single character that separates date and time portions. If + ``None``, the parser will accept any single character. + For strict ISO-8601 adherence, pass ``'T'``. + """ + if sep is not None: + if (len(sep) != 1 or ord(sep) >= 128 or sep in '0123456789'): + raise ValueError('Separator must be a single, non-numeric ' + + 'ASCII character') + + sep = sep.encode('ascii') + + self._sep = sep + + @_takes_ascii + def isoparse(self, dt_str): + """ + Parse an ISO-8601 datetime string into a :class:`datetime.datetime`. + + An ISO-8601 datetime string consists of a date portion, followed + optionally by a time portion - the date and time portions are separated + by a single character separator, which is ``T`` in the official + standard. Incomplete date formats (such as ``YYYY-MM``) may *not* be + combined with a time portion. + + Supported date formats are: + + Common: + + - ``YYYY`` + - ``YYYY-MM`` + - ``YYYY-MM-DD`` or ``YYYYMMDD`` + + Uncommon: + + - ``YYYY-Www`` or ``YYYYWww`` - ISO week (day defaults to 0) + - ``YYYY-Www-D`` or ``YYYYWwwD`` - ISO week and day + + The ISO week and day numbering follows the same logic as + :func:`datetime.date.isocalendar`. + + Supported time formats are: + + - ``hh`` + - ``hh:mm`` or ``hhmm`` + - ``hh:mm:ss`` or ``hhmmss`` + - ``hh:mm:ss.ssssss`` (Up to 6 sub-second digits) + + Midnight is a special case for `hh`, as the standard supports both + 00:00 and 24:00 as a representation. The decimal separator can be + either a dot or a comma. + + + .. caution:: + + Support for fractional components other than seconds is part of the + ISO-8601 standard, but is not currently implemented in this parser. + + Supported time zone offset formats are: + + - `Z` (UTC) + - `±HH:MM` + - `±HHMM` + - `±HH` + + Offsets will be represented as :class:`dateutil.tz.tzoffset` objects, + with the exception of UTC, which will be represented as + :class:`dateutil.tz.tzutc`. Time zone offsets equivalent to UTC (such + as `+00:00`) will also be represented as :class:`dateutil.tz.tzutc`. + + :param dt_str: + A string or stream containing only an ISO-8601 datetime string + + :return: + Returns a :class:`datetime.datetime` representing the string. + Unspecified components default to their lowest value. + + .. warning:: + + As of version 2.7.0, the strictness of the parser should not be + considered a stable part of the contract. Any valid ISO-8601 string + that parses correctly with the default settings will continue to + parse correctly in future versions, but invalid strings that + currently fail (e.g. ``2017-01-01T00:00+00:00:00``) are not + guaranteed to continue failing in future versions if they encode + a valid date. + + .. versionadded:: 2.7.0 + """ + components, pos = self._parse_isodate(dt_str) + + if len(dt_str) > pos: + if self._sep is None or dt_str[pos:pos + 1] == self._sep: + components += self._parse_isotime(dt_str[pos + 1:]) + else: + raise ValueError('String contains unknown ISO components') + + if len(components) > 3 and components[3] == 24: + components[3] = 0 + return datetime(*components) + timedelta(days=1) + + return datetime(*components) + + @_takes_ascii + def parse_isodate(self, datestr): + """ + Parse the date portion of an ISO string. + + :param datestr: + The string portion of an ISO string, without a separator + + :return: + Returns a :class:`datetime.date` object + """ + components, pos = self._parse_isodate(datestr) + if pos < len(datestr): + raise ValueError('String contains unknown ISO ' + + 'components: {!r}'.format(datestr.decode('ascii'))) + return date(*components) + + @_takes_ascii + def parse_isotime(self, timestr): + """ + Parse the time portion of an ISO string. + + :param timestr: + The time portion of an ISO string, without a separator + + :return: + Returns a :class:`datetime.time` object + """ + components = self._parse_isotime(timestr) + if components[0] == 24: + components[0] = 0 + return time(*components) + + @_takes_ascii + def parse_tzstr(self, tzstr, zero_as_utc=True): + """ + Parse a valid ISO time zone string. + + See :func:`isoparser.isoparse` for details on supported formats. + + :param tzstr: + A string representing an ISO time zone offset + + :param zero_as_utc: + Whether to return :class:`dateutil.tz.tzutc` for zero-offset zones + + :return: + Returns :class:`dateutil.tz.tzoffset` for offsets and + :class:`dateutil.tz.tzutc` for ``Z`` and (if ``zero_as_utc`` is + specified) offsets equivalent to UTC. + """ + return self._parse_tzstr(tzstr, zero_as_utc=zero_as_utc) + + # Constants + _DATE_SEP = b'-' + _TIME_SEP = b':' + _FRACTION_REGEX = re.compile(b'[\\.,]([0-9]+)') + + def _parse_isodate(self, dt_str): + try: + return self._parse_isodate_common(dt_str) + except ValueError: + return self._parse_isodate_uncommon(dt_str) + + def _parse_isodate_common(self, dt_str): + len_str = len(dt_str) + components = [1, 1, 1] + + if len_str < 4: + raise ValueError('ISO string too short') + + # Year + components[0] = int(dt_str[0:4]) + pos = 4 + if pos >= len_str: + return components, pos + + has_sep = dt_str[pos:pos + 1] == self._DATE_SEP + if has_sep: + pos += 1 + + # Month + if len_str - pos < 2: + raise ValueError('Invalid common month') + + components[1] = int(dt_str[pos:pos + 2]) + pos += 2 + + if pos >= len_str: + if has_sep: + return components, pos + else: + raise ValueError('Invalid ISO format') + + if has_sep: + if dt_str[pos:pos + 1] != self._DATE_SEP: + raise ValueError('Invalid separator in ISO string') + pos += 1 + + # Day + if len_str - pos < 2: + raise ValueError('Invalid common day') + components[2] = int(dt_str[pos:pos + 2]) + return components, pos + 2 + + def _parse_isodate_uncommon(self, dt_str): + if len(dt_str) < 4: + raise ValueError('ISO string too short') + + # All ISO formats start with the year + year = int(dt_str[0:4]) + + has_sep = dt_str[4:5] == self._DATE_SEP + + pos = 4 + has_sep # Skip '-' if it's there + if dt_str[pos:pos + 1] == b'W': + # YYYY-?Www-?D? + pos += 1 + weekno = int(dt_str[pos:pos + 2]) + pos += 2 + + dayno = 1 + if len(dt_str) > pos: + if (dt_str[pos:pos + 1] == self._DATE_SEP) != has_sep: + raise ValueError('Inconsistent use of dash separator') + + pos += has_sep + + dayno = int(dt_str[pos:pos + 1]) + pos += 1 + + base_date = self._calculate_weekdate(year, weekno, dayno) + else: + # YYYYDDD or YYYY-DDD + if len(dt_str) - pos < 3: + raise ValueError('Invalid ordinal day') + + ordinal_day = int(dt_str[pos:pos + 3]) + pos += 3 + + if ordinal_day < 1 or ordinal_day > (365 + calendar.isleap(year)): + raise ValueError('Invalid ordinal day' + + ' {} for year {}'.format(ordinal_day, year)) + + base_date = date(year, 1, 1) + timedelta(days=ordinal_day - 1) + + components = [base_date.year, base_date.month, base_date.day] + return components, pos + + def _calculate_weekdate(self, year, week, day): + """ + Calculate the day of corresponding to the ISO year-week-day calendar. + + This function is effectively the inverse of + :func:`datetime.date.isocalendar`. + + :param year: + The year in the ISO calendar + + :param week: + The week in the ISO calendar - range is [1, 53] + + :param day: + The day in the ISO calendar - range is [1 (MON), 7 (SUN)] + + :return: + Returns a :class:`datetime.date` + """ + if not 0 < week < 54: + raise ValueError('Invalid week: {}'.format(week)) + + if not 0 < day < 8: # Range is 1-7 + raise ValueError('Invalid weekday: {}'.format(day)) + + # Get week 1 for the specific year: + jan_4 = date(year, 1, 4) # Week 1 always has January 4th in it + week_1 = jan_4 - timedelta(days=jan_4.isocalendar()[2] - 1) + + # Now add the specific number of weeks and days to get what we want + week_offset = (week - 1) * 7 + (day - 1) + return week_1 + timedelta(days=week_offset) + + def _parse_isotime(self, timestr): + len_str = len(timestr) + components = [0, 0, 0, 0, None] + pos = 0 + comp = -1 + + if len_str < 2: + raise ValueError('ISO time too short') + + has_sep = False + + while pos < len_str and comp < 5: + comp += 1 + + if timestr[pos:pos + 1] in b'-+Zz': + # Detect time zone boundary + components[-1] = self._parse_tzstr(timestr[pos:]) + pos = len_str + break + + if comp == 1 and timestr[pos:pos+1] == self._TIME_SEP: + has_sep = True + pos += 1 + elif comp == 2 and has_sep: + if timestr[pos:pos+1] != self._TIME_SEP: + raise ValueError('Inconsistent use of colon separator') + pos += 1 + + if comp < 3: + # Hour, minute, second + components[comp] = int(timestr[pos:pos + 2]) + pos += 2 + + if comp == 3: + # Fraction of a second + frac = self._FRACTION_REGEX.match(timestr[pos:]) + if not frac: + continue + + us_str = frac.group(1)[:6] # Truncate to microseconds + components[comp] = int(us_str) * 10**(6 - len(us_str)) + pos += len(frac.group()) + + if pos < len_str: + raise ValueError('Unused components in ISO string') + + if components[0] == 24: + # Standard supports 00:00 and 24:00 as representations of midnight + if any(component != 0 for component in components[1:4]): + raise ValueError('Hour may only be 24 at 24:00:00.000') + + return components + + def _parse_tzstr(self, tzstr, zero_as_utc=True): + if tzstr == b'Z' or tzstr == b'z': + return tz.UTC + + if len(tzstr) not in {3, 5, 6}: + raise ValueError('Time zone offset must be 1, 3, 5 or 6 characters') + + if tzstr[0:1] == b'-': + mult = -1 + elif tzstr[0:1] == b'+': + mult = 1 + else: + raise ValueError('Time zone offset requires sign') + + hours = int(tzstr[1:3]) + if len(tzstr) == 3: + minutes = 0 + else: + minutes = int(tzstr[(4 if tzstr[3:4] == self._TIME_SEP else 3):]) + + if zero_as_utc and hours == 0 and minutes == 0: + return tz.UTC + else: + if minutes > 59: + raise ValueError('Invalid minutes in time zone offset') + + if hours > 23: + raise ValueError('Invalid hours in time zone offset') + + return tz.tzoffset(None, mult * (hours * 60 + minutes) * 60) + + +DEFAULT_ISOPARSER = isoparser() +isoparse = DEFAULT_ISOPARSER.isoparse diff --git a/venv/lib/python3.12/site-packages/dateutil/relativedelta.py b/venv/lib/python3.12/site-packages/dateutil/relativedelta.py new file mode 100644 index 0000000000000000000000000000000000000000..cd323a549e0f182541ebcde2d2ea1adfbbd9701e --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/relativedelta.py @@ -0,0 +1,599 @@ +# -*- coding: utf-8 -*- +import datetime +import calendar + +import operator +from math import copysign + +from six import integer_types +from warnings import warn + +from ._common import weekday + +MO, TU, WE, TH, FR, SA, SU = weekdays = tuple(weekday(x) for x in range(7)) + +__all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"] + + +class relativedelta(object): + """ + The relativedelta type is designed to be applied to an existing datetime and + can replace specific components of that datetime, or represents an interval + of time. + + It is based on the specification of the excellent work done by M.-A. Lemburg + in his + `mx.DateTime `_ extension. + However, notice that this type does *NOT* implement the same algorithm as + his work. Do *NOT* expect it to behave like mx.DateTime's counterpart. + + There are two different ways to build a relativedelta instance. The + first one is passing it two date/datetime classes:: + + relativedelta(datetime1, datetime2) + + The second one is passing it any number of the following keyword arguments:: + + relativedelta(arg1=x,arg2=y,arg3=z...) + + year, month, day, hour, minute, second, microsecond: + Absolute information (argument is singular); adding or subtracting a + relativedelta with absolute information does not perform an arithmetic + operation, but rather REPLACES the corresponding value in the + original datetime with the value(s) in relativedelta. + + years, months, weeks, days, hours, minutes, seconds, microseconds: + Relative information, may be negative (argument is plural); adding + or subtracting a relativedelta with relative information performs + the corresponding arithmetic operation on the original datetime value + with the information in the relativedelta. + + weekday: + One of the weekday instances (MO, TU, etc) available in the + relativedelta module. These instances may receive a parameter N, + specifying the Nth weekday, which could be positive or negative + (like MO(+1) or MO(-2)). Not specifying it is the same as specifying + +1. You can also use an integer, where 0=MO. This argument is always + relative e.g. if the calculated date is already Monday, using MO(1) + or MO(-1) won't change the day. To effectively make it absolute, use + it in combination with the day argument (e.g. day=1, MO(1) for first + Monday of the month). + + leapdays: + Will add given days to the date found, if year is a leap + year, and the date found is post 28 of february. + + yearday, nlyearday: + Set the yearday or the non-leap year day (jump leap days). + These are converted to day/month/leapdays information. + + There are relative and absolute forms of the keyword + arguments. The plural is relative, and the singular is + absolute. For each argument in the order below, the absolute form + is applied first (by setting each attribute to that value) and + then the relative form (by adding the value to the attribute). + + The order of attributes considered when this relativedelta is + added to a datetime is: + + 1. Year + 2. Month + 3. Day + 4. Hours + 5. Minutes + 6. Seconds + 7. Microseconds + + Finally, weekday is applied, using the rule described above. + + For example + + >>> from datetime import datetime + >>> from dateutil.relativedelta import relativedelta, MO + >>> dt = datetime(2018, 4, 9, 13, 37, 0) + >>> delta = relativedelta(hours=25, day=1, weekday=MO(1)) + >>> dt + delta + datetime.datetime(2018, 4, 2, 14, 37) + + First, the day is set to 1 (the first of the month), then 25 hours + are added, to get to the 2nd day and 14th hour, finally the + weekday is applied, but since the 2nd is already a Monday there is + no effect. + + """ + + def __init__(self, dt1=None, dt2=None, + years=0, months=0, days=0, leapdays=0, weeks=0, + hours=0, minutes=0, seconds=0, microseconds=0, + year=None, month=None, day=None, weekday=None, + yearday=None, nlyearday=None, + hour=None, minute=None, second=None, microsecond=None): + + if dt1 and dt2: + # datetime is a subclass of date. So both must be date + if not (isinstance(dt1, datetime.date) and + isinstance(dt2, datetime.date)): + raise TypeError("relativedelta only diffs datetime/date") + + # We allow two dates, or two datetimes, so we coerce them to be + # of the same type + if (isinstance(dt1, datetime.datetime) != + isinstance(dt2, datetime.datetime)): + if not isinstance(dt1, datetime.datetime): + dt1 = datetime.datetime.fromordinal(dt1.toordinal()) + elif not isinstance(dt2, datetime.datetime): + dt2 = datetime.datetime.fromordinal(dt2.toordinal()) + + self.years = 0 + self.months = 0 + self.days = 0 + self.leapdays = 0 + self.hours = 0 + self.minutes = 0 + self.seconds = 0 + self.microseconds = 0 + self.year = None + self.month = None + self.day = None + self.weekday = None + self.hour = None + self.minute = None + self.second = None + self.microsecond = None + self._has_time = 0 + + # Get year / month delta between the two + months = (dt1.year - dt2.year) * 12 + (dt1.month - dt2.month) + self._set_months(months) + + # Remove the year/month delta so the timedelta is just well-defined + # time units (seconds, days and microseconds) + dtm = self.__radd__(dt2) + + # If we've overshot our target, make an adjustment + if dt1 < dt2: + compare = operator.gt + increment = 1 + else: + compare = operator.lt + increment = -1 + + while compare(dt1, dtm): + months += increment + self._set_months(months) + dtm = self.__radd__(dt2) + + # Get the timedelta between the "months-adjusted" date and dt1 + delta = dt1 - dtm + self.seconds = delta.seconds + delta.days * 86400 + self.microseconds = delta.microseconds + else: + # Check for non-integer values in integer-only quantities + if any(x is not None and x != int(x) for x in (years, months)): + raise ValueError("Non-integer years and months are " + "ambiguous and not currently supported.") + + # Relative information + self.years = int(years) + self.months = int(months) + self.days = days + weeks * 7 + self.leapdays = leapdays + self.hours = hours + self.minutes = minutes + self.seconds = seconds + self.microseconds = microseconds + + # Absolute information + self.year = year + self.month = month + self.day = day + self.hour = hour + self.minute = minute + self.second = second + self.microsecond = microsecond + + if any(x is not None and int(x) != x + for x in (year, month, day, hour, + minute, second, microsecond)): + # For now we'll deprecate floats - later it'll be an error. + warn("Non-integer value passed as absolute information. " + + "This is not a well-defined condition and will raise " + + "errors in future versions.", DeprecationWarning) + + if isinstance(weekday, integer_types): + self.weekday = weekdays[weekday] + else: + self.weekday = weekday + + yday = 0 + if nlyearday: + yday = nlyearday + elif yearday: + yday = yearday + if yearday > 59: + self.leapdays = -1 + if yday: + ydayidx = [31, 59, 90, 120, 151, 181, 212, + 243, 273, 304, 334, 366] + for idx, ydays in enumerate(ydayidx): + if yday <= ydays: + self.month = idx+1 + if idx == 0: + self.day = yday + else: + self.day = yday-ydayidx[idx-1] + break + else: + raise ValueError("invalid year day (%d)" % yday) + + self._fix() + + def _fix(self): + if abs(self.microseconds) > 999999: + s = _sign(self.microseconds) + div, mod = divmod(self.microseconds * s, 1000000) + self.microseconds = mod * s + self.seconds += div * s + if abs(self.seconds) > 59: + s = _sign(self.seconds) + div, mod = divmod(self.seconds * s, 60) + self.seconds = mod * s + self.minutes += div * s + if abs(self.minutes) > 59: + s = _sign(self.minutes) + div, mod = divmod(self.minutes * s, 60) + self.minutes = mod * s + self.hours += div * s + if abs(self.hours) > 23: + s = _sign(self.hours) + div, mod = divmod(self.hours * s, 24) + self.hours = mod * s + self.days += div * s + if abs(self.months) > 11: + s = _sign(self.months) + div, mod = divmod(self.months * s, 12) + self.months = mod * s + self.years += div * s + if (self.hours or self.minutes or self.seconds or self.microseconds + or self.hour is not None or self.minute is not None or + self.second is not None or self.microsecond is not None): + self._has_time = 1 + else: + self._has_time = 0 + + @property + def weeks(self): + return int(self.days / 7.0) + + @weeks.setter + def weeks(self, value): + self.days = self.days - (self.weeks * 7) + value * 7 + + def _set_months(self, months): + self.months = months + if abs(self.months) > 11: + s = _sign(self.months) + div, mod = divmod(self.months * s, 12) + self.months = mod * s + self.years = div * s + else: + self.years = 0 + + def normalized(self): + """ + Return a version of this object represented entirely using integer + values for the relative attributes. + + >>> relativedelta(days=1.5, hours=2).normalized() + relativedelta(days=+1, hours=+14) + + :return: + Returns a :class:`dateutil.relativedelta.relativedelta` object. + """ + # Cascade remainders down (rounding each to roughly nearest microsecond) + days = int(self.days) + + hours_f = round(self.hours + 24 * (self.days - days), 11) + hours = int(hours_f) + + minutes_f = round(self.minutes + 60 * (hours_f - hours), 10) + minutes = int(minutes_f) + + seconds_f = round(self.seconds + 60 * (minutes_f - minutes), 8) + seconds = int(seconds_f) + + microseconds = round(self.microseconds + 1e6 * (seconds_f - seconds)) + + # Constructor carries overflow back up with call to _fix() + return self.__class__(years=self.years, months=self.months, + days=days, hours=hours, minutes=minutes, + seconds=seconds, microseconds=microseconds, + leapdays=self.leapdays, year=self.year, + month=self.month, day=self.day, + weekday=self.weekday, hour=self.hour, + minute=self.minute, second=self.second, + microsecond=self.microsecond) + + def __add__(self, other): + if isinstance(other, relativedelta): + return self.__class__(years=other.years + self.years, + months=other.months + self.months, + days=other.days + self.days, + hours=other.hours + self.hours, + minutes=other.minutes + self.minutes, + seconds=other.seconds + self.seconds, + microseconds=(other.microseconds + + self.microseconds), + leapdays=other.leapdays or self.leapdays, + year=(other.year if other.year is not None + else self.year), + month=(other.month if other.month is not None + else self.month), + day=(other.day if other.day is not None + else self.day), + weekday=(other.weekday if other.weekday is not None + else self.weekday), + hour=(other.hour if other.hour is not None + else self.hour), + minute=(other.minute if other.minute is not None + else self.minute), + second=(other.second if other.second is not None + else self.second), + microsecond=(other.microsecond if other.microsecond + is not None else + self.microsecond)) + if isinstance(other, datetime.timedelta): + return self.__class__(years=self.years, + months=self.months, + days=self.days + other.days, + hours=self.hours, + minutes=self.minutes, + seconds=self.seconds + other.seconds, + microseconds=self.microseconds + other.microseconds, + leapdays=self.leapdays, + year=self.year, + month=self.month, + day=self.day, + weekday=self.weekday, + hour=self.hour, + minute=self.minute, + second=self.second, + microsecond=self.microsecond) + if not isinstance(other, datetime.date): + return NotImplemented + elif self._has_time and not isinstance(other, datetime.datetime): + other = datetime.datetime.fromordinal(other.toordinal()) + year = (self.year or other.year)+self.years + month = self.month or other.month + if self.months: + assert 1 <= abs(self.months) <= 12 + month += self.months + if month > 12: + year += 1 + month -= 12 + elif month < 1: + year -= 1 + month += 12 + day = min(calendar.monthrange(year, month)[1], + self.day or other.day) + repl = {"year": year, "month": month, "day": day} + for attr in ["hour", "minute", "second", "microsecond"]: + value = getattr(self, attr) + if value is not None: + repl[attr] = value + days = self.days + if self.leapdays and month > 2 and calendar.isleap(year): + days += self.leapdays + ret = (other.replace(**repl) + + datetime.timedelta(days=days, + hours=self.hours, + minutes=self.minutes, + seconds=self.seconds, + microseconds=self.microseconds)) + if self.weekday: + weekday, nth = self.weekday.weekday, self.weekday.n or 1 + jumpdays = (abs(nth) - 1) * 7 + if nth > 0: + jumpdays += (7 - ret.weekday() + weekday) % 7 + else: + jumpdays += (ret.weekday() - weekday) % 7 + jumpdays *= -1 + ret += datetime.timedelta(days=jumpdays) + return ret + + def __radd__(self, other): + return self.__add__(other) + + def __rsub__(self, other): + return self.__neg__().__radd__(other) + + def __sub__(self, other): + if not isinstance(other, relativedelta): + return NotImplemented # In case the other object defines __rsub__ + return self.__class__(years=self.years - other.years, + months=self.months - other.months, + days=self.days - other.days, + hours=self.hours - other.hours, + minutes=self.minutes - other.minutes, + seconds=self.seconds - other.seconds, + microseconds=self.microseconds - other.microseconds, + leapdays=self.leapdays or other.leapdays, + year=(self.year if self.year is not None + else other.year), + month=(self.month if self.month is not None else + other.month), + day=(self.day if self.day is not None else + other.day), + weekday=(self.weekday if self.weekday is not None else + other.weekday), + hour=(self.hour if self.hour is not None else + other.hour), + minute=(self.minute if self.minute is not None else + other.minute), + second=(self.second if self.second is not None else + other.second), + microsecond=(self.microsecond if self.microsecond + is not None else + other.microsecond)) + + def __abs__(self): + return self.__class__(years=abs(self.years), + months=abs(self.months), + days=abs(self.days), + hours=abs(self.hours), + minutes=abs(self.minutes), + seconds=abs(self.seconds), + microseconds=abs(self.microseconds), + leapdays=self.leapdays, + year=self.year, + month=self.month, + day=self.day, + weekday=self.weekday, + hour=self.hour, + minute=self.minute, + second=self.second, + microsecond=self.microsecond) + + def __neg__(self): + return self.__class__(years=-self.years, + months=-self.months, + days=-self.days, + hours=-self.hours, + minutes=-self.minutes, + seconds=-self.seconds, + microseconds=-self.microseconds, + leapdays=self.leapdays, + year=self.year, + month=self.month, + day=self.day, + weekday=self.weekday, + hour=self.hour, + minute=self.minute, + second=self.second, + microsecond=self.microsecond) + + def __bool__(self): + return not (not self.years and + not self.months and + not self.days and + not self.hours and + not self.minutes and + not self.seconds and + not self.microseconds and + not self.leapdays and + self.year is None and + self.month is None and + self.day is None and + self.weekday is None and + self.hour is None and + self.minute is None and + self.second is None and + self.microsecond is None) + # Compatibility with Python 2.x + __nonzero__ = __bool__ + + def __mul__(self, other): + try: + f = float(other) + except TypeError: + return NotImplemented + + return self.__class__(years=int(self.years * f), + months=int(self.months * f), + days=int(self.days * f), + hours=int(self.hours * f), + minutes=int(self.minutes * f), + seconds=int(self.seconds * f), + microseconds=int(self.microseconds * f), + leapdays=self.leapdays, + year=self.year, + month=self.month, + day=self.day, + weekday=self.weekday, + hour=self.hour, + minute=self.minute, + second=self.second, + microsecond=self.microsecond) + + __rmul__ = __mul__ + + def __eq__(self, other): + if not isinstance(other, relativedelta): + return NotImplemented + if self.weekday or other.weekday: + if not self.weekday or not other.weekday: + return False + if self.weekday.weekday != other.weekday.weekday: + return False + n1, n2 = self.weekday.n, other.weekday.n + if n1 != n2 and not ((not n1 or n1 == 1) and (not n2 or n2 == 1)): + return False + return (self.years == other.years and + self.months == other.months and + self.days == other.days and + self.hours == other.hours and + self.minutes == other.minutes and + self.seconds == other.seconds and + self.microseconds == other.microseconds and + self.leapdays == other.leapdays and + self.year == other.year and + self.month == other.month and + self.day == other.day and + self.hour == other.hour and + self.minute == other.minute and + self.second == other.second and + self.microsecond == other.microsecond) + + def __hash__(self): + return hash(( + self.weekday, + self.years, + self.months, + self.days, + self.hours, + self.minutes, + self.seconds, + self.microseconds, + self.leapdays, + self.year, + self.month, + self.day, + self.hour, + self.minute, + self.second, + self.microsecond, + )) + + def __ne__(self, other): + return not self.__eq__(other) + + def __div__(self, other): + try: + reciprocal = 1 / float(other) + except TypeError: + return NotImplemented + + return self.__mul__(reciprocal) + + __truediv__ = __div__ + + def __repr__(self): + l = [] + for attr in ["years", "months", "days", "leapdays", + "hours", "minutes", "seconds", "microseconds"]: + value = getattr(self, attr) + if value: + l.append("{attr}={value:+g}".format(attr=attr, value=value)) + for attr in ["year", "month", "day", "weekday", + "hour", "minute", "second", "microsecond"]: + value = getattr(self, attr) + if value is not None: + l.append("{attr}={value}".format(attr=attr, value=repr(value))) + return "{classname}({attrs})".format(classname=self.__class__.__name__, + attrs=", ".join(l)) + + +def _sign(x): + return int(copysign(1, x)) + +# vim:ts=4:sw=4:et diff --git a/venv/lib/python3.12/site-packages/dateutil/rrule.py b/venv/lib/python3.12/site-packages/dateutil/rrule.py new file mode 100644 index 0000000000000000000000000000000000000000..571a0d2bc886a7ea4c06196b2f52e740c2ed6e9f --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/rrule.py @@ -0,0 +1,1737 @@ +# -*- coding: utf-8 -*- +""" +The rrule module offers a small, complete, and very fast, implementation of +the recurrence rules documented in the +`iCalendar RFC `_, +including support for caching of results. +""" +import calendar +import datetime +import heapq +import itertools +import re +import sys +from functools import wraps +# For warning about deprecation of until and count +from warnings import warn + +from six import advance_iterator, integer_types + +from six.moves import _thread, range + +from ._common import weekday as weekdaybase + +try: + from math import gcd +except ImportError: + from fractions import gcd + +__all__ = ["rrule", "rruleset", "rrulestr", + "YEARLY", "MONTHLY", "WEEKLY", "DAILY", + "HOURLY", "MINUTELY", "SECONDLY", + "MO", "TU", "WE", "TH", "FR", "SA", "SU"] + +# Every mask is 7 days longer to handle cross-year weekly periods. +M366MASK = tuple([1]*31+[2]*29+[3]*31+[4]*30+[5]*31+[6]*30 + + [7]*31+[8]*31+[9]*30+[10]*31+[11]*30+[12]*31+[1]*7) +M365MASK = list(M366MASK) +M29, M30, M31 = list(range(1, 30)), list(range(1, 31)), list(range(1, 32)) +MDAY366MASK = tuple(M31+M29+M31+M30+M31+M30+M31+M31+M30+M31+M30+M31+M31[:7]) +MDAY365MASK = list(MDAY366MASK) +M29, M30, M31 = list(range(-29, 0)), list(range(-30, 0)), list(range(-31, 0)) +NMDAY366MASK = tuple(M31+M29+M31+M30+M31+M30+M31+M31+M30+M31+M30+M31+M31[:7]) +NMDAY365MASK = list(NMDAY366MASK) +M366RANGE = (0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366) +M365RANGE = (0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365) +WDAYMASK = [0, 1, 2, 3, 4, 5, 6]*55 +del M29, M30, M31, M365MASK[59], MDAY365MASK[59], NMDAY365MASK[31] +MDAY365MASK = tuple(MDAY365MASK) +M365MASK = tuple(M365MASK) + +FREQNAMES = ['YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY', 'HOURLY', 'MINUTELY', 'SECONDLY'] + +(YEARLY, + MONTHLY, + WEEKLY, + DAILY, + HOURLY, + MINUTELY, + SECONDLY) = list(range(7)) + +# Imported on demand. +easter = None +parser = None + + +class weekday(weekdaybase): + """ + This version of weekday does not allow n = 0. + """ + def __init__(self, wkday, n=None): + if n == 0: + raise ValueError("Can't create weekday with n==0") + + super(weekday, self).__init__(wkday, n) + + +MO, TU, WE, TH, FR, SA, SU = weekdays = tuple(weekday(x) for x in range(7)) + + +def _invalidates_cache(f): + """ + Decorator for rruleset methods which may invalidate the + cached length. + """ + @wraps(f) + def inner_func(self, *args, **kwargs): + rv = f(self, *args, **kwargs) + self._invalidate_cache() + return rv + + return inner_func + + +class rrulebase(object): + def __init__(self, cache=False): + if cache: + self._cache = [] + self._cache_lock = _thread.allocate_lock() + self._invalidate_cache() + else: + self._cache = None + self._cache_complete = False + self._len = None + + def __iter__(self): + if self._cache_complete: + return iter(self._cache) + elif self._cache is None: + return self._iter() + else: + return self._iter_cached() + + def _invalidate_cache(self): + if self._cache is not None: + self._cache = [] + self._cache_complete = False + self._cache_gen = self._iter() + + if self._cache_lock.locked(): + self._cache_lock.release() + + self._len = None + + def _iter_cached(self): + i = 0 + gen = self._cache_gen + cache = self._cache + acquire = self._cache_lock.acquire + release = self._cache_lock.release + while gen: + if i == len(cache): + acquire() + if self._cache_complete: + break + try: + for j in range(10): + cache.append(advance_iterator(gen)) + except StopIteration: + self._cache_gen = gen = None + self._cache_complete = True + break + release() + yield cache[i] + i += 1 + while i < self._len: + yield cache[i] + i += 1 + + def __getitem__(self, item): + if self._cache_complete: + return self._cache[item] + elif isinstance(item, slice): + if item.step and item.step < 0: + return list(iter(self))[item] + else: + return list(itertools.islice(self, + item.start or 0, + item.stop or sys.maxsize, + item.step or 1)) + elif item >= 0: + gen = iter(self) + try: + for i in range(item+1): + res = advance_iterator(gen) + except StopIteration: + raise IndexError + return res + else: + return list(iter(self))[item] + + def __contains__(self, item): + if self._cache_complete: + return item in self._cache + else: + for i in self: + if i == item: + return True + elif i > item: + return False + return False + + # __len__() introduces a large performance penalty. + def count(self): + """ Returns the number of recurrences in this set. It will have go + through the whole recurrence, if this hasn't been done before. """ + if self._len is None: + for x in self: + pass + return self._len + + def before(self, dt, inc=False): + """ Returns the last recurrence before the given datetime instance. The + inc keyword defines what happens if dt is an occurrence. With + inc=True, if dt itself is an occurrence, it will be returned. """ + if self._cache_complete: + gen = self._cache + else: + gen = self + last = None + if inc: + for i in gen: + if i > dt: + break + last = i + else: + for i in gen: + if i >= dt: + break + last = i + return last + + def after(self, dt, inc=False): + """ Returns the first recurrence after the given datetime instance. The + inc keyword defines what happens if dt is an occurrence. With + inc=True, if dt itself is an occurrence, it will be returned. """ + if self._cache_complete: + gen = self._cache + else: + gen = self + if inc: + for i in gen: + if i >= dt: + return i + else: + for i in gen: + if i > dt: + return i + return None + + def xafter(self, dt, count=None, inc=False): + """ + Generator which yields up to `count` recurrences after the given + datetime instance, equivalent to `after`. + + :param dt: + The datetime at which to start generating recurrences. + + :param count: + The maximum number of recurrences to generate. If `None` (default), + dates are generated until the recurrence rule is exhausted. + + :param inc: + If `dt` is an instance of the rule and `inc` is `True`, it is + included in the output. + + :yields: Yields a sequence of `datetime` objects. + """ + + if self._cache_complete: + gen = self._cache + else: + gen = self + + # Select the comparison function + if inc: + comp = lambda dc, dtc: dc >= dtc + else: + comp = lambda dc, dtc: dc > dtc + + # Generate dates + n = 0 + for d in gen: + if comp(d, dt): + if count is not None: + n += 1 + if n > count: + break + + yield d + + def between(self, after, before, inc=False, count=1): + """ Returns all the occurrences of the rrule between after and before. + The inc keyword defines what happens if after and/or before are + themselves occurrences. With inc=True, they will be included in the + list, if they are found in the recurrence set. """ + if self._cache_complete: + gen = self._cache + else: + gen = self + started = False + l = [] + if inc: + for i in gen: + if i > before: + break + elif not started: + if i >= after: + started = True + l.append(i) + else: + l.append(i) + else: + for i in gen: + if i >= before: + break + elif not started: + if i > after: + started = True + l.append(i) + else: + l.append(i) + return l + + +class rrule(rrulebase): + """ + That's the base of the rrule operation. It accepts all the keywords + defined in the RFC as its constructor parameters (except byday, + which was renamed to byweekday) and more. The constructor prototype is:: + + rrule(freq) + + Where freq must be one of YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, + or SECONDLY. + + .. note:: + Per RFC section 3.3.10, recurrence instances falling on invalid dates + and times are ignored rather than coerced: + + Recurrence rules may generate recurrence instances with an invalid + date (e.g., February 30) or nonexistent local time (e.g., 1:30 AM + on a day where the local time is moved forward by an hour at 1:00 + AM). Such recurrence instances MUST be ignored and MUST NOT be + counted as part of the recurrence set. + + This can lead to possibly surprising behavior when, for example, the + start date occurs at the end of the month: + + >>> from dateutil.rrule import rrule, MONTHLY + >>> from datetime import datetime + >>> start_date = datetime(2014, 12, 31) + >>> list(rrule(freq=MONTHLY, count=4, dtstart=start_date)) + ... # doctest: +NORMALIZE_WHITESPACE + [datetime.datetime(2014, 12, 31, 0, 0), + datetime.datetime(2015, 1, 31, 0, 0), + datetime.datetime(2015, 3, 31, 0, 0), + datetime.datetime(2015, 5, 31, 0, 0)] + + Additionally, it supports the following keyword arguments: + + :param dtstart: + The recurrence start. Besides being the base for the recurrence, + missing parameters in the final recurrence instances will also be + extracted from this date. If not given, datetime.now() will be used + instead. + :param interval: + The interval between each freq iteration. For example, when using + YEARLY, an interval of 2 means once every two years, but with HOURLY, + it means once every two hours. The default interval is 1. + :param wkst: + The week start day. Must be one of the MO, TU, WE constants, or an + integer, specifying the first day of the week. This will affect + recurrences based on weekly periods. The default week start is got + from calendar.firstweekday(), and may be modified by + calendar.setfirstweekday(). + :param count: + If given, this determines how many occurrences will be generated. + + .. note:: + As of version 2.5.0, the use of the keyword ``until`` in conjunction + with ``count`` is deprecated, to make sure ``dateutil`` is fully + compliant with `RFC-5545 Sec. 3.3.10 `_. Therefore, ``until`` and ``count`` + **must not** occur in the same call to ``rrule``. + :param until: + If given, this must be a datetime instance specifying the upper-bound + limit of the recurrence. The last recurrence in the rule is the greatest + datetime that is less than or equal to the value specified in the + ``until`` parameter. + + .. note:: + As of version 2.5.0, the use of the keyword ``until`` in conjunction + with ``count`` is deprecated, to make sure ``dateutil`` is fully + compliant with `RFC-5545 Sec. 3.3.10 `_. Therefore, ``until`` and ``count`` + **must not** occur in the same call to ``rrule``. + :param bysetpos: + If given, it must be either an integer, or a sequence of integers, + positive or negative. Each given integer will specify an occurrence + number, corresponding to the nth occurrence of the rule inside the + frequency period. For example, a bysetpos of -1 if combined with a + MONTHLY frequency, and a byweekday of (MO, TU, WE, TH, FR), will + result in the last work day of every month. + :param bymonth: + If given, it must be either an integer, or a sequence of integers, + meaning the months to apply the recurrence to. + :param bymonthday: + If given, it must be either an integer, or a sequence of integers, + meaning the month days to apply the recurrence to. + :param byyearday: + If given, it must be either an integer, or a sequence of integers, + meaning the year days to apply the recurrence to. + :param byeaster: + If given, it must be either an integer, or a sequence of integers, + positive or negative. Each integer will define an offset from the + Easter Sunday. Passing the offset 0 to byeaster will yield the Easter + Sunday itself. This is an extension to the RFC specification. + :param byweekno: + If given, it must be either an integer, or a sequence of integers, + meaning the week numbers to apply the recurrence to. Week numbers + have the meaning described in ISO8601, that is, the first week of + the year is that containing at least four days of the new year. + :param byweekday: + If given, it must be either an integer (0 == MO), a sequence of + integers, one of the weekday constants (MO, TU, etc), or a sequence + of these constants. When given, these variables will define the + weekdays where the recurrence will be applied. It's also possible to + use an argument n for the weekday instances, which will mean the nth + occurrence of this weekday in the period. For example, with MONTHLY, + or with YEARLY and BYMONTH, using FR(+1) in byweekday will specify the + first friday of the month where the recurrence happens. Notice that in + the RFC documentation, this is specified as BYDAY, but was renamed to + avoid the ambiguity of that keyword. + :param byhour: + If given, it must be either an integer, or a sequence of integers, + meaning the hours to apply the recurrence to. + :param byminute: + If given, it must be either an integer, or a sequence of integers, + meaning the minutes to apply the recurrence to. + :param bysecond: + If given, it must be either an integer, or a sequence of integers, + meaning the seconds to apply the recurrence to. + :param cache: + If given, it must be a boolean value specifying to enable or disable + caching of results. If you will use the same rrule instance multiple + times, enabling caching will improve the performance considerably. + """ + def __init__(self, freq, dtstart=None, + interval=1, wkst=None, count=None, until=None, bysetpos=None, + bymonth=None, bymonthday=None, byyearday=None, byeaster=None, + byweekno=None, byweekday=None, + byhour=None, byminute=None, bysecond=None, + cache=False): + super(rrule, self).__init__(cache) + global easter + if not dtstart: + if until and until.tzinfo: + dtstart = datetime.datetime.now(tz=until.tzinfo).replace(microsecond=0) + else: + dtstart = datetime.datetime.now().replace(microsecond=0) + elif not isinstance(dtstart, datetime.datetime): + dtstart = datetime.datetime.fromordinal(dtstart.toordinal()) + else: + dtstart = dtstart.replace(microsecond=0) + self._dtstart = dtstart + self._tzinfo = dtstart.tzinfo + self._freq = freq + self._interval = interval + self._count = count + + # Cache the original byxxx rules, if they are provided, as the _byxxx + # attributes do not necessarily map to the inputs, and this can be + # a problem in generating the strings. Only store things if they've + # been supplied (the string retrieval will just use .get()) + self._original_rule = {} + + if until and not isinstance(until, datetime.datetime): + until = datetime.datetime.fromordinal(until.toordinal()) + self._until = until + + if self._dtstart and self._until: + if (self._dtstart.tzinfo is not None) != (self._until.tzinfo is not None): + # According to RFC5545 Section 3.3.10: + # https://tools.ietf.org/html/rfc5545#section-3.3.10 + # + # > If the "DTSTART" property is specified as a date with UTC + # > time or a date with local time and time zone reference, + # > then the UNTIL rule part MUST be specified as a date with + # > UTC time. + raise ValueError( + 'RRULE UNTIL values must be specified in UTC when DTSTART ' + 'is timezone-aware' + ) + + if count is not None and until: + warn("Using both 'count' and 'until' is inconsistent with RFC 5545" + " and has been deprecated in dateutil. Future versions will " + "raise an error.", DeprecationWarning) + + if wkst is None: + self._wkst = calendar.firstweekday() + elif isinstance(wkst, integer_types): + self._wkst = wkst + else: + self._wkst = wkst.weekday + + if bysetpos is None: + self._bysetpos = None + elif isinstance(bysetpos, integer_types): + if bysetpos == 0 or not (-366 <= bysetpos <= 366): + raise ValueError("bysetpos must be between 1 and 366, " + "or between -366 and -1") + self._bysetpos = (bysetpos,) + else: + self._bysetpos = tuple(bysetpos) + for pos in self._bysetpos: + if pos == 0 or not (-366 <= pos <= 366): + raise ValueError("bysetpos must be between 1 and 366, " + "or between -366 and -1") + + if self._bysetpos: + self._original_rule['bysetpos'] = self._bysetpos + + if (byweekno is None and byyearday is None and bymonthday is None and + byweekday is None and byeaster is None): + if freq == YEARLY: + if bymonth is None: + bymonth = dtstart.month + self._original_rule['bymonth'] = None + bymonthday = dtstart.day + self._original_rule['bymonthday'] = None + elif freq == MONTHLY: + bymonthday = dtstart.day + self._original_rule['bymonthday'] = None + elif freq == WEEKLY: + byweekday = dtstart.weekday() + self._original_rule['byweekday'] = None + + # bymonth + if bymonth is None: + self._bymonth = None + else: + if isinstance(bymonth, integer_types): + bymonth = (bymonth,) + + self._bymonth = tuple(sorted(set(bymonth))) + + if 'bymonth' not in self._original_rule: + self._original_rule['bymonth'] = self._bymonth + + # byyearday + if byyearday is None: + self._byyearday = None + else: + if isinstance(byyearday, integer_types): + byyearday = (byyearday,) + + self._byyearday = tuple(sorted(set(byyearday))) + self._original_rule['byyearday'] = self._byyearday + + # byeaster + if byeaster is not None: + if not easter: + from dateutil import easter + if isinstance(byeaster, integer_types): + self._byeaster = (byeaster,) + else: + self._byeaster = tuple(sorted(byeaster)) + + self._original_rule['byeaster'] = self._byeaster + else: + self._byeaster = None + + # bymonthday + if bymonthday is None: + self._bymonthday = () + self._bynmonthday = () + else: + if isinstance(bymonthday, integer_types): + bymonthday = (bymonthday,) + + bymonthday = set(bymonthday) # Ensure it's unique + + self._bymonthday = tuple(sorted(x for x in bymonthday if x > 0)) + self._bynmonthday = tuple(sorted(x for x in bymonthday if x < 0)) + + # Storing positive numbers first, then negative numbers + if 'bymonthday' not in self._original_rule: + self._original_rule['bymonthday'] = tuple( + itertools.chain(self._bymonthday, self._bynmonthday)) + + # byweekno + if byweekno is None: + self._byweekno = None + else: + if isinstance(byweekno, integer_types): + byweekno = (byweekno,) + + self._byweekno = tuple(sorted(set(byweekno))) + + self._original_rule['byweekno'] = self._byweekno + + # byweekday / bynweekday + if byweekday is None: + self._byweekday = None + self._bynweekday = None + else: + # If it's one of the valid non-sequence types, convert to a + # single-element sequence before the iterator that builds the + # byweekday set. + if isinstance(byweekday, integer_types) or hasattr(byweekday, "n"): + byweekday = (byweekday,) + + self._byweekday = set() + self._bynweekday = set() + for wday in byweekday: + if isinstance(wday, integer_types): + self._byweekday.add(wday) + elif not wday.n or freq > MONTHLY: + self._byweekday.add(wday.weekday) + else: + self._bynweekday.add((wday.weekday, wday.n)) + + if not self._byweekday: + self._byweekday = None + elif not self._bynweekday: + self._bynweekday = None + + if self._byweekday is not None: + self._byweekday = tuple(sorted(self._byweekday)) + orig_byweekday = [weekday(x) for x in self._byweekday] + else: + orig_byweekday = () + + if self._bynweekday is not None: + self._bynweekday = tuple(sorted(self._bynweekday)) + orig_bynweekday = [weekday(*x) for x in self._bynweekday] + else: + orig_bynweekday = () + + if 'byweekday' not in self._original_rule: + self._original_rule['byweekday'] = tuple(itertools.chain( + orig_byweekday, orig_bynweekday)) + + # byhour + if byhour is None: + if freq < HOURLY: + self._byhour = {dtstart.hour} + else: + self._byhour = None + else: + if isinstance(byhour, integer_types): + byhour = (byhour,) + + if freq == HOURLY: + self._byhour = self.__construct_byset(start=dtstart.hour, + byxxx=byhour, + base=24) + else: + self._byhour = set(byhour) + + self._byhour = tuple(sorted(self._byhour)) + self._original_rule['byhour'] = self._byhour + + # byminute + if byminute is None: + if freq < MINUTELY: + self._byminute = {dtstart.minute} + else: + self._byminute = None + else: + if isinstance(byminute, integer_types): + byminute = (byminute,) + + if freq == MINUTELY: + self._byminute = self.__construct_byset(start=dtstart.minute, + byxxx=byminute, + base=60) + else: + self._byminute = set(byminute) + + self._byminute = tuple(sorted(self._byminute)) + self._original_rule['byminute'] = self._byminute + + # bysecond + if bysecond is None: + if freq < SECONDLY: + self._bysecond = ((dtstart.second,)) + else: + self._bysecond = None + else: + if isinstance(bysecond, integer_types): + bysecond = (bysecond,) + + self._bysecond = set(bysecond) + + if freq == SECONDLY: + self._bysecond = self.__construct_byset(start=dtstart.second, + byxxx=bysecond, + base=60) + else: + self._bysecond = set(bysecond) + + self._bysecond = tuple(sorted(self._bysecond)) + self._original_rule['bysecond'] = self._bysecond + + if self._freq >= HOURLY: + self._timeset = None + else: + self._timeset = [] + for hour in self._byhour: + for minute in self._byminute: + for second in self._bysecond: + self._timeset.append( + datetime.time(hour, minute, second, + tzinfo=self._tzinfo)) + self._timeset.sort() + self._timeset = tuple(self._timeset) + + def __str__(self): + """ + Output a string that would generate this RRULE if passed to rrulestr. + This is mostly compatible with RFC5545, except for the + dateutil-specific extension BYEASTER. + """ + + output = [] + h, m, s = [None] * 3 + if self._dtstart: + output.append(self._dtstart.strftime('DTSTART:%Y%m%dT%H%M%S')) + h, m, s = self._dtstart.timetuple()[3:6] + + parts = ['FREQ=' + FREQNAMES[self._freq]] + if self._interval != 1: + parts.append('INTERVAL=' + str(self._interval)) + + if self._wkst: + parts.append('WKST=' + repr(weekday(self._wkst))[0:2]) + + if self._count is not None: + parts.append('COUNT=' + str(self._count)) + + if self._until: + parts.append(self._until.strftime('UNTIL=%Y%m%dT%H%M%S')) + + if self._original_rule.get('byweekday') is not None: + # The str() method on weekday objects doesn't generate + # RFC5545-compliant strings, so we should modify that. + original_rule = dict(self._original_rule) + wday_strings = [] + for wday in original_rule['byweekday']: + if wday.n: + wday_strings.append('{n:+d}{wday}'.format( + n=wday.n, + wday=repr(wday)[0:2])) + else: + wday_strings.append(repr(wday)) + + original_rule['byweekday'] = wday_strings + else: + original_rule = self._original_rule + + partfmt = '{name}={vals}' + for name, key in [('BYSETPOS', 'bysetpos'), + ('BYMONTH', 'bymonth'), + ('BYMONTHDAY', 'bymonthday'), + ('BYYEARDAY', 'byyearday'), + ('BYWEEKNO', 'byweekno'), + ('BYDAY', 'byweekday'), + ('BYHOUR', 'byhour'), + ('BYMINUTE', 'byminute'), + ('BYSECOND', 'bysecond'), + ('BYEASTER', 'byeaster')]: + value = original_rule.get(key) + if value: + parts.append(partfmt.format(name=name, vals=(','.join(str(v) + for v in value)))) + + output.append('RRULE:' + ';'.join(parts)) + return '\n'.join(output) + + def replace(self, **kwargs): + """Return new rrule with same attributes except for those attributes given new + values by whichever keyword arguments are specified.""" + new_kwargs = {"interval": self._interval, + "count": self._count, + "dtstart": self._dtstart, + "freq": self._freq, + "until": self._until, + "wkst": self._wkst, + "cache": False if self._cache is None else True } + new_kwargs.update(self._original_rule) + new_kwargs.update(kwargs) + return rrule(**new_kwargs) + + def _iter(self): + year, month, day, hour, minute, second, weekday, yearday, _ = \ + self._dtstart.timetuple() + + # Some local variables to speed things up a bit + freq = self._freq + interval = self._interval + wkst = self._wkst + until = self._until + bymonth = self._bymonth + byweekno = self._byweekno + byyearday = self._byyearday + byweekday = self._byweekday + byeaster = self._byeaster + bymonthday = self._bymonthday + bynmonthday = self._bynmonthday + bysetpos = self._bysetpos + byhour = self._byhour + byminute = self._byminute + bysecond = self._bysecond + + ii = _iterinfo(self) + ii.rebuild(year, month) + + getdayset = {YEARLY: ii.ydayset, + MONTHLY: ii.mdayset, + WEEKLY: ii.wdayset, + DAILY: ii.ddayset, + HOURLY: ii.ddayset, + MINUTELY: ii.ddayset, + SECONDLY: ii.ddayset}[freq] + + if freq < HOURLY: + timeset = self._timeset + else: + gettimeset = {HOURLY: ii.htimeset, + MINUTELY: ii.mtimeset, + SECONDLY: ii.stimeset}[freq] + if ((freq >= HOURLY and + self._byhour and hour not in self._byhour) or + (freq >= MINUTELY and + self._byminute and minute not in self._byminute) or + (freq >= SECONDLY and + self._bysecond and second not in self._bysecond)): + timeset = () + else: + timeset = gettimeset(hour, minute, second) + + total = 0 + count = self._count + while True: + # Get dayset with the right frequency + dayset, start, end = getdayset(year, month, day) + + # Do the "hard" work ;-) + filtered = False + for i in dayset[start:end]: + if ((bymonth and ii.mmask[i] not in bymonth) or + (byweekno and not ii.wnomask[i]) or + (byweekday and ii.wdaymask[i] not in byweekday) or + (ii.nwdaymask and not ii.nwdaymask[i]) or + (byeaster and not ii.eastermask[i]) or + ((bymonthday or bynmonthday) and + ii.mdaymask[i] not in bymonthday and + ii.nmdaymask[i] not in bynmonthday) or + (byyearday and + ((i < ii.yearlen and i+1 not in byyearday and + -ii.yearlen+i not in byyearday) or + (i >= ii.yearlen and i+1-ii.yearlen not in byyearday and + -ii.nextyearlen+i-ii.yearlen not in byyearday)))): + dayset[i] = None + filtered = True + + # Output results + if bysetpos and timeset: + poslist = [] + for pos in bysetpos: + if pos < 0: + daypos, timepos = divmod(pos, len(timeset)) + else: + daypos, timepos = divmod(pos-1, len(timeset)) + try: + i = [x for x in dayset[start:end] + if x is not None][daypos] + time = timeset[timepos] + except IndexError: + pass + else: + date = datetime.date.fromordinal(ii.yearordinal+i) + res = datetime.datetime.combine(date, time) + if res not in poslist: + poslist.append(res) + poslist.sort() + for res in poslist: + if until and res > until: + self._len = total + return + elif res >= self._dtstart: + if count is not None: + count -= 1 + if count < 0: + self._len = total + return + total += 1 + yield res + else: + for i in dayset[start:end]: + if i is not None: + date = datetime.date.fromordinal(ii.yearordinal + i) + for time in timeset: + res = datetime.datetime.combine(date, time) + if until and res > until: + self._len = total + return + elif res >= self._dtstart: + if count is not None: + count -= 1 + if count < 0: + self._len = total + return + + total += 1 + yield res + + # Handle frequency and interval + fixday = False + if freq == YEARLY: + year += interval + if year > datetime.MAXYEAR: + self._len = total + return + ii.rebuild(year, month) + elif freq == MONTHLY: + month += interval + if month > 12: + div, mod = divmod(month, 12) + month = mod + year += div + if month == 0: + month = 12 + year -= 1 + if year > datetime.MAXYEAR: + self._len = total + return + ii.rebuild(year, month) + elif freq == WEEKLY: + if wkst > weekday: + day += -(weekday+1+(6-wkst))+self._interval*7 + else: + day += -(weekday-wkst)+self._interval*7 + weekday = wkst + fixday = True + elif freq == DAILY: + day += interval + fixday = True + elif freq == HOURLY: + if filtered: + # Jump to one iteration before next day + hour += ((23-hour)//interval)*interval + + if byhour: + ndays, hour = self.__mod_distance(value=hour, + byxxx=self._byhour, + base=24) + else: + ndays, hour = divmod(hour+interval, 24) + + if ndays: + day += ndays + fixday = True + + timeset = gettimeset(hour, minute, second) + elif freq == MINUTELY: + if filtered: + # Jump to one iteration before next day + minute += ((1439-(hour*60+minute))//interval)*interval + + valid = False + rep_rate = (24*60) + for j in range(rep_rate // gcd(interval, rep_rate)): + if byminute: + nhours, minute = \ + self.__mod_distance(value=minute, + byxxx=self._byminute, + base=60) + else: + nhours, minute = divmod(minute+interval, 60) + + div, hour = divmod(hour+nhours, 24) + if div: + day += div + fixday = True + filtered = False + + if not byhour or hour in byhour: + valid = True + break + + if not valid: + raise ValueError('Invalid combination of interval and ' + + 'byhour resulting in empty rule.') + + timeset = gettimeset(hour, minute, second) + elif freq == SECONDLY: + if filtered: + # Jump to one iteration before next day + second += (((86399 - (hour * 3600 + minute * 60 + second)) + // interval) * interval) + + rep_rate = (24 * 3600) + valid = False + for j in range(0, rep_rate // gcd(interval, rep_rate)): + if bysecond: + nminutes, second = \ + self.__mod_distance(value=second, + byxxx=self._bysecond, + base=60) + else: + nminutes, second = divmod(second+interval, 60) + + div, minute = divmod(minute+nminutes, 60) + if div: + hour += div + div, hour = divmod(hour, 24) + if div: + day += div + fixday = True + + if ((not byhour or hour in byhour) and + (not byminute or minute in byminute) and + (not bysecond or second in bysecond)): + valid = True + break + + if not valid: + raise ValueError('Invalid combination of interval, ' + + 'byhour and byminute resulting in empty' + + ' rule.') + + timeset = gettimeset(hour, minute, second) + + if fixday and day > 28: + daysinmonth = calendar.monthrange(year, month)[1] + if day > daysinmonth: + while day > daysinmonth: + day -= daysinmonth + month += 1 + if month == 13: + month = 1 + year += 1 + if year > datetime.MAXYEAR: + self._len = total + return + daysinmonth = calendar.monthrange(year, month)[1] + ii.rebuild(year, month) + + def __construct_byset(self, start, byxxx, base): + """ + If a `BYXXX` sequence is passed to the constructor at the same level as + `FREQ` (e.g. `FREQ=HOURLY,BYHOUR={2,4,7},INTERVAL=3`), there are some + specifications which cannot be reached given some starting conditions. + + This occurs whenever the interval is not coprime with the base of a + given unit and the difference between the starting position and the + ending position is not coprime with the greatest common denominator + between the interval and the base. For example, with a FREQ of hourly + starting at 17:00 and an interval of 4, the only valid values for + BYHOUR would be {21, 1, 5, 9, 13, 17}, because 4 and 24 are not + coprime. + + :param start: + Specifies the starting position. + :param byxxx: + An iterable containing the list of allowed values. + :param base: + The largest allowable value for the specified frequency (e.g. + 24 hours, 60 minutes). + + This does not preserve the type of the iterable, returning a set, since + the values should be unique and the order is irrelevant, this will + speed up later lookups. + + In the event of an empty set, raises a :exception:`ValueError`, as this + results in an empty rrule. + """ + + cset = set() + + # Support a single byxxx value. + if isinstance(byxxx, integer_types): + byxxx = (byxxx, ) + + for num in byxxx: + i_gcd = gcd(self._interval, base) + # Use divmod rather than % because we need to wrap negative nums. + if i_gcd == 1 or divmod(num - start, i_gcd)[1] == 0: + cset.add(num) + + if len(cset) == 0: + raise ValueError("Invalid rrule byxxx generates an empty set.") + + return cset + + def __mod_distance(self, value, byxxx, base): + """ + Calculates the next value in a sequence where the `FREQ` parameter is + specified along with a `BYXXX` parameter at the same "level" + (e.g. `HOURLY` specified with `BYHOUR`). + + :param value: + The old value of the component. + :param byxxx: + The `BYXXX` set, which should have been generated by + `rrule._construct_byset`, or something else which checks that a + valid rule is present. + :param base: + The largest allowable value for the specified frequency (e.g. + 24 hours, 60 minutes). + + If a valid value is not found after `base` iterations (the maximum + number before the sequence would start to repeat), this raises a + :exception:`ValueError`, as no valid values were found. + + This returns a tuple of `divmod(n*interval, base)`, where `n` is the + smallest number of `interval` repetitions until the next specified + value in `byxxx` is found. + """ + accumulator = 0 + for ii in range(1, base + 1): + # Using divmod() over % to account for negative intervals + div, value = divmod(value + self._interval, base) + accumulator += div + if value in byxxx: + return (accumulator, value) + + +class _iterinfo(object): + __slots__ = ["rrule", "lastyear", "lastmonth", + "yearlen", "nextyearlen", "yearordinal", "yearweekday", + "mmask", "mrange", "mdaymask", "nmdaymask", + "wdaymask", "wnomask", "nwdaymask", "eastermask"] + + def __init__(self, rrule): + for attr in self.__slots__: + setattr(self, attr, None) + self.rrule = rrule + + def rebuild(self, year, month): + # Every mask is 7 days longer to handle cross-year weekly periods. + rr = self.rrule + if year != self.lastyear: + self.yearlen = 365 + calendar.isleap(year) + self.nextyearlen = 365 + calendar.isleap(year + 1) + firstyday = datetime.date(year, 1, 1) + self.yearordinal = firstyday.toordinal() + self.yearweekday = firstyday.weekday() + + wday = datetime.date(year, 1, 1).weekday() + if self.yearlen == 365: + self.mmask = M365MASK + self.mdaymask = MDAY365MASK + self.nmdaymask = NMDAY365MASK + self.wdaymask = WDAYMASK[wday:] + self.mrange = M365RANGE + else: + self.mmask = M366MASK + self.mdaymask = MDAY366MASK + self.nmdaymask = NMDAY366MASK + self.wdaymask = WDAYMASK[wday:] + self.mrange = M366RANGE + + if not rr._byweekno: + self.wnomask = None + else: + self.wnomask = [0]*(self.yearlen+7) + # no1wkst = firstwkst = self.wdaymask.index(rr._wkst) + no1wkst = firstwkst = (7-self.yearweekday+rr._wkst) % 7 + if no1wkst >= 4: + no1wkst = 0 + # Number of days in the year, plus the days we got + # from last year. + wyearlen = self.yearlen+(self.yearweekday-rr._wkst) % 7 + else: + # Number of days in the year, minus the days we + # left in last year. + wyearlen = self.yearlen-no1wkst + div, mod = divmod(wyearlen, 7) + numweeks = div+mod//4 + for n in rr._byweekno: + if n < 0: + n += numweeks+1 + if not (0 < n <= numweeks): + continue + if n > 1: + i = no1wkst+(n-1)*7 + if no1wkst != firstwkst: + i -= 7-firstwkst + else: + i = no1wkst + for j in range(7): + self.wnomask[i] = 1 + i += 1 + if self.wdaymask[i] == rr._wkst: + break + if 1 in rr._byweekno: + # Check week number 1 of next year as well + # TODO: Check -numweeks for next year. + i = no1wkst+numweeks*7 + if no1wkst != firstwkst: + i -= 7-firstwkst + if i < self.yearlen: + # If week starts in next year, we + # don't care about it. + for j in range(7): + self.wnomask[i] = 1 + i += 1 + if self.wdaymask[i] == rr._wkst: + break + if no1wkst: + # Check last week number of last year as + # well. If no1wkst is 0, either the year + # started on week start, or week number 1 + # got days from last year, so there are no + # days from last year's last week number in + # this year. + if -1 not in rr._byweekno: + lyearweekday = datetime.date(year-1, 1, 1).weekday() + lno1wkst = (7-lyearweekday+rr._wkst) % 7 + lyearlen = 365+calendar.isleap(year-1) + if lno1wkst >= 4: + lno1wkst = 0 + lnumweeks = 52+(lyearlen + + (lyearweekday-rr._wkst) % 7) % 7//4 + else: + lnumweeks = 52+(self.yearlen-no1wkst) % 7//4 + else: + lnumweeks = -1 + if lnumweeks in rr._byweekno: + for i in range(no1wkst): + self.wnomask[i] = 1 + + if (rr._bynweekday and (month != self.lastmonth or + year != self.lastyear)): + ranges = [] + if rr._freq == YEARLY: + if rr._bymonth: + for month in rr._bymonth: + ranges.append(self.mrange[month-1:month+1]) + else: + ranges = [(0, self.yearlen)] + elif rr._freq == MONTHLY: + ranges = [self.mrange[month-1:month+1]] + if ranges: + # Weekly frequency won't get here, so we may not + # care about cross-year weekly periods. + self.nwdaymask = [0]*self.yearlen + for first, last in ranges: + last -= 1 + for wday, n in rr._bynweekday: + if n < 0: + i = last+(n+1)*7 + i -= (self.wdaymask[i]-wday) % 7 + else: + i = first+(n-1)*7 + i += (7-self.wdaymask[i]+wday) % 7 + if first <= i <= last: + self.nwdaymask[i] = 1 + + if rr._byeaster: + self.eastermask = [0]*(self.yearlen+7) + eyday = easter.easter(year).toordinal()-self.yearordinal + for offset in rr._byeaster: + self.eastermask[eyday+offset] = 1 + + self.lastyear = year + self.lastmonth = month + + def ydayset(self, year, month, day): + return list(range(self.yearlen)), 0, self.yearlen + + def mdayset(self, year, month, day): + dset = [None]*self.yearlen + start, end = self.mrange[month-1:month+1] + for i in range(start, end): + dset[i] = i + return dset, start, end + + def wdayset(self, year, month, day): + # We need to handle cross-year weeks here. + dset = [None]*(self.yearlen+7) + i = datetime.date(year, month, day).toordinal()-self.yearordinal + start = i + for j in range(7): + dset[i] = i + i += 1 + # if (not (0 <= i < self.yearlen) or + # self.wdaymask[i] == self.rrule._wkst): + # This will cross the year boundary, if necessary. + if self.wdaymask[i] == self.rrule._wkst: + break + return dset, start, i + + def ddayset(self, year, month, day): + dset = [None] * self.yearlen + i = datetime.date(year, month, day).toordinal() - self.yearordinal + dset[i] = i + return dset, i, i + 1 + + def htimeset(self, hour, minute, second): + tset = [] + rr = self.rrule + for minute in rr._byminute: + for second in rr._bysecond: + tset.append(datetime.time(hour, minute, second, + tzinfo=rr._tzinfo)) + tset.sort() + return tset + + def mtimeset(self, hour, minute, second): + tset = [] + rr = self.rrule + for second in rr._bysecond: + tset.append(datetime.time(hour, minute, second, tzinfo=rr._tzinfo)) + tset.sort() + return tset + + def stimeset(self, hour, minute, second): + return (datetime.time(hour, minute, second, + tzinfo=self.rrule._tzinfo),) + + +class rruleset(rrulebase): + """ The rruleset type allows more complex recurrence setups, mixing + multiple rules, dates, exclusion rules, and exclusion dates. The type + constructor takes the following keyword arguments: + + :param cache: If True, caching of results will be enabled, improving + performance of multiple queries considerably. """ + + class _genitem(object): + def __init__(self, genlist, gen): + try: + self.dt = advance_iterator(gen) + genlist.append(self) + except StopIteration: + pass + self.genlist = genlist + self.gen = gen + + def __next__(self): + try: + self.dt = advance_iterator(self.gen) + except StopIteration: + if self.genlist[0] is self: + heapq.heappop(self.genlist) + else: + self.genlist.remove(self) + heapq.heapify(self.genlist) + + next = __next__ + + def __lt__(self, other): + return self.dt < other.dt + + def __gt__(self, other): + return self.dt > other.dt + + def __eq__(self, other): + return self.dt == other.dt + + def __ne__(self, other): + return self.dt != other.dt + + def __init__(self, cache=False): + super(rruleset, self).__init__(cache) + self._rrule = [] + self._rdate = [] + self._exrule = [] + self._exdate = [] + + @_invalidates_cache + def rrule(self, rrule): + """ Include the given :py:class:`rrule` instance in the recurrence set + generation. """ + self._rrule.append(rrule) + + @_invalidates_cache + def rdate(self, rdate): + """ Include the given :py:class:`datetime` instance in the recurrence + set generation. """ + self._rdate.append(rdate) + + @_invalidates_cache + def exrule(self, exrule): + """ Include the given rrule instance in the recurrence set exclusion + list. Dates which are part of the given recurrence rules will not + be generated, even if some inclusive rrule or rdate matches them. + """ + self._exrule.append(exrule) + + @_invalidates_cache + def exdate(self, exdate): + """ Include the given datetime instance in the recurrence set + exclusion list. Dates included that way will not be generated, + even if some inclusive rrule or rdate matches them. """ + self._exdate.append(exdate) + + def _iter(self): + rlist = [] + self._rdate.sort() + self._genitem(rlist, iter(self._rdate)) + for gen in [iter(x) for x in self._rrule]: + self._genitem(rlist, gen) + exlist = [] + self._exdate.sort() + self._genitem(exlist, iter(self._exdate)) + for gen in [iter(x) for x in self._exrule]: + self._genitem(exlist, gen) + lastdt = None + total = 0 + heapq.heapify(rlist) + heapq.heapify(exlist) + while rlist: + ritem = rlist[0] + if not lastdt or lastdt != ritem.dt: + while exlist and exlist[0] < ritem: + exitem = exlist[0] + advance_iterator(exitem) + if exlist and exlist[0] is exitem: + heapq.heapreplace(exlist, exitem) + if not exlist or ritem != exlist[0]: + total += 1 + yield ritem.dt + lastdt = ritem.dt + advance_iterator(ritem) + if rlist and rlist[0] is ritem: + heapq.heapreplace(rlist, ritem) + self._len = total + + + + +class _rrulestr(object): + """ Parses a string representation of a recurrence rule or set of + recurrence rules. + + :param s: + Required, a string defining one or more recurrence rules. + + :param dtstart: + If given, used as the default recurrence start if not specified in the + rule string. + + :param cache: + If set ``True`` caching of results will be enabled, improving + performance of multiple queries considerably. + + :param unfold: + If set ``True`` indicates that a rule string is split over more + than one line and should be joined before processing. + + :param forceset: + If set ``True`` forces a :class:`dateutil.rrule.rruleset` to + be returned. + + :param compatible: + If set ``True`` forces ``unfold`` and ``forceset`` to be ``True``. + + :param ignoretz: + If set ``True``, time zones in parsed strings are ignored and a naive + :class:`datetime.datetime` object is returned. + + :param tzids: + If given, a callable or mapping used to retrieve a + :class:`datetime.tzinfo` from a string representation. + Defaults to :func:`dateutil.tz.gettz`. + + :param tzinfos: + Additional time zone names / aliases which may be present in a string + representation. See :func:`dateutil.parser.parse` for more + information. + + :return: + Returns a :class:`dateutil.rrule.rruleset` or + :class:`dateutil.rrule.rrule` + """ + + _freq_map = {"YEARLY": YEARLY, + "MONTHLY": MONTHLY, + "WEEKLY": WEEKLY, + "DAILY": DAILY, + "HOURLY": HOURLY, + "MINUTELY": MINUTELY, + "SECONDLY": SECONDLY} + + _weekday_map = {"MO": 0, "TU": 1, "WE": 2, "TH": 3, + "FR": 4, "SA": 5, "SU": 6} + + def _handle_int(self, rrkwargs, name, value, **kwargs): + rrkwargs[name.lower()] = int(value) + + def _handle_int_list(self, rrkwargs, name, value, **kwargs): + rrkwargs[name.lower()] = [int(x) for x in value.split(',')] + + _handle_INTERVAL = _handle_int + _handle_COUNT = _handle_int + _handle_BYSETPOS = _handle_int_list + _handle_BYMONTH = _handle_int_list + _handle_BYMONTHDAY = _handle_int_list + _handle_BYYEARDAY = _handle_int_list + _handle_BYEASTER = _handle_int_list + _handle_BYWEEKNO = _handle_int_list + _handle_BYHOUR = _handle_int_list + _handle_BYMINUTE = _handle_int_list + _handle_BYSECOND = _handle_int_list + + def _handle_FREQ(self, rrkwargs, name, value, **kwargs): + rrkwargs["freq"] = self._freq_map[value] + + def _handle_UNTIL(self, rrkwargs, name, value, **kwargs): + global parser + if not parser: + from dateutil import parser + try: + rrkwargs["until"] = parser.parse(value, + ignoretz=kwargs.get("ignoretz"), + tzinfos=kwargs.get("tzinfos")) + except ValueError: + raise ValueError("invalid until date") + + def _handle_WKST(self, rrkwargs, name, value, **kwargs): + rrkwargs["wkst"] = self._weekday_map[value] + + def _handle_BYWEEKDAY(self, rrkwargs, name, value, **kwargs): + """ + Two ways to specify this: +1MO or MO(+1) + """ + l = [] + for wday in value.split(','): + if '(' in wday: + # If it's of the form TH(+1), etc. + splt = wday.split('(') + w = splt[0] + n = int(splt[1][:-1]) + elif len(wday): + # If it's of the form +1MO + for i in range(len(wday)): + if wday[i] not in '+-0123456789': + break + n = wday[:i] or None + w = wday[i:] + if n: + n = int(n) + else: + raise ValueError("Invalid (empty) BYDAY specification.") + + l.append(weekdays[self._weekday_map[w]](n)) + rrkwargs["byweekday"] = l + + _handle_BYDAY = _handle_BYWEEKDAY + + def _parse_rfc_rrule(self, line, + dtstart=None, + cache=False, + ignoretz=False, + tzinfos=None): + if line.find(':') != -1: + name, value = line.split(':') + if name != "RRULE": + raise ValueError("unknown parameter name") + else: + value = line + rrkwargs = {} + for pair in value.split(';'): + name, value = pair.split('=') + name = name.upper() + value = value.upper() + try: + getattr(self, "_handle_"+name)(rrkwargs, name, value, + ignoretz=ignoretz, + tzinfos=tzinfos) + except AttributeError: + raise ValueError("unknown parameter '%s'" % name) + except (KeyError, ValueError): + raise ValueError("invalid '%s': %s" % (name, value)) + return rrule(dtstart=dtstart, cache=cache, **rrkwargs) + + def _parse_date_value(self, date_value, parms, rule_tzids, + ignoretz, tzids, tzinfos): + global parser + if not parser: + from dateutil import parser + + datevals = [] + value_found = False + TZID = None + + for parm in parms: + if parm.startswith("TZID="): + try: + tzkey = rule_tzids[parm.split('TZID=')[-1]] + except KeyError: + continue + if tzids is None: + from . import tz + tzlookup = tz.gettz + elif callable(tzids): + tzlookup = tzids + else: + tzlookup = getattr(tzids, 'get', None) + if tzlookup is None: + msg = ('tzids must be a callable, mapping, or None, ' + 'not %s' % tzids) + raise ValueError(msg) + + TZID = tzlookup(tzkey) + continue + + # RFC 5445 3.8.2.4: The VALUE parameter is optional, but may be found + # only once. + if parm not in {"VALUE=DATE-TIME", "VALUE=DATE"}: + raise ValueError("unsupported parm: " + parm) + else: + if value_found: + msg = ("Duplicate value parameter found in: " + parm) + raise ValueError(msg) + value_found = True + + for datestr in date_value.split(','): + date = parser.parse(datestr, ignoretz=ignoretz, tzinfos=tzinfos) + if TZID is not None: + if date.tzinfo is None: + date = date.replace(tzinfo=TZID) + else: + raise ValueError('DTSTART/EXDATE specifies multiple timezone') + datevals.append(date) + + return datevals + + def _parse_rfc(self, s, + dtstart=None, + cache=False, + unfold=False, + forceset=False, + compatible=False, + ignoretz=False, + tzids=None, + tzinfos=None): + global parser + if compatible: + forceset = True + unfold = True + + TZID_NAMES = dict(map( + lambda x: (x.upper(), x), + re.findall('TZID=(?P[^:]+):', s) + )) + s = s.upper() + if not s.strip(): + raise ValueError("empty string") + if unfold: + lines = s.splitlines() + i = 0 + while i < len(lines): + line = lines[i].rstrip() + if not line: + del lines[i] + elif i > 0 and line[0] == " ": + lines[i-1] += line[1:] + del lines[i] + else: + i += 1 + else: + lines = s.split() + if (not forceset and len(lines) == 1 and (s.find(':') == -1 or + s.startswith('RRULE:'))): + return self._parse_rfc_rrule(lines[0], cache=cache, + dtstart=dtstart, ignoretz=ignoretz, + tzinfos=tzinfos) + else: + rrulevals = [] + rdatevals = [] + exrulevals = [] + exdatevals = [] + for line in lines: + if not line: + continue + if line.find(':') == -1: + name = "RRULE" + value = line + else: + name, value = line.split(':', 1) + parms = name.split(';') + if not parms: + raise ValueError("empty property name") + name = parms[0] + parms = parms[1:] + if name == "RRULE": + for parm in parms: + raise ValueError("unsupported RRULE parm: "+parm) + rrulevals.append(value) + elif name == "RDATE": + for parm in parms: + if parm != "VALUE=DATE-TIME": + raise ValueError("unsupported RDATE parm: "+parm) + rdatevals.append(value) + elif name == "EXRULE": + for parm in parms: + raise ValueError("unsupported EXRULE parm: "+parm) + exrulevals.append(value) + elif name == "EXDATE": + exdatevals.extend( + self._parse_date_value(value, parms, + TZID_NAMES, ignoretz, + tzids, tzinfos) + ) + elif name == "DTSTART": + dtvals = self._parse_date_value(value, parms, TZID_NAMES, + ignoretz, tzids, tzinfos) + if len(dtvals) != 1: + raise ValueError("Multiple DTSTART values specified:" + + value) + dtstart = dtvals[0] + else: + raise ValueError("unsupported property: "+name) + if (forceset or len(rrulevals) > 1 or rdatevals + or exrulevals or exdatevals): + if not parser and (rdatevals or exdatevals): + from dateutil import parser + rset = rruleset(cache=cache) + for value in rrulevals: + rset.rrule(self._parse_rfc_rrule(value, dtstart=dtstart, + ignoretz=ignoretz, + tzinfos=tzinfos)) + for value in rdatevals: + for datestr in value.split(','): + rset.rdate(parser.parse(datestr, + ignoretz=ignoretz, + tzinfos=tzinfos)) + for value in exrulevals: + rset.exrule(self._parse_rfc_rrule(value, dtstart=dtstart, + ignoretz=ignoretz, + tzinfos=tzinfos)) + for value in exdatevals: + rset.exdate(value) + if compatible and dtstart: + rset.rdate(dtstart) + return rset + else: + return self._parse_rfc_rrule(rrulevals[0], + dtstart=dtstart, + cache=cache, + ignoretz=ignoretz, + tzinfos=tzinfos) + + def __call__(self, s, **kwargs): + return self._parse_rfc(s, **kwargs) + + +rrulestr = _rrulestr() + +# vim:ts=4:sw=4:et diff --git a/venv/lib/python3.12/site-packages/dateutil/tz/__init__.py b/venv/lib/python3.12/site-packages/dateutil/tz/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..af1352c47292f4eebc5cae8da45641b5544558e3 --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/tz/__init__.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +from .tz import * +from .tz import __doc__ + +__all__ = ["tzutc", "tzoffset", "tzlocal", "tzfile", "tzrange", + "tzstr", "tzical", "tzwin", "tzwinlocal", "gettz", + "enfold", "datetime_ambiguous", "datetime_exists", + "resolve_imaginary", "UTC", "DeprecatedTzFormatWarning"] + + +class DeprecatedTzFormatWarning(Warning): + """Warning raised when time zones are parsed from deprecated formats.""" diff --git a/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..77de23b93083f14a5faec32dc54ed2fca73fbf5d Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/_common.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/_common.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d075159c8d3c0b3c1e7ca833af52494e5e23334 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/_common.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/_factories.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/_factories.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..058b9f6c7ec545f4719209c16e86cede5cf4dffe Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/_factories.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/tz.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/tz.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54c6e322777a67246ab349edc28580ca451e911f Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/tz.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/win.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/win.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f5efc4a071c719db5d0089a21a97da3de8bee58 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/tz/__pycache__/win.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/tz/_common.py b/venv/lib/python3.12/site-packages/dateutil/tz/_common.py new file mode 100644 index 0000000000000000000000000000000000000000..e6ac11831522b266114d5b68ee1da298e3aeb14a --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/tz/_common.py @@ -0,0 +1,419 @@ +from six import PY2 + +from functools import wraps + +from datetime import datetime, timedelta, tzinfo + + +ZERO = timedelta(0) + +__all__ = ['tzname_in_python2', 'enfold'] + + +def tzname_in_python2(namefunc): + """Change unicode output into bytestrings in Python 2 + + tzname() API changed in Python 3. It used to return bytes, but was changed + to unicode strings + """ + if PY2: + @wraps(namefunc) + def adjust_encoding(*args, **kwargs): + name = namefunc(*args, **kwargs) + if name is not None: + name = name.encode() + + return name + + return adjust_encoding + else: + return namefunc + + +# The following is adapted from Alexander Belopolsky's tz library +# https://github.com/abalkin/tz +if hasattr(datetime, 'fold'): + # This is the pre-python 3.6 fold situation + def enfold(dt, fold=1): + """ + Provides a unified interface for assigning the ``fold`` attribute to + datetimes both before and after the implementation of PEP-495. + + :param fold: + The value for the ``fold`` attribute in the returned datetime. This + should be either 0 or 1. + + :return: + Returns an object for which ``getattr(dt, 'fold', 0)`` returns + ``fold`` for all versions of Python. In versions prior to + Python 3.6, this is a ``_DatetimeWithFold`` object, which is a + subclass of :py:class:`datetime.datetime` with the ``fold`` + attribute added, if ``fold`` is 1. + + .. versionadded:: 2.6.0 + """ + return dt.replace(fold=fold) + +else: + class _DatetimeWithFold(datetime): + """ + This is a class designed to provide a PEP 495-compliant interface for + Python versions before 3.6. It is used only for dates in a fold, so + the ``fold`` attribute is fixed at ``1``. + + .. versionadded:: 2.6.0 + """ + __slots__ = () + + def replace(self, *args, **kwargs): + """ + Return a datetime with the same attributes, except for those + attributes given new values by whichever keyword arguments are + specified. Note that tzinfo=None can be specified to create a naive + datetime from an aware datetime with no conversion of date and time + data. + + This is reimplemented in ``_DatetimeWithFold`` because pypy3 will + return a ``datetime.datetime`` even if ``fold`` is unchanged. + """ + argnames = ( + 'year', 'month', 'day', 'hour', 'minute', 'second', + 'microsecond', 'tzinfo' + ) + + for arg, argname in zip(args, argnames): + if argname in kwargs: + raise TypeError('Duplicate argument: {}'.format(argname)) + + kwargs[argname] = arg + + for argname in argnames: + if argname not in kwargs: + kwargs[argname] = getattr(self, argname) + + dt_class = self.__class__ if kwargs.get('fold', 1) else datetime + + return dt_class(**kwargs) + + @property + def fold(self): + return 1 + + def enfold(dt, fold=1): + """ + Provides a unified interface for assigning the ``fold`` attribute to + datetimes both before and after the implementation of PEP-495. + + :param fold: + The value for the ``fold`` attribute in the returned datetime. This + should be either 0 or 1. + + :return: + Returns an object for which ``getattr(dt, 'fold', 0)`` returns + ``fold`` for all versions of Python. In versions prior to + Python 3.6, this is a ``_DatetimeWithFold`` object, which is a + subclass of :py:class:`datetime.datetime` with the ``fold`` + attribute added, if ``fold`` is 1. + + .. versionadded:: 2.6.0 + """ + if getattr(dt, 'fold', 0) == fold: + return dt + + args = dt.timetuple()[:6] + args += (dt.microsecond, dt.tzinfo) + + if fold: + return _DatetimeWithFold(*args) + else: + return datetime(*args) + + +def _validate_fromutc_inputs(f): + """ + The CPython version of ``fromutc`` checks that the input is a ``datetime`` + object and that ``self`` is attached as its ``tzinfo``. + """ + @wraps(f) + def fromutc(self, dt): + if not isinstance(dt, datetime): + raise TypeError("fromutc() requires a datetime argument") + if dt.tzinfo is not self: + raise ValueError("dt.tzinfo is not self") + + return f(self, dt) + + return fromutc + + +class _tzinfo(tzinfo): + """ + Base class for all ``dateutil`` ``tzinfo`` objects. + """ + + def is_ambiguous(self, dt): + """ + Whether or not the "wall time" of a given datetime is ambiguous in this + zone. + + :param dt: + A :py:class:`datetime.datetime`, naive or time zone aware. + + + :return: + Returns ``True`` if ambiguous, ``False`` otherwise. + + .. versionadded:: 2.6.0 + """ + + dt = dt.replace(tzinfo=self) + + wall_0 = enfold(dt, fold=0) + wall_1 = enfold(dt, fold=1) + + same_offset = wall_0.utcoffset() == wall_1.utcoffset() + same_dt = wall_0.replace(tzinfo=None) == wall_1.replace(tzinfo=None) + + return same_dt and not same_offset + + def _fold_status(self, dt_utc, dt_wall): + """ + Determine the fold status of a "wall" datetime, given a representation + of the same datetime as a (naive) UTC datetime. This is calculated based + on the assumption that ``dt.utcoffset() - dt.dst()`` is constant for all + datetimes, and that this offset is the actual number of hours separating + ``dt_utc`` and ``dt_wall``. + + :param dt_utc: + Representation of the datetime as UTC + + :param dt_wall: + Representation of the datetime as "wall time". This parameter must + either have a `fold` attribute or have a fold-naive + :class:`datetime.tzinfo` attached, otherwise the calculation may + fail. + """ + if self.is_ambiguous(dt_wall): + delta_wall = dt_wall - dt_utc + _fold = int(delta_wall == (dt_utc.utcoffset() - dt_utc.dst())) + else: + _fold = 0 + + return _fold + + def _fold(self, dt): + return getattr(dt, 'fold', 0) + + def _fromutc(self, dt): + """ + Given a timezone-aware datetime in a given timezone, calculates a + timezone-aware datetime in a new timezone. + + Since this is the one time that we *know* we have an unambiguous + datetime object, we take this opportunity to determine whether the + datetime is ambiguous and in a "fold" state (e.g. if it's the first + occurrence, chronologically, of the ambiguous datetime). + + :param dt: + A timezone-aware :class:`datetime.datetime` object. + """ + + # Re-implement the algorithm from Python's datetime.py + dtoff = dt.utcoffset() + if dtoff is None: + raise ValueError("fromutc() requires a non-None utcoffset() " + "result") + + # The original datetime.py code assumes that `dst()` defaults to + # zero during ambiguous times. PEP 495 inverts this presumption, so + # for pre-PEP 495 versions of python, we need to tweak the algorithm. + dtdst = dt.dst() + if dtdst is None: + raise ValueError("fromutc() requires a non-None dst() result") + delta = dtoff - dtdst + + dt += delta + # Set fold=1 so we can default to being in the fold for + # ambiguous dates. + dtdst = enfold(dt, fold=1).dst() + if dtdst is None: + raise ValueError("fromutc(): dt.dst gave inconsistent " + "results; cannot convert") + return dt + dtdst + + @_validate_fromutc_inputs + def fromutc(self, dt): + """ + Given a timezone-aware datetime in a given timezone, calculates a + timezone-aware datetime in a new timezone. + + Since this is the one time that we *know* we have an unambiguous + datetime object, we take this opportunity to determine whether the + datetime is ambiguous and in a "fold" state (e.g. if it's the first + occurrence, chronologically, of the ambiguous datetime). + + :param dt: + A timezone-aware :class:`datetime.datetime` object. + """ + dt_wall = self._fromutc(dt) + + # Calculate the fold status given the two datetimes. + _fold = self._fold_status(dt, dt_wall) + + # Set the default fold value for ambiguous dates + return enfold(dt_wall, fold=_fold) + + +class tzrangebase(_tzinfo): + """ + This is an abstract base class for time zones represented by an annual + transition into and out of DST. Child classes should implement the following + methods: + + * ``__init__(self, *args, **kwargs)`` + * ``transitions(self, year)`` - this is expected to return a tuple of + datetimes representing the DST on and off transitions in standard + time. + + A fully initialized ``tzrangebase`` subclass should also provide the + following attributes: + * ``hasdst``: Boolean whether or not the zone uses DST. + * ``_dst_offset`` / ``_std_offset``: :class:`datetime.timedelta` objects + representing the respective UTC offsets. + * ``_dst_abbr`` / ``_std_abbr``: Strings representing the timezone short + abbreviations in DST and STD, respectively. + * ``_hasdst``: Whether or not the zone has DST. + + .. versionadded:: 2.6.0 + """ + def __init__(self): + raise NotImplementedError('tzrangebase is an abstract base class') + + def utcoffset(self, dt): + isdst = self._isdst(dt) + + if isdst is None: + return None + elif isdst: + return self._dst_offset + else: + return self._std_offset + + def dst(self, dt): + isdst = self._isdst(dt) + + if isdst is None: + return None + elif isdst: + return self._dst_base_offset + else: + return ZERO + + @tzname_in_python2 + def tzname(self, dt): + if self._isdst(dt): + return self._dst_abbr + else: + return self._std_abbr + + def fromutc(self, dt): + """ Given a datetime in UTC, return local time """ + if not isinstance(dt, datetime): + raise TypeError("fromutc() requires a datetime argument") + + if dt.tzinfo is not self: + raise ValueError("dt.tzinfo is not self") + + # Get transitions - if there are none, fixed offset + transitions = self.transitions(dt.year) + if transitions is None: + return dt + self.utcoffset(dt) + + # Get the transition times in UTC + dston, dstoff = transitions + + dston -= self._std_offset + dstoff -= self._std_offset + + utc_transitions = (dston, dstoff) + dt_utc = dt.replace(tzinfo=None) + + isdst = self._naive_isdst(dt_utc, utc_transitions) + + if isdst: + dt_wall = dt + self._dst_offset + else: + dt_wall = dt + self._std_offset + + _fold = int(not isdst and self.is_ambiguous(dt_wall)) + + return enfold(dt_wall, fold=_fold) + + def is_ambiguous(self, dt): + """ + Whether or not the "wall time" of a given datetime is ambiguous in this + zone. + + :param dt: + A :py:class:`datetime.datetime`, naive or time zone aware. + + + :return: + Returns ``True`` if ambiguous, ``False`` otherwise. + + .. versionadded:: 2.6.0 + """ + if not self.hasdst: + return False + + start, end = self.transitions(dt.year) + + dt = dt.replace(tzinfo=None) + return (end <= dt < end + self._dst_base_offset) + + def _isdst(self, dt): + if not self.hasdst: + return False + elif dt is None: + return None + + transitions = self.transitions(dt.year) + + if transitions is None: + return False + + dt = dt.replace(tzinfo=None) + + isdst = self._naive_isdst(dt, transitions) + + # Handle ambiguous dates + if not isdst and self.is_ambiguous(dt): + return not self._fold(dt) + else: + return isdst + + def _naive_isdst(self, dt, transitions): + dston, dstoff = transitions + + dt = dt.replace(tzinfo=None) + + if dston < dstoff: + isdst = dston <= dt < dstoff + else: + isdst = not dstoff <= dt < dston + + return isdst + + @property + def _dst_base_offset(self): + return self._dst_offset - self._std_offset + + __hash__ = None + + def __ne__(self, other): + return not (self == other) + + def __repr__(self): + return "%s(...)" % self.__class__.__name__ + + __reduce__ = object.__reduce__ diff --git a/venv/lib/python3.12/site-packages/dateutil/tz/_factories.py b/venv/lib/python3.12/site-packages/dateutil/tz/_factories.py new file mode 100644 index 0000000000000000000000000000000000000000..f8a65891a023ebf9eb0c24d391ba67541b7133f1 --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/tz/_factories.py @@ -0,0 +1,80 @@ +from datetime import timedelta +import weakref +from collections import OrderedDict + +from six.moves import _thread + + +class _TzSingleton(type): + def __init__(cls, *args, **kwargs): + cls.__instance = None + super(_TzSingleton, cls).__init__(*args, **kwargs) + + def __call__(cls): + if cls.__instance is None: + cls.__instance = super(_TzSingleton, cls).__call__() + return cls.__instance + + +class _TzFactory(type): + def instance(cls, *args, **kwargs): + """Alternate constructor that returns a fresh instance""" + return type.__call__(cls, *args, **kwargs) + + +class _TzOffsetFactory(_TzFactory): + def __init__(cls, *args, **kwargs): + cls.__instances = weakref.WeakValueDictionary() + cls.__strong_cache = OrderedDict() + cls.__strong_cache_size = 8 + + cls._cache_lock = _thread.allocate_lock() + + def __call__(cls, name, offset): + if isinstance(offset, timedelta): + key = (name, offset.total_seconds()) + else: + key = (name, offset) + + instance = cls.__instances.get(key, None) + if instance is None: + instance = cls.__instances.setdefault(key, + cls.instance(name, offset)) + + # This lock may not be necessary in Python 3. See GH issue #901 + with cls._cache_lock: + cls.__strong_cache[key] = cls.__strong_cache.pop(key, instance) + + # Remove an item if the strong cache is overpopulated + if len(cls.__strong_cache) > cls.__strong_cache_size: + cls.__strong_cache.popitem(last=False) + + return instance + + +class _TzStrFactory(_TzFactory): + def __init__(cls, *args, **kwargs): + cls.__instances = weakref.WeakValueDictionary() + cls.__strong_cache = OrderedDict() + cls.__strong_cache_size = 8 + + cls.__cache_lock = _thread.allocate_lock() + + def __call__(cls, s, posix_offset=False): + key = (s, posix_offset) + instance = cls.__instances.get(key, None) + + if instance is None: + instance = cls.__instances.setdefault(key, + cls.instance(s, posix_offset)) + + # This lock may not be necessary in Python 3. See GH issue #901 + with cls.__cache_lock: + cls.__strong_cache[key] = cls.__strong_cache.pop(key, instance) + + # Remove an item if the strong cache is overpopulated + if len(cls.__strong_cache) > cls.__strong_cache_size: + cls.__strong_cache.popitem(last=False) + + return instance + diff --git a/venv/lib/python3.12/site-packages/dateutil/tz/tz.py b/venv/lib/python3.12/site-packages/dateutil/tz/tz.py new file mode 100644 index 0000000000000000000000000000000000000000..617591446bd92eb1cc7b7d67fa3f17435e691cdd --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/tz/tz.py @@ -0,0 +1,1849 @@ +# -*- coding: utf-8 -*- +""" +This module offers timezone implementations subclassing the abstract +:py:class:`datetime.tzinfo` type. There are classes to handle tzfile format +files (usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`, +etc), TZ environment string (in all known formats), given ranges (with help +from relative deltas), local machine timezone, fixed offset timezone, and UTC +timezone. +""" +import datetime +import struct +import time +import sys +import os +import bisect +import weakref +from collections import OrderedDict + +import six +from six import string_types +from six.moves import _thread +from ._common import tzname_in_python2, _tzinfo +from ._common import tzrangebase, enfold +from ._common import _validate_fromutc_inputs + +from ._factories import _TzSingleton, _TzOffsetFactory +from ._factories import _TzStrFactory +try: + from .win import tzwin, tzwinlocal +except ImportError: + tzwin = tzwinlocal = None + +# For warning about rounding tzinfo +from warnings import warn + +ZERO = datetime.timedelta(0) +EPOCH = datetime.datetime(1970, 1, 1, 0, 0) +EPOCHORDINAL = EPOCH.toordinal() + + +@six.add_metaclass(_TzSingleton) +class tzutc(datetime.tzinfo): + """ + This is a tzinfo object that represents the UTC time zone. + + **Examples:** + + .. doctest:: + + >>> from datetime import * + >>> from dateutil.tz import * + + >>> datetime.now() + datetime.datetime(2003, 9, 27, 9, 40, 1, 521290) + + >>> datetime.now(tzutc()) + datetime.datetime(2003, 9, 27, 12, 40, 12, 156379, tzinfo=tzutc()) + + >>> datetime.now(tzutc()).tzname() + 'UTC' + + .. versionchanged:: 2.7.0 + ``tzutc()`` is now a singleton, so the result of ``tzutc()`` will + always return the same object. + + .. doctest:: + + >>> from dateutil.tz import tzutc, UTC + >>> tzutc() is tzutc() + True + >>> tzutc() is UTC + True + """ + def utcoffset(self, dt): + return ZERO + + def dst(self, dt): + return ZERO + + @tzname_in_python2 + def tzname(self, dt): + return "UTC" + + def is_ambiguous(self, dt): + """ + Whether or not the "wall time" of a given datetime is ambiguous in this + zone. + + :param dt: + A :py:class:`datetime.datetime`, naive or time zone aware. + + + :return: + Returns ``True`` if ambiguous, ``False`` otherwise. + + .. versionadded:: 2.6.0 + """ + return False + + @_validate_fromutc_inputs + def fromutc(self, dt): + """ + Fast track version of fromutc() returns the original ``dt`` object for + any valid :py:class:`datetime.datetime` object. + """ + return dt + + def __eq__(self, other): + if not isinstance(other, (tzutc, tzoffset)): + return NotImplemented + + return (isinstance(other, tzutc) or + (isinstance(other, tzoffset) and other._offset == ZERO)) + + __hash__ = None + + def __ne__(self, other): + return not (self == other) + + def __repr__(self): + return "%s()" % self.__class__.__name__ + + __reduce__ = object.__reduce__ + + +#: Convenience constant providing a :class:`tzutc()` instance +#: +#: .. versionadded:: 2.7.0 +UTC = tzutc() + + +@six.add_metaclass(_TzOffsetFactory) +class tzoffset(datetime.tzinfo): + """ + A simple class for representing a fixed offset from UTC. + + :param name: + The timezone name, to be returned when ``tzname()`` is called. + :param offset: + The time zone offset in seconds, or (since version 2.6.0, represented + as a :py:class:`datetime.timedelta` object). + """ + def __init__(self, name, offset): + self._name = name + + try: + # Allow a timedelta + offset = offset.total_seconds() + except (TypeError, AttributeError): + pass + + self._offset = datetime.timedelta(seconds=_get_supported_offset(offset)) + + def utcoffset(self, dt): + return self._offset + + def dst(self, dt): + return ZERO + + @tzname_in_python2 + def tzname(self, dt): + return self._name + + @_validate_fromutc_inputs + def fromutc(self, dt): + return dt + self._offset + + def is_ambiguous(self, dt): + """ + Whether or not the "wall time" of a given datetime is ambiguous in this + zone. + + :param dt: + A :py:class:`datetime.datetime`, naive or time zone aware. + :return: + Returns ``True`` if ambiguous, ``False`` otherwise. + + .. versionadded:: 2.6.0 + """ + return False + + def __eq__(self, other): + if not isinstance(other, tzoffset): + return NotImplemented + + return self._offset == other._offset + + __hash__ = None + + def __ne__(self, other): + return not (self == other) + + def __repr__(self): + return "%s(%s, %s)" % (self.__class__.__name__, + repr(self._name), + int(self._offset.total_seconds())) + + __reduce__ = object.__reduce__ + + +class tzlocal(_tzinfo): + """ + A :class:`tzinfo` subclass built around the ``time`` timezone functions. + """ + def __init__(self): + super(tzlocal, self).__init__() + + self._std_offset = datetime.timedelta(seconds=-time.timezone) + if time.daylight: + self._dst_offset = datetime.timedelta(seconds=-time.altzone) + else: + self._dst_offset = self._std_offset + + self._dst_saved = self._dst_offset - self._std_offset + self._hasdst = bool(self._dst_saved) + self._tznames = tuple(time.tzname) + + def utcoffset(self, dt): + if dt is None and self._hasdst: + return None + + if self._isdst(dt): + return self._dst_offset + else: + return self._std_offset + + def dst(self, dt): + if dt is None and self._hasdst: + return None + + if self._isdst(dt): + return self._dst_offset - self._std_offset + else: + return ZERO + + @tzname_in_python2 + def tzname(self, dt): + return self._tznames[self._isdst(dt)] + + def is_ambiguous(self, dt): + """ + Whether or not the "wall time" of a given datetime is ambiguous in this + zone. + + :param dt: + A :py:class:`datetime.datetime`, naive or time zone aware. + + + :return: + Returns ``True`` if ambiguous, ``False`` otherwise. + + .. versionadded:: 2.6.0 + """ + naive_dst = self._naive_is_dst(dt) + return (not naive_dst and + (naive_dst != self._naive_is_dst(dt - self._dst_saved))) + + def _naive_is_dst(self, dt): + timestamp = _datetime_to_timestamp(dt) + return time.localtime(timestamp + time.timezone).tm_isdst + + def _isdst(self, dt, fold_naive=True): + # We can't use mktime here. It is unstable when deciding if + # the hour near to a change is DST or not. + # + # timestamp = time.mktime((dt.year, dt.month, dt.day, dt.hour, + # dt.minute, dt.second, dt.weekday(), 0, -1)) + # return time.localtime(timestamp).tm_isdst + # + # The code above yields the following result: + # + # >>> import tz, datetime + # >>> t = tz.tzlocal() + # >>> datetime.datetime(2003,2,15,23,tzinfo=t).tzname() + # 'BRDT' + # >>> datetime.datetime(2003,2,16,0,tzinfo=t).tzname() + # 'BRST' + # >>> datetime.datetime(2003,2,15,23,tzinfo=t).tzname() + # 'BRST' + # >>> datetime.datetime(2003,2,15,22,tzinfo=t).tzname() + # 'BRDT' + # >>> datetime.datetime(2003,2,15,23,tzinfo=t).tzname() + # 'BRDT' + # + # Here is a more stable implementation: + # + if not self._hasdst: + return False + + # Check for ambiguous times: + dstval = self._naive_is_dst(dt) + fold = getattr(dt, 'fold', None) + + if self.is_ambiguous(dt): + if fold is not None: + return not self._fold(dt) + else: + return True + + return dstval + + def __eq__(self, other): + if isinstance(other, tzlocal): + return (self._std_offset == other._std_offset and + self._dst_offset == other._dst_offset) + elif isinstance(other, tzutc): + return (not self._hasdst and + self._tznames[0] in {'UTC', 'GMT'} and + self._std_offset == ZERO) + elif isinstance(other, tzoffset): + return (not self._hasdst and + self._tznames[0] == other._name and + self._std_offset == other._offset) + else: + return NotImplemented + + __hash__ = None + + def __ne__(self, other): + return not (self == other) + + def __repr__(self): + return "%s()" % self.__class__.__name__ + + __reduce__ = object.__reduce__ + + +class _ttinfo(object): + __slots__ = ["offset", "delta", "isdst", "abbr", + "isstd", "isgmt", "dstoffset"] + + def __init__(self): + for attr in self.__slots__: + setattr(self, attr, None) + + def __repr__(self): + l = [] + for attr in self.__slots__: + value = getattr(self, attr) + if value is not None: + l.append("%s=%s" % (attr, repr(value))) + return "%s(%s)" % (self.__class__.__name__, ", ".join(l)) + + def __eq__(self, other): + if not isinstance(other, _ttinfo): + return NotImplemented + + return (self.offset == other.offset and + self.delta == other.delta and + self.isdst == other.isdst and + self.abbr == other.abbr and + self.isstd == other.isstd and + self.isgmt == other.isgmt and + self.dstoffset == other.dstoffset) + + __hash__ = None + + def __ne__(self, other): + return not (self == other) + + def __getstate__(self): + state = {} + for name in self.__slots__: + state[name] = getattr(self, name, None) + return state + + def __setstate__(self, state): + for name in self.__slots__: + if name in state: + setattr(self, name, state[name]) + + +class _tzfile(object): + """ + Lightweight class for holding the relevant transition and time zone + information read from binary tzfiles. + """ + attrs = ['trans_list', 'trans_list_utc', 'trans_idx', 'ttinfo_list', + 'ttinfo_std', 'ttinfo_dst', 'ttinfo_before', 'ttinfo_first'] + + def __init__(self, **kwargs): + for attr in self.attrs: + setattr(self, attr, kwargs.get(attr, None)) + + +class tzfile(_tzinfo): + """ + This is a ``tzinfo`` subclass that allows one to use the ``tzfile(5)`` + format timezone files to extract current and historical zone information. + + :param fileobj: + This can be an opened file stream or a file name that the time zone + information can be read from. + + :param filename: + This is an optional parameter specifying the source of the time zone + information in the event that ``fileobj`` is a file object. If omitted + and ``fileobj`` is a file stream, this parameter will be set either to + ``fileobj``'s ``name`` attribute or to ``repr(fileobj)``. + + See `Sources for Time Zone and Daylight Saving Time Data + `_ for more information. + Time zone files can be compiled from the `IANA Time Zone database files + `_ with the `zic time zone compiler + `_ + + .. note:: + + Only construct a ``tzfile`` directly if you have a specific timezone + file on disk that you want to read into a Python ``tzinfo`` object. + If you want to get a ``tzfile`` representing a specific IANA zone, + (e.g. ``'America/New_York'``), you should call + :func:`dateutil.tz.gettz` with the zone identifier. + + + **Examples:** + + Using the US Eastern time zone as an example, we can see that a ``tzfile`` + provides time zone information for the standard Daylight Saving offsets: + + .. testsetup:: tzfile + + from dateutil.tz import gettz + from datetime import datetime + + .. doctest:: tzfile + + >>> NYC = gettz('America/New_York') + >>> NYC + tzfile('/usr/share/zoneinfo/America/New_York') + + >>> print(datetime(2016, 1, 3, tzinfo=NYC)) # EST + 2016-01-03 00:00:00-05:00 + + >>> print(datetime(2016, 7, 7, tzinfo=NYC)) # EDT + 2016-07-07 00:00:00-04:00 + + + The ``tzfile`` structure contains a fully history of the time zone, + so historical dates will also have the right offsets. For example, before + the adoption of the UTC standards, New York used local solar mean time: + + .. doctest:: tzfile + + >>> print(datetime(1901, 4, 12, tzinfo=NYC)) # LMT + 1901-04-12 00:00:00-04:56 + + And during World War II, New York was on "Eastern War Time", which was a + state of permanent daylight saving time: + + .. doctest:: tzfile + + >>> print(datetime(1944, 2, 7, tzinfo=NYC)) # EWT + 1944-02-07 00:00:00-04:00 + + """ + + def __init__(self, fileobj, filename=None): + super(tzfile, self).__init__() + + file_opened_here = False + if isinstance(fileobj, string_types): + self._filename = fileobj + fileobj = open(fileobj, 'rb') + file_opened_here = True + elif filename is not None: + self._filename = filename + elif hasattr(fileobj, "name"): + self._filename = fileobj.name + else: + self._filename = repr(fileobj) + + if fileobj is not None: + if not file_opened_here: + fileobj = _nullcontext(fileobj) + + with fileobj as file_stream: + tzobj = self._read_tzfile(file_stream) + + self._set_tzdata(tzobj) + + def _set_tzdata(self, tzobj): + """ Set the time zone data of this object from a _tzfile object """ + # Copy the relevant attributes over as private attributes + for attr in _tzfile.attrs: + setattr(self, '_' + attr, getattr(tzobj, attr)) + + def _read_tzfile(self, fileobj): + out = _tzfile() + + # From tzfile(5): + # + # The time zone information files used by tzset(3) + # begin with the magic characters "TZif" to identify + # them as time zone information files, followed by + # sixteen bytes reserved for future use, followed by + # six four-byte values of type long, written in a + # ``standard'' byte order (the high-order byte + # of the value is written first). + if fileobj.read(4).decode() != "TZif": + raise ValueError("magic not found") + + fileobj.read(16) + + ( + # The number of UTC/local indicators stored in the file. + ttisgmtcnt, + + # The number of standard/wall indicators stored in the file. + ttisstdcnt, + + # The number of leap seconds for which data is + # stored in the file. + leapcnt, + + # The number of "transition times" for which data + # is stored in the file. + timecnt, + + # The number of "local time types" for which data + # is stored in the file (must not be zero). + typecnt, + + # The number of characters of "time zone + # abbreviation strings" stored in the file. + charcnt, + + ) = struct.unpack(">6l", fileobj.read(24)) + + # The above header is followed by tzh_timecnt four-byte + # values of type long, sorted in ascending order. + # These values are written in ``standard'' byte order. + # Each is used as a transition time (as returned by + # time(2)) at which the rules for computing local time + # change. + + if timecnt: + out.trans_list_utc = list(struct.unpack(">%dl" % timecnt, + fileobj.read(timecnt*4))) + else: + out.trans_list_utc = [] + + # Next come tzh_timecnt one-byte values of type unsigned + # char; each one tells which of the different types of + # ``local time'' types described in the file is associated + # with the same-indexed transition time. These values + # serve as indices into an array of ttinfo structures that + # appears next in the file. + + if timecnt: + out.trans_idx = struct.unpack(">%dB" % timecnt, + fileobj.read(timecnt)) + else: + out.trans_idx = [] + + # Each ttinfo structure is written as a four-byte value + # for tt_gmtoff of type long, in a standard byte + # order, followed by a one-byte value for tt_isdst + # and a one-byte value for tt_abbrind. In each + # structure, tt_gmtoff gives the number of + # seconds to be added to UTC, tt_isdst tells whether + # tm_isdst should be set by localtime(3), and + # tt_abbrind serves as an index into the array of + # time zone abbreviation characters that follow the + # ttinfo structure(s) in the file. + + ttinfo = [] + + for i in range(typecnt): + ttinfo.append(struct.unpack(">lbb", fileobj.read(6))) + + abbr = fileobj.read(charcnt).decode() + + # Then there are tzh_leapcnt pairs of four-byte + # values, written in standard byte order; the + # first value of each pair gives the time (as + # returned by time(2)) at which a leap second + # occurs; the second gives the total number of + # leap seconds to be applied after the given time. + # The pairs of values are sorted in ascending order + # by time. + + # Not used, for now (but seek for correct file position) + if leapcnt: + fileobj.seek(leapcnt * 8, os.SEEK_CUR) + + # Then there are tzh_ttisstdcnt standard/wall + # indicators, each stored as a one-byte value; + # they tell whether the transition times associated + # with local time types were specified as standard + # time or wall clock time, and are used when + # a time zone file is used in handling POSIX-style + # time zone environment variables. + + if ttisstdcnt: + isstd = struct.unpack(">%db" % ttisstdcnt, + fileobj.read(ttisstdcnt)) + + # Finally, there are tzh_ttisgmtcnt UTC/local + # indicators, each stored as a one-byte value; + # they tell whether the transition times associated + # with local time types were specified as UTC or + # local time, and are used when a time zone file + # is used in handling POSIX-style time zone envi- + # ronment variables. + + if ttisgmtcnt: + isgmt = struct.unpack(">%db" % ttisgmtcnt, + fileobj.read(ttisgmtcnt)) + + # Build ttinfo list + out.ttinfo_list = [] + for i in range(typecnt): + gmtoff, isdst, abbrind = ttinfo[i] + gmtoff = _get_supported_offset(gmtoff) + tti = _ttinfo() + tti.offset = gmtoff + tti.dstoffset = datetime.timedelta(0) + tti.delta = datetime.timedelta(seconds=gmtoff) + tti.isdst = isdst + tti.abbr = abbr[abbrind:abbr.find('\x00', abbrind)] + tti.isstd = (ttisstdcnt > i and isstd[i] != 0) + tti.isgmt = (ttisgmtcnt > i and isgmt[i] != 0) + out.ttinfo_list.append(tti) + + # Replace ttinfo indexes for ttinfo objects. + out.trans_idx = [out.ttinfo_list[idx] for idx in out.trans_idx] + + # Set standard, dst, and before ttinfos. before will be + # used when a given time is before any transitions, + # and will be set to the first non-dst ttinfo, or to + # the first dst, if all of them are dst. + out.ttinfo_std = None + out.ttinfo_dst = None + out.ttinfo_before = None + if out.ttinfo_list: + if not out.trans_list_utc: + out.ttinfo_std = out.ttinfo_first = out.ttinfo_list[0] + else: + for i in range(timecnt-1, -1, -1): + tti = out.trans_idx[i] + if not out.ttinfo_std and not tti.isdst: + out.ttinfo_std = tti + elif not out.ttinfo_dst and tti.isdst: + out.ttinfo_dst = tti + + if out.ttinfo_std and out.ttinfo_dst: + break + else: + if out.ttinfo_dst and not out.ttinfo_std: + out.ttinfo_std = out.ttinfo_dst + + for tti in out.ttinfo_list: + if not tti.isdst: + out.ttinfo_before = tti + break + else: + out.ttinfo_before = out.ttinfo_list[0] + + # Now fix transition times to become relative to wall time. + # + # I'm not sure about this. In my tests, the tz source file + # is setup to wall time, and in the binary file isstd and + # isgmt are off, so it should be in wall time. OTOH, it's + # always in gmt time. Let me know if you have comments + # about this. + lastdst = None + lastoffset = None + lastdstoffset = None + lastbaseoffset = None + out.trans_list = [] + + for i, tti in enumerate(out.trans_idx): + offset = tti.offset + dstoffset = 0 + + if lastdst is not None: + if tti.isdst: + if not lastdst: + dstoffset = offset - lastoffset + + if not dstoffset and lastdstoffset: + dstoffset = lastdstoffset + + tti.dstoffset = datetime.timedelta(seconds=dstoffset) + lastdstoffset = dstoffset + + # If a time zone changes its base offset during a DST transition, + # then you need to adjust by the previous base offset to get the + # transition time in local time. Otherwise you use the current + # base offset. Ideally, I would have some mathematical proof of + # why this is true, but I haven't really thought about it enough. + baseoffset = offset - dstoffset + adjustment = baseoffset + if (lastbaseoffset is not None and baseoffset != lastbaseoffset + and tti.isdst != lastdst): + # The base DST has changed + adjustment = lastbaseoffset + + lastdst = tti.isdst + lastoffset = offset + lastbaseoffset = baseoffset + + out.trans_list.append(out.trans_list_utc[i] + adjustment) + + out.trans_idx = tuple(out.trans_idx) + out.trans_list = tuple(out.trans_list) + out.trans_list_utc = tuple(out.trans_list_utc) + + return out + + def _find_last_transition(self, dt, in_utc=False): + # If there's no list, there are no transitions to find + if not self._trans_list: + return None + + timestamp = _datetime_to_timestamp(dt) + + # Find where the timestamp fits in the transition list - if the + # timestamp is a transition time, it's part of the "after" period. + trans_list = self._trans_list_utc if in_utc else self._trans_list + idx = bisect.bisect_right(trans_list, timestamp) + + # We want to know when the previous transition was, so subtract off 1 + return idx - 1 + + def _get_ttinfo(self, idx): + # For no list or after the last transition, default to _ttinfo_std + if idx is None or (idx + 1) >= len(self._trans_list): + return self._ttinfo_std + + # If there is a list and the time is before it, return _ttinfo_before + if idx < 0: + return self._ttinfo_before + + return self._trans_idx[idx] + + def _find_ttinfo(self, dt): + idx = self._resolve_ambiguous_time(dt) + + return self._get_ttinfo(idx) + + def fromutc(self, dt): + """ + The ``tzfile`` implementation of :py:func:`datetime.tzinfo.fromutc`. + + :param dt: + A :py:class:`datetime.datetime` object. + + :raises TypeError: + Raised if ``dt`` is not a :py:class:`datetime.datetime` object. + + :raises ValueError: + Raised if this is called with a ``dt`` which does not have this + ``tzinfo`` attached. + + :return: + Returns a :py:class:`datetime.datetime` object representing the + wall time in ``self``'s time zone. + """ + # These isinstance checks are in datetime.tzinfo, so we'll preserve + # them, even if we don't care about duck typing. + if not isinstance(dt, datetime.datetime): + raise TypeError("fromutc() requires a datetime argument") + + if dt.tzinfo is not self: + raise ValueError("dt.tzinfo is not self") + + # First treat UTC as wall time and get the transition we're in. + idx = self._find_last_transition(dt, in_utc=True) + tti = self._get_ttinfo(idx) + + dt_out = dt + datetime.timedelta(seconds=tti.offset) + + fold = self.is_ambiguous(dt_out, idx=idx) + + return enfold(dt_out, fold=int(fold)) + + def is_ambiguous(self, dt, idx=None): + """ + Whether or not the "wall time" of a given datetime is ambiguous in this + zone. + + :param dt: + A :py:class:`datetime.datetime`, naive or time zone aware. + + + :return: + Returns ``True`` if ambiguous, ``False`` otherwise. + + .. versionadded:: 2.6.0 + """ + if idx is None: + idx = self._find_last_transition(dt) + + # Calculate the difference in offsets from current to previous + timestamp = _datetime_to_timestamp(dt) + tti = self._get_ttinfo(idx) + + if idx is None or idx <= 0: + return False + + od = self._get_ttinfo(idx - 1).offset - tti.offset + tt = self._trans_list[idx] # Transition time + + return timestamp < tt + od + + def _resolve_ambiguous_time(self, dt): + idx = self._find_last_transition(dt) + + # If we have no transitions, return the index + _fold = self._fold(dt) + if idx is None or idx == 0: + return idx + + # If it's ambiguous and we're in a fold, shift to a different index. + idx_offset = int(not _fold and self.is_ambiguous(dt, idx)) + + return idx - idx_offset + + def utcoffset(self, dt): + if dt is None: + return None + + if not self._ttinfo_std: + return ZERO + + return self._find_ttinfo(dt).delta + + def dst(self, dt): + if dt is None: + return None + + if not self._ttinfo_dst: + return ZERO + + tti = self._find_ttinfo(dt) + + if not tti.isdst: + return ZERO + + # The documentation says that utcoffset()-dst() must + # be constant for every dt. + return tti.dstoffset + + @tzname_in_python2 + def tzname(self, dt): + if not self._ttinfo_std or dt is None: + return None + return self._find_ttinfo(dt).abbr + + def __eq__(self, other): + if not isinstance(other, tzfile): + return NotImplemented + return (self._trans_list == other._trans_list and + self._trans_idx == other._trans_idx and + self._ttinfo_list == other._ttinfo_list) + + __hash__ = None + + def __ne__(self, other): + return not (self == other) + + def __repr__(self): + return "%s(%s)" % (self.__class__.__name__, repr(self._filename)) + + def __reduce__(self): + return self.__reduce_ex__(None) + + def __reduce_ex__(self, protocol): + return (self.__class__, (None, self._filename), self.__dict__) + + +class tzrange(tzrangebase): + """ + The ``tzrange`` object is a time zone specified by a set of offsets and + abbreviations, equivalent to the way the ``TZ`` variable can be specified + in POSIX-like systems, but using Python delta objects to specify DST + start, end and offsets. + + :param stdabbr: + The abbreviation for standard time (e.g. ``'EST'``). + + :param stdoffset: + An integer or :class:`datetime.timedelta` object or equivalent + specifying the base offset from UTC. + + If unspecified, +00:00 is used. + + :param dstabbr: + The abbreviation for DST / "Summer" time (e.g. ``'EDT'``). + + If specified, with no other DST information, DST is assumed to occur + and the default behavior or ``dstoffset``, ``start`` and ``end`` is + used. If unspecified and no other DST information is specified, it + is assumed that this zone has no DST. + + If this is unspecified and other DST information is *is* specified, + DST occurs in the zone but the time zone abbreviation is left + unchanged. + + :param dstoffset: + A an integer or :class:`datetime.timedelta` object or equivalent + specifying the UTC offset during DST. If unspecified and any other DST + information is specified, it is assumed to be the STD offset +1 hour. + + :param start: + A :class:`relativedelta.relativedelta` object or equivalent specifying + the time and time of year that daylight savings time starts. To + specify, for example, that DST starts at 2AM on the 2nd Sunday in + March, pass: + + ``relativedelta(hours=2, month=3, day=1, weekday=SU(+2))`` + + If unspecified and any other DST information is specified, the default + value is 2 AM on the first Sunday in April. + + :param end: + A :class:`relativedelta.relativedelta` object or equivalent + representing the time and time of year that daylight savings time + ends, with the same specification method as in ``start``. One note is + that this should point to the first time in the *standard* zone, so if + a transition occurs at 2AM in the DST zone and the clocks are set back + 1 hour to 1AM, set the ``hours`` parameter to +1. + + + **Examples:** + + .. testsetup:: tzrange + + from dateutil.tz import tzrange, tzstr + + .. doctest:: tzrange + + >>> tzstr('EST5EDT') == tzrange("EST", -18000, "EDT") + True + + >>> from dateutil.relativedelta import * + >>> range1 = tzrange("EST", -18000, "EDT") + >>> range2 = tzrange("EST", -18000, "EDT", -14400, + ... relativedelta(hours=+2, month=4, day=1, + ... weekday=SU(+1)), + ... relativedelta(hours=+1, month=10, day=31, + ... weekday=SU(-1))) + >>> tzstr('EST5EDT') == range1 == range2 + True + + """ + def __init__(self, stdabbr, stdoffset=None, + dstabbr=None, dstoffset=None, + start=None, end=None): + + global relativedelta + from dateutil import relativedelta + + self._std_abbr = stdabbr + self._dst_abbr = dstabbr + + try: + stdoffset = stdoffset.total_seconds() + except (TypeError, AttributeError): + pass + + try: + dstoffset = dstoffset.total_seconds() + except (TypeError, AttributeError): + pass + + if stdoffset is not None: + self._std_offset = datetime.timedelta(seconds=stdoffset) + else: + self._std_offset = ZERO + + if dstoffset is not None: + self._dst_offset = datetime.timedelta(seconds=dstoffset) + elif dstabbr and stdoffset is not None: + self._dst_offset = self._std_offset + datetime.timedelta(hours=+1) + else: + self._dst_offset = ZERO + + if dstabbr and start is None: + self._start_delta = relativedelta.relativedelta( + hours=+2, month=4, day=1, weekday=relativedelta.SU(+1)) + else: + self._start_delta = start + + if dstabbr and end is None: + self._end_delta = relativedelta.relativedelta( + hours=+1, month=10, day=31, weekday=relativedelta.SU(-1)) + else: + self._end_delta = end + + self._dst_base_offset_ = self._dst_offset - self._std_offset + self.hasdst = bool(self._start_delta) + + def transitions(self, year): + """ + For a given year, get the DST on and off transition times, expressed + always on the standard time side. For zones with no transitions, this + function returns ``None``. + + :param year: + The year whose transitions you would like to query. + + :return: + Returns a :class:`tuple` of :class:`datetime.datetime` objects, + ``(dston, dstoff)`` for zones with an annual DST transition, or + ``None`` for fixed offset zones. + """ + if not self.hasdst: + return None + + base_year = datetime.datetime(year, 1, 1) + + start = base_year + self._start_delta + end = base_year + self._end_delta + + return (start, end) + + def __eq__(self, other): + if not isinstance(other, tzrange): + return NotImplemented + + return (self._std_abbr == other._std_abbr and + self._dst_abbr == other._dst_abbr and + self._std_offset == other._std_offset and + self._dst_offset == other._dst_offset and + self._start_delta == other._start_delta and + self._end_delta == other._end_delta) + + @property + def _dst_base_offset(self): + return self._dst_base_offset_ + + +@six.add_metaclass(_TzStrFactory) +class tzstr(tzrange): + """ + ``tzstr`` objects are time zone objects specified by a time-zone string as + it would be passed to a ``TZ`` variable on POSIX-style systems (see + the `GNU C Library: TZ Variable`_ for more details). + + There is one notable exception, which is that POSIX-style time zones use an + inverted offset format, so normally ``GMT+3`` would be parsed as an offset + 3 hours *behind* GMT. The ``tzstr`` time zone object will parse this as an + offset 3 hours *ahead* of GMT. If you would like to maintain the POSIX + behavior, pass a ``True`` value to ``posix_offset``. + + The :class:`tzrange` object provides the same functionality, but is + specified using :class:`relativedelta.relativedelta` objects. rather than + strings. + + :param s: + A time zone string in ``TZ`` variable format. This can be a + :class:`bytes` (2.x: :class:`str`), :class:`str` (2.x: + :class:`unicode`) or a stream emitting unicode characters + (e.g. :class:`StringIO`). + + :param posix_offset: + Optional. If set to ``True``, interpret strings such as ``GMT+3`` or + ``UTC+3`` as being 3 hours *behind* UTC rather than ahead, per the + POSIX standard. + + .. caution:: + + Prior to version 2.7.0, this function also supported time zones + in the format: + + * ``EST5EDT,4,0,6,7200,10,0,26,7200,3600`` + * ``EST5EDT,4,1,0,7200,10,-1,0,7200,3600`` + + This format is non-standard and has been deprecated; this function + will raise a :class:`DeprecatedTZFormatWarning` until + support is removed in a future version. + + .. _`GNU C Library: TZ Variable`: + https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html + """ + def __init__(self, s, posix_offset=False): + global parser + from dateutil.parser import _parser as parser + + self._s = s + + res = parser._parsetz(s) + if res is None or res.any_unused_tokens: + raise ValueError("unknown string format") + + # Here we break the compatibility with the TZ variable handling. + # GMT-3 actually *means* the timezone -3. + if res.stdabbr in ("GMT", "UTC") and not posix_offset: + res.stdoffset *= -1 + + # We must initialize it first, since _delta() needs + # _std_offset and _dst_offset set. Use False in start/end + # to avoid building it two times. + tzrange.__init__(self, res.stdabbr, res.stdoffset, + res.dstabbr, res.dstoffset, + start=False, end=False) + + if not res.dstabbr: + self._start_delta = None + self._end_delta = None + else: + self._start_delta = self._delta(res.start) + if self._start_delta: + self._end_delta = self._delta(res.end, isend=1) + + self.hasdst = bool(self._start_delta) + + def _delta(self, x, isend=0): + from dateutil import relativedelta + kwargs = {} + if x.month is not None: + kwargs["month"] = x.month + if x.weekday is not None: + kwargs["weekday"] = relativedelta.weekday(x.weekday, x.week) + if x.week > 0: + kwargs["day"] = 1 + else: + kwargs["day"] = 31 + elif x.day: + kwargs["day"] = x.day + elif x.yday is not None: + kwargs["yearday"] = x.yday + elif x.jyday is not None: + kwargs["nlyearday"] = x.jyday + if not kwargs: + # Default is to start on first sunday of april, and end + # on last sunday of october. + if not isend: + kwargs["month"] = 4 + kwargs["day"] = 1 + kwargs["weekday"] = relativedelta.SU(+1) + else: + kwargs["month"] = 10 + kwargs["day"] = 31 + kwargs["weekday"] = relativedelta.SU(-1) + if x.time is not None: + kwargs["seconds"] = x.time + else: + # Default is 2AM. + kwargs["seconds"] = 7200 + if isend: + # Convert to standard time, to follow the documented way + # of working with the extra hour. See the documentation + # of the tzinfo class. + delta = self._dst_offset - self._std_offset + kwargs["seconds"] -= delta.seconds + delta.days * 86400 + return relativedelta.relativedelta(**kwargs) + + def __repr__(self): + return "%s(%s)" % (self.__class__.__name__, repr(self._s)) + + +class _tzicalvtzcomp(object): + def __init__(self, tzoffsetfrom, tzoffsetto, isdst, + tzname=None, rrule=None): + self.tzoffsetfrom = datetime.timedelta(seconds=tzoffsetfrom) + self.tzoffsetto = datetime.timedelta(seconds=tzoffsetto) + self.tzoffsetdiff = self.tzoffsetto - self.tzoffsetfrom + self.isdst = isdst + self.tzname = tzname + self.rrule = rrule + + +class _tzicalvtz(_tzinfo): + def __init__(self, tzid, comps=[]): + super(_tzicalvtz, self).__init__() + + self._tzid = tzid + self._comps = comps + self._cachedate = [] + self._cachecomp = [] + self._cache_lock = _thread.allocate_lock() + + def _find_comp(self, dt): + if len(self._comps) == 1: + return self._comps[0] + + dt = dt.replace(tzinfo=None) + + try: + with self._cache_lock: + return self._cachecomp[self._cachedate.index( + (dt, self._fold(dt)))] + except ValueError: + pass + + lastcompdt = None + lastcomp = None + + for comp in self._comps: + compdt = self._find_compdt(comp, dt) + + if compdt and (not lastcompdt or lastcompdt < compdt): + lastcompdt = compdt + lastcomp = comp + + if not lastcomp: + # RFC says nothing about what to do when a given + # time is before the first onset date. We'll look for the + # first standard component, or the first component, if + # none is found. + for comp in self._comps: + if not comp.isdst: + lastcomp = comp + break + else: + lastcomp = comp[0] + + with self._cache_lock: + self._cachedate.insert(0, (dt, self._fold(dt))) + self._cachecomp.insert(0, lastcomp) + + if len(self._cachedate) > 10: + self._cachedate.pop() + self._cachecomp.pop() + + return lastcomp + + def _find_compdt(self, comp, dt): + if comp.tzoffsetdiff < ZERO and self._fold(dt): + dt -= comp.tzoffsetdiff + + compdt = comp.rrule.before(dt, inc=True) + + return compdt + + def utcoffset(self, dt): + if dt is None: + return None + + return self._find_comp(dt).tzoffsetto + + def dst(self, dt): + comp = self._find_comp(dt) + if comp.isdst: + return comp.tzoffsetdiff + else: + return ZERO + + @tzname_in_python2 + def tzname(self, dt): + return self._find_comp(dt).tzname + + def __repr__(self): + return "" % repr(self._tzid) + + __reduce__ = object.__reduce__ + + +class tzical(object): + """ + This object is designed to parse an iCalendar-style ``VTIMEZONE`` structure + as set out in `RFC 5545`_ Section 4.6.5 into one or more `tzinfo` objects. + + :param `fileobj`: + A file or stream in iCalendar format, which should be UTF-8 encoded + with CRLF endings. + + .. _`RFC 5545`: https://tools.ietf.org/html/rfc5545 + """ + def __init__(self, fileobj): + global rrule + from dateutil import rrule + + if isinstance(fileobj, string_types): + self._s = fileobj + # ical should be encoded in UTF-8 with CRLF + fileobj = open(fileobj, 'r') + else: + self._s = getattr(fileobj, 'name', repr(fileobj)) + fileobj = _nullcontext(fileobj) + + self._vtz = {} + + with fileobj as fobj: + self._parse_rfc(fobj.read()) + + def keys(self): + """ + Retrieves the available time zones as a list. + """ + return list(self._vtz.keys()) + + def get(self, tzid=None): + """ + Retrieve a :py:class:`datetime.tzinfo` object by its ``tzid``. + + :param tzid: + If there is exactly one time zone available, omitting ``tzid`` + or passing :py:const:`None` value returns it. Otherwise a valid + key (which can be retrieved from :func:`keys`) is required. + + :raises ValueError: + Raised if ``tzid`` is not specified but there are either more + or fewer than 1 zone defined. + + :returns: + Returns either a :py:class:`datetime.tzinfo` object representing + the relevant time zone or :py:const:`None` if the ``tzid`` was + not found. + """ + if tzid is None: + if len(self._vtz) == 0: + raise ValueError("no timezones defined") + elif len(self._vtz) > 1: + raise ValueError("more than one timezone available") + tzid = next(iter(self._vtz)) + + return self._vtz.get(tzid) + + def _parse_offset(self, s): + s = s.strip() + if not s: + raise ValueError("empty offset") + if s[0] in ('+', '-'): + signal = (-1, +1)[s[0] == '+'] + s = s[1:] + else: + signal = +1 + if len(s) == 4: + return (int(s[:2]) * 3600 + int(s[2:]) * 60) * signal + elif len(s) == 6: + return (int(s[:2]) * 3600 + int(s[2:4]) * 60 + int(s[4:])) * signal + else: + raise ValueError("invalid offset: " + s) + + def _parse_rfc(self, s): + lines = s.splitlines() + if not lines: + raise ValueError("empty string") + + # Unfold + i = 0 + while i < len(lines): + line = lines[i].rstrip() + if not line: + del lines[i] + elif i > 0 and line[0] == " ": + lines[i-1] += line[1:] + del lines[i] + else: + i += 1 + + tzid = None + comps = [] + invtz = False + comptype = None + for line in lines: + if not line: + continue + name, value = line.split(':', 1) + parms = name.split(';') + if not parms: + raise ValueError("empty property name") + name = parms[0].upper() + parms = parms[1:] + if invtz: + if name == "BEGIN": + if value in ("STANDARD", "DAYLIGHT"): + # Process component + pass + else: + raise ValueError("unknown component: "+value) + comptype = value + founddtstart = False + tzoffsetfrom = None + tzoffsetto = None + rrulelines = [] + tzname = None + elif name == "END": + if value == "VTIMEZONE": + if comptype: + raise ValueError("component not closed: "+comptype) + if not tzid: + raise ValueError("mandatory TZID not found") + if not comps: + raise ValueError( + "at least one component is needed") + # Process vtimezone + self._vtz[tzid] = _tzicalvtz(tzid, comps) + invtz = False + elif value == comptype: + if not founddtstart: + raise ValueError("mandatory DTSTART not found") + if tzoffsetfrom is None: + raise ValueError( + "mandatory TZOFFSETFROM not found") + if tzoffsetto is None: + raise ValueError( + "mandatory TZOFFSETFROM not found") + # Process component + rr = None + if rrulelines: + rr = rrule.rrulestr("\n".join(rrulelines), + compatible=True, + ignoretz=True, + cache=True) + comp = _tzicalvtzcomp(tzoffsetfrom, tzoffsetto, + (comptype == "DAYLIGHT"), + tzname, rr) + comps.append(comp) + comptype = None + else: + raise ValueError("invalid component end: "+value) + elif comptype: + if name == "DTSTART": + # DTSTART in VTIMEZONE takes a subset of valid RRULE + # values under RFC 5545. + for parm in parms: + if parm != 'VALUE=DATE-TIME': + msg = ('Unsupported DTSTART param in ' + + 'VTIMEZONE: ' + parm) + raise ValueError(msg) + rrulelines.append(line) + founddtstart = True + elif name in ("RRULE", "RDATE", "EXRULE", "EXDATE"): + rrulelines.append(line) + elif name == "TZOFFSETFROM": + if parms: + raise ValueError( + "unsupported %s parm: %s " % (name, parms[0])) + tzoffsetfrom = self._parse_offset(value) + elif name == "TZOFFSETTO": + if parms: + raise ValueError( + "unsupported TZOFFSETTO parm: "+parms[0]) + tzoffsetto = self._parse_offset(value) + elif name == "TZNAME": + if parms: + raise ValueError( + "unsupported TZNAME parm: "+parms[0]) + tzname = value + elif name == "COMMENT": + pass + else: + raise ValueError("unsupported property: "+name) + else: + if name == "TZID": + if parms: + raise ValueError( + "unsupported TZID parm: "+parms[0]) + tzid = value + elif name in ("TZURL", "LAST-MODIFIED", "COMMENT"): + pass + else: + raise ValueError("unsupported property: "+name) + elif name == "BEGIN" and value == "VTIMEZONE": + tzid = None + comps = [] + invtz = True + + def __repr__(self): + return "%s(%s)" % (self.__class__.__name__, repr(self._s)) + + +if sys.platform != "win32": + TZFILES = ["/etc/localtime", "localtime"] + TZPATHS = ["/usr/share/zoneinfo", + "/usr/lib/zoneinfo", + "/usr/share/lib/zoneinfo", + "/etc/zoneinfo"] +else: + TZFILES = [] + TZPATHS = [] + + +def __get_gettz(): + tzlocal_classes = (tzlocal,) + if tzwinlocal is not None: + tzlocal_classes += (tzwinlocal,) + + class GettzFunc(object): + """ + Retrieve a time zone object from a string representation + + This function is intended to retrieve the :py:class:`tzinfo` subclass + that best represents the time zone that would be used if a POSIX + `TZ variable`_ were set to the same value. + + If no argument or an empty string is passed to ``gettz``, local time + is returned: + + .. code-block:: python3 + + >>> gettz() + tzfile('/etc/localtime') + + This function is also the preferred way to map IANA tz database keys + to :class:`tzfile` objects: + + .. code-block:: python3 + + >>> gettz('Pacific/Kiritimati') + tzfile('/usr/share/zoneinfo/Pacific/Kiritimati') + + On Windows, the standard is extended to include the Windows-specific + zone names provided by the operating system: + + .. code-block:: python3 + + >>> gettz('Egypt Standard Time') + tzwin('Egypt Standard Time') + + Passing a GNU ``TZ`` style string time zone specification returns a + :class:`tzstr` object: + + .. code-block:: python3 + + >>> gettz('AEST-10AEDT-11,M10.1.0/2,M4.1.0/3') + tzstr('AEST-10AEDT-11,M10.1.0/2,M4.1.0/3') + + :param name: + A time zone name (IANA, or, on Windows, Windows keys), location of + a ``tzfile(5)`` zoneinfo file or ``TZ`` variable style time zone + specifier. An empty string, no argument or ``None`` is interpreted + as local time. + + :return: + Returns an instance of one of ``dateutil``'s :py:class:`tzinfo` + subclasses. + + .. versionchanged:: 2.7.0 + + After version 2.7.0, any two calls to ``gettz`` using the same + input strings will return the same object: + + .. code-block:: python3 + + >>> tz.gettz('America/Chicago') is tz.gettz('America/Chicago') + True + + In addition to improving performance, this ensures that + `"same zone" semantics`_ are used for datetimes in the same zone. + + + .. _`TZ variable`: + https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html + + .. _`"same zone" semantics`: + https://blog.ganssle.io/articles/2018/02/aware-datetime-arithmetic.html + """ + def __init__(self): + + self.__instances = weakref.WeakValueDictionary() + self.__strong_cache_size = 8 + self.__strong_cache = OrderedDict() + self._cache_lock = _thread.allocate_lock() + + def __call__(self, name=None): + with self._cache_lock: + rv = self.__instances.get(name, None) + + if rv is None: + rv = self.nocache(name=name) + if not (name is None + or isinstance(rv, tzlocal_classes) + or rv is None): + # tzlocal is slightly more complicated than the other + # time zone providers because it depends on environment + # at construction time, so don't cache that. + # + # We also cannot store weak references to None, so we + # will also not store that. + self.__instances[name] = rv + else: + # No need for strong caching, return immediately + return rv + + self.__strong_cache[name] = self.__strong_cache.pop(name, rv) + + if len(self.__strong_cache) > self.__strong_cache_size: + self.__strong_cache.popitem(last=False) + + return rv + + def set_cache_size(self, size): + with self._cache_lock: + self.__strong_cache_size = size + while len(self.__strong_cache) > size: + self.__strong_cache.popitem(last=False) + + def cache_clear(self): + with self._cache_lock: + self.__instances = weakref.WeakValueDictionary() + self.__strong_cache.clear() + + @staticmethod + def nocache(name=None): + """A non-cached version of gettz""" + tz = None + if not name: + try: + name = os.environ["TZ"] + except KeyError: + pass + if name is None or name in ("", ":"): + for filepath in TZFILES: + if not os.path.isabs(filepath): + filename = filepath + for path in TZPATHS: + filepath = os.path.join(path, filename) + if os.path.isfile(filepath): + break + else: + continue + if os.path.isfile(filepath): + try: + tz = tzfile(filepath) + break + except (IOError, OSError, ValueError): + pass + else: + tz = tzlocal() + else: + try: + if name.startswith(":"): + name = name[1:] + except TypeError as e: + if isinstance(name, bytes): + new_msg = "gettz argument should be str, not bytes" + six.raise_from(TypeError(new_msg), e) + else: + raise + if os.path.isabs(name): + if os.path.isfile(name): + tz = tzfile(name) + else: + tz = None + else: + for path in TZPATHS: + filepath = os.path.join(path, name) + if not os.path.isfile(filepath): + filepath = filepath.replace(' ', '_') + if not os.path.isfile(filepath): + continue + try: + tz = tzfile(filepath) + break + except (IOError, OSError, ValueError): + pass + else: + tz = None + if tzwin is not None: + try: + tz = tzwin(name) + except (WindowsError, UnicodeEncodeError): + # UnicodeEncodeError is for Python 2.7 compat + tz = None + + if not tz: + from dateutil.zoneinfo import get_zonefile_instance + tz = get_zonefile_instance().get(name) + + if not tz: + for c in name: + # name is not a tzstr unless it has at least + # one offset. For short values of "name", an + # explicit for loop seems to be the fastest way + # To determine if a string contains a digit + if c in "0123456789": + try: + tz = tzstr(name) + except ValueError: + pass + break + else: + if name in ("GMT", "UTC"): + tz = UTC + elif name in time.tzname: + tz = tzlocal() + return tz + + return GettzFunc() + + +gettz = __get_gettz() +del __get_gettz + + +def datetime_exists(dt, tz=None): + """ + Given a datetime and a time zone, determine whether or not a given datetime + would fall in a gap. + + :param dt: + A :class:`datetime.datetime` (whose time zone will be ignored if ``tz`` + is provided.) + + :param tz: + A :class:`datetime.tzinfo` with support for the ``fold`` attribute. If + ``None`` or not provided, the datetime's own time zone will be used. + + :return: + Returns a boolean value whether or not the "wall time" exists in + ``tz``. + + .. versionadded:: 2.7.0 + """ + if tz is None: + if dt.tzinfo is None: + raise ValueError('Datetime is naive and no time zone provided.') + tz = dt.tzinfo + + dt = dt.replace(tzinfo=None) + + # This is essentially a test of whether or not the datetime can survive + # a round trip to UTC. + dt_rt = dt.replace(tzinfo=tz).astimezone(UTC).astimezone(tz) + dt_rt = dt_rt.replace(tzinfo=None) + + return dt == dt_rt + + +def datetime_ambiguous(dt, tz=None): + """ + Given a datetime and a time zone, determine whether or not a given datetime + is ambiguous (i.e if there are two times differentiated only by their DST + status). + + :param dt: + A :class:`datetime.datetime` (whose time zone will be ignored if ``tz`` + is provided.) + + :param tz: + A :class:`datetime.tzinfo` with support for the ``fold`` attribute. If + ``None`` or not provided, the datetime's own time zone will be used. + + :return: + Returns a boolean value whether or not the "wall time" is ambiguous in + ``tz``. + + .. versionadded:: 2.6.0 + """ + if tz is None: + if dt.tzinfo is None: + raise ValueError('Datetime is naive and no time zone provided.') + + tz = dt.tzinfo + + # If a time zone defines its own "is_ambiguous" function, we'll use that. + is_ambiguous_fn = getattr(tz, 'is_ambiguous', None) + if is_ambiguous_fn is not None: + try: + return tz.is_ambiguous(dt) + except Exception: + pass + + # If it doesn't come out and tell us it's ambiguous, we'll just check if + # the fold attribute has any effect on this particular date and time. + dt = dt.replace(tzinfo=tz) + wall_0 = enfold(dt, fold=0) + wall_1 = enfold(dt, fold=1) + + same_offset = wall_0.utcoffset() == wall_1.utcoffset() + same_dst = wall_0.dst() == wall_1.dst() + + return not (same_offset and same_dst) + + +def resolve_imaginary(dt): + """ + Given a datetime that may be imaginary, return an existing datetime. + + This function assumes that an imaginary datetime represents what the + wall time would be in a zone had the offset transition not occurred, so + it will always fall forward by the transition's change in offset. + + .. doctest:: + + >>> from dateutil import tz + >>> from datetime import datetime + >>> NYC = tz.gettz('America/New_York') + >>> print(tz.resolve_imaginary(datetime(2017, 3, 12, 2, 30, tzinfo=NYC))) + 2017-03-12 03:30:00-04:00 + + >>> KIR = tz.gettz('Pacific/Kiritimati') + >>> print(tz.resolve_imaginary(datetime(1995, 1, 1, 12, 30, tzinfo=KIR))) + 1995-01-02 12:30:00+14:00 + + As a note, :func:`datetime.astimezone` is guaranteed to produce a valid, + existing datetime, so a round-trip to and from UTC is sufficient to get + an extant datetime, however, this generally "falls back" to an earlier time + rather than falling forward to the STD side (though no guarantees are made + about this behavior). + + :param dt: + A :class:`datetime.datetime` which may or may not exist. + + :return: + Returns an existing :class:`datetime.datetime`. If ``dt`` was not + imaginary, the datetime returned is guaranteed to be the same object + passed to the function. + + .. versionadded:: 2.7.0 + """ + if dt.tzinfo is not None and not datetime_exists(dt): + + curr_offset = (dt + datetime.timedelta(hours=24)).utcoffset() + old_offset = (dt - datetime.timedelta(hours=24)).utcoffset() + + dt += curr_offset - old_offset + + return dt + + +def _datetime_to_timestamp(dt): + """ + Convert a :class:`datetime.datetime` object to an epoch timestamp in + seconds since January 1, 1970, ignoring the time zone. + """ + return (dt.replace(tzinfo=None) - EPOCH).total_seconds() + + +if sys.version_info >= (3, 6): + def _get_supported_offset(second_offset): + return second_offset +else: + def _get_supported_offset(second_offset): + # For python pre-3.6, round to full-minutes if that's not the case. + # Python's datetime doesn't accept sub-minute timezones. Check + # http://python.org/sf/1447945 or https://bugs.python.org/issue5288 + # for some information. + old_offset = second_offset + calculated_offset = 60 * ((second_offset + 30) // 60) + return calculated_offset + + +try: + # Python 3.7 feature + from contextlib import nullcontext as _nullcontext +except ImportError: + class _nullcontext(object): + """ + Class for wrapping contexts so that they are passed through in a + with statement. + """ + def __init__(self, context): + self.context = context + + def __enter__(self): + return self.context + + def __exit__(*args, **kwargs): + pass + +# vim:ts=4:sw=4:et diff --git a/venv/lib/python3.12/site-packages/dateutil/tz/win.py b/venv/lib/python3.12/site-packages/dateutil/tz/win.py new file mode 100644 index 0000000000000000000000000000000000000000..cde07ba792c40903f0c334839140173b39fd8124 --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/tz/win.py @@ -0,0 +1,370 @@ +# -*- coding: utf-8 -*- +""" +This module provides an interface to the native time zone data on Windows, +including :py:class:`datetime.tzinfo` implementations. + +Attempting to import this module on a non-Windows platform will raise an +:py:obj:`ImportError`. +""" +# This code was originally contributed by Jeffrey Harris. +import datetime +import struct + +from six.moves import winreg +from six import text_type + +try: + import ctypes + from ctypes import wintypes +except ValueError: + # ValueError is raised on non-Windows systems for some horrible reason. + raise ImportError("Running tzwin on non-Windows system") + +from ._common import tzrangebase + +__all__ = ["tzwin", "tzwinlocal", "tzres"] + +ONEWEEK = datetime.timedelta(7) + +TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones" +TZKEYNAME9X = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones" +TZLOCALKEYNAME = r"SYSTEM\CurrentControlSet\Control\TimeZoneInformation" + + +def _settzkeyname(): + handle = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) + try: + winreg.OpenKey(handle, TZKEYNAMENT).Close() + TZKEYNAME = TZKEYNAMENT + except WindowsError: + TZKEYNAME = TZKEYNAME9X + handle.Close() + return TZKEYNAME + + +TZKEYNAME = _settzkeyname() + + +class tzres(object): + """ + Class for accessing ``tzres.dll``, which contains timezone name related + resources. + + .. versionadded:: 2.5.0 + """ + p_wchar = ctypes.POINTER(wintypes.WCHAR) # Pointer to a wide char + + def __init__(self, tzres_loc='tzres.dll'): + # Load the user32 DLL so we can load strings from tzres + user32 = ctypes.WinDLL('user32') + + # Specify the LoadStringW function + user32.LoadStringW.argtypes = (wintypes.HINSTANCE, + wintypes.UINT, + wintypes.LPWSTR, + ctypes.c_int) + + self.LoadStringW = user32.LoadStringW + self._tzres = ctypes.WinDLL(tzres_loc) + self.tzres_loc = tzres_loc + + def load_name(self, offset): + """ + Load a timezone name from a DLL offset (integer). + + >>> from dateutil.tzwin import tzres + >>> tzr = tzres() + >>> print(tzr.load_name(112)) + 'Eastern Standard Time' + + :param offset: + A positive integer value referring to a string from the tzres dll. + + .. note:: + + Offsets found in the registry are generally of the form + ``@tzres.dll,-114``. The offset in this case is 114, not -114. + + """ + resource = self.p_wchar() + lpBuffer = ctypes.cast(ctypes.byref(resource), wintypes.LPWSTR) + nchar = self.LoadStringW(self._tzres._handle, offset, lpBuffer, 0) + return resource[:nchar] + + def name_from_string(self, tzname_str): + """ + Parse strings as returned from the Windows registry into the time zone + name as defined in the registry. + + >>> from dateutil.tzwin import tzres + >>> tzr = tzres() + >>> print(tzr.name_from_string('@tzres.dll,-251')) + 'Dateline Daylight Time' + >>> print(tzr.name_from_string('Eastern Standard Time')) + 'Eastern Standard Time' + + :param tzname_str: + A timezone name string as returned from a Windows registry key. + + :return: + Returns the localized timezone string from tzres.dll if the string + is of the form `@tzres.dll,-offset`, else returns the input string. + """ + if not tzname_str.startswith('@'): + return tzname_str + + name_splt = tzname_str.split(',-') + try: + offset = int(name_splt[1]) + except: + raise ValueError("Malformed timezone string.") + + return self.load_name(offset) + + +class tzwinbase(tzrangebase): + """tzinfo class based on win32's timezones available in the registry.""" + def __init__(self): + raise NotImplementedError('tzwinbase is an abstract base class') + + def __eq__(self, other): + # Compare on all relevant dimensions, including name. + if not isinstance(other, tzwinbase): + return NotImplemented + + return (self._std_offset == other._std_offset and + self._dst_offset == other._dst_offset and + self._stddayofweek == other._stddayofweek and + self._dstdayofweek == other._dstdayofweek and + self._stdweeknumber == other._stdweeknumber and + self._dstweeknumber == other._dstweeknumber and + self._stdhour == other._stdhour and + self._dsthour == other._dsthour and + self._stdminute == other._stdminute and + self._dstminute == other._dstminute and + self._std_abbr == other._std_abbr and + self._dst_abbr == other._dst_abbr) + + @staticmethod + def list(): + """Return a list of all time zones known to the system.""" + with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle: + with winreg.OpenKey(handle, TZKEYNAME) as tzkey: + result = [winreg.EnumKey(tzkey, i) + for i in range(winreg.QueryInfoKey(tzkey)[0])] + return result + + def display(self): + """ + Return the display name of the time zone. + """ + return self._display + + def transitions(self, year): + """ + For a given year, get the DST on and off transition times, expressed + always on the standard time side. For zones with no transitions, this + function returns ``None``. + + :param year: + The year whose transitions you would like to query. + + :return: + Returns a :class:`tuple` of :class:`datetime.datetime` objects, + ``(dston, dstoff)`` for zones with an annual DST transition, or + ``None`` for fixed offset zones. + """ + + if not self.hasdst: + return None + + dston = picknthweekday(year, self._dstmonth, self._dstdayofweek, + self._dsthour, self._dstminute, + self._dstweeknumber) + + dstoff = picknthweekday(year, self._stdmonth, self._stddayofweek, + self._stdhour, self._stdminute, + self._stdweeknumber) + + # Ambiguous dates default to the STD side + dstoff -= self._dst_base_offset + + return dston, dstoff + + def _get_hasdst(self): + return self._dstmonth != 0 + + @property + def _dst_base_offset(self): + return self._dst_base_offset_ + + +class tzwin(tzwinbase): + """ + Time zone object created from the zone info in the Windows registry + + These are similar to :py:class:`dateutil.tz.tzrange` objects in that + the time zone data is provided in the format of a single offset rule + for either 0 or 2 time zone transitions per year. + + :param: name + The name of a Windows time zone key, e.g. "Eastern Standard Time". + The full list of keys can be retrieved with :func:`tzwin.list`. + """ + + def __init__(self, name): + self._name = name + + with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle: + tzkeyname = text_type("{kn}\\{name}").format(kn=TZKEYNAME, name=name) + with winreg.OpenKey(handle, tzkeyname) as tzkey: + keydict = valuestodict(tzkey) + + self._std_abbr = keydict["Std"] + self._dst_abbr = keydict["Dlt"] + + self._display = keydict["Display"] + + # See http://ww_winreg.jsiinc.com/SUBA/tip0300/rh0398.htm + tup = struct.unpack("=3l16h", keydict["TZI"]) + stdoffset = -tup[0]-tup[1] # Bias + StandardBias * -1 + dstoffset = stdoffset-tup[2] # + DaylightBias * -1 + self._std_offset = datetime.timedelta(minutes=stdoffset) + self._dst_offset = datetime.timedelta(minutes=dstoffset) + + # for the meaning see the win32 TIME_ZONE_INFORMATION structure docs + # http://msdn.microsoft.com/en-us/library/windows/desktop/ms725481(v=vs.85).aspx + (self._stdmonth, + self._stddayofweek, # Sunday = 0 + self._stdweeknumber, # Last = 5 + self._stdhour, + self._stdminute) = tup[4:9] + + (self._dstmonth, + self._dstdayofweek, # Sunday = 0 + self._dstweeknumber, # Last = 5 + self._dsthour, + self._dstminute) = tup[12:17] + + self._dst_base_offset_ = self._dst_offset - self._std_offset + self.hasdst = self._get_hasdst() + + def __repr__(self): + return "tzwin(%s)" % repr(self._name) + + def __reduce__(self): + return (self.__class__, (self._name,)) + + +class tzwinlocal(tzwinbase): + """ + Class representing the local time zone information in the Windows registry + + While :class:`dateutil.tz.tzlocal` makes system calls (via the :mod:`time` + module) to retrieve time zone information, ``tzwinlocal`` retrieves the + rules directly from the Windows registry and creates an object like + :class:`dateutil.tz.tzwin`. + + Because Windows does not have an equivalent of :func:`time.tzset`, on + Windows, :class:`dateutil.tz.tzlocal` instances will always reflect the + time zone settings *at the time that the process was started*, meaning + changes to the machine's time zone settings during the run of a program + on Windows will **not** be reflected by :class:`dateutil.tz.tzlocal`. + Because ``tzwinlocal`` reads the registry directly, it is unaffected by + this issue. + """ + def __init__(self): + with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle: + with winreg.OpenKey(handle, TZLOCALKEYNAME) as tzlocalkey: + keydict = valuestodict(tzlocalkey) + + self._std_abbr = keydict["StandardName"] + self._dst_abbr = keydict["DaylightName"] + + try: + tzkeyname = text_type('{kn}\\{sn}').format(kn=TZKEYNAME, + sn=self._std_abbr) + with winreg.OpenKey(handle, tzkeyname) as tzkey: + _keydict = valuestodict(tzkey) + self._display = _keydict["Display"] + except OSError: + self._display = None + + stdoffset = -keydict["Bias"]-keydict["StandardBias"] + dstoffset = stdoffset-keydict["DaylightBias"] + + self._std_offset = datetime.timedelta(minutes=stdoffset) + self._dst_offset = datetime.timedelta(minutes=dstoffset) + + # For reasons unclear, in this particular key, the day of week has been + # moved to the END of the SYSTEMTIME structure. + tup = struct.unpack("=8h", keydict["StandardStart"]) + + (self._stdmonth, + self._stdweeknumber, # Last = 5 + self._stdhour, + self._stdminute) = tup[1:5] + + self._stddayofweek = tup[7] + + tup = struct.unpack("=8h", keydict["DaylightStart"]) + + (self._dstmonth, + self._dstweeknumber, # Last = 5 + self._dsthour, + self._dstminute) = tup[1:5] + + self._dstdayofweek = tup[7] + + self._dst_base_offset_ = self._dst_offset - self._std_offset + self.hasdst = self._get_hasdst() + + def __repr__(self): + return "tzwinlocal()" + + def __str__(self): + # str will return the standard name, not the daylight name. + return "tzwinlocal(%s)" % repr(self._std_abbr) + + def __reduce__(self): + return (self.__class__, ()) + + +def picknthweekday(year, month, dayofweek, hour, minute, whichweek): + """ dayofweek == 0 means Sunday, whichweek 5 means last instance """ + first = datetime.datetime(year, month, 1, hour, minute) + + # This will work if dayofweek is ISO weekday (1-7) or Microsoft-style (0-6), + # Because 7 % 7 = 0 + weekdayone = first.replace(day=((dayofweek - first.isoweekday()) % 7) + 1) + wd = weekdayone + ((whichweek - 1) * ONEWEEK) + if (wd.month != month): + wd -= ONEWEEK + + return wd + + +def valuestodict(key): + """Convert a registry key's values to a dictionary.""" + dout = {} + size = winreg.QueryInfoKey(key)[1] + tz_res = None + + for i in range(size): + key_name, value, dtype = winreg.EnumValue(key, i) + if dtype == winreg.REG_DWORD or dtype == winreg.REG_DWORD_LITTLE_ENDIAN: + # If it's a DWORD (32-bit integer), it's stored as unsigned - convert + # that to a proper signed integer + if value & (1 << 31): + value = value - (1 << 32) + elif dtype == winreg.REG_SZ: + # If it's a reference to the tzres DLL, load the actual string + if value.startswith('@tzres'): + tz_res = tz_res or tzres() + value = tz_res.name_from_string(value) + + value = value.rstrip('\x00') # Remove trailing nulls + + dout[key_name] = value + + return dout diff --git a/venv/lib/python3.12/site-packages/dateutil/tzwin.py b/venv/lib/python3.12/site-packages/dateutil/tzwin.py new file mode 100644 index 0000000000000000000000000000000000000000..cebc673e40fc376653ebf037e96f0a6d0b33e906 --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/tzwin.py @@ -0,0 +1,2 @@ +# tzwin has moved to dateutil.tz.win +from .tz.win import * diff --git a/venv/lib/python3.12/site-packages/dateutil/utils.py b/venv/lib/python3.12/site-packages/dateutil/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..dd2d245a0bebcd5fc37ac20526aabbd5358dab0e --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/utils.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +""" +This module offers general convenience and utility functions for dealing with +datetimes. + +.. versionadded:: 2.7.0 +""" +from __future__ import unicode_literals + +from datetime import datetime, time + + +def today(tzinfo=None): + """ + Returns a :py:class:`datetime` representing the current day at midnight + + :param tzinfo: + The time zone to attach (also used to determine the current day). + + :return: + A :py:class:`datetime.datetime` object representing the current day + at midnight. + """ + + dt = datetime.now(tzinfo) + return datetime.combine(dt.date(), time(0, tzinfo=tzinfo)) + + +def default_tzinfo(dt, tzinfo): + """ + Sets the ``tzinfo`` parameter on naive datetimes only + + This is useful for example when you are provided a datetime that may have + either an implicit or explicit time zone, such as when parsing a time zone + string. + + .. doctest:: + + >>> from dateutil.tz import tzoffset + >>> from dateutil.parser import parse + >>> from dateutil.utils import default_tzinfo + >>> dflt_tz = tzoffset("EST", -18000) + >>> print(default_tzinfo(parse('2014-01-01 12:30 UTC'), dflt_tz)) + 2014-01-01 12:30:00+00:00 + >>> print(default_tzinfo(parse('2014-01-01 12:30'), dflt_tz)) + 2014-01-01 12:30:00-05:00 + + :param dt: + The datetime on which to replace the time zone + + :param tzinfo: + The :py:class:`datetime.tzinfo` subclass instance to assign to + ``dt`` if (and only if) it is naive. + + :return: + Returns an aware :py:class:`datetime.datetime`. + """ + if dt.tzinfo is not None: + return dt + else: + return dt.replace(tzinfo=tzinfo) + + +def within_delta(dt1, dt2, delta): + """ + Useful for comparing two datetimes that may have a negligible difference + to be considered equal. + """ + delta = abs(delta) + difference = dt1 - dt2 + return -delta <= difference <= delta diff --git a/venv/lib/python3.12/site-packages/dateutil/zoneinfo/__init__.py b/venv/lib/python3.12/site-packages/dateutil/zoneinfo/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..34f11ad66c88047f2c049a4cdcc937b4b78ea6d6 --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/zoneinfo/__init__.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +import warnings +import json + +from tarfile import TarFile +from pkgutil import get_data +from io import BytesIO + +from dateutil.tz import tzfile as _tzfile + +__all__ = ["get_zonefile_instance", "gettz", "gettz_db_metadata"] + +ZONEFILENAME = "dateutil-zoneinfo.tar.gz" +METADATA_FN = 'METADATA' + + +class tzfile(_tzfile): + def __reduce__(self): + return (gettz, (self._filename,)) + + +def getzoneinfofile_stream(): + try: + return BytesIO(get_data(__name__, ZONEFILENAME)) + except IOError as e: # TODO switch to FileNotFoundError? + warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror)) + return None + + +class ZoneInfoFile(object): + def __init__(self, zonefile_stream=None): + if zonefile_stream is not None: + with TarFile.open(fileobj=zonefile_stream) as tf: + self.zones = {zf.name: tzfile(tf.extractfile(zf), filename=zf.name) + for zf in tf.getmembers() + if zf.isfile() and zf.name != METADATA_FN} + # deal with links: They'll point to their parent object. Less + # waste of memory + links = {zl.name: self.zones[zl.linkname] + for zl in tf.getmembers() if + zl.islnk() or zl.issym()} + self.zones.update(links) + try: + metadata_json = tf.extractfile(tf.getmember(METADATA_FN)) + metadata_str = metadata_json.read().decode('UTF-8') + self.metadata = json.loads(metadata_str) + except KeyError: + # no metadata in tar file + self.metadata = None + else: + self.zones = {} + self.metadata = None + + def get(self, name, default=None): + """ + Wrapper for :func:`ZoneInfoFile.zones.get`. This is a convenience method + for retrieving zones from the zone dictionary. + + :param name: + The name of the zone to retrieve. (Generally IANA zone names) + + :param default: + The value to return in the event of a missing key. + + .. versionadded:: 2.6.0 + + """ + return self.zones.get(name, default) + + +# The current API has gettz as a module function, although in fact it taps into +# a stateful class. So as a workaround for now, without changing the API, we +# will create a new "global" class instance the first time a user requests a +# timezone. Ugly, but adheres to the api. +# +# TODO: Remove after deprecation period. +_CLASS_ZONE_INSTANCE = [] + + +def get_zonefile_instance(new_instance=False): + """ + This is a convenience function which provides a :class:`ZoneInfoFile` + instance using the data provided by the ``dateutil`` package. By default, it + caches a single instance of the ZoneInfoFile object and returns that. + + :param new_instance: + If ``True``, a new instance of :class:`ZoneInfoFile` is instantiated and + used as the cached instance for the next call. Otherwise, new instances + are created only as necessary. + + :return: + Returns a :class:`ZoneInfoFile` object. + + .. versionadded:: 2.6 + """ + if new_instance: + zif = None + else: + zif = getattr(get_zonefile_instance, '_cached_instance', None) + + if zif is None: + zif = ZoneInfoFile(getzoneinfofile_stream()) + + get_zonefile_instance._cached_instance = zif + + return zif + + +def gettz(name): + """ + This retrieves a time zone from the local zoneinfo tarball that is packaged + with dateutil. + + :param name: + An IANA-style time zone name, as found in the zoneinfo file. + + :return: + Returns a :class:`dateutil.tz.tzfile` time zone object. + + .. warning:: + It is generally inadvisable to use this function, and it is only + provided for API compatibility with earlier versions. This is *not* + equivalent to ``dateutil.tz.gettz()``, which selects an appropriate + time zone based on the inputs, favoring system zoneinfo. This is ONLY + for accessing the dateutil-specific zoneinfo (which may be out of + date compared to the system zoneinfo). + + .. deprecated:: 2.6 + If you need to use a specific zoneinfofile over the system zoneinfo, + instantiate a :class:`dateutil.zoneinfo.ZoneInfoFile` object and call + :func:`dateutil.zoneinfo.ZoneInfoFile.get(name)` instead. + + Use :func:`get_zonefile_instance` to retrieve an instance of the + dateutil-provided zoneinfo. + """ + warnings.warn("zoneinfo.gettz() will be removed in future versions, " + "to use the dateutil-provided zoneinfo files, instantiate a " + "ZoneInfoFile object and use ZoneInfoFile.zones.get() " + "instead. See the documentation for details.", + DeprecationWarning) + + if len(_CLASS_ZONE_INSTANCE) == 0: + _CLASS_ZONE_INSTANCE.append(ZoneInfoFile(getzoneinfofile_stream())) + return _CLASS_ZONE_INSTANCE[0].zones.get(name) + + +def gettz_db_metadata(): + """ Get the zonefile metadata + + See `zonefile_metadata`_ + + :returns: + A dictionary with the database metadata + + .. deprecated:: 2.6 + See deprecation warning in :func:`zoneinfo.gettz`. To get metadata, + query the attribute ``zoneinfo.ZoneInfoFile.metadata``. + """ + warnings.warn("zoneinfo.gettz_db_metadata() will be removed in future " + "versions, to use the dateutil-provided zoneinfo files, " + "ZoneInfoFile object and query the 'metadata' attribute " + "instead. See the documentation for details.", + DeprecationWarning) + + if len(_CLASS_ZONE_INSTANCE) == 0: + _CLASS_ZONE_INSTANCE.append(ZoneInfoFile(getzoneinfofile_stream())) + return _CLASS_ZONE_INSTANCE[0].metadata diff --git a/venv/lib/python3.12/site-packages/dateutil/zoneinfo/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/zoneinfo/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33864158e71b86c3cb1c8263b5125571ab5f1af4 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/zoneinfo/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/zoneinfo/__pycache__/rebuild.cpython-312.pyc b/venv/lib/python3.12/site-packages/dateutil/zoneinfo/__pycache__/rebuild.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1f53d66479c20396e6c49667abcf25a57c22e57 Binary files /dev/null and b/venv/lib/python3.12/site-packages/dateutil/zoneinfo/__pycache__/rebuild.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz b/venv/lib/python3.12/site-packages/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ff62a934a5009337271c60501278a7a34913a20b --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3ea52e7b6e968de0d884df1288193596fa95b803db4f92a18279a7398004475 +size 156400 diff --git a/venv/lib/python3.12/site-packages/dateutil/zoneinfo/rebuild.py b/venv/lib/python3.12/site-packages/dateutil/zoneinfo/rebuild.py new file mode 100644 index 0000000000000000000000000000000000000000..684c6586f091350c347f2b6150935f5214ffec27 --- /dev/null +++ b/venv/lib/python3.12/site-packages/dateutil/zoneinfo/rebuild.py @@ -0,0 +1,75 @@ +import logging +import os +import tempfile +import shutil +import json +from subprocess import check_call, check_output +from tarfile import TarFile + +from dateutil.zoneinfo import METADATA_FN, ZONEFILENAME + + +def rebuild(filename, tag=None, format="gz", zonegroups=[], metadata=None): + """Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar* + + filename is the timezone tarball from ``ftp.iana.org/tz``. + + """ + tmpdir = tempfile.mkdtemp() + zonedir = os.path.join(tmpdir, "zoneinfo") + moduledir = os.path.dirname(__file__) + try: + with TarFile.open(filename) as tf: + for name in zonegroups: + tf.extract(name, tmpdir) + filepaths = [os.path.join(tmpdir, n) for n in zonegroups] + + _run_zic(zonedir, filepaths) + + # write metadata file + with open(os.path.join(zonedir, METADATA_FN), 'w') as f: + json.dump(metadata, f, indent=4, sort_keys=True) + target = os.path.join(moduledir, ZONEFILENAME) + with TarFile.open(target, "w:%s" % format) as tf: + for entry in os.listdir(zonedir): + entrypath = os.path.join(zonedir, entry) + tf.add(entrypath, entry) + finally: + shutil.rmtree(tmpdir) + + +def _run_zic(zonedir, filepaths): + """Calls the ``zic`` compiler in a compatible way to get a "fat" binary. + + Recent versions of ``zic`` default to ``-b slim``, while older versions + don't even have the ``-b`` option (but default to "fat" binaries). The + current version of dateutil does not support Version 2+ TZif files, which + causes problems when used in conjunction with "slim" binaries, so this + function is used to ensure that we always get a "fat" binary. + """ + + try: + help_text = check_output(["zic", "--help"]) + except OSError as e: + _print_on_nosuchfile(e) + raise + + if b"-b " in help_text: + bloat_args = ["-b", "fat"] + else: + bloat_args = [] + + check_call(["zic"] + bloat_args + ["-d", zonedir] + filepaths) + + +def _print_on_nosuchfile(e): + """Print helpful troubleshooting message + + e is an exception raised by subprocess.check_call() + + """ + if e.errno == 2: + logging.error( + "Could not find zic. Perhaps you need to install " + "libc-bin or some other package that provides it, " + "or it's not in your PATH?") diff --git a/venv/lib/python3.12/site-packages/distutils-precedence.pth b/venv/lib/python3.12/site-packages/distutils-precedence.pth new file mode 100644 index 0000000000000000000000000000000000000000..c659194195f07bd6f19b5522515551309af14a3d --- /dev/null +++ b/venv/lib/python3.12/site-packages/distutils-precedence.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2638ce9e2500e572a5e0de7faed6661eb569d1b696fcba07b0dd223da5f5d224 +size 151 diff --git a/venv/lib/python3.12/site-packages/filelock/__init__.py b/venv/lib/python3.12/site-packages/filelock/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..03cb401d57b4f6bbd37a071a913cd9793bbd86a3 --- /dev/null +++ b/venv/lib/python3.12/site-packages/filelock/__init__.py @@ -0,0 +1,115 @@ +""" +A platform independent file lock that supports the with-statement. + +.. autodata:: filelock.__version__ + :no-value: + +""" + +from __future__ import annotations + +import sys +import warnings +from typing import TYPE_CHECKING, Final + +from ._api import AcquireReturnProxy, BaseFileLock, CloseErrorPolicy, ContextErrorPolicy, LockOptions +from ._descriptor import lock_descriptor, unlock_descriptor +from ._error import LeaseSettingsMismatch, SoftFileLockLifetimeWarning, SoftFileLockProtocolError, Timeout +from ._lease import LeaseCompromise, SoftFileLease +from ._marker import MarkerSoftFileLock, OwnerRecord + +if TYPE_CHECKING: + from ._async_read_write import ( + AsyncAcquireReadWriteReturnProxy, + AsyncReadWriteLock, + ) + from ._read_write import ReadWriteLock +else: + try: + from ._async_read_write import AsyncAcquireReadWriteReturnProxy, AsyncReadWriteLock + from ._read_write import ReadWriteLock + except ImportError: # pragma: lacks sqlite3 + AsyncAcquireReadWriteReturnProxy = None + AsyncReadWriteLock = None + ReadWriteLock = None + +from ._soft import SoftFileLock +from ._soft_rw import AsyncAcquireSoftReadWriteReturnProxy, AsyncSoftReadWriteLock, SoftReadWriteLock +from ._strict import StrictSoftFileClaim, StrictSoftFileClaimState, StrictSoftFileLock +from ._unix import UnixFileLock, has_fcntl +from ._windows import WindowsFileLock +from .asyncio import ( + AsyncAcquireReturnProxy, + AsyncSoftFileLease, + AsyncSoftFileLock, + AsyncStrictSoftFileLock, + AsyncUnixFileLock, + AsyncWindowsFileLock, + BaseAsyncFileLock, +) +from .version import version + +#: version of the project as a string +__version__: Final[str] = version + + +if sys.platform == "win32": # pragma: win32 cover + _FileLock: type[BaseFileLock] = WindowsFileLock + _AsyncFileLock: type[BaseAsyncFileLock] = AsyncWindowsFileLock +else: # pragma: win32 no cover # ruff:ignore[collapsible-else-if] # the else carries the win32 no-cover pragma + if has_fcntl: + _FileLock: type[BaseFileLock] = UnixFileLock + _AsyncFileLock: type[BaseAsyncFileLock] = AsyncUnixFileLock + else: + _FileLock = SoftFileLock + _AsyncFileLock = AsyncSoftFileLock + warnings.warn("only soft file lock is available", stacklevel=2) + +if TYPE_CHECKING: + FileLock = SoftFileLock + AsyncFileLock = AsyncSoftFileLock +else: + #: Alias for the lock, which should be used for the current platform. + FileLock = _FileLock + AsyncFileLock = _AsyncFileLock + + +__all__ = [ + "AcquireReturnProxy", + "AsyncAcquireReadWriteReturnProxy", + "AsyncAcquireReturnProxy", + "AsyncAcquireSoftReadWriteReturnProxy", + "AsyncFileLock", + "AsyncReadWriteLock", + "AsyncSoftFileLease", + "AsyncSoftFileLock", + "AsyncSoftReadWriteLock", + "AsyncStrictSoftFileLock", + "AsyncUnixFileLock", + "AsyncWindowsFileLock", + "BaseAsyncFileLock", + "BaseFileLock", + "CloseErrorPolicy", + "ContextErrorPolicy", + "FileLock", + "LeaseCompromise", + "LeaseSettingsMismatch", + "LockOptions", + "MarkerSoftFileLock", + "OwnerRecord", + "ReadWriteLock", + "SoftFileLease", + "SoftFileLock", + "SoftFileLockLifetimeWarning", + "SoftFileLockProtocolError", + "SoftReadWriteLock", + "StrictSoftFileClaim", + "StrictSoftFileClaimState", + "StrictSoftFileLock", + "Timeout", + "UnixFileLock", + "WindowsFileLock", + "__version__", + "lock_descriptor", + "unlock_descriptor", +] diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/__init__.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9f8c60935a2b0291c3816ccd897ff3ddbf1c895 Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/__init__.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_api.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_api.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ef99daeb3a11ca26478a07bffa81b13e978eb38a Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_api.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_async.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_async.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7528887f377fd69e7fe6b2da4b811accd3ab6281 Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_async.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_async_read_write.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_async_read_write.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a0aee443c822a4d90ba1c5853214ab7b514add81 Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_async_read_write.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_descriptor.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_descriptor.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4971b31043dd05d23e92edb3c828efb2ef2467cf Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_descriptor.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_error.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_error.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b93ceb44f06cf9b404fc2f73eac458dcab35446 Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_error.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_identity.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_identity.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..814e5b04196043138900fb53be40eb6d968062a8 Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_identity.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_lease.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_lease.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df5fb135f72bfd3b6100943da44da12f9ca5173b Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_lease.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_marker.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_marker.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a970d13d966aad3434ceac9e22257711d8122d04 Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_marker.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_read_write.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_read_write.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0416ab67591bb28885d8b87a1d7a40a77ac3c315 Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_read_write.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_soft.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_soft.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d9b865e4be56948a0e17728e00e203119d66d6d Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_soft.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_soft_protocol.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_soft_protocol.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c706678f52aa96dfa3ab06f0598d9201b5ddc1ac Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_soft_protocol.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_strict.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_strict.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e34b4ac55e3edb52860c6237f032f4cb031f304 Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_strict.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_unix.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_unix.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8783ddf8b7123c92420c798047ec3497b7997354 Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_unix.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_util.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_util.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eacfb588e1abd4fd3dbf7f29cab3cb4b0c2294f7 Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_util.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/_windows.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/_windows.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c4b10030745bde5dd18b3756262de7d0a52d934 Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/_windows.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/asyncio.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/asyncio.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5c6cd72a9c51cb0e3abe3bd4b4764b25f18189db Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/asyncio.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/__pycache__/version.cpython-312.pyc b/venv/lib/python3.12/site-packages/filelock/__pycache__/version.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c896bf14a20d7eb17f7478cd162baead95061a2f Binary files /dev/null and b/venv/lib/python3.12/site-packages/filelock/__pycache__/version.cpython-312.pyc differ diff --git a/venv/lib/python3.12/site-packages/filelock/_api.py b/venv/lib/python3.12/site-packages/filelock/_api.py new file mode 100644 index 0000000000000000000000000000000000000000..df0c10cb756e3d0aa81249863683ab71b28668b6 --- /dev/null +++ b/venv/lib/python3.12/site-packages/filelock/_api.py @@ -0,0 +1,1819 @@ +from __future__ import annotations + +import contextlib +import inspect +import logging +import math +import os +import secrets +import sys +import time +import warnings +from abc import ABCMeta, abstractmethod +from collections.abc import Callable, Hashable +from contextlib import contextmanager +from dataclasses import dataclass +from itertools import count, starmap +from threading import Condition, RLock, get_ident, local +from typing import TYPE_CHECKING, Final, Literal, NoReturn, TypedDict, TypeVar, cast +from weakref import WeakKeyDictionary, WeakValueDictionary + +from ._error import SoftFileLockLifetimeWarning, Timeout +from ._util import break_lock_file + +#: No explicit file permission mode was passed. Lock files then open with 0o666 so umask and default ACLs pick +#: the final permissions, and fchmod is skipped to preserve POSIX default ACL inheritance. +_UNSET_FILE_MODE: Final[int] = -1 + +#: Ceiling on the retry counter used as a power of two, so a long contended wait cannot overflow the backoff multiply. +_MAX_BACKOFF_EXPONENT: Final[int] = 20 + +#: How a context manager reconciles a body failure with a release failure on exit (see the property of this name). +ContextErrorPolicy = Literal["chain", "group"] +_CONTEXT_ERROR_POLICIES: Final[frozenset[str]] = frozenset({"chain", "group"}) + +#: What a descriptor-owning backend does with an ``os.close`` failure after relinquishing ownership (see the property). +CloseErrorPolicy = Literal["default", "raise", "suppress"] +_CLOSE_ERROR_POLICIES: Final[frozenset[str]] = frozenset({"default", "raise", "suppress"}) + +if TYPE_CHECKING: + from collections.abc import Generator + from types import TracebackType + from typing import Protocol + + from ._read_write import ReadWriteLock + from ._soft_rw import SoftReadWriteLock + + class _ForkResettable(Protocol): + def _reset_after_fork_in_child(self) -> None: ... + + class _ForkDescriptorOwner(Protocol): + def _descriptors_for_fork(self) -> tuple[tuple[int, tuple[int, int] | None], ...]: ... + + # Matched against the class object itself rather than `type[...]` of it. A metaclass supplies this method to the + # class while leaving instances without it, so a `type[_ForkResettableClass]` bound rejects `ReadWriteLock`. + class _ForkResettableClass(Protocol): + def _reset_class_after_fork(self) -> None: ... + + class _RegisterAtFork(Protocol): + def __call__( + self, + *, + before: Callable[[], None] | None = None, + after_in_parent: Callable[[], None] | None = None, + after_in_child: Callable[[], None] | None = None, + ) -> None: ... + + if sys.version_info >= (3, 11): # pragma: no cover (py311+) + from typing import Self + else: # pragma: no cover ( type[BaseException]: + # BaseExceptionGroup is a builtin on 3.11+; on 3.10 it needs the exceptiongroup backport. filelock keeps zero + # runtime dependencies, so the backport is imported lazily rather than required, and only group mode needs it. + if sys.version_info >= (3, 11): # pragma: no cover (py311+) + return BaseExceptionGroup # ruff:ignore[undefined-name] # builtin on 3.11+ + # Alias the import so BaseExceptionGroup above stays the builtin rather than an unbound local of this function. + from exceptiongroup import ( # ruff:ignore[import-outside-top-level] # pragma: no cover ( NoReturn: + errors = (first_error, second_error, *additional_errors) + _detach_grouped_contexts(errors) + group = _exception_group_cls()(message, errors) + if marker is not None: + setattr(group, marker[0], marker[1]) + raise group from None + + +def _detach_grouped_contexts(errors: tuple[BaseException, ...]) -> None: + seen: set[int] = set() + pending = list(errors) + while pending: + error = pending.pop() + if id(error) in seen: + continue + seen.add(id(error)) + if (context := error.__context__) is not None and ( + context is error + or _same_exception_tree(error, context) + or any(context is root or _contains_exception(root, context) for root in errors) + ): + error.__context__ = None + elif context is not None: + pending.append(context) + if error.__cause__ is not None: + pending.append(error.__cause__) + if isinstance(error, _exception_group_cls()): + pending.extend(cast("_ExceptionGroupProtocol", error).exceptions) + + +def _same_exception_tree(first: BaseException, second: BaseException) -> bool: + pending = [(first, second)] + seen: set[tuple[int, int]] = set() + while pending: + first_error, second_error = pending.pop() + if first_error is second_error: + continue + if (pair := (id(first_error), id(second_error))) in seen: + continue + seen.add(pair) + if ( + type(first_error) is not type(second_error) + or not isinstance(first_error, _exception_group_cls()) + or not isinstance(second_error, _exception_group_cls()) + ): + return False + first_group = cast("_ExceptionGroupProtocol", first_error) + second_group = cast("_ExceptionGroupProtocol", second_error) + if first_group.message != second_group.message or len(first_group.exceptions) != len(second_group.exceptions): + return False + pending.extend(zip(first_group.exceptions, second_group.exceptions, strict=True)) + return True + + +def _contains_exception(error: BaseException, target: BaseException | None) -> bool: + if target is None or not isinstance(error, _exception_group_cls()): + return False + pending = list(cast("_ExceptionGroupProtocol", error).exceptions) + seen: set[int] = set() + while pending: + child = pending.pop() + if child is target: + return True + if id(child) in seen: + continue + seen.add(id(child)) + if isinstance(child, _exception_group_cls()): + pending.extend(cast("_ExceptionGroupProtocol", child).exceptions) + return False + + +def _append_exception_context(error: BaseException, context: BaseException) -> None: + if _exception_graph_contains(error, context) or _exception_graph_contains(context, error): + return + if error.__context__ is None: + error.__context__ = context + return + tail = error + seen: set[int] = set() + while id(tail) not in seen: + seen.add(id(tail)) + if (next_error := tail.__cause__ if tail.__cause__ is not None else tail.__context__) is None: + tail.__context__ = context + return + tail = next_error + + +def _exception_graph_contains(error: BaseException, target: BaseException) -> bool: + pending = [error] + seen: set[int] = set() + while pending: + current = pending.pop() + if current is target: + return True + if id(current) in seen: # pragma: no cover - arbitrary caller exceptions can contain cycles + continue + seen.add(id(current)) + if current.__cause__ is not None: + pending.append(current.__cause__) + if current.__context__ is not None: + pending.append(current.__context__) + if isinstance(current, _exception_group_cls()): + pending.extend(cast("_ExceptionGroupProtocol", current).exceptions) + return False + + +def _grouped_errors( + error: BaseException, message: str, marker: tuple[str, _MarkerValue] +) -> tuple[BaseException, ...] | None: + if not isinstance(error, _exception_group_cls()): + return None + group = cast("_ExceptionGroupProtocol", error) + return group.exceptions if group.message == message and getattr(group, marker[0], None) is marker[1] else None + + +if TYPE_CHECKING: + + class _ExceptionGroupProtocol(Protocol): + @property + def message(self) -> str: ... + + @property + def exceptions(self) -> tuple[BaseException, ...]: ... + + +def _raise_chained_errors(first_error: BaseException, second_error: BaseException | None = None) -> NoReturn: + if second_error is None: + first_context = first_error.__context__ + try: + raise first_error # ruff:ignore[raise-within-try] # the handler restores caller-supplied context before propagation + except BaseException: + first_error.__context__ = first_context + raise + if (second_context := second_error.__context__) is not None and second_context is not first_error: + _detach_exception_context(second_context, first_error) + _append_exception_context(first_error, second_context) + first_context = first_error.__context__ + try: + raise first_error # ruff:ignore[raise-within-try] # the second raise needs this error as implicit context + except BaseException: # ruff:ignore[blind-except] # first_error may be a control-flow exception + first_error.__context__ = first_context + try: + raise second_error # ruff:ignore[raise-within-try] # the handler makes the chain interpreter-independent + except BaseException: + second_error.__context__ = first_error + first_error.__context__ = first_context + raise + + +def _detach_exception_context(error: BaseException, target: BaseException) -> None: + pending = [error] + seen: set[int] = set() + while pending: + current = pending.pop() + if id(current) in seen: + continue + seen.add(id(current)) + if current.__context__ is target: + current.__context__ = None + elif current.__context__ is not None: + pending.append(current.__context__) + if current.__cause__ is not None: + pending.append(current.__cause__) + if isinstance(current, _exception_group_cls()): + pending.extend(cast("_ExceptionGroupProtocol", current).exceptions) + + +def _raise_body_and_release(body_error: BaseException, release_error: BaseException) -> NoReturn: + # Group mode: surface the body failure and the release failure as sibling leaves instead of letting one hide in the + # other's __context__. BaseExceptionGroup returns a plain ExceptionGroup when both leaves subclass Exception, so + # ``except*`` and ``except Exception`` still catch them; a BaseException leaf (KeyboardInterrupt, CancelledError) + # keeps the group outside ordinary handlers. ``from None`` stops the group itself gaining a redundant __context__. + _raise_grouped_errors("lock body and release both failed", body_error, release_error) + + +def _raise_cleanup_errors( + message: str, + primary_error: BaseException, + *cleanup_errors: BaseException | None, +) -> NoReturn: + _raise_grouped_errors( + message, + primary_error, + *(error for error in cleanup_errors if error is not None), + ) + + +# On Windows os.path.realpath calls CreateFileW with share_mode=0, which blocks concurrent DeleteFileW and causes +# livelocks under threaded contention with SoftFileLock. os.path.abspath is purely string-based and avoids this. +_resolve_dir: Final[Callable[[str], str]] = os.path.abspath if sys.platform == "win32" else os.path.realpath + + +def _canonical(path: str | os.PathLike[str]) -> str: + """ + Return one stable key for *path*, collapsing equivalent spellings without following a final symlink. + + Relative, absolute, and ``./`` spellings of one lock file must map to a single singleton instance, deadlock-registry + entry, and removal key. Resolving the whole path with ``realpath`` would follow a final symlink and alias a lock + target the backend deliberately rejects, so the registry identity would differ from the backend's. Resolving only + the parent directory and re-appending the literal final component collapses the equivalent spellings while keeping a + final symlink a distinct key. On Windows the parent is resolved with ``abspath`` so junctions and reparse points are + not followed either. + """ + parent, name = os.path.split(os.fspath(path)) + return os.path.join(_resolve_dir(parent or os.curdir), name) # ruff:ignore[os-path-join] # string join matches abspath/realpath + + +class _ThreadLocalRegistry(local): + def __init__(self) -> None: + super().__init__() + self.held: dict[Hashable, int] = {} + + +_registry: Final[_ThreadLocalRegistry] = _ThreadLocalRegistry() + + +_T = TypeVar("_T", bound="BaseFileLock") + + +class FileLockMeta(ABCMeta): + _instances: WeakValueDictionary[str, BaseFileLock] + _instances_lock: RLock + _instances_under_construction: set[str] + + def __call__( # ruff:ignore[too-many-arguments] # forwards the public constructor's documented parameters + cls: type[_T], + lock_file: str | os.PathLike[str], + timeout: float = -1, + mode: int = _UNSET_FILE_MODE, + thread_local: bool = True, # ruff:ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument] # public API: positional bool kept for backwards compatibility + *, + blocking: bool = True, + is_singleton: bool = False, + poll_interval: float = 0.05, + lifetime: float | None = None, + context_error_policy: ContextErrorPolicy = "chain", + close_error_policy: CloseErrorPolicy = "default", + fallback_to_soft: bool = True, + preserve_lock_file: bool = False, + on_acquired: Callable[[int], None] | None = None, + **kwargs: _ExtraValue, + ) -> _T: + _ensure_current_process() + lifetime = _resolve_lifetime(lifetime, cls, stacklevel=cls._constructor_lifetime_warning_stacklevel) + # Validate before building the instance: a raise inside __init__ would leave a half-constructed object whose + # __del__ then trips over the missing context. + context_error_policy = _resolve_context_error_policy(context_error_policy) + close_error_policy = _resolve_close_error_policy(close_error_policy) + preserve_lock_file = _resolve_preserve_lock_file( + preserve=preserve_lock_file, supported=cls._preserve_lock_file_supported, cls_name=cls.__name__ + ) + on_acquired = _resolve_on_acquired(on_acquired, supported=cls._on_acquired_supported, cls_name=cls.__name__) + params: dict[str, _LockInitValue | _ExtraValue] = { + "timeout": timeout, + "mode": mode, + "thread_local": thread_local, + "blocking": blocking, + "is_singleton": is_singleton, + "poll_interval": poll_interval, + "lifetime": lifetime, + "context_error_policy": context_error_policy, + "close_error_policy": close_error_policy, + "fallback_to_soft": fallback_to_soft, + "preserve_lock_file": preserve_lock_file, + "on_acquired": on_acquired, + **kwargs, + } + if not is_singleton: + return cls._create_instance(lock_file, params) + + # Look up, build and store under one lock. Without it two threads racing the first construction for a + # path both miss the cache and each build their own instance, so callers relying on is_singleton for + # reentrant locking across instances end up with two "singletons" and acquire()'s deadlock check then + # rejects a legitimate reentrant acquire; the unguarded writes to the WeakValueDictionary are a data + # race besides. ReadWriteLock and SoftReadWriteLock already guard their singleton caches this way. + # Key the cache on the canonical form so equivalent spellings of one path share a singleton, and it matches the + # deadlock-registry key acquire() uses. + singleton_key = _canonical(lock_file) + with cls._instances_lock: + if (instance := cls._instances.get(singleton_key)) is None: + if singleton_key in cls._instances_under_construction: # pragma: needs fork + msg = f"Singleton lock construction is already active for {lock_file!s}" + raise RuntimeError(msg) + construction_registry = cls._instances_under_construction + construction_pid = os.getpid() + construction_registry.add(singleton_key) + try: + instance = cls._create_instance(lock_file, params) + finally: + construction_registry.discard(singleton_key) + if os.getpid() != construction_pid: # pragma: needs fork + msg = "Lock construction cannot continue after fork; construct a new lock in the child" + raise RuntimeError(msg) + cls._instances[singleton_key] = instance + return instance + + params_to_check = { + "thread_local": (thread_local, instance.is_thread_local()), + "timeout": (timeout, instance.timeout), + "mode": (mode, instance._context.mode), # ruff:ignore[private-member-access] # compares against the managed instance's own context + "blocking": (blocking, instance.blocking), + "poll_interval": (poll_interval, instance.poll_interval), + "lifetime": (lifetime, instance.lifetime), + "context_error_policy": (context_error_policy, instance.context_error_policy), + "close_error_policy": (close_error_policy, instance.close_error_policy), + "fallback_to_soft": (fallback_to_soft, instance.fallback_to_soft), + "preserve_lock_file": (preserve_lock_file, instance.preserve_lock_file), + } + non_matching_params = { + name: (passed_param, set_param) + for name, (passed_param, set_param) in params_to_check.items() + if passed_param != set_param + } + # Callables compare by identity, not equality: two equal callables can close over different state, so a + # singleton must reject a different hook object even if it compares equal. Keep it out of the scalar dict above. + hook_mismatch = on_acquired is not instance.on_acquired + if not non_matching_params and not hook_mismatch: + return instance # ty: ignore[invalid-return-type] # https://github.com/astral-sh/ty/issues/3231 + + msg = "Singleton lock instances cannot be initialized with differing arguments" + msg += "\nNon-matching arguments: " + for param_name, (passed_param, set_param) in non_matching_params.items(): + msg += f"\n\t{param_name} (existing lock has {set_param} but {passed_param} was passed)" + if hook_mismatch: + msg += f"\n\ton_acquired (existing lock has {instance.on_acquired} but {on_acquired} was passed)" + raise ValueError(msg) + + def _create_instance( + cls: type[_T], lock_file: str | os.PathLike[str], params: dict[str, _LockInitValue | _ExtraValue] + ) -> _T: + model = _init_parameter_model(cls) + if model.accepts_kwargs: + return super().__call__(lock_file, **params) + + unsupported = sorted( + name + for name, value in params.items() + if name not in model.accepted_params + and ((parameter := model.default_params.get(name)) is None or value != parameter.default) + ) + if unsupported: + msg = f"{cls.__name__} does not support non-default lock options: {', '.join(unsupported)}" + raise TypeError(msg) + # virtualenv narrows a BaseFileLock descendant's signature; omit base defaults it does not accept (#340). + return super().__call__( + lock_file, + **{name: value for name, value in params.items() if name in model.accepted_params}, + ) + + +_INIT_PARAMETER_MODELS: Final[WeakKeyDictionary[type[BaseFileLock], _InitParameterModel]] = WeakKeyDictionary() + + +def _init_parameter_model(cls: type[BaseFileLock]) -> _InitParameterModel: + # A strong cache would keep dynamically created subclasses alive for the process lifetime. + with _fork_transition(), _FORK_STATE.parameter_models_lock: + if (model := _INIT_PARAMETER_MODELS.get(cls)) is None: + parameters = inspect.signature(cls.__init__).parameters.values() + model = _InitParameterModel( + accepted_params=frozenset( + parameter.name + for parameter in parameters + if parameter.kind in {inspect.Parameter.POSITIONAL_OR_KEYWORD, inspect.Parameter.KEYWORD_ONLY} + ), + accepts_kwargs=any(parameter.kind is inspect.Parameter.VAR_KEYWORD for parameter in parameters), + default_params={ + name: parameter + for name, parameter in inspect.signature(type(cls).__call__).parameters.items() + if parameter.default is not inspect.Parameter.empty + }, + ) + _INIT_PARAMETER_MODELS[cls] = model + return model + + +@dataclass(frozen=True) +class _InitParameterModel: + accepted_params: frozenset[str] + accepts_kwargs: bool + default_params: dict[str, inspect.Parameter] + + +def _resolve_lifetime(lifetime: float | None, cls: type[BaseFileLock], *, stacklevel: int) -> float | None: + """ + Validate ``lifetime`` and drop a value the backend cannot honor. + + ``lifetime`` is a deliberate age-based lease: a lock file older than ``lifetime`` is broken even while its holder is + still alive. Existence locks (:class:`SoftFileLock`) implement that behavior by unlinking a reclaimable pathname, + which can overlap a live holder. A native OS lock lives on the inode, so unlinking the pathname by age cannot revoke + the kernel lock; a contender would lock a fresh inode and overlap the live holder (#590). Ignore the request with a + warning rather than accept a setting that breaks mutual exclusion. + """ + if lifetime is not None: + if isinstance(lifetime, bool) or not isinstance(lifetime, (int, float)): + msg = f"lifetime must be a finite non-negative number or None, not {type(lifetime).__name__}" + raise TypeError(msg) + if lifetime < 0 or (isinstance(lifetime, float) and not math.isfinite(lifetime)): + msg = f"lifetime must be finite and non-negative, not {lifetime!r}" + raise ValueError(msg) + if lifetime is not None and not cls._lifetime_supported: + warnings.warn( + f"lifetime is ignored for {cls.__name__}: {cls._lifetime_unsupported_reason}; " + f"only SoftFileLock supports lifetime-based expiry", + stacklevel=stacklevel, + ) + return None + if lifetime is not None and cls._lifetime_replacements is not None: + strict_lock, lease = cls._lifetime_replacements + warnings.warn( + f"{cls.__name__}(lifetime=...) uses age-based expiry and can overlap a live holder; " + f"use {lease} for expiry or {strict_lock} for fail-closed locking", + SoftFileLockLifetimeWarning, + stacklevel=stacklevel, + ) + return lifetime + + +def _resolve_context_error_policy(policy: str) -> ContextErrorPolicy: + if policy not in _CONTEXT_ERROR_POLICIES: + msg = f"context_error_policy must be 'chain' or 'group', got {policy!r}" + raise ValueError(msg) + if policy == "group": # fail fast at construction rather than only when a dual failure happens to occur + try: + _exception_group_cls() + except ImportError as exc: # pragma: no cover # only on 3.10 without the exceptiongroup backport + msg = "context_error_policy='group' requires Python 3.11+ or the 'exceptiongroup' backport installed" + raise ValueError(msg) from exc + return cast("ContextErrorPolicy", policy) + + +def _resolve_close_error_policy(policy: str) -> CloseErrorPolicy: + if policy not in _CLOSE_ERROR_POLICIES: + msg = f"close_error_policy must be 'default', 'raise', or 'suppress', got {policy!r}" + raise ValueError(msg) + return cast("CloseErrorPolicy", policy) + + +def _resolve_preserve_lock_file(*, preserve: bool, supported: bool, cls_name: str) -> bool: + # An existence lock unlinks its marker to release, so preserving the pathname would defeat unlocking. Reject the + # request rather than silently ignore it, since a caller asking for a stable identity must know it cannot be kept. + if preserve and not supported: + msg = f"preserve_lock_file=True is not supported by {cls_name}: unlinking its marker is how it releases" + raise ValueError(msg) + return preserve + + +def _resolve_on_acquired( + on_acquired: Callable[[int], None] | None, *, supported: bool, cls_name: str +) -> Callable[[int], None] | None: + if on_acquired is None: + return None + # An existence lock stores protocol state in its marker, so a caller writing through the descriptor would corrupt + # stale detection and ownership metadata; only native locks lend out the descriptor. + if not supported: + msg = f"on_acquired is not supported by {cls_name}: only native locks expose the lock descriptor" + raise ValueError(msg) + # A hook that fails and then also fails to release surfaces both errors as a BaseExceptionGroup. Require that class + # at construction rather than at the rare moment both fail, matching how context_error_policy='group' validates. + try: + _exception_group_cls() + except ImportError as exc: # pragma: no cover # only on 3.10 without the exceptiongroup backport + msg = "on_acquired requires Python 3.11+ or the 'exceptiongroup' backport for its rollback error path" + raise ValueError(msg) from exc + return on_acquired + + +class BaseFileLock(contextlib.ContextDecorator, metaclass=FileLockMeta): # ruff:ignore[too-many-public-methods] # public config properties + """ + Abstract base class for a file lock object. + + Provides the common reentrant API and state management. Subclasses implement the locking mechanism + (:class:`UnixFileLock `, :class:`WindowsFileLock `, + :class:`SoftFileLock `). + + """ + + _instances: WeakValueDictionary[str, BaseFileLock] + _instances_lock: RLock + _instances_under_construction: set[str] + + #: How the cross-instance deadlock message names the conflicting holder; the async subclass says "task". + _deadlock_holder_desc: str = "FileLock instance in this thread" + + #: Whether an age-based :attr:`lifetime` lease may break this lock. Only existence locks set it (they reclaim by + #: unlinking a pathname); native OS locks leave it ``False`` since a kernel lock cannot be revoked by file age. + _lifetime_supported: bool = False + + #: Strict-lock and lease replacements for a backend with legacy age-based expiry. + _lifetime_replacements: tuple[str, str] | None = None + + #: Why a backend that refuses ``lifetime`` cannot honor it, named in the warning that drops the value. + _lifetime_unsupported_reason: str = "a native OS lock cannot be broken safely by file age" + + #: Async construction adds one metaclass frame before lifetime validation. + _constructor_lifetime_warning_stacklevel: int = 3 + + #: Whether :attr:`preserve_lock_file` may be ``True``. Native locks keep the pathname on release, so they support + #: it; existence locks unlink their marker to release and reject it. + _preserve_lock_file_supported: bool = True + + #: Whether an :attr:`on_acquired` hook may be set. Native locks lend the descriptor out; existence locks keep + #: protocol state in the marker and reject it. + _on_acquired_supported: bool = True + + #: Whether a shared instance serializes its physical acquire and release behind one gate. A backend that publishes + #: several files per owner needs it; a single-file backend is atomic and leaves it off to skip the gate entirely. + _serialize_transitions: bool = False + + #: Ceiling in seconds on the jittered backoff between contended acquisition retries. ``0`` keeps the fixed + #: poll cadence; a multi-file backend sets it so contending processes desynchronize instead of livelocking. + _poll_backoff_cap: float = 0.0 + + def __init_subclass__(cls, **kwargs: _SubclassValue) -> None: + """Give each lock subclass its own singleton registry and lock.""" + super().__init_subclass__(**kwargs) + cls._instances = WeakValueDictionary() + cls._instances_lock = RLock() + cls._instances_under_construction = set() + _register_fork_class(cls) + + @classmethod + def _reset_class_after_fork(cls) -> None: # pragma: forked child + cls._instances = WeakValueDictionary() + cls._instances_lock = RLock() + cls._instances_under_construction = set() + + def __init__( # ruff:ignore[too-many-arguments] # public constructor: one parameter per documented lock option + self, + lock_file: str | os.PathLike[str], + timeout: float = -1, + mode: int = _UNSET_FILE_MODE, + thread_local: bool = True, # ruff:ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument] # public API: positional bool kept for backwards compatibility + *, + blocking: bool = True, + is_singleton: bool = False, + poll_interval: float = 0.05, + lifetime: float | None = None, + context_error_policy: ContextErrorPolicy = "chain", + close_error_policy: CloseErrorPolicy = "default", + fallback_to_soft: bool = True, + preserve_lock_file: bool = False, + on_acquired: Callable[[int], None] | None = None, + ) -> None: + """ + Create a new lock object. + + :param lock_file: path to the file + :param timeout: default timeout when acquiring the lock, in seconds. It will be used as fallback value in the + acquire method, if no timeout value (``None``) is given. If you want to disable the timeout, set it to a + negative value. A timeout of 0 means that there is exactly one attempt to acquire the file lock. + :param mode: file permissions for the lockfile. When not specified, the OS controls permissions via umask and + default ACLs, preserving POSIX default ACL inheritance in shared directories. + :param thread_local: Whether this object's internal context should be thread local or not. If this is set to + ``False`` then the lock will be reentrant across threads. When ``True`` (the default), **all fields of the + lock's internal context are per-thread**, including the configuration values ``poll_interval``, ``timeout``, + ``blocking``, ``mode``, and ``lifetime``. Setting one of these properties from one thread does not change + the value seen by another thread; threads that did not perform the write continue to see the value supplied + at construction time. If you need configuration values to be visible across threads, construct the lock + with ``thread_local=False``. + :param blocking: whether the lock should be blocking or not + :param is_singleton: If this is set to ``True`` then only one instance of this class will be created per lock + file. This is useful if you want to use the lock object for reentrant locking without needing to pass the + same object around. + :param poll_interval: default interval for polling the lock file, in seconds. It will be used as fallback value + in the acquire method, if no poll_interval value (``None``) is given. + :param lifetime: for :class:`SoftFileLock`, the age in seconds after which a waiting process may delete the + marker, even while its holder remains alive. This legacy expiry mode does not provide strict mutual + exclusion. ``None`` (the default) disables age-based expiry. Native OS locks (:class:`FileLock`) cannot be + revoked by file age and ignore a non-``None`` ``lifetime`` with a warning. + :param context_error_policy: how a context manager reconciles a failure in its body with a failure while + releasing on exit. ``"chain"`` (the default) keeps Python's behavior: the release error propagates with the + body error in its ``__context__``. ``"group"`` raises a :class:`BaseExceptionGroup` holding the body error + first and the release error second, so neither hides the other. + :param close_error_policy: what to do with an ``os.close`` failure after relinquishing descriptor ownership. + ``"default"`` keeps each backend's historical behavior (Unix native locks drop a FUSE/Docker ``EIO``; + Windows native locks and :class:`SoftFileLock` propagate); ``"raise"`` always propagates the ``OSError``; + ``"suppress"`` always ignores it. Held state is released either way. It does not affect unlock failures or + lock-file deletion. + :param fallback_to_soft: for :class:`UnixFileLock`, whether to switch to :class:`SoftFileLock` when the + filesystem's ``flock`` returns ``ENOSYS``. ``True`` (the default) keeps the historical fallback; + ``False`` fails closed, letting the ``ENOSYS`` propagate so a caller that needs kernel-enforced + locking is never silently downgraded. It has no effect on Windows or :class:`SoftFileLock`. + :param preserve_lock_file: for native locks (:class:`FileLock`), whether filelock promises not to unlink the + lock pathname on release. ``False`` (the default) keeps each backend's cleanup: Windows removes the lock + file, Unix already leaves it. ``True`` keeps a stable file identity for ACLs, auditing, and holder metadata: + Windows skips its post-release unlink and Unix refuses to enter the ``ENOSYS`` soft fallback (which releases + by unlinking). :class:`SoftFileLock` rejects ``True``. The promise covers filelock's own release path only; + it cannot stop another process or the filesystem from removing the pathname. + :param on_acquired: for native locks (:class:`FileLock`), a callable invoked with the borrowed lock descriptor + once per physical acquisition, after filelock holds the native lock and finished backend initialization but + before :meth:`~BaseFileLock.acquire` returns. Recursive acquisitions do not call it again. The callback may + read, write, seek, truncate, or set metadata through ``os`` on the descriptor, but must not close, unlock, + or take ownership of it, and filelock does not fsync its writes. If it raises, filelock releases the lock + and re-raises. :class:`SoftFileLock` rejects the hook. + + """ + self._creator_pid = os.getpid() + self._transition_lock = RLock() + self._is_thread_local = thread_local + self._is_singleton = is_singleton + self._context_error_policy = context_error_policy # already validated by the metaclass + self._close_error_policy = close_error_policy # already validated by the metaclass + self._fallback_to_soft = fallback_to_soft + self._preserve_lock_file = preserve_lock_file # already validated by the metaclass + self._on_acquired = on_acquired # already validated by the metaclass + + self._context: FileLockContext = (ThreadLocalFileContext if thread_local else FileLockContext)( + lock_file=os.fspath(lock_file), + timeout=timeout, + mode=mode, + blocking=blocking, + poll_interval=poll_interval, + lifetime=lifetime, + ) + _register_fork_object(self) + + def is_thread_local(self) -> bool: + """:returns: a flag indicating if this lock is thread local or not""" + return self._is_thread_local + + @property + def is_singleton(self) -> bool: + """ + A flag indicating if this lock is singleton or not. + + .. versionadded:: 3.13.0 + + """ + return self._is_singleton + + @property + def context_error_policy(self) -> ContextErrorPolicy: + """ + How a context manager reconciles a body failure with a release failure on exit. + + .. versionadded:: 3.30.0 + + """ + return self._context_error_policy + + @property + def close_error_policy(self) -> CloseErrorPolicy: + """ + What a lock does with an ``os.close`` failure after relinquishing descriptor ownership. + + .. versionadded:: 3.30.0 + + """ + return self._close_error_policy + + def _close_released_fd(self, fd: int, *, default_suppresses: bool) -> None: + # CPython never retries close() after EINTR because the descriptor number may already be reused, so neither does + # this. close_error_policy decides the error's fate after the backend relinquishes descriptor ownership. + try: + os.close(fd) + except OSError: + if self._close_error_policy == "suppress" or (self._close_error_policy == "default" and default_suppresses): + return + raise + + @property + def fallback_to_soft(self) -> bool: + """ + Whether a :class:`FileLock` falls back to :class:`SoftFileLock` when the filesystem lacks ``flock``. + + Only :class:`UnixFileLock` acts on it: when ``False`` an ``ENOSYS`` from ``flock`` propagates instead of + switching to existence-lock semantics. + + .. versionadded:: 3.30.0 + + """ + return self._fallback_to_soft + + @property + def preserve_lock_file(self) -> bool: + """ + Whether filelock promises not to unlink the lock pathname on release. + + When ``True``, Windows skips its post-release unlink and Unix refuses the ``ENOSYS`` soft fallback. + :class:`SoftFileLock` rejects ``True`` because unlinking its marker is how it releases. + + .. versionadded:: 3.30.0 + + """ + return self._preserve_lock_file + + @property + def on_acquired(self) -> Callable[[int], None] | None: + """ + The callback run with the borrowed lock descriptor once per physical acquisition, or ``None``. + + Native locks only. It runs after the native lock is held and backend initialization finished, before + :meth:`~BaseFileLock.acquire` returns; a raise rolls back the acquisition. :class:`SoftFileLock` rejects it. + + .. versionadded:: 3.30.0 + + """ + return self._on_acquired + + @property + def lock_file(self) -> str: + """Path to the lock file.""" + return self._context.lock_file + + @property + def timeout(self) -> float: + """ + The default timeout value, in seconds. + + .. versionadded:: 2.0.0 + + """ + return self._context.timeout + + @timeout.setter + def timeout(self, value: float | str) -> None: + """ + Change the default timeout value. + + :param value: the new value, in seconds + + """ + self._context.timeout = float(value) + + @property + def blocking(self) -> bool: + """ + Whether the locking is blocking or not. + + .. versionadded:: 3.14.0 + + """ + return self._context.blocking + + @blocking.setter + def blocking(self, value: bool) -> None: + """ + Change the default blocking value. + + :param value: the new value as bool + + """ + self._context.blocking = value + + @property + def poll_interval(self) -> float: + """ + The default polling interval, in seconds. + + .. versionadded:: 3.24.0 + + """ + return self._context.poll_interval + + @poll_interval.setter + def poll_interval(self, value: float) -> None: + """ + Change the default polling interval. + + :param value: the new value, in seconds + + """ + self._context.poll_interval = value + + @property + def lifetime(self) -> float | None: + """ + The soft marker age in seconds that permits expiry, or ``None`` to disable age-based expiry. + + A non-``None`` value permits a waiter to enter while the previous holder remains active, so it does not provide + strict mutual exclusion. Native locks ignore the value with a warning. + + .. versionadded:: 3.24.0 + + """ + return self._context.lifetime + + @lifetime.setter + def lifetime(self, value: float | None) -> None: + """ + Change the legacy age-based expiry threshold. + + :param value: the new value in seconds, or ``None`` to disable expiration + + :raises ValueError: if *value* is negative or not finite + :raises TypeError: if *value* is not ``None`` and not a real number + + """ + self._context.lifetime = _resolve_lifetime(value, type(self), stacklevel=3) + + @property + def mode(self) -> int: + """The file permissions for the lockfile.""" + return 0o644 if self._context.mode == _UNSET_FILE_MODE else self._context.mode + + @property + def has_explicit_mode(self) -> bool: + """Whether the file permissions were explicitly set.""" + return self._context.mode != _UNSET_FILE_MODE + + def _open_mode(self) -> int: + """Mode for ``os.open``: 0o666 when unset so umask and ACLs decide, otherwise the explicit mode.""" + return 0o666 if self._context.mode == _UNSET_FILE_MODE else self._context.mode + + @property + def is_locked(self) -> bool: + """ + A boolean indicating if the lock file is holding the lock currently. + + .. versionchanged:: 2.0.0 + + This was previously a method and is now a property. + + """ + _ensure_current_process() + return self._context.lock_file_fd is not None + + @property + def lock_counter(self) -> int: + """The number of times this lock has been acquired (but not yet released).""" + _ensure_current_process() + return self._context.lock_counter + + def __enter__(self) -> Self: + """ + Acquire the lock. + + :returns: the lock object + + """ + self.acquire() + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + traceback: TracebackType | None, + ) -> None: + """Release the lock, reconciling a release failure with any body failure per :attr:`context_error_policy`.""" + self._release_in_context(exc_value) + + def _release_in_context(self, body_error: BaseException | None) -> None: + # Release from a context-manager exit. "chain" lets a release failure propagate with the body error already in + # its __context__ (Python's default); "group" raises both as sibling leaves so neither one hides the other. + try: + self.release() + except BaseException as release_error: + if body_error is None or self._context_error_policy == "chain": + raise + _raise_body_and_release(body_error, release_error) + + def __del__(self) -> None: + """Force-release so a dropped reference never leaks a held lock.""" + if vars(self).get("_creator_pid") != os.getpid(): + return # pragma: forked child + # A finalizer must not raise. A release error during garbage collection would otherwise surface as an + # unraisable-exception warning, attributed to whichever code triggered collection. The dropped lock still gets + # best-effort cleanup; an explicit release() reports the same error to a caller who can act on it. + with contextlib.suppress(Exception): + self.release(force=True) + + def acquire( + self, + timeout: float | None = None, + poll_interval: float | None = None, + *, + poll_intervall: float | None = None, + blocking: bool | None = None, + cancel_check: Callable[[], bool] | None = None, + ) -> AcquireReturnProxy: + """ + Try to acquire the file lock. + + :param timeout: maximum wait time for acquiring the lock, ``None`` means use the default :attr:`~timeout` is and + if ``timeout < 0``, there is no timeout and this method will block until the lock could be acquired + :param poll_interval: interval of trying to acquire the lock file, ``None`` means use the default + :attr:`~poll_interval` + :param poll_intervall: deprecated, kept for backwards compatibility, use ``poll_interval`` instead + :param blocking: defaults to True. If False, function will return immediately if it cannot obtain a lock on the + first attempt. Otherwise, this method will block until the timeout expires or the lock is acquired. + :param cancel_check: a callable returning ``True`` when the acquisition should be canceled. Checked on each poll + iteration. When triggered, raises :class:`~Timeout` just like an expired timeout. + + :returns: a context object that will unlock the file when the context is exited + + :raises Timeout: if fails to acquire lock within the timeout period + + .. code-block:: python + + # You can use this method in the context manager (recommended) + with lock.acquire(): + pass + + # Or use an equivalent try-finally construct: + lock.acquire() + try: + pass + finally: + lock.release() + + .. versionchanged:: 2.0.0 + + This method returns now a *proxy* object instead of *self*, so that it can be used in a with statement + without side effects. + + """ + self._raise_if_inherited() + if timeout is None: + timeout = self._context.timeout + + if blocking is None: + blocking = self._context.blocking + + if poll_intervall is not None: + msg = "use poll_interval instead of poll_intervall" + warnings.warn(msg, DeprecationWarning, stacklevel=2) + poll_interval = poll_intervall + + poll_interval = poll_interval if poll_interval is not None else self._context.poll_interval + + start_time = time.perf_counter() + # Wait for admission before touching any state: a caller refused entry must leave the counter, the registry and + # the descriptor exactly as it found them. + with self._transition_admission( + blocking=blocking, + cancel_check=cancel_check, + timeout=timeout, + poll_interval=poll_interval, + start_time=start_time, + ): + # Bump the counter up front; _undo_acquire rolls it back if acquisition fails. + self._context.lock_counter += 1 + + canonical = _canonical(self.lock_file) + self._raise_if_would_deadlock(canonical, timeout=timeout, blocking=blocking) + + try: + self._poll_until_acquired( + blocking=blocking, + cancel_check=cancel_check, + timeout=timeout, + poll_interval=poll_interval, + start_time=start_time, + ) + except BaseException: + self._reconcile_failed_acquire(canonical) + raise + self._commit_acquire(canonical) + return AcquireReturnProxy(lock=self) + + @contextlib.contextmanager + def _transition_admission( + self, + *, + blocking: bool, + cancel_check: Callable[[], bool] | None, + timeout: float, + poll_interval: float, + start_time: float, + ) -> Generator[None]: + # One thread at a time drives the physical transition of a shared instance. A protocol that publishes several + # files per owner leaves a half-built claim visible otherwise, and a second thread would read it as a holder. + # Only such a backend opts in; a single-file backend and a thread-local context each need no gate. + if not self._serialize_transitions or self._is_thread_local: + yield + return + while not self._transition_lock.acquire(blocking=False): # pragma: needs hard-link + if not blocking or (cancel_check is not None and cancel_check()): + raise Timeout(self.lock_file) + if timeout >= 0 and time.perf_counter() - start_time >= timeout: + raise Timeout(self.lock_file) + time.sleep(poll_interval) + try: # pragma: needs hard-link + yield + finally: # pragma: needs hard-link + self._transition_lock.release() + + def release(self, force: bool = False) -> None: # ruff:ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument] # public API: positional bool kept for backwards compatibility + """ + Release the file lock. The lock is only completely released when the lock counter reaches 0. The lock file + itself may be deleted automatically, the behavior is platform-specific. + + :param force: If true, the lock counter is ignored and the lock is released in every case. + + """ + # A shared instance releases under the same gate its acquisition ran through, so a thread entering the lock + # never observes a partially torn-down owner. + serialize = self._serialize_transitions and not self._is_thread_local + with self._transition_lock if serialize else contextlib.nullcontext(): + if self._creator_pid != os.getpid() or not self.is_locked: + return + if not force and self._context.lock_counter > 1: + self._context.lock_counter -= 1 + return + + lock_id, lock_filename = id(self), self.lock_file + _LOGGER.debug("Attempting to release lock %s on %s", lock_id, lock_filename) + try: + self._release_with_fork_tracking() + except BaseException: + # A failure after the OS unlock (during close or unlink) still released the lock: the backend cleared + # its descriptor, so commit the counter and registry to released even as the cleanup error propagates. + # A failure that left the lock held keeps the counter so a later release can retry the OS unlock. + if not self.is_locked: + self._commit_release() + raise + self._commit_release() + _LOGGER.debug("Lock %s released on %s", lock_id, lock_filename) + + def _raise_if_inherited(self) -> None: + if self._creator_pid != os.getpid(): # pragma: forked child + msg = f"{type(self).__name__} on {self.lock_file} was inherited across fork; construct a new instance" + raise RuntimeError(msg) + + def _mark_descriptor_owned(self, fd: int, identity: tuple[int, int] | None = None) -> None: + self._context.pending_lock_file_fd = None + self._context.pending_lock_file_fd_identity = None + self._context.lock_file_fd = fd + self._context.lock_file_fd_identity = identity + + def _mark_descriptor_pending(self, fd: int, identity: tuple[int, int] | None = None) -> None: + self._context.pending_lock_file_fd = fd + self._context.pending_lock_file_fd_identity = identity + + def _mark_descriptor_released(self) -> None: + self._context.pending_lock_file_fd = None + self._context.pending_lock_file_fd_identity = None + self._context.lock_file_fd = None + self._context.lock_file_fd_identity = None + + def _reset_after_fork_in_child(self) -> None: # pragma: forked child + # fork copies the lock in whatever state the parent's threads left it, so give the child an unheld one. + self._transition_lock = RLock() + self._context.owner_claim_paths = () + self._context.claim_root = None + self._context.lock_file_fd = None + self._context.lock_file_fd_token = None + self._context.lock_file_fd_identity = None + self._context.pending_lock_file_fd = None + self._context.pending_lock_file_fd_identity = None + self._context.lock_counter = 0 + self._context.lock_file_key = None + + def _descriptors_for_fork(self) -> tuple[tuple[int, tuple[int, int] | None], ...]: # pragma: needs fork + descriptors: list[tuple[int, tuple[int, int] | None]] = [] + if self._context.lock_file_fd is not None and self._context.lock_file_fd_token is None: + descriptors.append((self._context.lock_file_fd, self._context.lock_file_fd_identity)) + if self._context.pending_lock_file_fd is not None: + descriptors.append((self._context.pending_lock_file_fd, self._context.pending_lock_file_fd_identity)) + return tuple(descriptors) + + def _raise_if_would_deadlock(self, canonical: str, *, timeout: float, blocking: bool) -> None: + """ + Fail fast when a *different* live instance already holds this path in the current deadlock scope. + + Only the first, indefinitely-blocking acquire can self-deadlock this way: waiting in the OS primitive would + block on a lock this flow already owns. A finite timeout or ``blocking=False`` keeps the normal Timeout path. + """ + would_block = self._context.lock_counter == 1 and not self.is_locked and timeout < 0 and blocking + if would_block and _registry.held.get(self._registry_key(canonical)) not in {None, id(self)}: + self._context.lock_counter -= 1 + msg = ( + f"Deadlock: lock '{self.lock_file}' is already held by a different {self._deadlock_holder_desc}. " + f"Use is_singleton=True to enable reentrant locking across instances." + ) + raise RuntimeError(msg) + + def _registry_key(self, canonical: str) -> Hashable: + return canonical if (scope := self._deadlock_scope()) is None else (scope, canonical) + + @staticmethod + def _deadlock_scope() -> Hashable | None: + """ + Execution unit whose own hold would deadlock a new acquire. + + ``None`` scopes holders to the thread, which the thread-local registry already separates. Async locks + override it with the running task, since one event loop thread runs many tasks and only a reacquire from + the *same* task can self-deadlock. + """ + return None + + def _poll_until_acquired( + self, + *, + blocking: bool, + cancel_check: Callable[[], bool] | None, + timeout: float, + poll_interval: float, + start_time: float, + ) -> None: + lock_id = id(self) + lock_filename = self.lock_file + attempt = 0 + while True: + self._raise_if_inherited() + if not self.is_locked: + self._try_break_expired_lock() + _LOGGER.debug("Attempting to acquire lock %s on %s", lock_id, lock_filename) + self._acquire_with_fork_tracking() + self._raise_if_inherited() + if self.is_locked: + _LOGGER.debug("Lock %s acquired on %s", lock_id, lock_filename) + return + if self._check_give_up( + blocking=blocking, + cancel_check=cancel_check, + timeout=timeout, + start_time=start_time, + ): + raise Timeout(lock_filename) + attempt += 1 + delay = self._poll_delay(poll_interval, attempt) + msg = "Lock %s not acquired on %s, waiting %s seconds ..." + _LOGGER.debug(msg, lock_id, lock_filename, delay) + time.sleep(delay) + + def _poll_delay(self, poll_interval: float, attempt: int) -> float: + # A single-file lock retries on a fixed cadence. A backend that publishes several files per acquisition sets a + # cap, and then contending processes back off across a jittered, exponentially widening window instead of + # colliding on every poll; poll_interval stays the floor so a lone waiter is still responsive. + if not self._poll_backoff_cap: + return poll_interval + # Cap the exponent before doubling: under heavy contention attempt reaches the thousands, and 2**attempt would + # overflow the float multiply long before the window itself stops growing past the cap. + window = min( + self._poll_backoff_cap, poll_interval * 2 ** min(attempt, _MAX_BACKOFF_EXPONENT) + ) # pragma: needs hard-link + return max(poll_interval, secrets.randbelow(int(window * 1_000_000) + 1) / 1_000_000) # pragma: needs hard-link + + def _reconcile_failed_acquire(self, canonical: str) -> None: + # An acquire that raised while still holding the native lock (a hook that failed and whose rollback could not + # release) must keep the registry entry so a later release can retry the OS unlock; otherwise roll the counter + # back. is_locked was already reconciled by whichever release ran. + if self.is_locked: + self._commit_acquire(canonical) + else: + self._undo_acquire() + + def _invoke_on_acquired(self) -> None: + # The wrapper runs in the backend executor for async locks, preserving the callback's documented thread. + if self._on_acquired is None or self._context.lock_counter != 1: + return + try: + self._on_acquired(cast("int", self._context.lock_file_fd)) + except BaseException as callback_error: # arbitrary caller code; roll back on any failure + callback_context = callback_error.__context__ + try: + self._release_with_fork_tracking() + except BaseException as release_error: # ruff:ignore[blind-except] # both errors surface via the group below + _raise_body_and_release(callback_error, release_error) + callback_error.__context__ = callback_context + raise + + def _acquire_with_fork_tracking(self) -> None: + with _fork_transition(self): + try: + self._acquire() + except BaseException as acquisition_error: + self._rollback_failed_acquire(acquisition_error) + raise + try: + self._register_context_descriptor() + except BaseException as registration_error: # pragma: needs fork + self._rollback_failed_registration(registration_error) + raise + if self.is_locked: + self._invoke_on_acquired() + + def _rollback_failed_acquire(self, acquisition_error: BaseException) -> None: + if not self.is_locked: + return + registration_error: BaseException | None = None + tracking_error: BaseException | None = None + try: + self._register_context_descriptor() + except BaseException as error: # ruff:ignore[blind-except] # preserve registration and acquisition failures + registration_error = error + try: + # Rollback may fail too; retain the fd so a child can close it without another identity probe. + self._register_unverified_context_descriptor() + except BaseException as error: # ruff:ignore[blind-except] # pragma: no cover - allocation/control-flow during fallback + tracking_error = error + try: + self._release_with_fork_tracking() + except BaseException as rollback_error: # ruff:ignore[blind-except] # preserve rollback and acquisition failures + _raise_cleanup_errors( + "lock acquisition cleanup failed", + acquisition_error, + registration_error, + tracking_error, + rollback_error, + ) + if registration_error is not None: # pragma: needs fork + _raise_cleanup_errors( + "lock acquisition cleanup failed", acquisition_error, registration_error, tracking_error + ) + + def _rollback_failed_registration(self, registration_error: BaseException) -> None: # pragma: needs fork + tracking_error: BaseException | None = None + try: + # Rollback may fail too; retain the fd so a child can close it without another identity probe. + self._register_unverified_context_descriptor() + except BaseException as error: # ruff:ignore[blind-except] # pragma: no cover - allocation/control-flow during fallback + tracking_error = error + try: + self._release_with_fork_tracking() + except BaseException as rollback_error: # ruff:ignore[blind-except] # preserve rollback and registration failures + _raise_cleanup_errors( + "descriptor registration cleanup failed", registration_error, tracking_error, rollback_error + ) + if tracking_error is not None: # pragma: no cover - requires failed in-memory fallback + _raise_cleanup_errors("descriptor registration cleanup failed", registration_error, tracking_error) + + def _release_with_fork_tracking(self) -> None: + with _fork_transition(self): + try: + self._release() + finally: + self._unregister_released_descriptor() + + def _register_context_descriptor(self) -> None: + if self._context.lock_file_fd is not None and self._context.lock_file_fd_token is None: + self._context.lock_file_fd_token = _register_owned_descriptor( + self._context.lock_file_fd, + self._context.lock_file_fd_identity, + ) + + def _register_unverified_context_descriptor(self) -> None: + # The rollback only reaches here still holding a descriptor it never managed to register. + if self._context.lock_file_fd is not None and self._context.lock_file_fd_token is None: # pragma: no branch + self._context.lock_file_fd_token = _register_unverified_owned_descriptor(self._context.lock_file_fd) + + def _unregister_released_descriptor(self) -> None: + if self._context.lock_file_fd is None: + if (token := self._context.lock_file_fd_token) is not None: # pragma: needs fork + _unregister_owned_descriptor(token) + self._context.lock_file_fd_token = None + self._context.lock_file_fd_identity = None + + def _undo_acquire(self) -> None: + """Roll back the counter after a failed acquire, dropping the registry entry once nothing holds the path.""" + self._context.lock_counter = max(0, self._context.lock_counter - 1) + if self._context.lock_counter == 0: + self._drop_registry_entry() + + def _commit_acquire(self, canonical: str) -> None: + """Record this instance as the holder once the first acquire succeeds, so peers can detect the deadlock.""" + if self._context.lock_counter == 1: + key = self._registry_key(canonical) + # The holder scope is resolved once at commit so a later release from another flow drops the right entry. + self._context.lock_file_key = key + _registry.held[key] = id(self) + + def _drop_registry_entry(self) -> None: + """Forget the key owned by this hold without resolving a mutable path again.""" + key = self._context.lock_file_key + self._context.lock_file_key = None + if key is not None: + _registry.held.pop(key, None) + + def _commit_release(self) -> None: + """Record the lock as fully released: reset the recursion counter and drop the deadlock-registry entry.""" + self._context.lock_counter = 0 + self._drop_registry_entry() + + def _try_break_expired_lock(self) -> None: + """Remove the lock file if its modification time exceeds the configured :attr:`lifetime`.""" + if (lifetime := self._context.lifetime) is None: + return + with contextlib.suppress(OSError): + # lstat, not stat: an attacker with write access to the lock directory can replace a held + # lock file with a symlink pointing at an old file, making stat() report the target's stale + # mtime so a waiter breaks a live lock and two processes hold it at once. lstat reads the + # symlink's own mtime, matching the O_NOFOLLOW reads elsewhere. + st = os.lstat(self.lock_file) + if time.time() - st.st_mtime < lifetime: + return + break_lock_file(self.lock_file, st.st_mtime, st.st_ino) + + def _check_give_up( + self, + *, + blocking: bool, + cancel_check: Callable[[], bool] | None, + timeout: float, + start_time: float, + ) -> bool: + lock_id, lock_filename = id(self), self.lock_file + if blocking is False: + _LOGGER.debug("Failed to immediately acquire lock %s on %s", lock_id, lock_filename) + return True + if cancel_check is not None and cancel_check(): + _LOGGER.debug("Cancellation requested for lock %s on %s", lock_id, lock_filename) + return True + if 0 <= timeout < time.perf_counter() - start_time: + _LOGGER.debug("Timeout on acquiring lock %s on %s", lock_id, lock_filename) + return True + return False + + @abstractmethod + def _acquire(self) -> None: + """If the file lock could be acquired, self._context.lock_file_fd holds the file descriptor of the lock file.""" + raise NotImplementedError + + @abstractmethod + def _release(self) -> None: + """Releases the lock and sets self._context.lock_file_fd to None.""" + raise NotImplementedError + + +# acquire() returns this wrapper instead of self so entering the with-statement does not call __enter__ a second +# time; returning self would re-acquire the lock in BaseFileLock.__enter__ without a matching release (issue #37). +class AcquireReturnProxy: + """A context-aware object that will release the lock file when exiting.""" + + def __init__(self, lock: BaseFileLock | ReadWriteLock | SoftReadWriteLock) -> None: + self.lock: BaseFileLock | ReadWriteLock | SoftReadWriteLock = lock + + def __enter__(self) -> BaseFileLock | ReadWriteLock | SoftReadWriteLock: + return self.lock + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + traceback: TracebackType | None, + ) -> None: + if isinstance(self.lock, BaseFileLock): + self.lock._release_in_context(exc_value) # ruff:ignore[private-member-access] # forwards __exit__ to the owned lock's context release + else: # a reader/writer lock does not carry a context_error_policy + self.lock.release() + + +@dataclass +class FileLockContext: + """Holds the context for a ``BaseFileLock`` object.""" + + # A separate class so ThreadLocalFileContext can make the whole context thread-local. + + lock_file: str + timeout: float + mode: int + blocking: bool + poll_interval: float + + #: The lock lifetime in seconds; ``None`` means the lock never expires. + lifetime: float | None = None + + #: File descriptor from os.open for the lock file; not None while the lock is held. + lock_file_fd: int | None = None + + #: Registry token for the descriptor owned by this thread's context. + lock_file_fd_token: int | None = None + + #: Identity captured by a backend that already inspected the descriptor. + lock_file_fd_identity: tuple[int, int] | None = None + + #: Descriptor opened by a backend but not yet committed as the held lock. + pending_lock_file_fd: int | None = None + + #: Identity captured for a descriptor whose acquisition has not committed. + pending_lock_file_fd_identity: tuple[int, int] | None = None + + #: Depth of nested acquisitions; the lock is released only when it returns to 0. + lock_counter: int = 0 + + #: Canonical registry key captured when the first physical acquisition commits. + lock_file_key: Hashable | None = None + + #: Claim pathnames this owner published, removed by name on release so no holder ever unlinks a peer's claim. + owner_claim_paths: tuple[str, ...] = () + + #: Canonical lock path resolved when an acquisition starts. A waiter polling a relative path must keep publishing + #: into the directory it started in, even when another thread changes the working directory mid-wait. + claim_root: str | None = None + + +class ThreadLocalFileContext(FileLockContext, local): + """A thread local version of the ``FileLockContext`` class.""" + + +@dataclass(frozen=True) +class _OwnedDescriptor: + fd: int + creator_pid: int + device: int | None + inode: int | None + + +class _ForkTransitionContext(local): + depth: int = 0 + + +class _ForkState: + def __init__(self) -> None: + self.gate = Condition(RLock()) + self.registry_lock = RLock() + self.parameter_models_lock = RLock() + self.transition_context = _ForkTransitionContext() + self.transitions: dict[int, dict[int, _ForkDescriptorOwner | None]] = {} + self.active_transitions = 0 + self.admission_closed = False + self.fork_owner_depths: dict[int, int] = {} + self.pinned_objects: dict[int, list[tuple[_ForkResettable, ...]]] = {} + self.pinned_classes: dict[int, list[tuple[_ForkResettableClass, ...]]] = {} + self.provisional_descriptor_tokens: dict[int, list[tuple[int, ...]]] = {} + self.pid = os.getpid() + + def reset_synchronization(self) -> None: # pragma: forked child + self.gate = Condition(RLock()) + self.registry_lock = RLock() + self.parameter_models_lock = RLock() + self.transition_context = _ForkTransitionContext() + self.transitions = {} + self.active_transitions = 0 + self.admission_closed = False + self.fork_owner_depths = {} + self.pinned_objects = {} + self.pinned_classes = {} + self.provisional_descriptor_tokens = {} + + +_FORK_OBJECTS: Final[WeakValueDictionary[int, _ForkResettable]] = WeakValueDictionary() +_FORK_CLASSES: Final[WeakValueDictionary[int, _ForkResettableClass]] = WeakValueDictionary() +_OWNED_DESCRIPTORS: Final[dict[int, _OwnedDescriptor]] = {} +_DESCRIPTOR_TOKENS: Final[count[int]] = count() +_TRANSITION_TOKENS: Final[count[int]] = count() +_FORK_STATE: Final = _ForkState() +_FORK_AUDIT_EVENTS: Final[frozenset[str]] = frozenset({"os.fork", "os.forkpty"}) + + +def _register_fork_hooks() -> None: + if _REGISTER_AT_FORK is None: + return # pragma: lacks fork + sys.addaudithook(_audit_fork_safety) # pragma: needs fork + _REGISTER_AT_FORK( # pragma: needs fork + before=_pin_fork_objects, + after_in_parent=_resume_parent_after_fork, + after_in_child=_reset_child_after_fork, + ) + + +@contextmanager +def _fork_transition(descriptor_owner: _ForkDescriptorOwner | None = None) -> Generator[None]: + if not _HAS_REGISTER_AT_FORK: + yield # pragma: lacks fork + return # pragma: lacks fork + _ensure_current_process() # pragma: needs fork + creator_pid = os.getpid() # pragma: needs fork + token = _enter_fork_transition(descriptor_owner) # pragma: needs fork + try: # pragma: needs fork + yield + finally: + if os.getpid() == creator_pid: # pragma: needs fork + _leave_fork_transition(token) + + +def _register_fork_object(instance: _ForkResettable) -> None: + if not _HAS_REGISTER_AT_FORK: + return # pragma: lacks fork + with _fork_transition(), _FORK_STATE.registry_lock: # pragma: needs fork + _FORK_OBJECTS[id(instance)] = instance + _refresh_owner_pins() + + +def _register_fork_class(cls: _ForkResettableClass) -> None: + if not _HAS_REGISTER_AT_FORK: + return # pragma: lacks fork + with _fork_transition(), _FORK_STATE.registry_lock: # pragma: needs fork + _FORK_CLASSES[id(cls)] = cls + _refresh_owner_pins() + + +def _register_owned_descriptor(fd: int, identity: tuple[int, int] | None = None) -> int | None: + if not _HAS_REGISTER_AT_FORK: + return None # pragma: lacks fork + with _fork_transition(): # pragma: needs fork + if identity is None: + stat_result = os.fstat(fd) + identity = stat_result.st_dev, stat_result.st_ino + return _record_owned_descriptor(fd, identity) + + +def _register_unverified_owned_descriptor(fd: int) -> int | None: + if not _HAS_REGISTER_AT_FORK: + return None # pragma: lacks fork + with _fork_transition(): # pragma: needs fork + return _record_owned_descriptor(fd, None) + + +def _record_owned_descriptor(fd: int, identity: tuple[int, int] | None) -> int: # pragma: needs fork + with _FORK_STATE.registry_lock: + token = next(_DESCRIPTOR_TOKENS) + _OWNED_DESCRIPTORS[token] = _OwnedDescriptor( + fd=fd, + creator_pid=os.getpid(), + device=None if identity is None else identity[0], + inode=None if identity is None else identity[1], + ) + return token + + +def _unregister_owned_descriptor(token: int) -> None: # pragma: needs fork + with _fork_transition(), _FORK_STATE.registry_lock: + _OWNED_DESCRIPTORS.pop(token, None) + + +def _pin_fork_objects() -> None: # pragma: needs fork + _ensure_current_process() + thread_id = get_ident() + with _FORK_STATE.gate: + _FORK_STATE.fork_owner_depths[thread_id] = _FORK_STATE.fork_owner_depths.get(thread_id, 0) + 1 + _FORK_STATE.admission_closed = True + while _FORK_STATE.active_transitions > len(_FORK_STATE.transitions.get(thread_id, ())): + _FORK_STATE.gate.wait() + transition_owners = tuple(_FORK_STATE.transitions.get(thread_id, {}).values()) + _verify_unverified_descriptors() + owners = {id(owner): owner for owner in transition_owners if owner is not None} + provisional_descriptor_tokens = tuple( + starmap( + _snapshot_descriptor_for_fork, + (descriptor for owner in owners.values() for descriptor in owner._descriptors_for_fork()), # ruff:ignore[private-member-access] # snapshots each owner's own fork descriptors + ) + ) + with _FORK_STATE.registry_lock: + _FORK_STATE.provisional_descriptor_tokens.setdefault(thread_id, []).append(provisional_descriptor_tokens) + _FORK_STATE.pinned_objects.setdefault(thread_id, []).append(tuple(_FORK_OBJECTS.values())) + _FORK_STATE.pinned_classes.setdefault(thread_id, []).append(tuple(_FORK_CLASSES.values())) + + +def _resume_parent_after_fork() -> None: # pragma: needs fork + thread_id = get_ident() + with _FORK_STATE.registry_lock: + for token in _FORK_STATE.provisional_descriptor_tokens[thread_id].pop(): + _OWNED_DESCRIPTORS.pop(token, None) + _FORK_STATE.pinned_objects[thread_id].pop() + _FORK_STATE.pinned_classes[thread_id].pop() + if not _FORK_STATE.provisional_descriptor_tokens[thread_id]: # pragma: needs fork + del _FORK_STATE.provisional_descriptor_tokens[thread_id] + del _FORK_STATE.pinned_objects[thread_id] + del _FORK_STATE.pinned_classes[thread_id] + with _FORK_STATE.gate: + if _FORK_STATE.fork_owner_depths[thread_id] == 1: + del _FORK_STATE.fork_owner_depths[thread_id] + else: # pragma: no cover - earlier at-fork callbacks may deadlock first + _FORK_STATE.fork_owner_depths[thread_id] -= 1 + _FORK_STATE.admission_closed = bool(_FORK_STATE.fork_owner_depths) + _FORK_STATE.gate.notify_all() + + +def _ensure_current_process() -> None: + _reset_child_after_fork() + + +def _reset_child_after_fork() -> None: # pragma: forked child + if (pid := os.getpid()) == _FORK_STATE.pid: + return + thread_id = get_ident() + pinned_objects = _FORK_STATE.pinned_objects.get(thread_id, [()])[-1] + pinned_classes = _FORK_STATE.pinned_classes.get(thread_id, [()])[-1] + descriptors: list[_OwnedDescriptor] = [] + for token, descriptor in tuple(_OWNED_DESCRIPTORS.items()): + if descriptor.creator_pid != pid: + descriptors.append(_OWNED_DESCRIPTORS.pop(token)) + _FORK_STATE.reset_synchronization() + _FORK_STATE.pid = pid + _INIT_PARAMETER_MODELS.clear() + _detach_child_state(descriptors, pinned_objects, pinned_classes) + + +def _enter_fork_transition(descriptor_owner: _ForkDescriptorOwner | None) -> int: # pragma: needs fork + thread_id = get_ident() + with _FORK_STATE.gate: + while ( + _FORK_STATE.admission_closed + and thread_id not in _FORK_STATE.fork_owner_depths + and thread_id not in _FORK_STATE.transitions + ): + _FORK_STATE.gate.wait() # pragma: no cover - exercised in isolated interpreter + token = next(_TRANSITION_TOKENS) + _FORK_STATE.transitions.setdefault(thread_id, {})[token] = descriptor_owner + _FORK_STATE.active_transitions += 1 + _FORK_STATE.transition_context.depth += 1 + return token + + +def _leave_fork_transition(token: int) -> None: # pragma: needs fork + _FORK_STATE.transition_context.depth -= 1 + with _FORK_STATE.gate: + thread_id = get_ident() + del _FORK_STATE.transitions[thread_id][token] + if not _FORK_STATE.transitions[thread_id]: + del _FORK_STATE.transitions[thread_id] + _FORK_STATE.active_transitions -= 1 + _FORK_STATE.gate.notify_all() + + +def _verify_unverified_descriptors() -> None: # pragma: needs fork + with _FORK_STATE.registry_lock: + for token, descriptor in tuple(_OWNED_DESCRIPTORS.items()): + if descriptor.creator_pid != os.getpid() or descriptor.device is not None: + continue + try: + stat_result = os.fstat(descriptor.fd) + except OSError: + continue + _OWNED_DESCRIPTORS[token] = _OwnedDescriptor( + fd=descriptor.fd, + creator_pid=descriptor.creator_pid, + device=stat_result.st_dev, + inode=stat_result.st_ino, + ) + + +def _snapshot_descriptor_for_fork(fd: int, identity: tuple[int, int] | None) -> int: # pragma: needs fork + if identity is None: # pragma: needs fork + try: + stat_result = os.fstat(fd) + except OSError: + pass + else: + identity = stat_result.st_dev, stat_result.st_ino + return _record_owned_descriptor(fd, identity) + + +def _detach_child_state( # pragma: forked child + descriptors: list[_OwnedDescriptor], + pinned_objects: tuple[_ForkResettable, ...], + pinned_classes: tuple[_ForkResettableClass, ...], +) -> None: + for descriptor in descriptors: + if descriptor.device is None: + continue + try: + stat_result = os.fstat(descriptor.fd) + except OSError: + continue + if (stat_result.st_dev, stat_result.st_ino) != (descriptor.device, descriptor.inode): + continue + with contextlib.suppress(OSError): + os.close(descriptor.fd) + for instance in pinned_objects: + instance._reset_after_fork_in_child() # ruff:ignore[private-member-access] # resets each pinned instance in the fork child + for cls in pinned_classes: + cls._reset_class_after_fork() + _registry.held.clear() + + +def _refresh_owner_pins() -> None: # pragma: needs fork + with _FORK_STATE.gate: + fork_owner_thread_ids = tuple(_FORK_STATE.fork_owner_depths) + if get_ident() not in fork_owner_thread_ids: # pragma: no cover - at-fork callbacks disable tracing + return + objects = tuple(_FORK_OBJECTS.values()) + classes = tuple(_FORK_CLASSES.values()) + for thread_id in fork_owner_thread_ids: + if object_snapshots := _FORK_STATE.pinned_objects.get(thread_id): # pragma: needs fork + object_snapshots[:] = [objects] * len(object_snapshots) + _FORK_STATE.pinned_classes[thread_id][:] = [classes] * len(object_snapshots) + + +# Audit events carry unrelated interpreter-owned values; object is the sole accurate common element type. +def _audit_fork_safety( # pragma: no cover - CPython disables tracing while Python audit hooks run + event: str, _args: tuple[object, ...] +) -> None: + if event in _FORK_AUDIT_EVENTS: + if _FORK_STATE.transition_context.depth or _FORK_STATE.fork_owner_depths: + msg = f"{event} is unsafe while filelock is changing descriptor ownership" + raise RuntimeError(msg) + elif event == "_posixsubprocess.fork_exec" and _FORK_STATE.transition_context.depth: + msg = "fork_exec is unsafe while filelock is changing descriptor ownership" + raise RuntimeError(msg) + + +_register_fork_hooks() + + +__all__ = [ + "_UNSET_FILE_MODE", + "AcquireReturnProxy", + "BaseFileLock", + "CloseErrorPolicy", + "ContextErrorPolicy", + "FileLockContext", + "FileLockMeta", + "LockOptions", + "_append_exception_context", + "_canonical", + "_ensure_current_process", + "_fork_transition", + "_grouped_errors", + "_raise_body_and_release", + "_raise_chained_errors", + "_raise_cleanup_errors", + "_raise_grouped_errors", + "_register_fork_class", + "_register_fork_object", + "_register_owned_descriptor", + "_unregister_owned_descriptor", +] diff --git a/venv/lib/python3.12/site-packages/filelock/_async.py b/venv/lib/python3.12/site-packages/filelock/_async.py new file mode 100644 index 0000000000000000000000000000000000000000..3848dbcc8f9623a129485e643e4c2173a96ff090 --- /dev/null +++ b/venv/lib/python3.12/site-packages/filelock/_async.py @@ -0,0 +1,173 @@ +"""Separate caller cancellation from backend task and executor-future results.""" + +from __future__ import annotations + +import asyncio +import contextlib +import time +from concurrent.futures import Future as ConcurrentFuture +from dataclasses import dataclass +from threading import Lock +from typing import TYPE_CHECKING, Final, Generic, NoReturn, TypeVar, cast + +from ._api import _append_exception_context, _raise_chained_errors + +if TYPE_CHECKING: + from collections.abc import AsyncIterator, Awaitable, Callable + +_T = TypeVar("_T") + + +class _AsyncTransitionUnavailableError(Exception): + pass + + +@dataclass(frozen=True) +class _BackendOutcome(Generic[_T]): + value: _T | None = None + error: BaseException | None = None + + +class _AsyncTransitionGate: + def __init__(self) -> None: + self._tail_lock: Final[Lock] = Lock() + self._tail: ConcurrentFuture[None] | None = None + + @contextlib.asynccontextmanager + async def hold(self) -> AsyncIterator[None]: + ticket: ConcurrentFuture[None] = ConcurrentFuture() + with self._tail_lock: + predecessor = self._tail + self._tail = ticket + if predecessor is not None: + try: + await _wait_until_done(asyncio.wrap_future(predecessor)) + except asyncio.CancelledError: + predecessor.add_done_callback(lambda _predecessor: self._leave(ticket)) + raise + try: + yield + finally: + self._leave(ticket) + + @contextlib.asynccontextmanager + async def hold_for_acquire( + self, + *, + blocking: bool, + cancel_check: Callable[[], bool] | None, + deadline: float | None, + poll_interval: float, + ) -> AsyncIterator[None]: + ticket: ConcurrentFuture[None] = ConcurrentFuture() + with self._tail_lock: + predecessor = self._tail + self._tail = ticket + if predecessor is not None and not predecessor.done(): + try: + await self._wait_for_predecessor( + predecessor, + blocking=blocking, + cancel_check=cancel_check, + deadline=deadline, + poll_interval=poll_interval, + ) + except BaseException: + predecessor.add_done_callback(lambda _predecessor: self._leave(ticket)) + raise + try: + yield + finally: + self._leave(ticket) + + @staticmethod + async def _wait_for_predecessor( + predecessor: ConcurrentFuture[None], + *, + blocking: bool, + cancel_check: Callable[[], bool] | None, + deadline: float | None, + poll_interval: float, + ) -> None: + if not blocking: + raise _AsyncTransitionUnavailableError + waiter = asyncio.wrap_future(predecessor) + while not predecessor.done(): + if cancel_check is not None and cancel_check(): + raise _AsyncTransitionUnavailableError + if deadline is not None: + if (remaining := deadline - time.perf_counter()) <= 0: + raise _AsyncTransitionUnavailableError + wait_interval = min(poll_interval, remaining) if cancel_check is not None else remaining + else: + wait_interval = poll_interval if cancel_check is not None else None + await asyncio.wait((waiter,), timeout=wait_interval) + + def _leave(self, ticket: ConcurrentFuture[None]) -> None: + with self._tail_lock: + if self._tail is ticket: + self._tail = None + ticket.set_result(None) + + +async def _drain_future(future: asyncio.Future[_BackendOutcome[_T]]) -> _T: + while not future.done(): + with contextlib.suppress(asyncio.CancelledError): + await _wait_until_done(future) + return _future_result(future) + + +async def _wait_until_done(future: asyncio.Future[_T]) -> None: + if not future.done(): + await asyncio.wait((future,)) + + +def _future_result(future: asyncio.Future[_BackendOutcome[_T]]) -> _T: + outcome = future.result() + if (error := outcome.error) is None: + return cast("_T", outcome.value) + context = error.__context__ + try: + raise error # ruff:ignore[raise-within-try] # the handler restores context changed across the async boundary + except BaseException: + error.__context__ = context + raise + + +def _capture_call(func: Callable[[], _T]) -> _BackendOutcome[_T]: + try: + return _BackendOutcome(value=func()) + except BaseException as error: # ruff:ignore[blind-except] # backend control-flow exceptions are operation results + return _BackendOutcome(error=error) + + +def _raise_cancelled_error(cancellation: asyncio.CancelledError, error: BaseException) -> NoReturn: + # A reconciliation step failed while unwinding a cancellation, so keep both exception chains. Splice the error's + # existing context onto the cancellation, then make the cancellation the error's context, so both the failure and + # the cancellation that triggered it survive. Shared by the async wrappers so cancellations report the same way. + if (context := error.__context__) is not None and context is not cancellation: + if (cancellation_context := cancellation.__context__) is not None: + _append_exception_context(context, cancellation_context) + cancellation.__context__ = context + error.__context__ = cancellation + _raise_chained_errors(error) + + +async def _capture_awaitable(awaitable: Awaitable[_T]) -> _BackendOutcome[_T]: + try: + return _BackendOutcome(value=await awaitable) + except BaseException as error: # ruff:ignore[blind-except] # backend cancellation must remain distinct from caller cancellation + return _BackendOutcome(error=error) + + +__all__ = [ + "_AsyncTransitionGate", + "_AsyncTransitionUnavailableError", + "_BackendOutcome", + "_capture_awaitable", + "_capture_call", + "_drain_future", + "_future_result", + "_raise_cancelled_error", + "_wait_until_done", +] diff --git a/venv/lib/python3.12/site-packages/filelock/_async_read_write.py b/venv/lib/python3.12/site-packages/filelock/_async_read_write.py new file mode 100644 index 0000000000000000000000000000000000000000..58ad40cb2a2ed24d1dd15545e12f0489bc6dfca0 --- /dev/null +++ b/venv/lib/python3.12/site-packages/filelock/_async_read_write.py @@ -0,0 +1,338 @@ +"""Async wrapper around :class:`ReadWriteLock` for use with ``asyncio``.""" + +from __future__ import annotations + +import asyncio +import functools +import os +import sqlite3 +from concurrent.futures import ThreadPoolExecutor +from contextlib import asynccontextmanager +from typing import TYPE_CHECKING, ParamSpec, TypeVar + +from ._api import ( + _append_exception_context, + _ensure_current_process, + _fork_transition, + _register_fork_object, +) +from ._async import ( + _BackendOutcome, + _capture_call, + _drain_future, + _future_result, + _raise_cancelled_error, + _wait_until_done, +) +from ._read_write import ReadWriteLock + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Callable + from concurrent import futures + from types import TracebackType + + from ._api import AcquireReturnProxy + +_P = ParamSpec("_P") +_R = TypeVar("_R") + + +class AsyncReadWriteLock: + """ + Async wrapper around :class:`ReadWriteLock` for use in ``asyncio`` applications. + + This wrapper dispatches every blocking SQLite operation to a thread pool via ``loop.run_in_executor()`` because + Python's :mod:`sqlite3` module has no async API. It delegates reentrancy, upgrade/downgrade rules, and singleton + behavior to the underlying :class:`ReadWriteLock`. + + :param lock_file: path to the SQLite database file used as the lock + :param timeout: maximum wait time in seconds; ``-1`` means block indefinitely + :param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable + :param is_singleton: if ``True``, reuse existing :class:`ReadWriteLock` instances for the same resolved path + :param loop: event loop for ``run_in_executor``; ``None`` uses the running loop + :param executor: executor for ``run_in_executor``. When ``None`` this lock creates and owns a dedicated + single-thread executor so every operation runs on the same thread (SQLite affinity requires this) and shuts it + down in :meth:`close`. This lock uses a caller-supplied executor as-is and never shuts it down, so after passing + no executor call :meth:`close` to release the owned one. + + .. versionadded:: 3.21.0 + + """ + + def __init__( # ruff:ignore[too-many-arguments] # public constructor: one parameter per documented lock option + self, + lock_file: str | os.PathLike[str], + timeout: float = -1, + *, + blocking: bool = True, + is_singleton: bool = True, + loop: asyncio.AbstractEventLoop | None = None, + executor: futures.Executor | None = None, + ) -> None: + creator_pid = os.getpid() + self._creator_pid = creator_pid + self._fork_invalidated = False + self._closed = False + _register_fork_object(self) + with _fork_transition(): + self._lock = ReadWriteLock(lock_file, timeout, blocking=blocking, is_singleton=is_singleton) + self._loop = loop + self._owns_executor = executor is None + self._executor = executor or ThreadPoolExecutor(max_workers=1) + if os.getpid() != creator_pid: # pragma: forked child + msg = "AsyncReadWriteLock construction cannot continue after fork" + raise RuntimeError(msg) + + @property + def lock_file(self) -> str: + """The path to the lock file.""" + return self._lock.lock_file + + @property + def timeout(self) -> float: + """The default timeout.""" + return self._lock.timeout + + @property + def blocking(self) -> bool: + """Whether blocking is enabled by default.""" + return self._lock.blocking + + @property + def loop(self) -> asyncio.AbstractEventLoop | None: + """The event loop (or ``None`` for the running loop).""" + return self._loop + + @property + def executor(self) -> futures.Executor: + """The executor used for ``run_in_executor`` (a dedicated single-thread one if none was supplied).""" + return self._executor + + @asynccontextmanager + async def read_lock(self, timeout: float | None = None, *, blocking: bool | None = None) -> AsyncGenerator[None]: + """ + Async context manager that acquires and releases a shared read lock. + + Falls back to instance defaults for *timeout* and *blocking* when ``None``. + + :param timeout: maximum wait time in seconds, or ``None`` to use the instance default + :param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately; ``None`` uses the instance default + + """ + if timeout is None: + timeout = self._lock.timeout + if blocking is None: + blocking = self._lock.blocking + await self.acquire_read(timeout, blocking=blocking) + body_error: BaseException | None = None + try: + yield + except BaseException as error: + body_error = error + raise + finally: + await self._release_in_context(body_error) + + @asynccontextmanager + async def write_lock(self, timeout: float | None = None, *, blocking: bool | None = None) -> AsyncGenerator[None]: + """ + Async context manager that acquires and releases an exclusive write lock. + + Falls back to instance defaults for *timeout* and *blocking* when ``None``. + + :param timeout: maximum wait time in seconds, or ``None`` to use the instance default + :param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately; ``None`` uses the instance default + + """ + if timeout is None: + timeout = self._lock.timeout + if blocking is None: + blocking = self._lock.blocking + await self.acquire_write(timeout, blocking=blocking) + body_error: BaseException | None = None + try: + yield + except BaseException as error: + body_error = error + raise + finally: + await self._release_in_context(body_error) + + async def _release_in_context(self, body_error: BaseException | None) -> None: + try: + await self.release() + except BaseException as release_error: + if body_error is not None: + _append_exception_context(release_error, body_error) + raise + + async def acquire_read(self, timeout: float = -1, *, blocking: bool = True) -> AsyncAcquireReadWriteReturnProxy: + """ + Acquire a shared read lock. + + See :meth:`ReadWriteLock.acquire_read` for full semantics. + + :param timeout: maximum wait time in seconds; ``-1`` means block indefinitely + :param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable + + :returns: a proxy that can be used as an async context manager to release the lock + + :raises RuntimeError: if a write lock is already held on this instance + :raises Timeout: if the lock cannot be acquired within *timeout* seconds + + """ + self._raise_if_unusable() + await self._run_acquire(functools.partial(self._lock.acquire_read, timeout, blocking=blocking)) + return AsyncAcquireReadWriteReturnProxy(lock=self) + + async def acquire_write(self, timeout: float = -1, *, blocking: bool = True) -> AsyncAcquireReadWriteReturnProxy: + """ + Acquire an exclusive write lock. + + See :meth:`ReadWriteLock.acquire_write` for full semantics. + + :param timeout: maximum wait time in seconds; ``-1`` means block indefinitely + :param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable + + :returns: a proxy that can be used as an async context manager to release the lock + + :raises RuntimeError: if a read lock is already held, or a write lock is held by a different thread + :raises Timeout: if the lock cannot be acquired within *timeout* seconds + + """ + self._raise_if_unusable() + await self._run_acquire(functools.partial(self._lock.acquire_write, timeout, blocking=blocking)) + return AsyncAcquireReadWriteReturnProxy(lock=self) + + async def release(self, *, force: bool = False) -> None: + """ + Release one level of the current lock. + + See :meth:`ReadWriteLock.release` for full semantics. + + :param force: if ``True``, release the lock completely regardless of the current lock level + + :raises RuntimeError: if no lock is currently held and *force* is ``False`` + + """ + _ensure_current_process() + if self._inherited: # pragma: needs fork + return + await self._run(self._lock.release, force=force) + + async def close(self) -> None: + """ + Release the lock (if held) and close the underlying SQLite connection. + + After calling this method, the lock instance is no longer usable. + + """ + _ensure_current_process() + if self._inherited: # pragma: needs fork + return + if self._closed: + return + close_future = self._submit(self._lock.close) + try: + await _wait_until_done(close_future) + except asyncio.CancelledError as cancellation: + try: + await _drain_future(close_future) + except BaseException as error: # ruff:ignore[blind-except] # reported with the cancellation below + _raise_cancelled_error(cancellation, error) + self._closed = True + self._shutdown_owned_executor() + raise + _future_result(close_future) + self._closed = True + # Wait for the worker to exit rather than letting it drain in the background: a caller that forks right + # after closing deserves a single-threaded process, and os.fork warns about any surviving thread. + if self._owns_executor: + await asyncio.to_thread(functools.partial(self._executor.shutdown, wait=True)) + + async def _run_acquire(self, acquire: Callable[[], AcquireReturnProxy]) -> None: + acquire_future = self._submit(acquire) + try: + await _wait_until_done(acquire_future) + except asyncio.CancelledError as cancellation: + try: + await _drain_future(acquire_future) + except BaseException as error: # ruff:ignore[blind-except] # reported with the cancellation below + _raise_cancelled_error(cancellation, error) + try: + await _drain_future(self._submit(self._lock.release)) + except BaseException as error: # ruff:ignore[blind-except] # reported with the cancellation below + _raise_cancelled_error(cancellation, error) + raise + _future_result(acquire_future) + + async def _run(self, func: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: + future = self._submit(func, *args, **kwargs) + try: + await _wait_until_done(future) + except asyncio.CancelledError as cancellation: + try: + await _drain_future(future) + except BaseException as error: # ruff:ignore[blind-except] # reported with the cancellation below + _raise_cancelled_error(cancellation, error) + raise + return _future_result(future) + + def _submit( + self, func: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs + ) -> asyncio.Future[_BackendOutcome[_R]]: + return (self._loop or asyncio.get_running_loop()).run_in_executor( + self._executor, + _capture_call, + functools.partial(func, *args, **kwargs), + ) + + def _shutdown_owned_executor(self) -> None: + if self._owns_executor: + self._executor.shutdown(wait=False) + + @property + def _inherited(self) -> bool: + return self._fork_invalidated or os.getpid() != self._creator_pid + + def _raise_if_unusable(self) -> None: + _ensure_current_process() + if self._inherited: # pragma: needs fork + msg = f"AsyncReadWriteLock on {self.lock_file} was invalidated by fork(); construct a new instance" + raise RuntimeError(msg) + if self._closed: + msg = "Cannot operate on a closed database." + raise sqlite3.ProgrammingError(msg) + + def _reset_after_fork_in_child(self) -> None: # pragma: forked child + self._fork_invalidated = True + + def __del__(self) -> None: + # Safety net when close() was never called: shut down the executor we own so its worker thread does not + # outlive the lock. shutdown(wait=False) never blocks. + if os.getpid() == getattr(self, "_creator_pid", None) and getattr(self, "_owns_executor", False): + self._executor.shutdown(wait=False) + + +class AsyncAcquireReadWriteReturnProxy: + """Context-aware object that releases the async read/write lock on exit.""" + + def __init__(self, lock: AsyncReadWriteLock) -> None: + self.lock = lock + + async def __aenter__(self) -> AsyncReadWriteLock: + return self.lock + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + traceback: TracebackType | None, + ) -> None: + await self.lock.release() + + +__all__ = [ + "AsyncAcquireReadWriteReturnProxy", + "AsyncReadWriteLock", +] diff --git a/venv/lib/python3.12/site-packages/filelock/_descriptor.py b/venv/lib/python3.12/site-packages/filelock/_descriptor.py new file mode 100644 index 0000000000000000000000000000000000000000..7c9aa97101d7787cf8fc95df6160f8958fc76559 --- /dev/null +++ b/venv/lib/python3.12/site-packages/filelock/_descriptor.py @@ -0,0 +1,71 @@ +"""A minimal native lock over a caller-owned file descriptor, contending with :class:`FileLock` on the same file.""" + +from __future__ import annotations + +import sys +import time +from math import isfinite +from typing import Final + +if sys.platform == "win32": # pragma: win32 cover + from ._windows import _lock_fd_nonblocking, _unlock_fd +else: # pragma: win32 no cover + from ._unix import _lock_fd_nonblocking, _unlock_fd + + +def lock_descriptor(fd: int, *, blocking: bool = True, poll_interval: float = 0.05) -> bool: + """ + Take the native OS lock on *fd*, a file descriptor the caller opened and owns. + + This is the same one-byte exclusive lock :class:`FileLock` uses, so a descriptor lock and a path lock on the same + file contend with each other. Unlike :class:`FileLock` it adds no path handling: it never opens, truncates, closes, + unlinks, chmods, canonicalizes, or falls back. The caller owns *fd* before, during, and after the call, and must + close it. On Windows *fd* must be a synchronous descriptor (its handle not opened with ``FILE_FLAG_OVERLAPPED``). + + For timeout, reentrancy, singleton, lifetime, or stale-break behavior, use :class:`FileLock`. There is no async + wrapper. Run this in an executor, or drive ``blocking=False`` from your own polling loop. + + :param fd: an open file descriptor the caller owns. + :param blocking: when ``True`` (default), retry the nonblocking attempt every *poll_interval* seconds until it + succeeds; when ``False``, make one attempt. + :param poll_interval: finite, positive seconds between attempts while blocking; ignored when *blocking* is + ``False``. + + :returns: ``True`` once the lock is held, or ``False`` on contention when ``blocking`` is ``False``. + + :raises OSError: for a permanent native failure, such as an invalid descriptor, or with ``errno.ENOSYS`` when the + Python build lacks the native locking primitive. The descriptor is left open. + :raises ValueError: if a blocking call receives a non-finite or non-positive *poll_interval*. + + .. versionadded:: 3.30.0 + + """ + if not blocking: + return _lock_fd_nonblocking(fd) + if not isfinite(poll_interval) or poll_interval <= 0: + msg: Final[str] = f"poll_interval must be finite and greater than 0, got {poll_interval}" + raise ValueError(msg) + while not _lock_fd_nonblocking(fd): + time.sleep(poll_interval) + return True + + +def unlock_descriptor(fd: int) -> None: + """ + Release the native OS lock on *fd* without touching the descriptor. + + :param fd: the descriptor a prior :func:`lock_descriptor` locked; the caller still owns and must close it. + + :raises OSError: if the native unlock fails, including ``errno.ENOSYS`` when the Python build lacks the native + locking primitive; the caller may retry on the same descriptor. + + .. versionadded:: 3.30.0 + + """ + _unlock_fd(fd) + + +__all__ = [ + "lock_descriptor", + "unlock_descriptor", +] diff --git a/venv/lib/python3.12/site-packages/filelock/_error.py b/venv/lib/python3.12/site-packages/filelock/_error.py new file mode 100644 index 0000000000000000000000000000000000000000..6159b34e61a2932893acec0899173c2ee6f548da --- /dev/null +++ b/venv/lib/python3.12/site-packages/filelock/_error.py @@ -0,0 +1,74 @@ +from __future__ import annotations + + +class Timeout(TimeoutError): # ruff:ignore[error-suffix-on-exception-name] # public exception name; renaming breaks the API + """Raised when the lock could not be acquired in *timeout* seconds.""" + + def __init__(self, lock_file: str) -> None: + super().__init__() + self._lock_file = lock_file + + def __reduce__(self) -> tuple[type[Timeout], tuple[str]]: + # __init__ needs lock_file, so pickle must restore it as a constructor arg + return self.__class__, (self._lock_file,) + + def __str__(self) -> str: # pragma: needs hard-link + return f"The file lock '{self._lock_file}' could not be acquired." + + def __repr__(self) -> str: + return f"{self.__class__.__name__}({self.lock_file!r})" + + @property + def lock_file(self) -> str: + """The path of the file lock.""" + return self._lock_file + + +class SoftFileLockLifetimeWarning(DeprecationWarning): + """The configured soft-lock lifetime permits overlapping live holders after expiry.""" + + +class LeaseSettingsMismatch(ValueError): # ruff:ignore[error-suffix-on-exception-name] # public exception name; renaming breaks the API + """A lease contender disagrees with the published claim about how long the lease lasts.""" + + +class SoftFileLockProtocolError(OSError): + """Raised when strict soft-lock state cannot be interpreted without risking overlap.""" + + def __init__(self, lock_file: str, claim_name: str | None, reason: str) -> None: + self._lock_file = lock_file + self._claim_name = claim_name + self._reason = reason + super().__init__(self.__str__()) + + def __reduce__( + self, + ) -> tuple[type[SoftFileLockProtocolError], tuple[str, str | None, str]]: # pragma: needs hard-link + return self.__class__, (self._lock_file, self._claim_name, self._reason) + + def __str__(self) -> str: + location = self._lock_file if self._claim_name is None else f"{self._lock_file}: claim {self._claim_name!r}" + return f"Invalid strict soft-lock state at {location}: {self._reason}" + + @property + def lock_file(self) -> str: # pragma: needs hard-link + """The requested lock path.""" + return self._lock_file + + @property + def claim_name(self) -> str | None: # pragma: needs hard-link + """The claim that caused the error, if scanning identified one.""" + return self._claim_name + + @property + def reason(self) -> str: # pragma: needs hard-link + """The protocol validation failure.""" + return self._reason + + +__all__ = [ + "LeaseSettingsMismatch", + "SoftFileLockLifetimeWarning", + "SoftFileLockProtocolError", + "Timeout", +] diff --git a/venv/lib/python3.12/site-packages/filelock/_identity.py b/venv/lib/python3.12/site-packages/filelock/_identity.py new file mode 100644 index 0000000000000000000000000000000000000000..fe1b03d425a7f1f6d1af736a96a6a493082a4d49 --- /dev/null +++ b/venv/lib/python3.12/site-packages/filelock/_identity.py @@ -0,0 +1,177 @@ +from __future__ import annotations + +import os +import socket +import sys +from errno import EPERM, ESRCH +from pathlib import Path +from typing import Final + + +def host_name() -> str: + """The hostname recorded alongside an owner, so a marker written on another machine is never probed here.""" + return socket.gethostname() + + +def owner_is_stale(pid: int, hostname: str, start_token: int | None) -> bool: + """ + Whether the recorded owner is provably gone, so reclaiming its marker cannot detach a live holder. + + Fail closed: return ``True`` only when this process can prove the exact recorded owner is dead. A marker from + another host cannot be probed; a live PID whose start token still matches, or whose token cannot be read, is the + holder or is indistinguishable from it; a live PID whose start token differs is a recycled PID, so the process that + wrote the marker is gone. PostgreSQL, Qt ``QLockFile`` and Mercurial all break a stale lock only on proof of death + and treat an unreadable or foreign owner as still holding. + """ + if hostname != host_name(): + return False + if not process_alive(pid): + return True + if start_token is None: + return False + current = process_start_token(pid) + return current is not None and current != start_token + + +if sys.platform == "win32": # pragma: win32 cover + import ctypes + from ctypes import wintypes + + _KERNEL32: Final[ctypes.WinDLL] = ctypes.WinDLL("kernel32", use_last_error=True) + _KERNEL32.CloseHandle.argtypes = [wintypes.HANDLE] + _KERNEL32.CloseHandle.restype = wintypes.BOOL + _KERNEL32.OpenProcess.argtypes = [wintypes.DWORD, wintypes.BOOL, wintypes.DWORD] + _KERNEL32.OpenProcess.restype = wintypes.HANDLE + _KERNEL32.GetProcessTimes.argtypes = [ + wintypes.HANDLE, + ctypes.POINTER(wintypes.FILETIME), + ctypes.POINTER(wintypes.FILETIME), + ctypes.POINTER(wintypes.FILETIME), + ctypes.POINTER(wintypes.FILETIME), + ] + _KERNEL32.GetProcessTimes.restype = wintypes.BOOL + + _WIN_SYNCHRONIZE: Final[int] = 0x100000 + _WIN_PROCESS_QUERY_LIMITED_INFORMATION: Final[int] = 0x1000 + _WIN_ERROR_INVALID_PARAMETER: Final[int] = 87 + _WIN_INHERIT_HANDLE: Final[bool] = False + + def process_alive(pid: int) -> bool: + """Whether a process with this PID exists, treating an access denial as proof it does.""" + handle = _KERNEL32.OpenProcess(_WIN_SYNCHRONIZE, _WIN_INHERIT_HANDLE, pid) + if handle: + _KERNEL32.CloseHandle(handle) + return True + return ctypes.get_last_error() != _WIN_ERROR_INVALID_PARAMETER + + def process_start_token(pid: int) -> int | None: + """The process creation FILETIME as a 100ns tick count, or ``None`` when it cannot be read.""" + handle = _KERNEL32.OpenProcess(_WIN_PROCESS_QUERY_LIMITED_INFORMATION, _WIN_INHERIT_HANDLE, pid) + if not handle: + return None + creation, exit_time, kernel_time, user_time = (wintypes.FILETIME() for _ in range(4)) + try: + if not _KERNEL32.GetProcessTimes( + handle, + ctypes.byref(creation), + ctypes.byref(exit_time), + ctypes.byref(kernel_time), + ctypes.byref(user_time), + ): + return None # pragma: no cover # win32 GetProcessTimes failure path; not reproducible on a live handle + finally: + _KERNEL32.CloseHandle(handle) + return (creation.dwHighDateTime << 32) | creation.dwLowDateTime + +else: # pragma: win32 no cover + + def process_alive(pid: int) -> bool: + """Whether a process with this PID exists, treating an access denial (``EPERM``) as proof it does.""" + try: + os.kill(pid, 0) + except OSError as error: + if error.errno == ESRCH: + return False + if error.errno == EPERM: + return True + raise + return True + + if sys.platform in {"linux", "android"}: # pragma: linux cover + # Termux/Android reports sys.platform == "android" but runs the Linux kernel, so /proc//stat and the boot + # id are the same reliable start-time source; treat it exactly like Linux rather than the tokenless fallback. + # comm (field 2) is wrapped in parentheses and may itself contain spaces or a ')', so the fixed fields start + # after the final ')'. starttime is field 22 overall, the twentieth of those trailing fields (index 19). + _STARTTIME_INDEX: Final[int] = 19 + + def _read_boot_id() -> int: + # starttime is measured in clock ticks since boot, so on its own it repeats across a reboot. Folding the + # boot id into the high bits makes the Linux token reboot-safe like the absolute clocks macOS and Windows + # expose, while staying a single integer so a 3.29 reader still parses the third marker line. 0 when the + # kernel does not expose a boot id degrades to bare starttime, which stays safe (a reboot collision fails + # closed rather than reclaiming a live marker). + try: + boot_id = Path("/proc/sys/kernel/random/boot_id").read_text(encoding="ascii") + return int(boot_id.strip().replace("-", ""), 16) + except (OSError, ValueError): # pragma: no cover # the kernel always exposes boot_id as a UUID on Linux + return 0 + + _BOOT_ID: Final[int] = _read_boot_id() + + def process_start_token(pid: int) -> int | None: + """The ``/proc//stat`` ``starttime`` folded with the boot id, or ``None`` when the process is gone.""" + try: + data = Path(f"/proc/{pid}/stat").read_bytes() + except OSError: + return None + # psutil identifies a process by the same (pid, starttime) pair; the boot id extends that across reboots. + fields = data[data.rfind(b")") + 1 :].split() + if len(fields) <= _STARTTIME_INDEX: # pragma: no cover # a truncated /proc read, never seen in practice + return None + try: + starttime = int(fields[_STARTTIME_INDEX]) + except ValueError: # pragma: no cover # /proc always renders starttime as an integer + return None + return (_BOOT_ID << 64) | starttime + + elif sys.platform == "darwin": # pragma: darwin cover + import ctypes + import struct + + _LIBC: Final[ctypes.CDLL] = ctypes.CDLL(None, use_errno=True) + _CTL_KERN: Final[int] = 1 + _KERN_PROC: Final[int] = 14 + _KERN_PROC_PID: Final[int] = 1 + # kinfo_proc opens with kp_proc.p_starttime (a struct timeval) at offset 0: int64 seconds, int32 microseconds. + # The offset is fixed by the struct chain kinfo_proc -> extern_proc -> p_un, so a read at 0 is not a guess. + _TIMEVAL_AT_ZERO: Final[str] = " int | None: + """The process start time in microseconds from ``sysctl(KERN_PROC_PID)``, or ``None`` when it is gone.""" + mib = (ctypes.c_int * 4)(_CTL_KERN, _KERN_PROC, _KERN_PROC_PID, pid) + length = ctypes.c_size_t(0) + # The size probe reports the kinfo_proc size for any PID, so the read below, not the probe, tells a live + # process from a gone one: a gone PID leaves the fetch a zero-length success, so re-check the length after. + if _LIBC.sysctl(mib, 4, None, ctypes.byref(length), None, 0) != 0: + return None + buffer = (ctypes.c_char * length.value)() + if _LIBC.sysctl(mib, 4, buffer, ctypes.byref(length), None, 0) != 0 or length.value < _TIMEVAL_SIZE: + return None + seconds, microseconds = struct.unpack_from(_TIMEVAL_AT_ZERO, buffer.raw, 0) + return seconds * 1_000_000 + microseconds + + else: # pragma: no cover # a POSIX platform without a proven start-time source falls back to fail-closed liveness + + def process_start_token(pid: int) -> int | None: + """No proven start-time source, so the owner carries no token and liveness rests on the PID alone.""" + del pid + return None + + +__all__ = [ + "host_name", + "owner_is_stale", + "process_alive", + "process_start_token", +]