examples/benchmarks/PolyBench/jacobi-1d-imper.c in bones-compiler-1.3.1 vs examples/benchmarks/PolyBench/jacobi-1d-imper.c in bones-compiler-1.6.0
- old
+ new
@@ -41,11 +41,13 @@
*/
// Perform the computation
#pragma scop
for (t=0; t<TSTEPS; t++) {
#pragma species kernel 1:LARGE_N-2|neighbourhood(-1:1) -> 1:LARGE_N-2|element
- for (i=1; i<LARGE_N-1; i++) {
- B[i] = 0.33333 * (A[i-1] + A[i] + A[i+1]);
+ for (i=0; i<LARGE_N; i++) {
+ if (i > 0 && i < LARGE_N-1) {
+ B[i] = 0.33333 * (A[i-1] + A[i] + A[i+1]);
+ }
}
#pragma species endkernel jacobi-1d-imper-part1
#pragma species kernel 1:LARGE_N-2|element -> 1:LARGE_N-2|element
for (j=1; j<LARGE_N-1; j++) {
A[j] = B[j];