From a76d23b77127fa439d7c5c60d322f355cf80c4c9 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Fri, 16 Oct 2020 10:44:58 +0200 Subject: extracted from Polybench syrk --- test/monniaux/loop_nest/syrk.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/monniaux/loop_nest/syrk.c (limited to 'test/monniaux/loop_nest') 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]; +} -- cgit