From aba1066919919bf068b723fca3741be6f3a1de97 Mon Sep 17 00:00:00 2001 From: Nadesh Ramanathan Date: Sun, 15 Nov 2020 11:44:21 +0000 Subject: some fixes --- benchmarks/polybench-syn/linear-algebra/solvers/durbin.c | 9 ++++++++- benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c | 13 +++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'benchmarks/polybench-syn/linear-algebra') diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/durbin.c b/benchmarks/polybench-syn/linear-algebra/solvers/durbin.c index dd6d05e..4b1a87f 100644 --- a/benchmarks/polybench-syn/linear-algebra/solvers/durbin.c +++ b/benchmarks/polybench-syn/linear-algebra/solvers/durbin.c @@ -9,6 +9,9 @@ */ /* durbin.c: this file is part of PolyBench/C */ +#ifndef SYNTHESIS +#include +#endif unsigned int divider(unsigned int x, unsigned int y) { @@ -76,9 +79,13 @@ int print_array(int n, int res = 0; for (i = 0; i < n; plus(i)) { - res += y[i]; + res ^= y[i]; } +#ifndef SYNTHESIS + printf("finished: %u\n", res); +#endif + return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c b/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c index 8e76231..2f636df 100644 --- a/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c +++ b/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c @@ -11,6 +11,11 @@ #include "../../include/misc.h" + +#ifndef SYNTHESIS +#include +#endif + #define plus(i) i = i + ONE static void init_array(int n, @@ -23,7 +28,7 @@ void init_array(int n, for (i = 0; i < n; plus(i)) { - x[i] = - 999; + x[i] = -999; b[i] = i ; for (j = 0; j <= i; plus(j)) L[i][j] = (int) divider((i+n-j+ONE)*(ONE+ONE), n); @@ -42,8 +47,12 @@ int check_array(int n, int res = 0; int ONE = 1; for (i = 0; i < n; plus(i)) { - res += x[i]; + res ^= x[i]; } + +#ifndef SYNTHESIS + printf("finished: %u\n", res); +#endif return res; } -- cgit From 25f9100da11ccea1d8b5c24160270be425f2cab2 Mon Sep 17 00:00:00 2001 From: Nadesh Ramanathan Date: Sun, 15 Nov 2020 12:44:39 +0000 Subject: lu fix --- benchmarks/polybench-syn/linear-algebra/solvers/lu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'benchmarks/polybench-syn/linear-algebra') diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/lu.c b/benchmarks/polybench-syn/linear-algebra/solvers/lu.c index 56dadd7..a7ec246 100644 --- a/benchmarks/polybench-syn/linear-algebra/solvers/lu.c +++ b/benchmarks/polybench-syn/linear-algebra/solvers/lu.c @@ -29,7 +29,7 @@ void init_array (int n, { for (j = 0; j <= i; plus(j)) A[i][j] = sdivider(smodulo(-j, n), n) + ONE; - for (j = plus(i); j < n; plus(j)) { + for (j = i+1; j < n; plus(j)) { A[i][j] = 0; } A[i][i] = 1; -- cgit From 38b249970456a55f0a69ff28070887367e113205 Mon Sep 17 00:00:00 2001 From: Nadesh Ramanathan Date: Tue, 17 Nov 2020 09:06:04 +0000 Subject: final checks reworked and including compilation time in script --- .../polybench-syn/linear-algebra/blas/gemm.c | 6 ++++ .../polybench-syn/linear-algebra/blas/gemver.c | 6 ++++ .../polybench-syn/linear-algebra/blas/gesummv.c | 3 ++ .../polybench-syn/linear-algebra/blas/symm.c | 6 ++++ .../polybench-syn/linear-algebra/blas/syr2k.c | 6 ++++ .../polybench-syn/linear-algebra/blas/syrk.c | 6 ++++ .../polybench-syn/linear-algebra/blas/trmm.c | 6 ++++ .../polybench-syn/linear-algebra/kernels/2mm.c | 7 +++++ .../polybench-syn/linear-algebra/kernels/3mm.c | 7 +++++ .../polybench-syn/linear-algebra/kernels/atas.c | 7 +++++ .../polybench-syn/linear-algebra/kernels/bicg.c | 7 +++++ .../polybench-syn/linear-algebra/kernels/doitgen.c | 7 +++++ .../polybench-syn/linear-algebra/kernels/mvt.c | 7 +++++ .../linear-algebra/solvers/cholesky.c | 8 +++++ .../polybench-syn/linear-algebra/solvers/lu.c | 34 +++++----------------- .../polybench-syn/linear-algebra/solvers/ludcmp.c | 9 +++++- 16 files changed, 104 insertions(+), 28 deletions(-) (limited to 'benchmarks/polybench-syn/linear-algebra') diff --git a/benchmarks/polybench-syn/linear-algebra/blas/gemm.c b/benchmarks/polybench-syn/linear-algebra/blas/gemm.c index a81f094..2c0aaf7 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/gemm.c +++ b/benchmarks/polybench-syn/linear-algebra/blas/gemm.c @@ -11,6 +11,9 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif #define plus(i) i = i + ONE static void init_array(int ni, int nj, int nk, @@ -50,6 +53,9 @@ int print_array(int ni, int nj, for (j = 0; j < nj; plus(j)) { res ^= C[i][j]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/blas/gemver.c b/benchmarks/polybench-syn/linear-algebra/blas/gemver.c index fafd49f..2f68871 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/gemver.c +++ b/benchmarks/polybench-syn/linear-algebra/blas/gemver.c @@ -11,6 +11,9 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif #define plus(i) i = i + ONE static void init_array (int n, @@ -63,6 +66,9 @@ int print_array(int n, for (i = 0; i < n; plus(i)) { res ^= w[i]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/blas/gesummv.c b/benchmarks/polybench-syn/linear-algebra/blas/gesummv.c index e9fe78e..c7d30f3 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/gesummv.c +++ b/benchmarks/polybench-syn/linear-algebra/blas/gesummv.c @@ -49,6 +49,9 @@ int print_array(int n, for (i = 0; i < n; plus(i)) { res ^= y[i]; } +#ifndef SYNTHESIS + printf("finished: %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/blas/symm.c b/benchmarks/polybench-syn/linear-algebra/blas/symm.c index f13577b..5e8fb1e 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/symm.c +++ b/benchmarks/polybench-syn/linear-algebra/blas/symm.c @@ -11,6 +11,9 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif #define plus(i) i = i + ONE static void init_array(int m, int n, @@ -51,6 +54,9 @@ int print_array(int m, int n, for (j = 0; j < n; plus(j)) { res ^= C[i][j]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/blas/syr2k.c b/benchmarks/polybench-syn/linear-algebra/blas/syr2k.c index 2214d4a..3366672 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/syr2k.c +++ b/benchmarks/polybench-syn/linear-algebra/blas/syr2k.c @@ -11,6 +11,9 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif #define plus(i) i = i + ONE static void init_array(int n, int m, @@ -51,6 +54,9 @@ int print_array(int n, for (j = 0; j < n; plus(j)) { res ^= C[i][j]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/blas/syrk.c b/benchmarks/polybench-syn/linear-algebra/blas/syrk.c index 3c792a0..4dd65a6 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/syrk.c +++ b/benchmarks/polybench-syn/linear-algebra/blas/syrk.c @@ -11,6 +11,9 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif #define plus(i) i = i + ONE static void init_array(int n, int m, @@ -45,6 +48,9 @@ int print_array(int n, for (j = 0; j < n; plus(j)) { res ^= C[i][j]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/blas/trmm.c b/benchmarks/polybench-syn/linear-algebra/blas/trmm.c index e369fd0..a14d131 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/trmm.c +++ b/benchmarks/polybench-syn/linear-algebra/blas/trmm.c @@ -11,6 +11,9 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif #define plus(i) i = i + ONE static void init_array(int m, int n, @@ -49,6 +52,9 @@ int print_array(int m, int n, for (j = 0; j < n; plus(j)) { res ^= B[i][j]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/2mm.c b/benchmarks/polybench-syn/linear-algebra/kernels/2mm.c index f5c5ff3..d8b79e2 100644 --- a/benchmarks/polybench-syn/linear-algebra/kernels/2mm.c +++ b/benchmarks/polybench-syn/linear-algebra/kernels/2mm.c @@ -12,6 +12,10 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif + #define plus(i) i = i + ONE static void init_array(int ni, int nj, int nk, int nl, @@ -52,6 +56,9 @@ int print_array(int ni, int nl, for (j = 0; j < nl; plus(j)) { res ^= D[i][j]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c b/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c index 2905719..60be3f8 100644 --- a/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c +++ b/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c @@ -12,6 +12,10 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif + #define plus(i) i = i + ONE static void init_array(int ni, int nj, int nk, int nl, int nm, @@ -52,6 +56,9 @@ int print_array(int ni, int nl, for (j = 0; j < nl; plus(j)) { res ^= G[i][j]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/atas.c b/benchmarks/polybench-syn/linear-algebra/kernels/atas.c index 7bd0151..c3173e4 100644 --- a/benchmarks/polybench-syn/linear-algebra/kernels/atas.c +++ b/benchmarks/polybench-syn/linear-algebra/kernels/atas.c @@ -11,6 +11,10 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif + #define plus(i) i = i + ONE static void init_array (int m, int n, @@ -42,6 +46,9 @@ int print_array(int n, for (i = 0; i < n; plus(i)) { res ^= y[i]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/bicg.c b/benchmarks/polybench-syn/linear-algebra/kernels/bicg.c index 5981924..3290f1b 100644 --- a/benchmarks/polybench-syn/linear-algebra/kernels/bicg.c +++ b/benchmarks/polybench-syn/linear-algebra/kernels/bicg.c @@ -12,6 +12,10 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif + #define plus(i) i = i + ONE static void init_array (int m, int n, @@ -50,6 +54,9 @@ int print_array(int m, int n, for (i = 0; i < n; plus(i)) { res ^= q[i]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/doitgen.c b/benchmarks/polybench-syn/linear-algebra/kernels/doitgen.c index 081a3ba..7a997f1 100644 --- a/benchmarks/polybench-syn/linear-algebra/kernels/doitgen.c +++ b/benchmarks/polybench-syn/linear-algebra/kernels/doitgen.c @@ -11,6 +11,10 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif + #define plus(i) i = i + ONE static void init_array(int nr, int nq, int np, @@ -43,6 +47,9 @@ int print_array(int nr, int nq, int np, for (k = 0; k < np; plus(k)) { res ^= A[i][j][k]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/mvt.c b/benchmarks/polybench-syn/linear-algebra/kernels/mvt.c index 7eb612e..f8822bb 100644 --- a/benchmarks/polybench-syn/linear-algebra/kernels/mvt.c +++ b/benchmarks/polybench-syn/linear-algebra/kernels/mvt.c @@ -11,6 +11,10 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS + #include +#endif + #define plus(i) i = i + ONE static @@ -56,6 +60,9 @@ int print_array(int n, for (i = 0; i < n; plus(i)) { res ^= x2[i]; } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/cholesky.c b/benchmarks/polybench-syn/linear-algebra/solvers/cholesky.c index 05e85ea..b43402b 100644 --- a/benchmarks/polybench-syn/linear-algebra/solvers/cholesky.c +++ b/benchmarks/polybench-syn/linear-algebra/solvers/cholesky.c @@ -11,6 +11,10 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS +#include +#endif + # define SQRT_FUN(x) sqrtf(x) #define plus(i) i = i + ONE @@ -63,6 +67,10 @@ int check_array(int n, for (j = 0; j <= i; plus(j)) { if(A[i][j]!=0) res = 1; } + #ifndef SYNTHESIS + printf("finished: %u\n", res); + #endif + return res; } diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/lu.c b/benchmarks/polybench-syn/linear-algebra/solvers/lu.c index a7ec246..1365f54 100644 --- a/benchmarks/polybench-syn/linear-algebra/solvers/lu.c +++ b/benchmarks/polybench-syn/linear-algebra/solvers/lu.c @@ -16,6 +16,10 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS +#include +#endif + #define plus(i) i = i + ONE static @@ -53,30 +57,6 @@ void init_array (int n, } - - -/* -static -void print_array(int n, - int A[ 40 + 0][40 + 0]) - -{ - int i, j; - - fprintf(stderr, "==BEGIN DUMP_ARRAYS==\n"); - fprintf(stderr, "begin dump: %s", "A"); - for (i = 0; i < n; i++) - for (j = 0; j < n; j++) { - if ((i * n + j) % 20 == 0) fprintf (stderr, "\n"); - fprintf (stderr, "%d ", A[i][j]); - } - fprintf(stderr, "\nend dump: %s\n", "A"); - fprintf(stderr, "==END DUMP_ARRAYS==\n"); -} -*/ - - - static void kernel_lu(int n, int A[ 40][40]) @@ -110,6 +90,9 @@ int check_array(int n, for (i = 0; i < n; plus(i)) for (j = 0; j < n; plus(j)) if(A[i][j] !=0) res = 1; + #ifndef SYNTHESIS + printf("finished: %u\n", res); + #endif return res; } @@ -126,11 +109,8 @@ int main() init_array (n, A); - - kernel_lu (n, A); - return check_array(n, A); return 0; diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/ludcmp.c b/benchmarks/polybench-syn/linear-algebra/solvers/ludcmp.c index f37d983..0f4522e 100644 --- a/benchmarks/polybench-syn/linear-algebra/solvers/ludcmp.c +++ b/benchmarks/polybench-syn/linear-algebra/solvers/ludcmp.c @@ -11,6 +11,10 @@ #include "../../include/misc.h" +#ifndef SYNTHESIS +#include +#endif + #define plus(i) i = i + ONE static @@ -71,8 +75,11 @@ int check_array(int n, int res = 0; for (i = 0; i < n; plus(i)) { - res += x[i]; + res ^= x[i]; } +#ifndef SYNTHESIS + printf("finished: %u\n", res); +#endif return res; } -- cgit