aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-10-18 22:49:10 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-10-18 22:49:10 +0200
commit996a2e5bbc4826d95144b62f5218b6e3e1e7d881 (patch)
tree55a5136c68e7d0f7a304913f28d0a761d9facd9a /test/monniaux
parent8c3a2bdb56eba8d8bc5e359b01a320916eac85f0 (diff)
parenta2f31f2b886ccb9656a019db1780aabc1789368a (diff)
downloadcompcert-kvx-996a2e5bbc4826d95144b62f5218b6e3e1e7d881.tar.gz
compcert-kvx-996a2e5bbc4826d95144b62f5218b6e3e1e7d881.zip
Merge remote-tracking branch 'origin/kvx-work' into kvx-test-prepass
Diffstat (limited to 'test/monniaux')
-rw-r--r--test/monniaux/loop_nest/syrk.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/monniaux/loop_nest/syrk.c b/test/monniaux/loop_nest/syrk.c
new file mode 100644
index 00000000..490d0a01
--- /dev/null
+++ b/test/monniaux/loop_nest/syrk.c
@@ -0,0 +1,28 @@
+/* Include polybench common header. */
+#include "polybench.h"
+
+/* Include benchmark-specific header. */
+/* Default data type is double, default size is 4000. */
+#include "syrk.h"
+
+/* Main computational kernel. The whole function will be timed,
+ including the call and return. */
+void kernel_syrk(int ni, int nj,
+ DATA_TYPE alpha,
+ DATA_TYPE beta,
+ DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni),
+ DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj))
+{
+ int i, j, k;
+
+ /* C := alpha*A*A' + beta*C */
+#if 0
+ for (i = 0; i < _PB_NI; i++)
+ for (j = 0; j < _PB_NI; j++)
+ C[i][j] *= beta;
+#endif
+ for (i = 0; i < _PB_NI; i++)
+ for (j = 0; j < _PB_NI; j++)
+ for (k = 0; k < _PB_NJ; k++)
+ C[i][j] += alpha * A[i][k] * A[j][k];
+}