Skip to content

Commit 93db730

Browse files
committed
_check_nvjitlink_usable() in test_path_finder.py
1 parent cb3ca5a commit 93db730

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎cuda_bindings/tests/test_path_finder.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,21 @@ def _build_subprocess_failed_for_libname_message(libname, result):
3838
)
3939

4040

41+
def _check_nvjitlink_usable():
42+
from cuda.bindings._internal import nvjitlink as inner_nvjitlink
43+
44+
return inner_nvjitlink._inspect_function_pointer("__nvJitLinkVersion") != 0
45+
46+
4147
@pytest.mark.parametrize("api", ("find", "load"))
4248
@pytest.mark.parametrize("libname", TEST_LIBNAMES)
4349
def test_find_or_load_nvidia_dynamic_library(api, libname):
4450
if sys.platform == "win32" and not supported_libs.SUPPORTED_WINDOWS_DLLS[libname]:
4551
pytest.skip(f"{libname=!r} not supported on {sys.platform=}")
4652

53+
if libname == "nvJitLink" and not _check_nvjitlink_usable():
54+
pytest.skip(f"{libname=!r} not usable")
55+
4756
if api == "find":
4857
code = f"""\
4958
from cuda.bindings._path_finder.find_nvidia_dynamic_library import find_nvidia_dynamic_library

0 commit comments

Comments
 (0)