Skip to content

Commit 916734f

Browse files
committed
Add test for nvvm LLVM version query.
Guard with FunctionNotFoundError because nvvmLLVMVersion is absent on pre-13.1.1 NVVM builds and the loader raises when the symbol is missing. Made-with: Cursor
1 parent 26b0e79 commit 916734f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cuda_bindings/tests/test_nvvm.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import pytest
99

1010
from cuda.bindings import nvvm
11+
from cuda.bindings._internal.utils import FunctionNotFoundError
1112

1213
pytest_plugins = ("cuda_python_test_helpers.nvvm_bitcode",)
1314

@@ -62,6 +63,15 @@ def test_nvvm_ir_version():
6263
assert ver >= (1, 0, 0, 0)
6364

6465

66+
def test_nvvm_llvm_version():
67+
try:
68+
ver = nvvm.llvm_version("compute_75")
69+
except FunctionNotFoundError:
70+
pytest.skip("nvvmLLVMVersion not available in this NVVM version")
71+
assert isinstance(ver, int)
72+
assert ver >= 0
73+
74+
6575
def test_create_and_destroy():
6676
with nvvm_program() as prog:
6777
assert isinstance(prog, int)

0 commit comments

Comments
 (0)