examples/shared/example01.c in bones-compiler-1.3.1 vs examples/shared/example01.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/example1.c
+// Filename...........shared/example01.c
// Author.............Cedric Nugteren
-// Last modified on...16-April-2012
+// Last modified on...10-October-2014
//
#include <stdio.h>
#include <stdlib.h>
#define SIZE 512*1024
-// This is 'example1', a basic associative and commutative reduction to scalar
+// This is 'example01', a basic associative and commutative reduction to scalar
int main(void) {
int i;
// Declare input/output arrays
int *A = (int *)malloc(SIZE*sizeof(int));
@@ -30,14 +30,16 @@
A[i] = 1;
}
// Perform the computation
B[0] = 0;
- #pragma species kernel 0:SIZE-1|element -> 0:0|shared
+ #pragma scop
+ #pragma species kernel A[0:SIZE-1]|element -> B[0:0]|shared
for(i=0;i<SIZE;i++) {
B[0] = B[0] + A[i];
}
#pragma species endkernel example1
+ #pragma endscop
// Clean-up and exit the function
fflush(stdout);
return 0;
}