36 for (i = 0; i < tmax; i++)
38 for (i = 0; i < nx; i++)
39 for (j = 0; j < ny; j++)
61 for (i = 0; i < nx; i++)
62 for (j = 0; j < ny; j++) {
70 for (i = 0; i < nx; i++)
71 for (j = 0; j < ny; j++) {
78 for (i = 0; i < nx; i++)
79 for (j = 0; j < ny; j++) {
90 void kernel_fdtd_2d(
int tmax,
104 for (j = 0; j <
_PB_NY; j++)
105 ey[0][j] = _fict_[t];
106 for (i = 1; i <
_PB_NX; i++)
107 for (j = 0; j <
_PB_NY; j++)
108 ey[i][j] = ey[i][j] -
SCALAR_VAL(0.5)*(hz[i][j]-hz[i-1][j]);
109 for (i = 0; i <
_PB_NX; i++)
110 for (j = 1; j <
_PB_NY; j++)
111 ex[i][j] = ex[i][j] -
SCALAR_VAL(0.5)*(hz[i][j]-hz[i][j-1]);
112 for (i = 0; i < _PB_NX - 1; i++)
113 for (j = 0; j < _PB_NY - 1; j++)
114 hz[i][j] = hz[i][j] -
SCALAR_VAL(0.7)* (ex[i][j+1] - ex[i][j] +
115 ey[i+1][j] - ey[i][j]);
122 int main(
int argc,
char** argv)
146 kernel_fdtd_2d (tmax, nx, ny,
#define POLYBENCH_ARRAY(x)
int main(int argc, char **argv)
#define POLYBENCH_DUMP_BEGIN(s)
#define POLYBENCH_FREE_ARRAY(x)
static void init_array(int tmax, int nx, int ny, DATA_TYPE POLYBENCH_2D(ex, NX, NY, nx, ny), DATA_TYPE POLYBENCH_2D(ey, NX, NY, nx, ny), DATA_TYPE POLYBENCH_2D(hz, NX, NY, nx, ny), DATA_TYPE POLYBENCH_1D(_fict_, TMAX, tmax))
This version is stamped on May 10, 2016.
#define POLYBENCH_2D(var, dim1, dim2, ddim1, ddim2)
__attribute__((noinline))
Convert the given fixedpt number to a decimal string.
#define POLYBENCH_DUMP_START
#define POLYBENCH_2D_ARRAY_DECL(var, type, dim1, dim2, ddim1, ddim2)
#define DATA_PRINTF_MODIFIER
#define polybench_prevent_dce(func)
#define POLYBENCH_DUMP_TARGET
#define POLYBENCH_DUMP_END(s)
static void print_array(int nx, int ny, DATA_TYPE POLYBENCH_2D(ex, NX, NY, nx, ny), DATA_TYPE POLYBENCH_2D(ey, NX, NY, nx, ny), DATA_TYPE POLYBENCH_2D(hz, NX, NY, nx, ny))
#define POLYBENCH_1D(var, dim1, ddim1)
#define POLYBENCH_DUMP_FINISH
#define POLYBENCH_1D_ARRAY_DECL(var, type, dim1, ddim1)
#define polybench_stop_instruments
#define polybench_print_instruments
#define polybench_start_instruments