aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
authorNadesh Ramanathan <nadeshramanathan88@gmail.com>2020-11-10 09:41:14 +0000
committerNadesh Ramanathan <nadeshramanathan88@gmail.com>2020-11-10 09:41:14 +0000
commitd030cd2dbc1e97df341745516089719c24abe425 (patch)
treeb08bdc9f399a48dc4038b41b7a73413bf0ab4bd2 /benchmarks
parent3c3413c288a8ab211c4793aaf3f9c3e6f4063aec (diff)
parent2a0acd46e80769483ec27faf4e8feff514075e06 (diff)
downloadvericert-d030cd2dbc1e97df341745516089719c24abe425.tar.gz
vericert-d030cd2dbc1e97df341745516089719c24abe425.zip
Merge branch 'dev-experiments' of https://github.com/ymherklotz/vericert into dev-experiments
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/polybench-syn/stencils/adi.c13
-rw-r--r--benchmarks/polybench-syn/stencils/fdtd-2d.c12
2 files changed, 16 insertions, 9 deletions
diff --git a/benchmarks/polybench-syn/stencils/adi.c b/benchmarks/polybench-syn/stencils/adi.c
index cc54e11..5dd406b 100644
--- a/benchmarks/polybench-syn/stencils/adi.c
+++ b/benchmarks/polybench-syn/stencils/adi.c
@@ -70,13 +70,14 @@ void kernel_adi(int tsteps, int n,
d = -mul2 / 2;
e = 1+mul2;
f = d;
+ int ZERO = 0;
for (t=1; t<=tsteps; t++) {
for (i=1; i<n-1; i++) {
- v[0][i] = 1;
- p[i][0] = 0;
- q[i][0] = v[0][i];
+ v[ZERO][i] = 1;
+ p[i][ZERO] = 0;
+ q[i][ZERO] = v[ZERO][i];
for (j=1; j<n-1; j++) {
p[i][j] = -c / (a*p[i][j-1]+b);
q[i][j] = (-d*u[j][i-1]+(1+2*d)*u[j][i] - f*u[j][i+1]-a*q[i][j-1])/(a*p[i][j-1]+b);
@@ -89,9 +90,9 @@ void kernel_adi(int tsteps, int n,
}
for (i=1; i<n-1; i++) {
- u[i][0] = 1;
- p[i][0] = 0;
- q[i][0] = u[i][0];
+ u[i][ZERO] = 1;
+ p[i][ZERO] = 0;
+ q[i][ZERO] = u[i][ZERO];
for (j=1; j<n-1; j++) {
p[i][j] = -f / (d*p[i][j-1]+e);
q[i][j] = (-a*v[i-1][j]+(1+2*a)*v[i][j] - c*v[i+1][j]-d*q[i][j-1])/(d*p[i][j-1]+e);
diff --git a/benchmarks/polybench-syn/stencils/fdtd-2d.c b/benchmarks/polybench-syn/stencils/fdtd-2d.c
index cee6b03..b699937 100644
--- a/benchmarks/polybench-syn/stencils/fdtd-2d.c
+++ b/benchmarks/polybench-syn/stencils/fdtd-2d.c
@@ -9,6 +9,8 @@
*/
/* fdtd-2d.c: this file is part of PolyBench/C */
+#include <stdio.h>
+
#define plus(i) i = i + ONE
static
void init_array (int tmax,
@@ -62,6 +64,10 @@ int print_array(int nx,
for (j = 0; j < ny; plus(j)) {
res ^= hz[i][j];
}
+
+#ifndef SYNTHESIS
+ printf("finished: %u\n", res);
+#endif
return res;
}
@@ -87,15 +93,15 @@ void kernel_fdtd_2d(int tmax,
ey[0][j] = _fict_[t];
for (i = 1; i < nx; plus(i))
for (j = 0; j < ny; plus(j))
- ey[i][j] = ey[i][j] - ((hz[i][j]-(hz[i-ONE][j])>>1));
+ ey[i][j] = ey[i][j] - ((hz[i][j]-((hz[i-ONE][j])>>1)));
for (i = 0; i < nx; plus(i))
for (j = 1; j < ny; plus(j))
- ex[i][j] = ex[i][j] - ((hz[i][j]-(hz[i][j-ONE])>>1));
+ ex[i][j] = ex[i][j] - ((hz[i][j]-((hz[i][j-ONE])>>1)));
for (i = 0; i < nx - ONE; plus(i))
for (j = 0; j < ny - ONE; plus(j)){
int tmp = (ex[i][j+ONE] - ex[i][j] +
ey[i+ONE][j] - ey[i][j]);
- hz[i][j] = hz[i][j] - tmp >> 1 - tmp >> 2;
+ hz[i][j] = hz[i][j] - (tmp >> 1) - (tmp >> 2);
}
}