From 08f253a69e7264f26fabedce1d166be1a2e81ed1 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 18 Dec 2009 23:50:24 +0100 Subject: [PATCH] update isl for fix in convex hull computation Fixes a problem reported by Tobias Grosser Signed-off-by: Sven Verdoolaege --- isl | 2 +- test/Makefile.am | 3 +- test/isl/sor1d.c | 21 +++++ test/polylib/sor1d.c | 19 ++++ test/sor1d.cloog | 256 +++++++++++++++++++++++++++++++++++++++++++++++++++ test/sor1d.good.c | 39 ++++++++ 6 files changed, 338 insertions(+), 2 deletions(-) create mode 100644 test/isl/sor1d.c create mode 100644 test/polylib/sor1d.c create mode 100644 test/sor1d.cloog create mode 100644 test/sor1d.good.c diff --git a/isl b/isl index ed3b444..df634e4 160000 --- a/isl +++ b/isl @@ -1 +1 @@ -Subproject commit ed3b444376995164166ecd93e6ed1d62901d3a16 +Subproject commit df634e4ddc439e7bedca3c61032a795a0a45be96 diff --git a/test/Makefile.am b/test/Makefile.am index f5b843d..10180ba 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -191,7 +191,8 @@ SPECIAL_OPTIONS = \ 'equality -f -1 -l 2 -override' \ 'equality2 -f -1 -l 4 -esp 1 -override' \ 'stride -f -1 -strides 1' \ - 'stride2 -f -1 -strides 1' + 'stride2 -f -1 -strides 1' \ + 'sor1d -f -1' EXTRA_DIST = \ $(CLOOGTEST_C:%=%.cloog) \ diff --git a/test/isl/sor1d.c b/test/isl/sor1d.c new file mode 100644 index 0000000..199eabc --- /dev/null +++ b/test/isl/sor1d.c @@ -0,0 +1,21 @@ +/* Generated from /home/skimo/git/cloog/test/sor1d.cloog by CLooG 0.14.0-226-g3fc65ac gmp bits in 0.22s. */ +if ((M >= 1) && (N >= 3)) { + for (glT1=-1;glT1<=floord(3*M+N-5,100);glT1++) { + for (rp1=max(max(0,ceild(100*glT1-2*M-N+5,100)),ceild(100*glT1-N-193,300));rp1<=min(min(floord(glT1+1,3),floord(M,100)),glT1);rp1++) { + for (vT1=max(max(max(max(ceild(-50*glT1+9850*rp1-98,49),ceild(19700*rp1-197,99)),100*glT1-100*rp1),200*rp1-3),200*rp1-N+1);vT1<=min(min(min(2*M+N-5,100*glT1-100*rp1+99),200*rp1+N+193),100*glT1-100*rp1+N+95);vT1++) { + if (rp1 >= max(1,ceild(vT1-N+7,200))) { + S3(glT1-rp1,rp1-1,rp1,100*rp1-1,-200*rp1+vT1+6); + } + for (vP1=max(max(1,ceild(vT1-N+5,2)),100*rp1);vP1<=min(min(floord(vT1+2,2),M),100*rp1+99);vP1++) { + if (glT1 >= ceild(9850*rp1-49*vT1-98,50)) { + S1(glT1-rp1,rp1,vP1,vT1-2*vP1+4); + } + if ((rp1 <= min(floord(M-100,100),floord(vT1-197,200))) && (100*rp1 == vP1-99)) { + S2(glT1-rp1,rp1,rp1+1,100*rp1+99,-200*rp1+vT1-194); + } + } + } + } + S4(glT1); + } +} diff --git a/test/polylib/sor1d.c b/test/polylib/sor1d.c new file mode 100644 index 0000000..8250cd6 --- /dev/null +++ b/test/polylib/sor1d.c @@ -0,0 +1,19 @@ +/* Generated from /home/skimo/git/cloog/test/sor1d.cloog by CLooG 0.14.0-226-g3fc65ac gmp bits in 0.04s. */ +if ((M >= 1) && (N >= 3)) { + for (glT1=-1;glT1<=floord(3*M+N-5,100);glT1++) { + for (rp1=max(max(0,ceild(100*glT1-2*M-N+5,100)),ceild(100*glT1-N-193,300));rp1<=min(min(min(min(floord(glT1+1,2),floord(M,100)),floord(100*glT1+99,100)),floord(50*glT1+51,150)),floord(100*glT1+N+98,300));rp1++) { + for (vT1=max(max(max(max(0,100*glT1-100*rp1),100*rp1-1),200*rp1-3),200*rp1-N+1);vT1<=min(min(2*M+N-5,100*glT1-100*rp1+99),200*rp1+N+193);vT1++) { + if (rp1 >= max(1,ceild(vT1-N+7,200))) { + S3(glT1-rp1,rp1-1,rp1,100*rp1-1,-200*rp1+vT1+6); + } + for (vP1=max(max(1,ceild(vT1-N+5,2)),100*rp1);vP1<=min(min(floord(vT1+2,2),M),100*rp1+99);vP1++) { + S1(glT1-rp1,rp1,vP1,vT1-2*vP1+4); + if ((rp1 <= min(floord(M-100,100),floord(vT1-197,200))) && (100*rp1 == vP1-99)) { + S2(glT1-rp1,rp1,rp1+1,100*rp1+99,-200*rp1+vT1-194); + } + } + } + } + S4(glT1); + } +} diff --git a/test/sor1d.cloog b/test/sor1d.cloog new file mode 100644 index 0000000..ba1ca70 --- /dev/null +++ b/test/sor1d.cloog @@ -0,0 +1,256 @@ +# created: Thu Dec 17 16:41:33 CET 2009 +# ---------------------- CONTEXT ---------------------- +c # language is C + +# Context +2 4 + 1 1 0 0 + 1 0 1 0 + + +1 # set parameter names +M N + +# --------------------- STATEMENTS -------------------- +4 + +# 1 computation stmts: +1 # domains per statement +19 8 + 1 -100 0 2 1 0 0 -4 + 1 0 0 0 1 0 0 -2 + 1 100 0 -2 -1 0 0 103 + 1 0 0 0 -1 0 1 -1 + 1 0 0 1 0 0 0 -1 + 1 0 -100 1 0 0 0 0 + 1 -100 0 2 0 0 1 -5 + 1 0 0 -1 0 1 0 0 + 1 0 100 -1 0 0 0 99 + 1 100 0 -2 0 0 0 101 + 1 0 50 0 0 0 0 49 + 1 -100 200 0 0 0 1 193 + 1 0 -100 0 0 1 0 0 + 1 100 -200 0 0 0 0 101 + 1 100 0 0 0 0 0 99 + 1 -100 0 0 0 2 1 -5 + 1 0 0 0 0 0 1 -3 + 1 0 0 0 0 2 1 94 + 1 0 0 0 0 1 0 -1 + + +0 0 0 # for future options... + + +# 1 prepare-send stmts: +1 # domains per statement +57 9 + 1 0 -200 0 2 1 0 0 -3 + 1 0 0 0 2 1 0 0 -5 + 1 -100 0 0 2 1 0 0 -4 + 1 0 0 0 0 1 0 0 -3 + 1 0 200 0 -2 -1 0 1 197 + 1 0 0 0 -2 -1 2 1 -3 + 1 100 0 0 -2 -1 0 0 103 + 1 0 0 0 0 -1 0 1 -1 + 1 0 0 -100 1 0 0 0 1 + 1 0 -100 0 1 0 0 0 0 + 1 0 0 0 1 0 0 0 -1 + 1 0 -200 0 2 0 0 1 -4 + 1 0 0 0 2 0 0 1 -6 + 1 -100 0 0 2 0 0 1 -5 + 1 0 0 100 -1 0 0 0 98 + 1 0 100 0 -1 0 0 0 99 + 1 0 0 0 -1 0 1 0 -1 + 1 0 200 0 -2 0 0 1 194 + 1 0 0 0 -2 0 2 1 -6 + 1 50 0 0 -1 0 0 0 50 + 1 0 -1 1 0 0 0 0 -1 + 1 0 0 100 0 0 0 0 97 + 1 0 -200 200 0 0 0 1 192 + 1 0 0 200 0 0 0 1 190 + 1 -100 0 200 0 0 0 1 191 + 1 0 1 -1 0 0 0 0 1 + 1 0 0 -100 0 0 1 0 0 + 1 0 200 -200 0 0 0 1 196 + 1 0 0 -200 0 0 2 1 -4 + 1 50 0 -100 0 0 0 0 51 + 1 -100 200 0 0 0 0 2 189 + 1 -100 200 0 0 0 0 1 193 + 1 0 100 0 0 0 0 1 94 + 1 0 200 0 0 0 0 1 192 + 1 0 50 0 0 0 0 0 49 + 1 100 -200 0 0 0 0 1 96 + 1 0 -100 0 0 0 1 1 -5 + 1 0 -100 0 0 0 1 0 -100 + 1 0 -200 0 0 0 2 1 -204 + 1 50 -100 0 0 0 0 0 -49 + 1 50 0 0 0 0 0 0 49 + 1 100 0 0 0 0 0 1 94 + 1 100 0 0 0 0 0 3 284 + 1 50 0 0 0 0 0 1 45 + 1 -100 0 0 0 0 2 1 -7 + 1 -100 0 0 0 0 2 2 -11 + 1 -100 0 0 0 0 2 4 179 + 1 -100 0 0 0 0 2 3 -15 + 1 0 0 0 0 0 2 1 -8 + 1 0 0 0 0 0 2 3 -16 + 1 0 0 0 0 0 1 1 -6 + 1 0 0 0 0 0 0 1 -4 + 1 0 0 0 0 0 2 4 79 + 1 0 0 0 0 0 2 7 463 + 1 0 0 0 0 0 2 6 269 + 1 0 0 0 0 0 2 5 75 + 1 0 0 0 0 0 1 0 -2 + + +0 0 0 # for future options... + + +# 1 prepare-receive stmts: +1 # domains per statement +57 9 + 1 0 -200 0 2 1 0 0 -3 + 1 0 0 0 2 1 0 0 -5 + 1 -100 0 0 2 1 0 0 -4 + 1 0 0 0 0 1 0 0 -3 + 1 0 200 0 -2 -1 0 1 197 + 1 0 0 0 -2 -1 2 1 -3 + 1 100 0 0 -2 -1 0 0 103 + 1 0 0 0 0 -1 0 1 -1 + 1 0 0 -100 1 0 0 0 1 + 1 0 -100 0 1 0 0 0 0 + 1 0 0 0 1 0 0 0 -1 + 1 0 -200 0 2 0 0 1 -4 + 1 0 0 0 2 0 0 1 -6 + 1 -100 0 0 2 0 0 1 -5 + 1 0 0 100 -1 0 0 0 98 + 1 0 100 0 -1 0 0 0 99 + 1 0 0 0 -1 0 1 0 -1 + 1 0 200 0 -2 0 0 1 194 + 1 0 0 0 -2 0 2 1 -6 + 1 50 0 0 -1 0 0 0 50 + 1 0 -1 1 0 0 0 0 -1 + 1 0 0 100 0 0 0 0 97 + 1 0 -200 200 0 0 0 1 192 + 1 0 0 200 0 0 0 1 190 + 1 -100 0 200 0 0 0 1 191 + 1 0 1 -1 0 0 0 0 1 + 1 0 0 -100 0 0 1 0 0 + 1 0 200 -200 0 0 0 1 196 + 1 0 0 -200 0 0 2 1 -4 + 1 50 0 -100 0 0 0 0 51 + 1 -100 200 0 0 0 0 2 189 + 1 -100 200 0 0 0 0 1 193 + 1 0 100 0 0 0 0 1 94 + 1 0 200 0 0 0 0 1 192 + 1 0 50 0 0 0 0 0 49 + 1 100 -200 0 0 0 0 1 96 + 1 0 -100 0 0 0 1 1 -5 + 1 0 -100 0 0 0 1 0 -100 + 1 0 -200 0 0 0 2 1 -204 + 1 50 -100 0 0 0 0 0 -49 + 1 50 0 0 0 0 0 0 49 + 1 100 0 0 0 0 0 1 94 + 1 100 0 0 0 0 0 3 284 + 1 50 0 0 0 0 0 1 45 + 1 -100 0 0 0 0 2 1 -7 + 1 -100 0 0 0 0 2 2 -11 + 1 -100 0 0 0 0 2 4 179 + 1 -100 0 0 0 0 2 3 -15 + 1 0 0 0 0 0 2 1 -8 + 1 0 0 0 0 0 2 3 -16 + 1 0 0 0 0 0 1 1 -6 + 1 0 0 0 0 0 0 1 -4 + 1 0 0 0 0 0 2 4 79 + 1 0 0 0 0 0 2 7 463 + 1 0 0 0 0 0 2 6 269 + 1 0 0 0 0 0 2 5 75 + 1 0 0 0 0 0 1 0 -2 + + +0 0 0 # for future options... + + +# 1 communication stmts: +1 # domains per statement +21 5 + 1 200 0 3 781 + 1 200 0 1 391 + 1 200 0 4 1075 + 1 100 0 1 392 + 1 100 0 0 197 + 1 -200 6 5 377 + 1 -200 6 6 671 + 1 -100 3 2 190 + 1 -200 6 3 -13 + 1 -100 3 1 -5 + 1 0 2 3 484 + 1 0 1 1 95 + 1 0 3 1 192 + 1 0 3 5 873 + 1 0 3 2 189 + 1 0 6 7 1062 + 1 0 6 5 771 + 1 0 3 4 579 + 1 0 0 1 -3 + 1 0 2 1 -5 + 1 0 1 0 -1 + + +0 0 0 # for future options... + + + +1 # set the iterator names +tileT1 tileP1 other1 other2 other3 other4 other5 + +# --------------------- SCATTERING -------------------- +4 # Scattering functions +9 17 + 0 1 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 + 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 1 0 0 0 0 0 0 0 -1 0 0 0 0 0 + 0 0 0 0 1 0 0 0 0 0 0 0 -2 -1 0 0 4 + 0 0 0 0 0 1 0 0 0 0 0 0 -1 0 0 0 0 + 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 -1 + 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 + +9 18 + 0 1 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 + 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 + 0 0 0 0 1 0 0 0 0 0 0 0 0 -2 -1 0 0 4 + 0 0 0 0 0 1 0 0 0 0 0 0 0 -1 0 0 0 0 + 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 -2 + 0 0 0 0 0 0 0 1 0 0 0 0 -1 0 0 0 0 0 + 0 0 0 0 0 0 0 0 1 0 0 0 0 0 -1 0 0 0 + 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 -1 + +9 18 + 0 1 0 0 0 0 0 -1 0 0 -1 0 0 0 0 0 0 -1 + 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 1 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 + 0 0 0 0 1 0 0 0 0 0 0 0 0 -2 -1 0 0 4 + 0 0 0 0 0 1 0 0 0 0 0 0 0 -1 0 0 0 0 + 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 1 0 0 0 -1 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 1 0 0 0 0 0 -1 0 0 0 + 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 -1 + +9 14 + 0 1 0 0 0 0 0 0 0 0 -1 0 0 0 + 0 0 1 0 0 0 0 0 0 0 0 0 0 -1 + 0 0 0 1 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 1 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 1 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 1 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 1 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 1 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 1 0 0 0 0 + + +1 # we set the scattering dimension names +glT1 bl rp1 vT1 vP1 stmtType otherP1 arrAcc1 arrNr1 + diff --git a/test/sor1d.good.c b/test/sor1d.good.c new file mode 100644 index 0000000..bb5d643 --- /dev/null +++ b/test/sor1d.good.c @@ -0,0 +1,39 @@ +/* Generated from /home/skimo/git/cloog/test/sor1d.cloog by CLooG 0.14.0-226-g3fc65ac gmp bits in 0.04s. */ +extern void hash(int); + +/* Useful macros. */ +#define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) +#define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) +#define max(x,y) ((x) > (y) ? (x) : (y)) +#define min(x,y) ((x) < (y) ? (x) : (y)) + +#define S1(tileT1,tileP1,other1,other2) { hash(1); hash(tileT1); hash(tileP1); hash(other1); hash(other2); } +#define S2(tileT1,tileP1,other1,other2,other3) { hash(2); hash(tileT1); hash(tileP1); hash(other1); hash(other2); hash(other3); } +#define S3(tileT1,tileP1,other1,other2,other3) { hash(3); hash(tileT1); hash(tileP1); hash(other1); hash(other2); hash(other3); } +#define S4(tileT1) { hash(4); hash(tileT1); } + +void test(int M, int N) +{ + /* Scattering iterators. */ + int glT1, rp1, vT1, vP1, otherP1, arrAcc1; + /* Original iterators. */ + int tileT1, tileP1, other1, other2, other3; + if ((M >= 1) && (N >= 3)) { + for (glT1=-1;glT1<=floord(3*M+N-5,100);glT1++) { + for (rp1=max(max(0,ceild(100*glT1-2*M-N+5,100)),ceild(100*glT1-N-193,300));rp1<=min(min(min(min(floord(glT1+1,2),floord(M,100)),floord(100*glT1+99,100)),floord(50*glT1+51,150)),floord(100*glT1+N+98,300));rp1++) { + for (vT1=max(max(max(max(0,100*glT1-100*rp1),100*rp1-1),200*rp1-3),200*rp1-N+1);vT1<=min(min(2*M+N-5,100*glT1-100*rp1+99),200*rp1+N+193);vT1++) { + if (rp1 >= max(1,ceild(vT1-N+7,200))) { + S3(glT1-rp1,rp1-1,rp1,100*rp1-1,-200*rp1+vT1+6); + } + for (vP1=max(max(1,ceild(vT1-N+5,2)),100*rp1);vP1<=min(min(floord(vT1+2,2),M),100*rp1+99);vP1++) { + S1(glT1-rp1,rp1,vP1,vT1-2*vP1+4); + if ((rp1 <= min(floord(M-100,100),floord(vT1-197,200))) && (100*rp1 == vP1-99)) { + S2(glT1-rp1,rp1,rp1+1,100*rp1+99,-200*rp1+vT1-194); + } + } + } + } + S4(glT1); + } + } +} -- 2.11.4.GIT