cpp: void print_array(int ni, int nj,\nDATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),\nDATA_TYPE POLYBENCH_2D(R,NJ,NJ,nj,nj),\nDATA_TYPE POLYBENCH_2D(Q,NI,NJ,ni,nj))\n{\nint i, j;\n\nfor (i = 0; i < ni; i++)\nfor (j = 0; j < nj; j++) {\nfprintf (stderr, DATA_PRINTF_MODIFIER, A[i][j]);\nif (i % 20 == 0) fprintf (stderr, "\n");\n}\nfprintf (stderr, "\n");\nfor (i = 0; i < nj; i++)\nfor (j = 0; j < nj; j++) {\nfprintf (stderr, DATA_PRINTF_MODIFIER, R[i][j]);\nif (i % 20 == 0) fprintf (stderr, "\n");\n}\nfprintf (stderr, "\n");\nfor (i = 0; i < ni; i++)\nfor (j = 0; j < nj; j++) {\nfprintf (stderr, DATA_PRINTF_MODIFIER, Q[i][j]);\nif (i % 20 == 0) fprintf (stderr, "\n");\n}\nfprintf (stderr, "\n");\n}
fortran: subroutine print_array(ni, nj, a, r, q)\nimplicit none\n\nDATA_TYPE, dimension(nj, ni) :: a\nDATA_TYPE, dimension(nj, nj) :: r\nDATA_TYPE, dimension(nj, ni) :: q\ninteger :: ni, nj\ninteger :: i, j\ndo i = 1, ni\ndo j = 1, nj\nwrite(0, DATA_PRINTF_MODIFIER) a(j, i)\nif (mod((i - 1), 20) == 0) then\nwrite(0, *)\nend if\nend do\nend do\nwrite(0, *)\ndo i = 1, nj\ndo j = 1, nj\nwrite(0, DATA_PRINTF_MODIFIER) r(j, i)\nif (mod((i - 1), 20) == 0) then\nwrite(0, *)\nend if\nend do\nend do\nwrite(0, *)\ndo i = 1, ni\ndo j = 1, nj\nwrite(0, DATA_PRINTF_MODIFIER) q(j, i)\nif (mod((i - 1), 20) == 0) then\nwrite(0, *)\nend if\nend do\nend do\nwrite(0, *)\nend subroutine