Skip to content

Commit 7d0c686

Browse files
inducerCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent cf59861 commit 7d0c686

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test/test_codegen.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,12 +622,17 @@ def test_reduction_bound_temps_are_private():
622622
result = csr @ x
623623
knl = pt.generate_loopy(result).kernel
624624

625+
found_bound_temp = False
625626
for name, tv in knl.temporary_variables.items():
626627
if name.endswith(("_lbound", "_ubound")):
628+
found_bound_temp = True
627629
assert tv.address_space == lp.AddressSpace.PRIVATE, (
628630
f"Reduction bound temporary '{name}' should be PRIVATE, "
629631
f"got {tv.address_space}")
630632

633+
assert found_bound_temp, (
634+
"Expected at least one reduction bound temporary whose name ends in "
635+
"'_lbound' or '_ubound', but none were found.")
631636

632637
@pytest.mark.parametrize("dtype", (np.float32, np.float64, np.complex128))
633638
@pytest.mark.parametrize("function_name", ("abs", "sin", "cos", "tan", "arcsin",

0 commit comments

Comments
 (0)