aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c
diff options
context:
space:
mode:
authorNadesh Ramanathan <nadeshramanathan88@gmail.com>2020-11-11 19:47:42 +0000
committerNadesh Ramanathan <nadeshramanathan88@gmail.com>2020-11-11 19:47:42 +0000
commit95861dbef966e2cb612b303615681fc29c3acd3d (patch)
treee3bff372bdb4b769ec6fb54077e30bda406ef9ee /benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c
parent47bad8cabe00a40723ce04852d02e7527473f3c3 (diff)
downloadvericert-kvx-95861dbef966e2cb612b303615681fc29c3acd3d.tar.gz
vericert-kvx-95861dbef966e2cb612b303615681fc29c3acd3d.zip
polybench edits
Diffstat (limited to 'benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c')
-rw-r--r--benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c22
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]);
+
+ }
}