examples/chunk/example03.c in bones-compiler-1.3.1 vs examples/chunk/example03.c in bones-compiler-1.6.0
- old
+ new
@@ -6,21 +6,21 @@
// == More information on Bones
// Contact............Cedric Nugteren <c.nugteren@tue.nl>
// Web address........http://parse.ele.tue.nl/bones/
//
// == File information
-// Filename...........chunk/example3.c
+// Filename...........chunk/example03.c
// Author.............Cedric Nugteren
-// Last modified on...16-April-2012
+// Last modified on...10-October-2014
//
#include <stdio.h>
#define BASE 2048
#define TILE 64
#define SIZE (BASE*TILE)
-// This is 'example3', demonstrating a chunked input and a chunked output, and showing the importance of ordering (array referenced first should be placed first)
+// This is 'example03', demonstrating a chunked input and a chunked output, and showing the importance of ordering (array referenced first should be placed first)
int main(void) {
int i;
int t = 0;
float result = 0;
@@ -37,11 +37,12 @@
for(i=0;i<SIZE;i++) {
B[i] = i%6+i;
}
// Perform the computation
- #pragma species kernel 0:BASE-1|element ^ 0:SIZE-1|chunk(0:TILE-1) -> 0:SIZE-1|chunk(0:TILE-1) ^ 0:SIZE-1|chunk(0:TILE-1)
+ #pragma scop
+ #pragma species kernel A[0:BASE-1]|element ^ B[0:SIZE-1]|chunk(0:TILE-1) -> out1[0:SIZE-1]|chunk(0:TILE-1) ^ out2[0:SIZE-1]|chunk(0:TILE-1)
for(i=0;i<BASE;i++) {
result = A[i];
for(t=0;t<TILE;t++) {
result = result + t*B[i*TILE+t];
}
@@ -49,9 +50,10 @@
out1[i*TILE+t] = result;
out2[i*TILE+t] = -result;
}
}
#pragma species endkernel example3
+ #pragma endscop
// Clean-up and exit the function
fflush(stdout);
return 0;
}