cpp: void kernel_cholesky(int n,\nDATA_TYPE POLYBENCH_1D(p,N,n),\nDATA_TYPE POLYBENCH_2D(A,N,N,n,n))\n{\nint i, j, k;\n\nDATA_TYPE x;\n\n#pragma scop\nfor (i = 0; i < _PB_N; ++i)\n{\nx = A[i][i];\nfor (j = 0; j <= i - 1; ++j)\nx = x - A[i][j] * A[i][j];\np[i] = 1.0 / sqrt(x);\nfor (j = i + 1; j < _PB_N; ++j)\n{\nx = A[i][j];\nfor (k = 0; k <= i - 1; ++k)\nx = x - A[j][k] * A[i][k];\nA[j][i] = x * p[i];\n}\n}\n#pragma endscop\n\n}
fortran: subroutine kernel_cholesky(n, p, a)\nimplicit none\n\nDATA_TYPE, dimension(n, n) :: a\nDATA_TYPE, dimension(n) :: p\nDATA_TYPE :: x\ninteger :: n\ninteger :: i, j, k\n\n!$pragma scop\ndo i = 1, _PB_N\nx = a(i, i)\ndo j = 1, i - 1\nx = x - a(j, i) * a(j, i)\nend do\np(i) = 1.0D0 / sqrt(x)\ndo j = i + 1, _PB_N\nx = a(j, i)\ndo k = 1, i - 1\nx = x - (a(k, j) * a(k, i))\nend do\na(i, j) = x * p(i)\nend do\nend do\n!$pragma endscop\nend subroutine