aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/polybench-syn/linear-algebra/solvers/durbin.c3
-rw-r--r--benchmarks/polybench-syn/linear-algebra/solvers/lu.c38
-rw-r--r--benchmarks/polybench-syn/stencils/fdtd-2d.c5
3 files changed, 25 insertions, 21 deletions
diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/durbin.c b/benchmarks/polybench-syn/linear-algebra/solvers/durbin.c
index 4b1a87f..b51adca 100644
--- a/benchmarks/polybench-syn/linear-algebra/solvers/durbin.c
+++ b/benchmarks/polybench-syn/linear-algebra/solvers/durbin.c
@@ -11,7 +11,7 @@
#ifndef SYNTHESIS
#include <stdio.h>
-#endif
+#endif
unsigned int divider(unsigned int x, unsigned int y)
{
@@ -112,7 +112,6 @@ void kernel_durbin(int n,
sum += r[k-i-ONE]*y[i];
}
alpha = - sdivider(r[k] + sum, beta);
- //alpha = - (r[k] + sum) / beta;
for (i=0; i<k; plus(i)) {
z[i] = y[i] + alpha*y[k-i-ONE];
diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/lu.c b/benchmarks/polybench-syn/linear-algebra/solvers/lu.c
index 1365f54..759d6ff 100644
--- a/benchmarks/polybench-syn/linear-algebra/solvers/lu.c
+++ b/benchmarks/polybench-syn/linear-algebra/solvers/lu.c
@@ -13,6 +13,7 @@
//#include <unistd.h>
//#include <string.h>
//#include <math.h>
+#include <stdio.h>
#include "../../include/misc.h"
@@ -24,9 +25,8 @@
static
void init_array (int n,
- int A[40][40])
+ int A[40][40])
{
- int ONE = 1;
int i, j;
for (i = 0; i < n; plus(i))
@@ -38,6 +38,8 @@ void init_array (int n,
}
A[i][i] = 1;
}
+ A[i][i] = 1;
+ }
@@ -49,39 +51,40 @@ void init_array (int n,
for (t = 0; t < n; plus(t))
for (r = 0; r < n; plus(r))
for (s = 0; s < n; plus(s))
- B[r][s] += A[r][t] * A[s][t];
- for (r = 0; r < n; plus(r))
- for (s = 0; s < n; plus(s))
- A[r][s] = B[r][s];
+ B[r][s] += A[r][t] * A[s][t];
+ for (r = 0; r < n; plus(r))
+ for (s = 0; s < n; plus(s))
+ A[r][s] = B[r][s];
//free((void*)B);;
}
+
static
void kernel_lu(int n,
- int A[ 40][40])
+ int A[ 40][40])
{
int i, j, k;
int ONE = 1;
- for (i = 0; i < n; plus(i)) {
+ 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] = sdivider(A[i][j], A[j][j]);
+ for (k = 0; k < j; plus(k)) {
+ A[i][j] -= A[i][k] * A[k][j];
+ }
+ A[i][j] = A[i][j] / A[j][j];
}
- for (j = i; j < n; plus(j)) {
- for (k = 0; k < i; plus(k)) {
- A[i][j] -= A[i][k] * A[k][j];
- }
+ for (j = i; j < n; plus(j)) {
+ for (k = 0; k < i; plus(k)) {
+ A[i][j] -= A[i][k] * A[k][j];
+ }
}
}
}
static
int check_array(int n,
- int A[40][40])
+ int A[40][40])
{
int res = 0;
int i, j;
@@ -112,7 +115,6 @@ int main()
kernel_lu (n, A);
return check_array(n, A);
- return 0;
//free((void*)A);;
}
diff --git a/benchmarks/polybench-syn/stencils/fdtd-2d.c b/benchmarks/polybench-syn/stencils/fdtd-2d.c
index c29982e..d92183e 100644
--- a/benchmarks/polybench-syn/stencils/fdtd-2d.c
+++ b/benchmarks/polybench-syn/stencils/fdtd-2d.c
@@ -9,6 +9,9 @@
*/
/* fdtd-2d.c: this file is part of PolyBench/C */
+#ifndef SYNTHESIS
+#include <stdio.h>
+#endif
#ifndef SYNTHESIS
#include <stdio.h>
@@ -70,7 +73,7 @@ int print_array(int nx,
}
#ifndef SYNTHESIS
- printf("finished %u\n", res);
+ printf("finished: %u\n", res);
#endif
return res;