From 61e84d141601981279830b3c23bd7a0f51886ba6 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Wed, 9 Sep 2015 07:51:56 -0500 Subject: [PATCH] Add more tests from Jie --- test/test_isl.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/test_isl.py b/test/test_isl.py index 506d89c..c4f52d9 100644 --- a/test/test_isl.py +++ b/test/test_isl.py @@ -204,6 +204,36 @@ def test_union_map(): aw.compute_flow(aw, aw, s) +def test_schedule_dump(): + ctx = isl.Context() + s = isl.UnionSet.read_from_str(ctx, + "{ S_2[i, j, k] : i <= 99 and i >= 0; S_3[i] : " + "i <= 99 and i >= 0; S_0[]; S_1[i] : i <= 99 and i >= 0 }") + cst = isl.ScheduleConstraints.on_domain(s) + schedule = isl.ScheduleConstraints.compute_schedule(cst) + schedule.dump() + + +def test_from_union_map(): + ctx = isl.Context() + m = isl.UnionMap.read_from_str(ctx, + "[m, n] -> { S_0[] -> [0, 0, 0, 0]; S_1[i] -> [i, 1, 0, 0]; S_3[i] -> " + "[1 + i, 3, 0, 0]; S_2[i, j, k] -> [i, 2, j, k] : " + "j <= -1 + m and j >= 0 and k <= -1 + n and k >= 0 }") + + isl.MultiUnionPwAff.from_union_map(m) + + +def test_get_schedule_map(): + ctx = isl.Context() + ss = isl.UnionSet.read_from_str( + ctx, "[m, n] -> { S_2[i, j, k] : " + "j <= -1 + m and j >= 0 and k <= -1 + n and k >= 0 }") + cst1 = isl.ScheduleConstraints.on_domain(ss) + sub_schedule = isl.ScheduleConstraints.compute_schedule(cst1) + sub_schedule.get_map() + + if __name__ == "__main__": import sys if len(sys.argv) > 1: -- GitLab