Skip to content

Commit 4e238c4

Browse files
committed
test: avoid PCH diagnostic text checks
Signed-off-by: Rui Luo <ruluo@nvidia.com>
1 parent 216430a commit 4e238c4

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

‎cuda_core/tests/test_program.py‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,10 +1532,10 @@ def test_nvrtc_debug_close_tolerates_removed_source(init_cuda):
15321532

15331533
@nvrtc_pch_available
15341534
@pytest.mark.skipif("NVRTC_DISABLE_PCH" in os.environ, reason="PCH is disabled by NVRTC_DISABLE_PCH")
1535-
@pytest.mark.thread_unsafe(reason="creates and reuses PCH files in the shared pytest tmp_path")
1535+
@pytest.mark.thread_unsafe(reason="creates PCH files in the shared pytest tmp_path")
15361536
@pytest.mark.agent_authored(model="gpt-6-sol")
1537-
def test_nvrtc_automatic_pch_reuse_preserves_compiled_kernel(init_cuda, tmp_path):
1538-
"""Automatic PCH reuse reports no new creation and preserves kernel output."""
1537+
def test_nvrtc_automatic_pch_preserves_compiled_kernel(init_cuda, tmp_path):
1538+
"""Automatic PCH compilation preserves kernel output and reports creation status."""
15391539
from io import StringIO
15401540

15411541
import numpy as np
@@ -1556,10 +1556,7 @@ def test_nvrtc_automatic_pch_reuse_preserves_compiled_kernel(init_cuda, tmp_path
15561556
actual = np.empty(1, dtype=np.int32)
15571557
try:
15581558
buffer = init_cuda.allocate(4, stream=stream)
1559-
for expected_status, expected_message in (
1560-
(PCHStatusType.CREATED, "creating precompiled header file"),
1561-
(PCHStatusType.NOT_ATTEMPTED, "using precompiled header file"),
1562-
):
1559+
for expected_status in (PCHStatusType.CREATED, PCHStatusType.NOT_ATTEMPTED):
15631560
program = Program(
15641561
code,
15651562
"c++",
@@ -1576,9 +1573,8 @@ def test_nvrtc_automatic_pch_reuse_preserves_compiled_kernel(init_cuda, tmp_path
15761573
assert actual[0] == 37
15771574
if expected_status == PCHStatusType.CREATED and program.pch_status == PCHStatusType.NOT_ATTEMPTED:
15781575
pytest.skip("NVRTC did not create an automatic PCH; kernel output was verified")
1579-
assert program.pch_status == expected_status
1580-
assert expected_message in logs.getvalue()
1581-
assert list(tmp_path.glob("*.pch"))
1576+
assert program.pch_status == expected_status, logs.getvalue()
1577+
assert list(tmp_path.glob("*.pch")), logs.getvalue()
15821578
finally:
15831579
program.close()
15841580
finally:

0 commit comments

Comments
 (0)