Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ __pycache__/
cache_driver
cache_runtime
cache_nvrtc
cuda_bindings/cuda/bindings/_lib/utils.pxi

# CUDA Python specific (auto-generated)
cuda_bindings/cuda/bindings/_bindings/cydriver.pxd
Expand Down
17 changes: 8 additions & 9 deletions cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ cimport cuda.bindings._lib.dlfcn as dlfcn
from libc.stdint cimport intptr_t
import os
import sys
import threading
cimport cuda.bindings._bindings.loader as loader
cdef object __symbol_lock = threading.RLock()
import threading

cdef object __symbol_lock = threading.Lock()
cdef bint __cuPythonInit = False
{{if 'cuGetErrorString' in found_functions}}cdef void *__cuGetErrorString = NULL{{endif}}
{{if 'cuGetErrorName' in found_functions}}cdef void *__cuGetErrorName = NULL{{endif}}
Expand Down Expand Up @@ -504,7 +505,7 @@ cdef int cuPythonInit() except -1 nogil:

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

# Load library
libPath[0] = 0
status = loader.getCUDALibraryPath(libPath, sys.maxsize > 2**32)
Expand All @@ -516,7 +517,7 @@ cdef int cuPythonInit() except -1 nogil:
{{else}}
path = 'libcuda.so.1'
{{endif}}

{{if 'Windows' == platform.system()}}
LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800
try:
Expand All @@ -528,7 +529,7 @@ cdef int cuPythonInit() except -1 nogil:
if (handle == NULL):
raise RuntimeError('Failed to dlopen ' + path)
{{endif}}

# Get latest __cuGetProcAddress_v2
global __cuGetProcAddress_v2
{{if 'Windows' == platform.system()}}
Expand All @@ -539,7 +540,7 @@ cdef int cuPythonInit() except -1 nogil:
{{else}}
__cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2')
{{endif}}

# Load using cuGetProcAddress if available
if __cuGetProcAddress_v2 != NULL:
_F_cuGetProcAddress_v2 = <__cuGetProcAddress_v2_T>__cuGetProcAddress_v2
Expand Down Expand Up @@ -2782,10 +2783,9 @@ cdef int cuPythonInit() except -1 nogil:
global __cuGraphicsVDPAURegisterOutputSurface
_F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterOutputSurface', &__cuGraphicsVDPAURegisterOutputSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
{{endif}}

__cuPythonInit = True
return 0

{{if 'Windows' == platform.system()}}
# Load using win32GetAddr
if usePTDS:
Expand Down Expand Up @@ -8943,7 +8943,6 @@ cdef int cuPythonInit() except -1 nogil:
__cuGraphicsVDPAURegisterOutputSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterOutputSurface')
{{endif}}
{{endif}}

__cuPythonInit = True
return 0

Expand Down
3 changes: 2 additions & 1 deletion cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ from libc.stdint cimport uintptr_t
from cuda.pathfinder import load_nvidia_dynamic_lib
from libc.stdint cimport intptr_t
import threading

cdef object __symbol_lock = threading.Lock()
cdef bint __cuPythonInit = False
{{if 'nvrtcGetErrorString' in found_functions}}cdef void *__nvrtcGetErrorString = NULL{{endif}}
Expand Down Expand Up @@ -343,8 +344,8 @@ cdef int cuPythonInit() except -1 nogil:
global __nvrtcSetFlowCallback
__nvrtcSetFlowCallback = dlfcn.dlsym(handle, 'nvrtcSetFlowCallback')
{{endif}}
{{endif}}

{{endif}}
__cuPythonInit = True
return 0

Expand Down
159 changes: 0 additions & 159 deletions cuda_bindings/cuda/bindings/_lib/param_packer.cpp

This file was deleted.

Loading
Loading