File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def check_nvvm_compiler_options(options: Sequence[str]) -> bool:
3636
3737 Parameters
3838 ----------
39- options : Sequence[bytes ]
39+ options : Sequence[str ]
4040 List of compiler options as strings (e.g., ["-arch=compute_90", "-g"]).
4141
4242 Returns
@@ -46,7 +46,7 @@ def check_nvvm_compiler_options(options: Sequence[str]) -> bool:
4646
4747 Examples
4848 --------
49- >>> from cuda.bindings.utils import check_nvvm_options
49+ >>> from cuda.bindings.utils import check_nvvm_compiler_options
5050 >>> check_nvvm_options(["-arch=compute_90", "-g"])
5151 True
5252 """
Original file line number Diff line number Diff line change 2222
2323
2424def _is_libnvvm_available () -> bool :
25+ from cuda .bindings ._internal .nvvm import _inspect_function_pointer
26+ from cuda .pathfinder import DynamicLibNotFoundError
2527 try :
26- from cuda .bindings ._internal .nvvm import _inspect_function_pointer
27-
2828 return _inspect_function_pointer ("__nvvmCreateProgram" ) != 0
29- except Exception :
29+ except DynamicLibNotFoundError :
3030 return False
3131
3232
Original file line number Diff line number Diff line change @@ -72,11 +72,10 @@ def _has_nvrtc_pch_apis_for_tests():
7272
7373def _has_check_nvvm_compiler_options ():
7474 try :
75- from cuda .bindings .utils import check_nvvm_compiler_options # noqa: F401
76-
77- return True
78- except ImportError :
75+ import cuda .bindings .utils as utils
76+ except ModuleNotFoundError :
7977 return False
78+ return hasattr (utils , "check_nvvm_compiler_options" )
8079
8180
8281has_nvvm_option_checker = pytest .mark .skipif (
You can’t perform that action at this time.
0 commit comments