cpp: void kernel_seidel_2d(int tsteps,\nint n,\nDATA_TYPE POLYBENCH_2D(A,N,N,n,n))\n{\nint t, i, j;\n\n#pragma scop\nfor (t = 0; t <= _PB_TSTEPS - 1; t++)\nfor (i = 1; i<= _PB_N - 2; i++)\nfor (j = 1; j <= _PB_N - 2; j++)\nA[i][j] = (A[i-1][j-1] + A[i-1][j] + A[i-1][j+1]\n+ A[i][j-1] + A[i][j] + A[i][j+1]\n+ A[i+1][j-1] + A[i+1][j] + A[i+1][j+1])/9.0;\n#pragma endscop\n\n}
fortran: subroutine kernel_seidel(tsteps, n, a)\nimplicit none\n\nDATA_TYPE, dimension(n, n) :: a\ninteger :: n, tsteps\ninteger :: i, t, j\n\n!$pragma scop\ndo t = 1, _PB_TSTEPS\ndo i = 2, _PB_N - 1\ndo j = 2, _PB_N - 1\na(j, i) = (a(j - 1, i - 1) + a(j, i - 1) + a(j + 1, i - 1) + &\na(j - 1, i) + a(j, i) + a(j + 1, i) + &\na(j - 1, i + 1) + a(j, i + 1) + &\na(j + 1, i + 1))/9.0D0\nend do\nend do\nend do\n!$pragma endscop\nend subroutine