Skip to content

Commit 806ee27

Browse files
committed
Follow symbolic link when returning path to library to reduce likelihood of context creation when determining CUBLAS version (#302).
1 parent 7bb6470 commit 806ee27

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

skcuda/cublas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ def _get_cublas_version():
264264
Results
265265
-------
266266
version : str
267-
Zeros are appended to match format of version returned
267+
Zeros are appended to match format of version returned
268268
by cublasGetVersion() (e.g., '6050' corresponds to version 6.5).
269269
270270
Notes
271271
-----
272-
Since the version number does not appear to be obtainable from the
272+
Since the version number does not appear to be obtainable from the
273273
MacOSX CUBLAS library, this function must call cublasGetVersion() on
274274
MacOSX (but raises a warning to let the user know).
275275
"""

skcuda/utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ def find_lib_path(name):
128128
"""
129129
Find full path of a shared library.
130130
131-
Searches for the full path of a shared library. On Posix operating systems
132-
other than MacOS, this function checks the directories listed in
133-
LD_LIBRARY_PATH (if any) and in the ld.so cache.
131+
Searches for the full path of a shared library. On Posix operating systems
132+
other than MacOS, this function checks the directories listed in
133+
LD_LIBRARY_PATH (if any) and in the ld.so cache.
134134
135135
Parameter
136136
---------
@@ -204,4 +204,6 @@ def find_lib_path(name):
204204
res = re.search(expr, data)
205205
if not res:
206206
return None
207-
return res.group(1)
207+
208+
# Follow symbolic links to the actual file:
209+
return os.path.realpath(res.group(1))

0 commit comments

Comments
 (0)