Skip to content

Commit 1c89a52

Browse files
kaushikcfdXiayou Wei
and
Xiayou Wei
committed
test the type inference kernel with self deps
Co-authored-by: Xiayou Wei <[email protected]>
1 parent a553905 commit 1c89a52

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/test_loopy.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,6 +3216,20 @@ def test_get_return_from_kernel_mapping():
32163216
assert ret_from_knl_idx[9] == 10
32173217

32183218

3219+
def test_type_inf_with_cicular_deps(ctx_factory):
3220+
# See https://github.com/inducer/loopy/issues/481
3221+
ctx = ctx_factory()
3222+
3223+
prog = lp.make_kernel(
3224+
"{[i]: 0<=i<3}",
3225+
"""
3226+
<> x[i] = if(i==0, 1, if(i==1, 1.1, if(i==2, 1.11, -1))) {id=insn1}
3227+
x[i] = if(x[i]>1.1, 2, x[i]) {id=insn2,dep=insn1,dup=i}
3228+
out[i] = x[i] {dep=insn2,dup=i}
3229+
""")
3230+
lp.auto_test_vs_ref(prog, ctx, prog)
3231+
3232+
32193233
if __name__ == "__main__":
32203234
if len(sys.argv) > 1:
32213235
exec(sys.argv[1])

0 commit comments

Comments
 (0)