cpp: void init_array(int n,\nDATA_TYPE POLYBENCH_2D(A,N,N,n,n),\nDATA_TYPE POLYBENCH_1D(x,N,n),\nDATA_TYPE POLYBENCH_1D(c,N,n))\n{\nint i, j;\n\nfor (i = 0; i < n; i++)\n{\nc[i] = x[i] = ((DATA_TYPE) i) / n;\nfor (j = 0; j < n; j++)\nA[i][j] = ((DATA_TYPE) i*j) / n;\n}\n}
fortran: subroutine init_array(n, a, x, c)\nimplicit none\n\nDATA_TYPE, dimension(n, n) :: a\nDATA_TYPE, dimension(n) :: c\nDATA_TYPE, dimension(n) :: x\ninteger :: n\ninteger :: i, j\ndo i = 1, n\nc(i) = DBLE(i - 1) / DBLE(n)\nx(i) = DBLE(i - 1) / DBLE(n)\ndo j = 1, n\na(j, i) = (DBLE(i - 1) * DBLE(j - 1)) / DBLE(n)\nend do\nend do\nend subroutine