File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
cuda_bindings/cuda/bindings/_bindings Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -47,18 +47,24 @@ cdef bint __cuPythonInit = False
47
47
{{if 'nvrtcSetFlowCallback' in found_functions}}cdef void *__nvrtcSetFlowCallback = NULL{{endif}}
48
48
49
49
cdef int cuPythonInit() except -1 nogil:
50
- {{if 'Windows' != platform.system()}}
51
- cdef void* handle = NULL
52
- {{endif}}
53
-
54
50
global __cuPythonInit
55
51
if __cuPythonInit:
56
52
return 0
57
53
__cuPythonInit = True
58
54
55
+ # Load library
59
56
{{if 'Windows' == platform.system()}}
60
57
with gil:
61
58
handle = path_finder._load_nvidia_dynamic_library("nvrtc").handle
59
+ {{else}}
60
+ with gil:
61
+ handle = <void*><uintptr_t>path_finder._load_nvidia_dynamic_library("nvrtc").handle
62
+ {{endif}}
63
+
64
+
65
+ # Load function
66
+ {{if 'Windows' == platform.system()}}
67
+ with gil:
62
68
{{if 'nvrtcGetErrorString' in found_functions}}
63
69
try:
64
70
global __nvrtcGetErrorString
@@ -243,8 +249,6 @@ cdef int cuPythonInit() except -1 nogil:
243
249
{{endif}}
244
250
245
251
{{else}}
246
- with gil:
247
- handle = <void*><uintptr_t>path_finder._load_nvidia_dynamic_library("nvrtc").handle
248
252
{{if 'nvrtcGetErrorString' in found_functions}}
249
253
global __nvrtcGetErrorString
250
254
__nvrtcGetErrorString = dlfcn.dlsym(handle, 'nvrtcGetErrorString')
You can’t perform that action at this time.
0 commit comments