cpp: void init_array(int n,\nDATA_TYPE *alpha,\nDATA_TYPE *beta,\nDATA_TYPE POLYBENCH_2D(A,N,N,n,n),\nDATA_TYPE POLYBENCH_2D(B,N,N,n,n),\nDATA_TYPE POLYBENCH_1D(x,N,n))\n{\nint i, j;\n\n*alpha = 43532;\n*beta = 12313;\nfor (i = 0; i < n; i++)\n{\nx[i] = ((DATA_TYPE) i) / n;\nfor (j = 0; j < n; j++) {\nA[i][j] = ((DATA_TYPE) i*j) / n;\nB[i][j] = ((DATA_TYPE) i*j) / n;\n}\n}\n}
fortran: subroutine init_array(n, alpha, beta, a, b, x)\nimplicit none\n\nDATA_TYPE, dimension(n, n) :: a\nDATA_TYPE, dimension(n, n) :: b\nDATA_TYPE, dimension(n) :: x\nDATA_TYPE :: alpha, beta\ninteger :: n\ninteger :: i, j\n\nalpha = 43532.0D0\nbeta = 12313.0D0\n\ndo i = 1, n\nx(i) = DBLE(i - 1) / DBLE(n)\ndo j = 1, n\na(j, i) = ((DBLE(i - 1) * DBLE(j - 1))) / DBLE(n)\nb(j, i) = ((DBLE(i - 1) * DBLE(j - 1))) / DBLE(n)\nend do\nend do\nend subroutine