patch for stencil example

This commit is contained in:
Evghenii
2014-01-13 08:50:21 +01:00
parent 8190869714
commit 8f17468fa3
3 changed files with 11 additions and 5 deletions

View File

@@ -22,7 +22,7 @@ stencil_step( int x0, int x1,
const int x = xb + programIndex;
int index = (z * Nxy) + (y * Nx) + x;
#define A_cur(x, y, z) __ldg(&Ain[index + (x) + ((y) * Nx) + ((z) * Nxy)])
#define A_cur(x, y, z) *(&Ain[index + (x) + ((y) * Nx) + ((z) * Nxy)])
#define A_next(x, y, z) Aout[index + (x) + ((y) * Nx) + ((z) * Nxy)]
double div =
coef0 * A_cur(0, 0, 0) +
@@ -38,7 +38,7 @@ stencil_step( int x0, int x1,
if (x < x1)
A_next(0, 0, 0) = 2.0 * A_cur(0, 0, 0) - A_next(0, 0, 0) +
__ldg(&vsq[index]) * div;
*(&vsq[index]) * div;
}
}