diff options
author | Yann Herklotz <git@yannherklotz.com> | 2020-11-14 16:23:00 +0000 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2020-11-14 16:23:00 +0000 |
commit | 4201a38997543ceedad52f77b992dd8eb4a2ee5e (patch) | |
tree | 16b4adb28028e21f3ae9d46539167ece72c1c4a8 /benchmarks/polybench-syn/linear-algebra/kernels/2mm.c | |
parent | 43773b8d4a69dfd30759db2a5026a4f44cdac4cb (diff) | |
parent | 95861dbef966e2cb612b303615681fc29c3acd3d (diff) | |
download | vericert-kvx-4201a38997543ceedad52f77b992dd8eb4a2ee5e.tar.gz vericert-kvx-4201a38997543ceedad52f77b992dd8eb4a2ee5e.zip |
Merge branch 'dev-experiments'
Diffstat (limited to 'benchmarks/polybench-syn/linear-algebra/kernels/2mm.c')
-rw-r--r-- | benchmarks/polybench-syn/linear-algebra/kernels/2mm.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/2mm.c b/benchmarks/polybench-syn/linear-algebra/kernels/2mm.c index 391e9ac..f5c5ff3 100644 --- a/benchmarks/polybench-syn/linear-algebra/kernels/2mm.c +++ b/benchmarks/polybench-syn/linear-algebra/kernels/2mm.c @@ -10,6 +10,8 @@ /* 2mm.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, @@ -27,16 +29,16 @@ void init_array(int ni, int nj, int nk, int nl, *beta = 2; for (i = 0; i < ni; plus(i)) for (j = 0; j < nk; plus(j)) - A[i][j] = (int) ((i*j+ONE) % ni) / ni; + A[i][j] = (int) divider(smodulo(i*j+ONE, ni), ni); for (i = 0; i < nk; plus(i)) for (j = 0; j < nj; plus(j)) - B[i][j] = (int) (i*(j+ONE) % nj) / nj; + B[i][j] = (int) divider(smodulo(i*(j+ONE), nj), nj); for (i = 0; i < nj; plus(i)) for (j = 0; j < nl; plus(j)) - C[i][j] = (int) ((i*(j+ONE+ONE+ONE)+ONE) % nl) / nl; + C[i][j] = (int) divider(smodulo(i*(j+ONE+ONE+ONE)+ONE, nl), nl); for (i = 0; i < ni; plus(i)) for (j = 0; j < nl; plus(j)) - D[i][j] = (int) (i*(j+ONE+ONE) % nk) / nk; + D[i][j] = (int) divider(smodulo(i*(j+ONE+ONE), nk), nk); } static @@ -69,8 +71,6 @@ void kernel_2mm(int ni, int nj, int nk, int nl, int ONE = 1; int i, j, k; -#pragma scop - for (i = 0; i < ni; plus(i)) for (j = 0; j < nj; plus(j)) { @@ -85,7 +85,6 @@ void kernel_2mm(int ni, int nj, int nk, int nl, for (k = 0; k < nj; plus(k)) D[i][j] += tmp[i][k] * C[k][j]; } -#pragma endscop } |