aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/polybench-syn/stencils/fdtd-2d.c
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/polybench-syn/stencils/fdtd-2d.c')
-rw-r--r--benchmarks/polybench-syn/stencils/fdtd-2d.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/benchmarks/polybench-syn/stencils/fdtd-2d.c b/benchmarks/polybench-syn/stencils/fdtd-2d.c
index 17acd34..853d362 100644
--- a/benchmarks/polybench-syn/stencils/fdtd-2d.c
+++ b/benchmarks/polybench-syn/stencils/fdtd-2d.c
@@ -10,6 +10,8 @@
/* fdtd-2d.c: this file is part of PolyBench/C */
+#include "../include/misc.h"
+
#define plus(i) i = i + ONE
static
void init_array (int tmax,
@@ -22,18 +24,16 @@ void init_array (int tmax,
{
int i, j;
int ONE = 1;
- int TWO = 1;
- int THREE = 1;
for (i = 0; i < tmax; plus(i))
_fict_[i] = (int) i;
for (i = 0; i < nx; plus(i))
for (j = 0; j < ny; plus(j))
- {
- ex[i][j] = ((int) i*(j+ONE)) / nx;
- ey[i][j] = ((int) i*(j+TWO)) / ny;
- hz[i][j] = ((int) i*(j+THREE)) / nx;
- }
+ {
+ ex[i][j] = sdivider(i*(j+1) , nx);
+ ey[i][j] = sdivider(i*(j+2) , ny);
+ hz[i][j] = sdivider(i*(j+3) , nx);
+ }
}