aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-11-14 16:23:00 +0000
committerYann Herklotz <git@yannherklotz.com>2020-11-14 16:23:00 +0000
commit4201a38997543ceedad52f77b992dd8eb4a2ee5e (patch)
tree16b4adb28028e21f3ae9d46539167ece72c1c4a8 /benchmarks/polybench-syn/linear-algebra/kernels/3mm.c
parent43773b8d4a69dfd30759db2a5026a4f44cdac4cb (diff)
parent95861dbef966e2cb612b303615681fc29c3acd3d (diff)
downloadvericert-kvx-4201a38997543ceedad52f77b992dd8eb4a2ee5e.tar.gz
vericert-kvx-4201a38997543ceedad52f77b992dd8eb4a2ee5e.zip
Merge branch 'dev-experiments'
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()
{