cpp: void kernel_trisolv(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\n#pragma scop\nfor (i = 0; i < _PB_N; i++)\n{\nx[i] = c[i];\nfor (j = 0; j <= i - 1; j++)\nx[i] = x[i] - A[i][j] * x[j];\nx[i] = x[i] / A[i][i];\n}\n#pragma endscop\n\n}
fortran: subroutine kernel_trisolv(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\n\n!$pragma scop\ndo i = 1, _PB_N\nx(i) = c(i)\ndo j = 1, i - 1\nx(i) = x(i) - (a(j, i) * x(j))\nend do\nx(i) = x(i) / a(i, i)\nend do\n!$pragma endscop\nend subroutine