diff options
author | Nadesh Ramanathan <nadeshramanathan88@gmail.com> | 2020-11-11 19:47:42 +0000 |
---|---|---|
committer | Nadesh Ramanathan <nadeshramanathan88@gmail.com> | 2020-11-11 19:47:42 +0000 |
commit | 95861dbef966e2cb612b303615681fc29c3acd3d (patch) | |
tree | e3bff372bdb4b769ec6fb54077e30bda406ef9ee /benchmarks/polybench-syn/stencils/seidel-2d.c | |
parent | 47bad8cabe00a40723ce04852d02e7527473f3c3 (diff) | |
download | vericert-95861dbef966e2cb612b303615681fc29c3acd3d.tar.gz vericert-95861dbef966e2cb612b303615681fc29c3acd3d.zip |
polybench edits
Diffstat (limited to 'benchmarks/polybench-syn/stencils/seidel-2d.c')
-rw-r--r-- | benchmarks/polybench-syn/stencils/seidel-2d.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/benchmarks/polybench-syn/stencils/seidel-2d.c b/benchmarks/polybench-syn/stencils/seidel-2d.c index d4c7f98..23ddc74 100644 --- a/benchmarks/polybench-syn/stencils/seidel-2d.c +++ b/benchmarks/polybench-syn/stencils/seidel-2d.c @@ -9,6 +9,8 @@ */ /* seidel-2d.c: this file is part of PolyBench/C */ +#include "../include/misc.h" + #define plus(i) i = i + ONE static void init_array (int n, @@ -20,7 +22,7 @@ void init_array (int n, for (i = 0; i < n; plus(i)) for (j = 0; j < n; plus(j)) - A[i][j] = ((int) i*(j+TWO) + TWO) / n; + A[i][j] = divider(((int) i*(j+TWO) + TWO), n); } @@ -55,14 +57,12 @@ void kernel_seidel_2d(int tsteps, int TWO = 2; int NINE = 9; -#pragma scop for (t = 0; t <= tsteps - ONE; plus(t)) for (i = ONE; i<= n - TWO; plus(i)) for (j = ONE; j <= n - TWO; plus(j)) - A[i][j] = (A[i-ONE][j-ONE] + A[i-ONE][j] + A[i-ONE][j+ONE] + A[i][j] = divider((A[i-ONE][j-ONE] + A[i-ONE][j] + A[i-ONE][j+ONE] + A[i][j-ONE] + A[i][j] + A[i][j+ONE] - + A[i+ONE][j-ONE] + A[i+ONE][j] + A[i+ONE][j+ONE])/NINE; -#pragma endscop + + A[i+ONE][j-ONE] + A[i+ONE][j] + A[i+ONE][j+ONE]), NINE); } |