cpp: void kernel_atax(int nx, int ny,\nDATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny),\nDATA_TYPE POLYBENCH_1D(x,NY,ny),\nDATA_TYPE POLYBENCH_1D(y,NY,ny),\nDATA_TYPE POLYBENCH_1D(tmp,NX,nx))\n{\nint i, j;\n\n#pragma scop\nfor (i = 0; i < _PB_NY; i++)\ny[i] = 0;\nfor (i = 0; i < _PB_NX; i++)\n{\ntmp[i] = 0;\nfor (j = 0; j < _PB_NY; j++)\ntmp[i] = tmp[i] + A[i][j] * x[j];\nfor (j = 0; j < _PB_NY; j++)\ny[j] = y[j] + A[i][j] * tmp[i];\n}\n#pragma endscop\n\n}
fortran: subroutine kernel_atax(nx, ny, a, x, y, tmp)\nimplicit none\n\nDATA_TYPE, dimension(ny, nx) :: a\nDATA_TYPE, dimension(ny) :: x\nDATA_TYPE, dimension(ny) :: y\nDATA_TYPE, dimension(nx) :: tmp\ninteger nx, ny, i, j\n\n!$pragma scop\ndo i = 1, _PB_NY\ny(i) = 0.0D0\nend do\n\ndo i = 1, _PB_NX\ntmp(i) = 0.0D0\ndo j = 1, _PB_NY\ntmp(i) = tmp(i) + (a(j, i) * x(j))\nend do\ndo j = 1, _PB_NY\ny(j) = y(j) + a(j, i) * tmp(i)\nend do\nend do\n!$pragma endscop\nend subroutine