diff options
author | Yann Herklotz <git@yannherklotz.com> | 2020-11-14 16:23:00 +0000 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2020-11-14 16:23:00 +0000 |
commit | 4201a38997543ceedad52f77b992dd8eb4a2ee5e (patch) | |
tree | 16b4adb28028e21f3ae9d46539167ece72c1c4a8 /benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c | |
parent | 43773b8d4a69dfd30759db2a5026a4f44cdac4cb (diff) | |
parent | 95861dbef966e2cb612b303615681fc29c3acd3d (diff) | |
download | vericert-4201a38997543ceedad52f77b992dd8eb4a2ee5e.tar.gz vericert-4201a38997543ceedad52f77b992dd8eb4a2ee5e.zip |
Merge branch 'dev-experiments'
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]); + + } } |