aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c
diff options
context:
space:
mode:
authorNadesh Ramanathan <nadeshramanathan88@gmail.com>2020-11-11 19:47:42 +0000
committerNadesh Ramanathan <nadeshramanathan88@gmail.com>2020-11-11 19:47:42 +0000
commit95861dbef966e2cb612b303615681fc29c3acd3d (patch)
treee3bff372bdb4b769ec6fb54077e30bda406ef9ee /benchmarks/polybench-syn/linear-algebra/kernels/3mm.c
parent47bad8cabe00a40723ce04852d02e7527473f3c3 (diff)
downloadvericert-kvx-95861dbef966e2cb612b303615681fc29c3acd3d.tar.gz
vericert-kvx-95861dbef966e2cb612b303615681fc29c3acd3d.zip
polybench edits
Diffstat (limited to 'benchmarks/polybench-syn/linear-algebra/kernels/3mm.c')
-rw-r--r--benchmarks/polybench-syn/linear-algebra/kernels/3mm.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c b/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c
index e565fb5..2905719 100644
--- a/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c
+++ b/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c
@@ -9,6 +9,9 @@
*/
/* 3mm.c: this file is part of PolyBench/C */
+
+#include "../../include/misc.h"
+
#define plus(i) i = i + ONE
static
void init_array(int ni, int nj, int nk, int nl, int nm,
@@ -21,25 +24,22 @@ void init_array(int ni, int nj, int nk, int nl, int nm,
int ONE = 1;
int TWO = 2;
int THREE = 3;
- int FIVE = 5;
for (i = 0; i < ni; plus(i))
for (j = 0; j < nk; plus(j))
- A[i][j] = (int) ((i*j+ONE) % ni) / (5*ni);
+ A[i][j] = (int) divider(smodulo((i*j+ONE), ni), (5*ni));
for (i = 0; i < nk; plus(i))
for (j = 0; j < nj; plus(j))
- B[i][j] = (int) ((i*(j+ONE)+TWO) % nj) / (5*nj);
+ B[i][j] = (int) divider(smodulo((i*(j+ONE)+TWO),nj), (5*nj));
for (i = 0; i < nj; plus(i))
for (j = 0; j < nm; plus(j))
- C[i][j] = (int) (i*(j+THREE) % nl) / (5*nl);
+ C[i][j] = (int) divider(smodulo(i*(j+THREE), nl), (5*nl));
for (i = 0; i < nm; plus(i))
for (j = 0; j < nl; plus(j))
- D[i][j] = (int) ((i*(j+TWO)+TWO) % nk) / (5*nk);
+ D[i][j] = (int) divider(smodulo((i*(j+TWO)+TWO), nk), (5*nk));
}
-
-
static
int print_array(int ni, int nl,
int G[ 16 + 0][22 + 0])
@@ -71,8 +71,6 @@ void kernel_3mm(int ni, int nj, int nk, int nl, int nm,
int ONE = 1;
int i, j, k;
-#pragma scop
-
for (i = 0; i < ni; plus(i))
for (j = 0; j < nj; plus(j))
{
@@ -96,11 +94,9 @@ void kernel_3mm(int ni, int nj, int nk, int nl, int nm,
for (k = 0; k < nj; plus(k))
G[i][j] += E[i][k] * F[k][j];
}
-#pragma endscop
}
-
int main()
{