aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-10-16 12:41:00 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-10-16 12:41:00 +0200
commitb6dcf1d6881470eaf6b1163ceac8aa94e221b084 (patch)
tree10a0f1335ea3064bf44e292c0c0c818e1e28e3f9 /test
parent0471c08b0aabf48f80a3b20939cff5a864149d88 (diff)
parent72c683787a7b1a902e019a3ace324809a7585314 (diff)
downloadcompcert-kvx-b6dcf1d6881470eaf6b1163ceac8aa94e221b084.tar.gz
compcert-kvx-b6dcf1d6881470eaf6b1163ceac8aa94e221b084.zip
Merge remote-tracking branch 'origin/kvx-work-unroll-fixcse3' into kvx-work
Diffstat (limited to 'test')
-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];
+}