Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cuda_bindings/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ test = [
"numpy>=1.21.1",
"pytest>=6.2.4",
"pytest-benchmark>=3.4.1",
"llvmlite",
]

[project.urls]
Expand Down
13 changes: 11 additions & 2 deletions cuda_bindings/tests/test_nvvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@
"6e673e0000000000",
}

# CUDA 13 introduced two NVVM IR dialects:
# * Legacy (LLVM 7.0.1) — used for all pre-Blackwell architectures.
# * Modern (LLVM 20.1.x) — only supported for Blackwell (compute_100+) and newer.
# With "-arch=compute_100" we're picking the Modern path, because it works with
# newer versions of llvmlite. We only want to exercise the Python bindings
# here, not libnvvm internals, therefore we don't need to exercise other
# architectures.
COMPILE_PROGRAM_OPTIONS = [["-arch=compute_100"] + opts for opts in [[], ["-opt=0"], ["-opt=3", "-g"]]]

MINIMAL_NVVMIR_CACHE = {}


Expand Down Expand Up @@ -274,7 +283,7 @@ def test_get_buffer_empty(get_size, get_buffer):
assert buffer == b"\x00"


@pytest.mark.parametrize("options", [[], ["-opt=0"], ["-opt=3", "-g"]])
@pytest.mark.parametrize("options", COMPILE_PROGRAM_OPTIONS)
def test_compile_program_with_minimal_nvvm_ir(minimal_nvvmir, options):
with nvvm_program() as prog:
nvvm.add_module_to_program(prog, minimal_nvvmir, len(minimal_nvvmir), "FileNameHere.ll")
Expand All @@ -294,7 +303,7 @@ def test_compile_program_with_minimal_nvvm_ir(minimal_nvvmir, options):
assert ".visible .entry kernel()" in buffer.decode()


@pytest.mark.parametrize("options", [[], ["-opt=0"], ["-opt=3", "-g"]])
@pytest.mark.parametrize("options", COMPILE_PROGRAM_OPTIONS)
def test_verify_program_with_minimal_nvvm_ir(minimal_nvvmir, options):
with nvvm_program() as prog:
nvvm.add_module_to_program(prog, minimal_nvvmir, len(minimal_nvvmir), "FileNameHere.ll")
Expand Down