Skip to content

Commit

Permalink
test splitting and joining iname works
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikcfd authored and inducer committed Jul 23, 2022
1 parent b03e67f commit 4598673
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/test_loopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3283,6 +3283,23 @@ def test_vec_inames_can_reenter(ctx_factory):
np.testing.assert_allclose(out.get(), 6*np.ones(4))


def test_split_and_join_inames(ctx_factory):
# See https://github.com/inducer/loopy/issues/652
ctx = ctx_factory()

tunit = lp.make_kernel(
"{[i]: 0<=i<16}",
"""
y[i] = i
""")
ref_tunit = tunit

tunit = lp.split_iname(tunit, "i", 4)
tunit = lp.join_inames(tunit, ["i_inner", "i_outer"])

lp.auto_test_vs_ref(ref_tunit, ctx, tunit)


if __name__ == "__main__":
if len(sys.argv) > 1:
exec(sys.argv[1])
Expand Down

0 comments on commit 4598673

Please sign in to comment.