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

- old
+ new

@@ -6,20 +6,20 @@ // == More information on Bones // Contact............Cedric Nugteren <c.nugteren@tue.nl> // Web address........http://parse.ele.tue.nl/bones/ // // == File information -// Filename...........shared/example4.c +// Filename...........shared/example04.c // Author.............Cedric Nugteren -// Last modified on...16-April-2012 +// Last modified on...10-October-2014 // #include <stdio.h> #include <stdlib.h> #define SIZE 1024*1024 -// This is 'example4', demonstrating a basic 256-bin histogram computation +// This is 'example04', demonstrating a basic 256-bin histogram computation int main(void) { int i; unsigned char index; // Declare input/output arrays @@ -35,15 +35,17 @@ for (i=0;i<256;i++) { B[i] = 0; } // Perform the computation - #pragma species kernel 0:SIZE-1|element -> 0:255|shared + #pragma scop + #pragma species kernel A[0:SIZE-1]|element -> B[0:255]|shared for(i=0;i<SIZE;i++) { index = A[i]; B[index]++; } #pragma species endkernel example4 + #pragma endscop // Clean-up and exit the function free(A); fflush(stdout); return 0;