cpp: void init_array (int m, int n,\nDATA_TYPE *float_n,\nDATA_TYPE POLYBENCH_2D(data,M,N,m,n))\n{\nint i, j;\n\n*float_n = 1.2;\n\nfor (i = 0; i < M; i++)\nfor (j = 0; j < N; j++)\ndata[i][j] = ((DATA_TYPE) i*j) / M;\n}
fortran: subroutine init_array(m, n, float_n, dat)\nimplicit none\n\nDATA_TYPE, dimension(n, m) :: dat\nDATA_TYPE :: float_n\ninteger :: m, n\ninteger :: i, j\n\nfloat_n = 1.2D0\ndo i = 1, m\ndo j = 1, n\ndat(j, i) = (DBLE((i - 1) * (j - 1))) / DBLE(m)\nend do\nend do\nend subroutine