Skip to content

Commit 15e99e9

Browse files
authored
Fix pathfinder imports and handle access (#814)
* Remove pathfinder redirect, update usage * fix handle attribute
1 parent fec95b8 commit 15e99e9

File tree

9 files changed

+13
-72
lines changed

9 files changed

+13
-72
lines changed

cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import win32api
99
cimport cuda.bindings._lib.dlfcn as dlfcn
1010
from libc.stdint cimport uintptr_t
1111
{{endif}}
12-
from cuda.bindings import path_finder
12+
from cuda.pathfinder import load_nvidia_dynamic_lib
1313
from libc.stdint cimport intptr_t
1414

1515
cdef bint __cuPythonInit = False
@@ -47,10 +47,10 @@ cdef int cuPythonInit() except -1 nogil:
4747
# Load library
4848
{{if 'Windows' == platform.system()}}
4949
with gil:
50-
handle = path_finder._load_nvidia_dynamic_library("nvrtc").handle
50+
handle = load_nvidia_dynamic_lib("nvrtc")._handle_uint
5151
{{else}}
5252
with gil:
53-
handle = <void*><uintptr_t>path_finder._load_nvidia_dynamic_library("nvrtc").handle
53+
handle = <void*><uintptr_t>load_nvidia_dynamic_lib("nvrtc")._handle_uint
5454
{{endif}}
5555

5656

cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from libc.stdint cimport intptr_t, uintptr_t
88

99
from .utils import FunctionNotFoundError, NotSupportedError
1010

11-
from cuda.bindings import path_finder
11+
from cuda.pathfinder import load_nvidia_dynamic_lib
1212

1313
import cython
1414

@@ -71,7 +71,7 @@ cdef void* __cuFileSetParameterString = NULL
7171

7272

7373
cdef void* load_library(const int driver_ver) except* with gil:
74-
cdef uintptr_t handle = path_finder._load_nvidia_dynamic_library("cufile").handle
74+
cdef uintptr_t handle = load_nvidia_dynamic_lib("cufile")._handle_uint
7575
return <void*>handle
7676

7777

cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from libc.stdint cimport intptr_t, uintptr_t
88

99
from .utils import FunctionNotFoundError, NotSupportedError
1010

11-
from cuda.bindings import path_finder
11+
from cuda.pathfinder import load_nvidia_dynamic_lib
1212

1313
###############################################################################
1414
# Extern
@@ -53,7 +53,7 @@ cdef void* __nvJitLinkVersion = NULL
5353

5454

5555
cdef void* load_library(int driver_ver) except* with gil:
56-
cdef uintptr_t handle = path_finder._load_nvidia_dynamic_library("nvJitLink").handle
56+
cdef uintptr_t handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint
5757
return <void*>handle
5858

5959

cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from libc.stdint cimport intptr_t
88

99
from .utils import FunctionNotFoundError, NotSupportedError
1010

11-
from cuda.bindings import path_finder
11+
from cuda.pathfinder import load_nvidia_dynamic_lib
1212

1313
import win32api
1414

@@ -61,7 +61,7 @@ cdef int _check_or_init_nvjitlink() except -1 nogil:
6161
raise RuntimeError('something went wrong')
6262

6363
# Load library
64-
handle = path_finder._load_nvidia_dynamic_library("nvJitLink").handle
64+
handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint
6565

6666
# Load function
6767
global __nvJitLinkCreate

cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from libc.stdint cimport intptr_t, uintptr_t
88

99
from .utils import FunctionNotFoundError, NotSupportedError
1010

11-
from cuda.bindings import path_finder
11+
from cuda.pathfinder import load_nvidia_dynamic_lib
1212

1313
###############################################################################
1414
# Extern
@@ -52,7 +52,7 @@ cdef void* __nvvmGetProgramLog = NULL
5252

5353

5454
cdef void* load_library(const int driver_ver) except* with gil:
55-
cdef uintptr_t handle = path_finder._load_nvidia_dynamic_library("nvvm").handle
55+
cdef uintptr_t handle = load_nvidia_dynamic_lib("nvvm")._handle_uint
5656
return <void*>handle
5757

5858

cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from libc.stdint cimport intptr_t
88

99
from .utils import FunctionNotFoundError, NotSupportedError
1010

11-
from cuda.bindings import path_finder
11+
from cuda.pathfinder import load_nvidia_dynamic_lib
1212

1313
import win32api
1414

@@ -60,7 +60,7 @@ cdef int _check_or_init_nvvm() except -1 nogil:
6060
raise RuntimeError('something went wrong')
6161

6262
# Load library
63-
handle = path_finder._load_nvidia_dynamic_library("nvvm").handle
63+
handle = load_nvidia_dynamic_lib("nvvm")._handle_uint
6464

6565
# Load function
6666
global __nvvmGetErrorString

cuda_bindings/cuda/bindings/_path_finder/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

cuda_bindings/cuda/bindings/_path_finder/temporary_backward_compatibility.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

cuda_bindings/cuda/bindings/path_finder.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)