examples/shared/example03.c in bones-compiler-1.3.1 vs examples/shared/example03.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/example3.c
+// Filename...........shared/example03.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
-// This is 'example3', demonstrating a reduction to a 2D array
+// This is 'example03', demonstrating a reduction to a 2D array
int main(void) {
int i,p,q;
int index1,index2;
// Declare input/output arrays
@@ -37,16 +37,18 @@
B[p][q] = 0;
}
}
// Perform the computation
- #pragma species kernel 0:SIZE-1|element -> 0:19,0:9|shared
+ #pragma scop
+ #pragma species kernel in[0:SIZE-1]|element -> B[0:19,0:9]|shared
for(i=0;i<SIZE;i++) {
index1 = in[i]%20;
index2 = in[i]%10;
B[index1][index2] = B[index1][index2] + 1;
}
#pragma species endkernel example3
+ #pragma endscop
// Clean-up and exit the function
free(in);
fflush(stdout);
return 0;