diff options
author | Nadesh Ramanathan <nadeshramanathan88@gmail.com> | 2020-11-11 19:47:42 +0000 |
---|---|---|
committer | Nadesh Ramanathan <nadeshramanathan88@gmail.com> | 2020-11-11 19:47:42 +0000 |
commit | 95861dbef966e2cb612b303615681fc29c3acd3d (patch) | |
tree | e3bff372bdb4b769ec6fb54077e30bda406ef9ee /benchmarks/polybench-syn/linear-algebra/blas/trmm.c | |
parent | 47bad8cabe00a40723ce04852d02e7527473f3c3 (diff) | |
download | vericert-95861dbef966e2cb612b303615681fc29c3acd3d.tar.gz vericert-95861dbef966e2cb612b303615681fc29c3acd3d.zip |
polybench edits
Diffstat (limited to 'benchmarks/polybench-syn/linear-algebra/blas/trmm.c')
-rw-r--r-- | benchmarks/polybench-syn/linear-algebra/blas/trmm.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/benchmarks/polybench-syn/linear-algebra/blas/trmm.c b/benchmarks/polybench-syn/linear-algebra/blas/trmm.c index 79b384d..e369fd0 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/trmm.c +++ b/benchmarks/polybench-syn/linear-algebra/blas/trmm.c @@ -9,13 +9,14 @@ */ /* trmm.c: this file is part of PolyBench/C */ +#include "../../include/misc.h" #define plus(i) i = i + ONE -static + static void init_array(int m, int n, - int *alpha, - int A[ 20 + 0][20 + 0], - int B[ 20 + 0][30 + 0]) + int *alpha, + int A[ 20 + 0][20 + 0], + int B[ 20 + 0][30 + 0]) { int i, j; int ONE = 1; @@ -23,22 +24,22 @@ void init_array(int m, int n, *alpha = 3; for (i = 0; i < m; plus(i)) { for (j = 0; j < i; plus(j)) { - A[i][j] = (int)((i+j) % m)/m; + A[i][j] = (int) divider(smodulo(i+j, m), m); } A[i][i] = 1; for (j = 0; j < n; plus(j)) { - B[i][j] = (int)((n+(i-j)) % n)/n; + B[i][j] = (int)divider(smodulo(n+i-j, n), n); } - } + } } -static + static int print_array(int m, int n, - int B[ 20 + 0][30 + 0]) + int B[ 20 + 0][30 + 0]) { int i, j; int ONE = 1; @@ -48,28 +49,26 @@ int print_array(int m, int n, for (j = 0; j < n; plus(j)) { res ^= B[i][j]; } - return res; + return res; } -static + static void kernel_trmm(int m, int n, - int alpha, - int A[ 20 + 0][20 + 0], - int B[ 20 + 0][30 + 0]) + int alpha, + int A[ 20 + 0][20 + 0], + int B[ 20 + 0][30 + 0]) { int i, j, k; int ONE = 1; -#pragma scop - for (i = 0; i < m; plus(i)) - for (j = 0; j < n; plus(j)) { - for (k = i+ONE; k < m; plus(k)) - B[i][j] += A[k][i] * B[k][j]; - B[i][j] = alpha * B[i][j]; - } -#pragma endscop + for (i = 0; i < m; plus(i)) + for (j = 0; j < n; plus(j)) { + for (k = i+ONE; k < m; plus(k)) + B[i][j] += A[k][i] * B[k][j]; + B[i][j] = alpha * B[i][j]; + } } |