From 045c0dc29fc31a8d3f15da8b3130dbc4706ea581 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Thu, 13 Aug 2020 23:24:40 +0100 Subject: Add modified polybench benchmarks --- .../polybench-syn/linear-algebra/solvers/trisolv.c | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c (limited to 'benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c') diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c b/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c new file mode 100644 index 0000000..5e760e6 --- /dev/null +++ b/benchmarks/polybench-syn/linear-algebra/solvers/trisolv.c @@ -0,0 +1,89 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* trisolv.c: this file is part of PolyBench/C */ + +#define plus(i) i = i + ONE +static +void init_array(int n, + int L[ 40 ][40 ], + int x[ 40 ], + int b[ 40 ]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < n; plus(i)) + { + x[i] = - 999; + b[i] = i ; + for (j = 0; j <= i; plus(j)) + L[i][j] = (int) (i+n-j+ONE)*(ONE+ONE)/n; + } +} + + + + +static +int check_array(int n, + int x[ 40]) + +{ + int i; + int res = 0; + int ONE = 1; + for (i = 0; i < n; plus(i)) { + res += x[i]; + } + return res; +} + + + + +static +void kernel_trisolv(int n, + int L[ 40 + 0][40 + 0], + int x[ 40 + 0], + int b[ 40 + 0]) +{ + int i, j; + int ONE = 1; + +#pragma scop + for (i = 0; i < n; plus(i)) + { + x[i] = b[i]; + for (j = 0; j