aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/polybench-syn/linear-algebra/solvers/lu.c
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-11-14 16:23:00 +0000
committerYann Herklotz <git@yannherklotz.com>2020-11-14 16:23:00 +0000
commit4201a38997543ceedad52f77b992dd8eb4a2ee5e (patch)
tree16b4adb28028e21f3ae9d46539167ece72c1c4a8 /benchmarks/polybench-syn/linear-algebra/solvers/lu.c
parent43773b8d4a69dfd30759db2a5026a4f44cdac4cb (diff)
parent95861dbef966e2cb612b303615681fc29c3acd3d (diff)
downloadvericert-kvx-4201a38997543ceedad52f77b992dd8eb4a2ee5e.tar.gz
vericert-kvx-4201a38997543ceedad52f77b992dd8eb4a2ee5e.zip
Merge branch 'dev-experiments'
Diffstat (limited to 'benchmarks/polybench-syn/linear-algebra/solvers/lu.c')
-rw-r--r--benchmarks/polybench-syn/linear-algebra/solvers/lu.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/lu.c b/benchmarks/polybench-syn/linear-algebra/solvers/lu.c
index 1cf07ea..56dadd7 100644
--- a/benchmarks/polybench-syn/linear-algebra/solvers/lu.c
+++ b/benchmarks/polybench-syn/linear-algebra/solvers/lu.c
@@ -14,6 +14,8 @@
//#include <string.h>
//#include <math.h>
+#include "../../include/misc.h"
+
#define plus(i) i = i + ONE
static
@@ -26,7 +28,7 @@ void init_array (int n,
for (i = 0; i < n; plus(i))
{
for (j = 0; j <= i; plus(j))
- A[i][j] = (int)(-j % n) / n + ONE;
+ A[i][j] = sdivider(smodulo(-j, n), n) + ONE;
for (j = plus(i); j < n; plus(j)) {
A[i][j] = 0;
}
@@ -82,13 +84,12 @@ void kernel_lu(int n,
int i, j, k;
int ONE = 1;
-#pragma scop
for (i = 0; i < n; plus(i)) {
for (j = 0; j <i; plus(j)) {
for (k = 0; k < j; plus(k)) {
A[i][j] -= A[i][k] * A[k][j];
}
- A[i][j] /= A[j][j];
+ A[i][j] = sdivider(A[i][j], A[j][j]);
}
for (j = i; j < n; plus(j)) {
for (k = 0; k < i; plus(k)) {
@@ -96,7 +97,6 @@ void kernel_lu(int n,
}
}
}
-#pragma endscop
}
static
@@ -128,19 +128,9 @@ int main()
- //print_array(n, A);
- // polybench_timer_start();;
-
-
kernel_lu (n, A);
- // polybench_timer_stop();;
- // polybench_timer_print();;
-
-
-
- //if (argc > 42 && ! strcmp(argv[0], ""))
return check_array(n, A);
return 0;