patch for stencil example
This commit is contained in:
@@ -2,7 +2,7 @@ PROG=stencil
|
||||
ISPC_SRC=stencil.ispc
|
||||
CU_SRC=stencil.cu
|
||||
CXX_SRC=stencil.cpp stencil_serial.cpp
|
||||
PTXCC_REGMAX=128
|
||||
PTXCC_REGMAX=92
|
||||
|
||||
LLVM_GPU=1
|
||||
NVVM_GPU=1
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,9 +100,15 @@ stencil_step(uniform int x0, uniform int x1,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __NVPTX__
|
||||
#define SPANX 32
|
||||
#define SPANY 2
|
||||
#define SPANZ 4
|
||||
#define SPANY 4
|
||||
#define SPANZ 8
|
||||
#else
|
||||
#define SPANX 64
|
||||
#define SPANY 4
|
||||
#define SPANZ 8
|
||||
#endif
|
||||
|
||||
static task void
|
||||
stencil_step_task(uniform int x0, uniform int x1,
|
||||
|
||||
Reference in New Issue
Block a user