aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/polybench-syn/stencils/seidel-2d.c
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-11-14 16:23:00 +0000
committerYann Herklotz <git@yannherklotz.com>2020-11-14 16:23:00 +0000
commit4201a38997543ceedad52f77b992dd8eb4a2ee5e (patch)
tree16b4adb28028e21f3ae9d46539167ece72c1c4a8 /benchmarks/polybench-syn/stencils/seidel-2d.c
parent43773b8d4a69dfd30759db2a5026a4f44cdac4cb (diff)
parent95861dbef966e2cb612b303615681fc29c3acd3d (diff)
downloadvericert-kvx-4201a38997543ceedad52f77b992dd8eb4a2ee5e.tar.gz
vericert-kvx-4201a38997543ceedad52f77b992dd8eb4a2ee5e.zip
Merge branch 'dev-experiments'
Diffstat (limited to 'benchmarks/polybench-syn/stencils/seidel-2d.c')
-rw-r--r--benchmarks/polybench-syn/stencils/seidel-2d.c10
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);
}