From a5e65a6adc567c12f317c6a0cfd252c97365dbc5 Mon Sep 17 00:00:00 2001 From: Nadesh Ramanathan Date: Tue, 10 Nov 2020 19:47:28 +0000 Subject: fixing gemver --- benchmarks/polybench-syn/linear-algebra/blas/gemver.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'benchmarks/polybench-syn/linear-algebra/blas/gemver.c') diff --git a/benchmarks/polybench-syn/linear-algebra/blas/gemver.c b/benchmarks/polybench-syn/linear-algebra/blas/gemver.c index a2711cb..5b627d1 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/gemver.c +++ b/benchmarks/polybench-syn/linear-algebra/blas/gemver.c @@ -9,6 +9,8 @@ */ /* gemver.c: this file is part of PolyBench/C */ +#include "../../include/misc.h" + #define plus(i) i = i + ONE static void init_array (int n, @@ -35,15 +37,15 @@ void init_array (int n, for (i = 0; i < n; plus(i)) { u1[i] = i; - u2[i] = ((i+ONE)/fn)/2; - v1[i] = ((i+ONE)/fn)/4; - v2[i] = ((i+ONE)/fn)/6; - y[i] = ((i+ONE)/fn)/8; - z[i] = ((i+ONE)/fn)/9; + u2[i] = sdivider(((i+ONE)/fn),2); + v1[i] = sdivider(((i+ONE)/fn),4); + v2[i] = sdivider(((i+ONE)/fn),6); + y[i] = sdivider(((i+ONE)/fn),8); + z[i] = sdivider(((i+ONE)/fn),9); x[i] = 0; w[i] = 0; for (j = 0; j < n; plus(j)) - A[i][j] = (int) (i*j % n) / n; + A[i][j] = (int) sdivider(smodulo(i*j, n), n); } } -- cgit From 95861dbef966e2cb612b303615681fc29c3acd3d Mon Sep 17 00:00:00 2001 From: Nadesh Ramanathan Date: Wed, 11 Nov 2020 19:47:42 +0000 Subject: polybench edits --- benchmarks/polybench-syn/linear-algebra/blas/gemver.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'benchmarks/polybench-syn/linear-algebra/blas/gemver.c') diff --git a/benchmarks/polybench-syn/linear-algebra/blas/gemver.c b/benchmarks/polybench-syn/linear-algebra/blas/gemver.c index 5b627d1..fafd49f 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/gemver.c +++ b/benchmarks/polybench-syn/linear-algebra/blas/gemver.c @@ -37,15 +37,15 @@ void init_array (int n, for (i = 0; i < n; plus(i)) { u1[i] = i; - u2[i] = sdivider(((i+ONE)/fn),2); - v1[i] = sdivider(((i+ONE)/fn),4); - v2[i] = sdivider(((i+ONE)/fn),6); - y[i] = sdivider(((i+ONE)/fn),8); - z[i] = sdivider(((i+ONE)/fn),9); + u2[i] = divider((i+ONE),fn*2); + v1[i] = divider((i+ONE),fn*4); + v2[i] = divider((i+ONE),fn*6); + y[i] = divider((i+ONE),fn*8); + z[i] = divider((i+ONE),fn*9); x[i] = 0; w[i] = 0; for (j = 0; j < n; plus(j)) - A[i][j] = (int) sdivider(smodulo(i*j, n), n); + A[i][j] = (int) divider(smodulo(i*j, n), n); } } @@ -86,8 +86,6 @@ void kernel_gemver(int n, int i, j; int ONE = 1; -#pragma scop - for (i = 0; i < n; plus(i)) for (j = 0; j < n; plus(j)) A[i][j] = A[i][j] + u1[i] * v1[j] + u2[i] * v2[j]; @@ -103,7 +101,6 @@ void kernel_gemver(int n, for (j = 0; j < n; plus(j)) w[i] = w[i] + alpha * A[i][j] * x[j]; -#pragma endscop } -- cgit