examples/shared/example02.c in bones-compiler-1.3.1 vs examples/shared/example02.c in bones-compiler-1.6.0

- old
+ new

@@ -6,18 +6,18 @@ // == More information on Bones // Contact............Cedric Nugteren <c.nugteren@tue.nl> // Web address........http://parse.ele.tue.nl/bones/ // // == File information -// Filename...........shared/example2.c +// Filename...........shared/example02.c // Author.............Cedric Nugteren -// Last modified on...09-May-2012 +// Last modified on...10-October-2014 // #include <stdio.h> -// This is 'example2', demonstrating a 3D input reduction to scalar +// This is 'example02', demonstrating a 3D input reduction to scalar int main(void) { int a,b,c; // Declare input/output arrays float in[8][16][32]; @@ -32,18 +32,20 @@ } } // Perform the computation out[0] = 0; - #pragma species kernel 0:7,0:15,0:31|element -> 0:0|shared + #pragma scop + #pragma species kernel in[0:7,0:15,0:31]|element -> out[0:0]|shared for(a=0;a<8;a++) { for(b=0;b<16;b++) { for(c=0;c<32;c++) { out[0] = out[0] + in[a][b][c]; } } } #pragma species endkernel example2 + #pragma endscop // Clean-up and exit the function fflush(stdout); return 0; }