Skip to content
Merged
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
51 changes: 30 additions & 21 deletions cuda_core/tests/test_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,6 @@ def ptx_code_object():
# TODO: Add test for pre_include once we have a suitable header in the test environment
# ProgramOptions(pre_include="cuda_runtime.h"),
ProgramOptions(no_cache=True),
pytest.param(
ProgramOptions(fdevice_time_trace="trace.json"),
marks=pytest.mark.skipif(
(_get_nvrtc_version_for_tests() or 0) < 13000,
reason="buggy with NVRTC < 13.0 (File 'trace.json.json' could not be opened)",
),
),
pytest.param(
ProgramOptions(arch="sm_100", device_float128=True),
marks=pytest.mark.skipif(
Expand All @@ -254,20 +247,6 @@ def ptx_code_object():
reason="PCH requires NVRTC >= 12.8",
),
),
pytest.param(
ProgramOptions(create_pch="test.pch"),
marks=pytest.mark.skipif(
(_get_nvrtc_version_for_tests() or 0) < 12800,
reason="PCH requires NVRTC >= 12.8",
),
),
pytest.param(
ProgramOptions(use_pch="test.pch"),
marks=pytest.mark.skipif(
(_get_nvrtc_version_for_tests() or 0) < 12800,
reason="PCH requires NVRTC >= 12.8",
),
),
# TODO: pch_dir requires actual PCH directory to exist - needs integration test
# pytest.param(
# ProgramOptions(pch_dir="/tmp/pch"),
Expand Down Expand Up @@ -308,6 +287,36 @@ def test_cpp_program_with_various_options(init_cuda, options):
assert program.handle is None


@pytest.mark.skipif(
(_get_nvrtc_version_for_tests() or 0) < 13000,
reason="buggy with NVRTC < 13.0 (File 'trace.json.json' could not be opened)",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick but can we make this trace.json instead of trace.json.json? 😆

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the bug that led to this skip condition. We set the filename to trace.json but NVRTC 12.9 insisted to look for trace.json.json.

)
def test_cpp_program_with_trace_option(init_cuda, tmp_path):
code = 'extern "C" __global__ void my_kernel() {}'
path = tmp_path / "trace"
options = ProgramOptions(fdevice_time_trace=path)
program = Program(code, "c++", options)
assert program.backend == "NVRTC"
program.compile("ptx")
program.close()
assert program.handle is None


@pytest.mark.skipif((_get_nvrtc_version_for_tests() or 0) < 12800, reason="PCH requires NVRTC >= 12.8")
def test_cpp_program_with_pch_options(init_cuda, tmp_path):
code = 'extern "C" __global__ void my_kernel() {}'

path = str(tmp_path / "test.pch")

for opts in (dict(create_pch=path), dict(use_pch=path)):
options = ProgramOptions(**opts)
program = Program(code, "c++", options)
assert program.backend == "NVRTC"
program.compile("ptx")
program.close()
assert program.handle is None


options = [
ProgramOptions(max_register_count=32),
ProgramOptions(debug=True),
Expand Down
Loading