// // This file is part of the Bones source-to-source compiler examples. The C-code // is largely identical in terms of functionality and variable naming to the code // found in PolyBench/C version 3.2. For more information on PolyBench/C or Bones // please use the contact information below. // // == More information on PolyBench/C // Contact............Louis-Noel Pouchet // Web address........http://polybench.sourceforge.net/ // // == More information on Bones // Contact............Cedric Nugteren // Web address........http://parse.ele.tue.nl/bones/ // // == File information // Filename...........benchmark/fdtd-2d-apml.c // Author.............Cedric Nugteren // Last modified on...30-May-2012 // #include "common.h" // This is 'fdtd-2d-apml', a 2D finite different time domain kernel using an anisotropic perfectly matched layer int main(void) { int i,j,k; int ix,iy,iz; float clf, tmp; float czm_iz, czp_iz; float cymh_iy, cyph_iy; // Declare arrays on the stack float czm[CZ+1]; float czp[CZ+1]; float cxmh[CXM+1]; float cxph[CXM+1]; float cymh[CYM+1]; float cyph[CYM+1]; float Ry[CZ+1][CYM+1]; float Ax[CZ+1][CYM+1]; float Ex[CZ+1][CYM+1][CXM+1]; float Ey[CZ+1][CYM+1][CXM+1]; float Hz[CZ+1][CYM+1][CXM+1]; float Bza[CZ+1][CYM+1][CXM+1]; // Set the constants float mui = 2341; float ch = 42; // Set the input data for (i=0; i<=CZ; i++) { czm[i] = ((float) i+1) / CXM; czp[i] = ((float) i+2) / CXM; } for (i=0; i<=CXM; i++) { cxmh[i] = ((float) i+3) / CXM; cxph[i] = ((float) i+4) / CXM; } for (i=0; i<=CYM; i++) { cymh[i] = ((float) i+5) / CXM; cyph[i] = ((float) i+6) / CXM; } for (i=0; i<=CZ; i++) { for (j=0; j<=CYM; j++) { Ry[i][j] = ((float) i*(j+1) + 10) / CYM; Ax[i][j] = ((float) i*(j+2) + 11) / CYM; for (k=0; k<=CXM; k++) { Ex[i][j][k] = ((float) i*(j+3) + k+1) / CXM; Ey[i][j][k] = ((float) i*(j+4) + k+2) / CYM; Hz[i][j][k] = ((float) i*(j+5) + k+3) / CZ; } } } // Perform the computation #pragma scop for (iz=0; iz iz:iz,iy:iy,0:CXM-1|element ^ iz:iz,iy:iy,0:CXM-1|element for (ix=0; ix