examples/fusion/example03.c in bones-compiler-1.3.1 vs examples/fusion/example03.c in bones-compiler-1.6.0
- old
+ new
@@ -8,11 +8,11 @@
// Web address........http://parse.ele.tue.nl/bones/
//
// == File information
// Filename...........fusion/example03.c
// Author.............Cedric Nugteren
-// Last modified on...02-Oct-2013
+// Last modified on...11-October-2014
//
#include <stdio.h>
// This is 'example03', with code similar to PolyBench's "2mm" benchmark. This is an example where fusion is only legal w.r.t. the i-loop
@@ -35,10 +35,11 @@
for (i=0; i<2048; i++) { for (j=0; j<2048; j++) { B[i][j] = ((float) i*(j+1)) / 2048; } }
for (i=0; i<2048; i++) { for (j=0; j<2048; j++) { C[i][j] = ((float) i*(j+3)) / 2048; } }
for (i=0; i<2048; i++) { for (j=0; j<2048; j++) { D[i][j] = ((float) i*(j+2)) / 2048; } }
// Perform the computation (E := alpha*A*B*C + beta*D)
+ #pragma scop
#pragma species copyin A[0:2047,0:2047]|0 ^ B[0:2047,0:2047]|0 ^ D[0:2047,0:2047]|1 ^ C[0:2047,0:2047]|1
#pragma species sync 0
#pragma species kernel A[0:2047,0:2047]|chunk(0:0,0:2047) ^ B[0:2047,0:2047]|chunk(0:2047,0:0) -> tmp[0:2047,0:2047]|element
for (i=0; i<2048; i++) {
for (j=0; j<2048; j++) {
@@ -61,9 +62,10 @@
}
}
#pragma species endkernel example03-part2
#pragma species copyout D[0:2047,0:2047]|2
#pragma species sync 2
+ #pragma endscop
// Clean-up and exit the function
fflush(stdout);
D[8][9] = D[8][9];
return 0;