Skip to content

Commit 870f2e9

Browse files
committed
Resolve another cython error: void* handle vs intptr_t handle
``` Error compiling Cython file: ------------------------------------------------------------ ... handle = load_library(driver_ver) # Load function global __nvJitLinkCreate try: __nvJitLinkCreate = <void*><intptr_t>win32api.GetProcAddress(handle, 'nvJitLinkCreate') ^ ------------------------------------------------------------ cuda\bindings\_internal\nvjitlink.pyx:78:73: Cannot convert 'void *' to Python object ```
1 parent feed101 commit 870f2e9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ cdef int _check_or_init_nvjitlink() except -1 nogil:
5353
return 0
5454

5555
cdef int err, driver_ver
56-
cdef void* handle
56+
cdef intptr_t handle
5757
with gil:
5858
# Load driver to check version
5959
try:
@@ -70,7 +70,7 @@ cdef int _check_or_init_nvjitlink() except -1 nogil:
7070
raise RuntimeError('something went wrong')
7171

7272
# Load library
73-
handle = load_library(driver_ver)
73+
handle = <intptr_t>load_library(driver_ver)
7474

7575
# Load function
7676
global __nvJitLinkCreate

cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ cdef int _check_or_init_nvvm() except -1 nogil:
5151
return 0
5252

5353
cdef int err, driver_ver
54-
cdef void* handle
54+
cdef intptr_t handle
5555
with gil:
5656
# Load driver to check version
5757
try:
@@ -68,7 +68,7 @@ cdef int _check_or_init_nvvm() except -1 nogil:
6868
raise RuntimeError('something went wrong')
6969

7070
# Load library
71-
handle = load_library(driver_ver)
71+
handle = <intptr_t>load_library(driver_ver)
7272

7373
# Load function
7474
global __nvvmVersion

0 commit comments

Comments
 (0)