diff options
Diffstat (limited to 'benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c')
-rw-r--r-- | benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c b/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c index 5e760e6..8e76231 100644 --- a/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c +++ b/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c @@ -9,6 +9,8 @@ */ /* trisolv.c: this file is part of PolyBench/C */ +#include "../../include/misc.h" + #define plus(i) i = i + ONE static void init_array(int n, @@ -24,7 +26,7 @@ void init_array(int n, x[i] = - 999; b[i] = i ; for (j = 0; j <= i; plus(j)) - L[i][j] = (int) (i+n-j+ONE)*(ONE+ONE)/n; + L[i][j] = (int) divider((i+n-j+ONE)*(ONE+ONE), n); } } @@ -57,15 +59,15 @@ void kernel_trisolv(int n, int i, j; int ONE = 1; -#pragma scop - for (i = 0; i < n; plus(i)) - { - x[i] = b[i]; - for (j = 0; j <i; plus(j)) - x[i] -= L[i][j] * x[j]; - x[i] = x[i] / L[i][i]; - } -#pragma endscop + for (i = 0; i < n; plus(i)) + { + x[i] = b[i]; + for (j = 0; j <i; plus(j)) + x[i] -= L[i][j] * x[j]; + + x[i] = divider(x[i],L[i][i]); + + } } |