From c0be24c8e577d54c11f8cf06512a14a7583a9bb1 Mon Sep 17 00:00:00 2001 From: Nadesh Ramanathan Date: Sat, 4 Jul 2020 14:25:27 +0100 Subject: shift bug --- benchmarks/polybench-syn/stencils/jacobi-2d.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/benchmarks/polybench-syn/stencils/jacobi-2d.c b/benchmarks/polybench-syn/stencils/jacobi-2d.c index 758a83a..3a5b43c 100644 --- a/benchmarks/polybench-syn/stencils/jacobi-2d.c +++ b/benchmarks/polybench-syn/stencils/jacobi-2d.c @@ -59,6 +59,7 @@ void kernel_jacobi_2d(int tsteps, { int t, i, j; int ONE = 1; + int TWO = 2; #pragma scop for (t = 0; t < tsteps; plus(t)) @@ -66,12 +67,12 @@ void kernel_jacobi_2d(int tsteps, for (i = 1; i < n - ONE; plus(i)) for (j = 1; j < n - ONE; plus(j)){ B[i][j] = (A[i][j] + A[i][j-ONE] + A[i][ONE+j] + A[ONE+i][j] + A[i-ONE][j]); - B[i][j] = B[i][j] >> 2; + B[i][j] = B[i][j] >> TWO; } for (i = 1; i < n - ONE; plus(i)) for (j = 1; j < n - ONE; plus(j)){ A[i][j] = (B[i][j] + B[i][j-ONE] + B[i][ONE+j] + B[ONE+i][j] + B[i-ONE][j]); - A[i][j] = A[i][j] >> 2; + A[i][j] = A[i][j] >> TWO; } } #pragma endscop @@ -83,7 +84,7 @@ int main() { int n = 30; - int tsteps = 20; + int tsteps = 5; int A[30 + 0][30 + 0]; -- cgit