aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/polybench-syn/linear-algebra/kernels/mvt.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/mvt.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/mvt.c')
-rw-r--r--benchmarks/polybench-syn/linear-algebra/kernels/mvt.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/mvt.c b/benchmarks/polybench-syn/linear-algebra/kernels/mvt.c
index aa68b1c..7eb612e 100644
--- a/benchmarks/polybench-syn/linear-algebra/kernels/mvt.c
+++ b/benchmarks/polybench-syn/linear-algebra/kernels/mvt.c
@@ -9,6 +9,8 @@
*/
/* mvt.c: this file is part of PolyBench/C */
+#include "../../include/misc.h"
+
#define plus(i) i = i + ONE
static
@@ -24,23 +26,23 @@ void init_array(int n,
int THREE = 3;
for (i = 0; i < n; plus(i))
- {
- x1[i] = (int) (i % n) / n;
- x2[i] = (int) ((i + ONE) % n) / n;
- y_1[i] = (int) ((i + THREE) % n) / n;
- y_2[i] = (int) ((i + 4) % n) / n;
- for (j = 0; j < n; plus(j))
- A[i][j] = (int) (i*j % n) / n;
- }
+ {
+ x1[i] = (int) divider(smodulo(i, n), n);
+ x2[i] = (int) divider(smodulo(i + ONE, n), n);
+ y_1[i] = (int) divider(smodulo(i + THREE, n), n);
+ y_2[i] = (int) divider(smodulo(i + 4, n), n);
+ for (j = 0; j < n; plus(j))
+ A[i][j] = (int) divider(smodulo(i*j,n), n);
+ }
}
-static
+ static
int print_array(int n,
- int x1[ 40 + 0],
- int x2[ 40 + 0])
+ int x1[ 40 + 0],
+ int x2[ 40 + 0])
{
int i;
@@ -71,14 +73,12 @@ void kernel_mvt(int n,
int i, j;
int ONE = 1;
-#pragma scop
for (i = 0; i < n; plus(i))
for (j = 0; j < n; plus(j))
x1[i] = x1[i] + A[i][j] * y_1[j];
for (i = 0; i < n; plus(i))
for (j = 0; j < n; plus(j))
x2[i] = x2[i] + A[j][i] * y_2[j];
-#pragma endscop
}