cpp: void init_array(int length,\nDATA_TYPE POLYBENCH_2D(c,LENGTH,LENGTH,length,length),\nDATA_TYPE POLYBENCH_2D(W,LENGTH,LENGTH,length,length))\n{\nint i, j;\nfor (i = 0; i < length; i++)\nfor (j = 0; j < length; j++) {\nc[i][j] = i*j % 2;\nW[i][j] = ((DATA_TYPE) i-j) / length;\n}\n}\n
fortran: subroutine init_array(length, c, w)\nimplicit none\n\nDATA_TYPE, dimension(length, length) :: w, c\ninteger :: i, j\ninteger length\n\ndo i = 1, length\ndo j = 1, length\nc(j, i) = mod((i-1)*(j-1), 2)\nw(j, i) = (DBLE((i - 1) - (j - 1))) / DBLE(length)\nend do\nend do\nend subroutine