Skip to content

Commit

Permalink
test the type inference kernel with self deps
Browse files Browse the repository at this point in the history
Co-authored-by: Xiaoyu Wei <[email protected]>
  • Loading branch information
kaushikcfd and Xiaoyu Wei committed Aug 14, 2021
1 parent a553905 commit 81fc416
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/test_loopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3216,6 +3216,20 @@ def test_get_return_from_kernel_mapping():
assert ret_from_knl_idx[9] == 10


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

prog = lp.make_kernel(
"{[i]: 0<=i<3}",
"""
<> x[i] = if(i==0, 1, if(i==1, 1.1, if(i==2, 1.11, -1))) {id=insn1}
x[i] = if(x[i]>1.1, 2, x[i]) {id=insn2,dep=insn1,dup=i}
out[i] = x[i] {dep=insn2,dup=i}
""")
lp.auto_test_vs_ref(prog, ctx, prog)


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

0 comments on commit 81fc416

Please sign in to comment.