Skip to content

Commit be34ebe

Browse files
committed
Fix Windows
1 parent bebad2c commit be34ebe

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

cuda_bindings/cuda/bindings/cyruntime.pyx.in

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,10 +1901,11 @@ cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCa
19011901
handle = <void *><uintptr_t>lib._handle_uint
19021902

19031903
{{if 'Windows' == platform.system()}}
1904-
try:
1905-
__cudaRuntimeGetVersion = <void*><unsigned long long>win32api.GetProcAddress(<uintptr_t>handle, 'cudaRuntimeGetVersion')
1906-
except:
1907-
pass
1904+
with gil:
1905+
try:
1906+
__cudaRuntimeGetVersion = <void*><unsigned long long>win32api.GetProcAddress(<uintptr_t>handle, 'cudaRuntimeGetVersion')
1907+
except:
1908+
pass
19081909
{{else}}
19091910
__cudaRuntimeGetVersion = dlfcn.dlsym(handle, 'cudaRuntimeGetVersion')
19101911
{{endif}}

0 commit comments

Comments
 (0)