aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/polybench-syn/stencils
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
parent43773b8d4a69dfd30759db2a5026a4f44cdac4cb (diff)
parent95861dbef966e2cb612b303615681fc29c3acd3d (diff)
downloadvericert-kvx-4201a38997543ceedad52f77b992dd8eb4a2ee5e.tar.gz
vericert-kvx-4201a38997543ceedad52f77b992dd8eb4a2ee5e.zip
Merge branch 'dev-experiments'
Diffstat (limited to 'benchmarks/polybench-syn/stencils')
-rw-r--r--benchmarks/polybench-syn/stencils/adi.c7
-rw-r--r--benchmarks/polybench-syn/stencils/fdtd-2d.c5
-rw-r--r--benchmarks/polybench-syn/stencils/jacobi-1d.c7
-rw-r--r--benchmarks/polybench-syn/stencils/jacobi-2d.c7
-rw-r--r--benchmarks/polybench-syn/stencils/seidel-2d.c10
5 files changed, 17 insertions, 19 deletions
diff --git a/benchmarks/polybench-syn/stencils/adi.c b/benchmarks/polybench-syn/stencils/adi.c
index 5dd406b..a424dec 100644
--- a/benchmarks/polybench-syn/stencils/adi.c
+++ b/benchmarks/polybench-syn/stencils/adi.c
@@ -9,6 +9,7 @@
*/
/* adi.c: this file is part of PolyBench/C */
+#include "../include/misc.h"
#define plus(i) i = i + ONE
static
@@ -64,10 +65,10 @@ void kernel_adi(int tsteps, int n,
mul1 = B1 * DT / (DX * DX);
mul2 = B2 * DT / (DY * DY);
- a = -mul1 / 2;
+ a = -(sdivider(mul1,2));
b = 1+mul1;
c = a;
- d = -mul2 / 2;
+ d = -(sdivider(mul2,2));
e = 1+mul2;
f = d;
int ZERO = 0;
@@ -107,7 +108,7 @@ void kernel_adi(int tsteps, int n,
}
-int main(int argc, char** argv)
+int main()
{
int n = 20;
diff --git a/benchmarks/polybench-syn/stencils/fdtd-2d.c b/benchmarks/polybench-syn/stencils/fdtd-2d.c
index b699937..f9f4a84 100644
--- a/benchmarks/polybench-syn/stencils/fdtd-2d.c
+++ b/benchmarks/polybench-syn/stencils/fdtd-2d.c
@@ -9,7 +9,9 @@
*/
/* fdtd-2d.c: this file is part of PolyBench/C */
+#ifndef SYNTHESIS
#include <stdio.h>
+#endif
#define plus(i) i = i + ONE
static
@@ -85,8 +87,6 @@ void kernel_fdtd_2d(int tmax,
int t, i, j;
int ONE = 1;
-#pragma scop
-
for(t = 0; t < tmax; t=t+ONE)
{
for (j = 0; j < ny; plus(j))
@@ -105,7 +105,6 @@ void kernel_fdtd_2d(int tmax,
}
}
-#pragma endscop
}
diff --git a/benchmarks/polybench-syn/stencils/jacobi-1d.c b/benchmarks/polybench-syn/stencils/jacobi-1d.c
index 1c3cf79..95cbb35 100644
--- a/benchmarks/polybench-syn/stencils/jacobi-1d.c
+++ b/benchmarks/polybench-syn/stencils/jacobi-1d.c
@@ -9,6 +9,7 @@
*/
/* jacobi-1d.c: this file is part of PolyBench/C */
+#include "../include/misc.h"
#define plus(i) i = i + ONE
static
@@ -23,8 +24,8 @@ void init_array (int n,
for (i = 0; i < n; plus(i))
{
- A[i] = ((int) i+TWO) / n;
- B[i] = ((int) i+THREE) / n;
+ A[i] = divider(((int) i+TWO), n);
+ B[i] = divider(((int) i+THREE), n);
}
}
@@ -59,7 +60,6 @@ void kernel_jacobi_1d(int tsteps,
int t, i;
int ONE = 1;
-#pragma scop
for (t = 0; t < tsteps; plus(t))
{
for (i = 1; i < n - ONE; plus(i)){
@@ -71,7 +71,6 @@ void kernel_jacobi_1d(int tsteps,
A[i] = A[i] >> 2;
}
}
-#pragma endscop
}
diff --git a/benchmarks/polybench-syn/stencils/jacobi-2d.c b/benchmarks/polybench-syn/stencils/jacobi-2d.c
index 3a5b43c..11349f4 100644
--- a/benchmarks/polybench-syn/stencils/jacobi-2d.c
+++ b/benchmarks/polybench-syn/stencils/jacobi-2d.c
@@ -9,6 +9,7 @@
*/
/* jacobi-2d.c: this file is part of PolyBench/C */
+#include "../include/misc.h"
#define plus(i) i = i + ONE
static
@@ -24,8 +25,8 @@ 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;
- B[i][j] = ((int) i*(j+THREE) + THREE) / n;
+ A[i][j] = divider(((int) i*(j+TWO) + TWO), n);
+ B[i][j] = divider(((int) i*(j+THREE) + THREE), n);
}
}
@@ -61,7 +62,6 @@ void kernel_jacobi_2d(int tsteps,
int ONE = 1;
int TWO = 2;
-#pragma scop
for (t = 0; t < tsteps; plus(t))
{
for (i = 1; i < n - ONE; plus(i))
@@ -75,7 +75,6 @@ void kernel_jacobi_2d(int tsteps,
A[i][j] = A[i][j] >> TWO;
}
}
-#pragma endscop
}
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);
}