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