examples/fusion/example02.c in bones-compiler-1.3.1 vs examples/fusion/example02.c in bones-compiler-1.6.0
- old
+ new
@@ -8,11 +8,11 @@
// Web address........http://parse.ele.tue.nl/bones/
//
// == File information
// Filename...........fusion/example02.c
// Author.............Cedric Nugteren
-// Last modified on...09-July-2013
+// Last modified on...11-October-2014
//
#include <stdio.h>
#define N 2048
#define M 512
@@ -33,10 +33,11 @@
A[i][j] = i+j;
}
}
// Perform the computation
+ #pragma scop
#pragma species kernel A[0:N-1,10:M-1]|element -> B[0:N-1,10:M-1]|element
for(i=0;i<N;i++) {
for(j=10;j<M;j++) {
B[i][j] = A[i][j] + 3;
}
@@ -47,24 +48,10 @@
for(j=0;j<M;j++) {
C[i][j] = -9*A[i][j];
}
}
#pragma species endkernel example02-part2
-
- /*
- #pragma species kernel A[0:N-1,0:M-1]|element -> B[0:N-1,0:M-1]|element ^ C[0:N-1,0:M-1]|element
- for(i=0;i<MAX(N,M);i++) {
- for(j=0;j<M;j++) {
- if (j >= 10 && i < N) {
- B[i][j] = A[i][j] + 3;
- }
- if (i < M) {
- C[i][j] = -9*A[i][j];
- }
- }
- }
- #pragma species endkernel example02-fused
- */
+ #pragma endscop
// Clean-up and exit the function
fflush(stdout);
C[8][9] = C[8][9];
return 0;