diff --git a/examples_ptx/nbody/nbody.cu b/examples_ptx/nbody/nbody.cu index 4a711882..6f062dc5 100644 --- a/examples_ptx/nbody/nbody.cu +++ b/examples_ptx/nbody/nbody.cu @@ -42,7 +42,7 @@ void closeNbody() static inline __device__ real rsqrt_real(real r2) { -#if 1 +#if 0 return r2> (real)0.0 ? (real)1.0/sqrt(r2) : 0; #else return r2> (real)0.0 ? rsqrt((float)r2) : 0; diff --git a/examples_ptx/nbody/nbody.ispc b/examples_ptx/nbody/nbody.ispc index f1d4b22f..802f55d0 100644 --- a/examples_ptx/nbody/nbody.ispc +++ b/examples_ptx/nbody/nbody.ispc @@ -29,7 +29,7 @@ void closeNbody() static inline real rsqrt_real(real r2) { -#if 1 +#if 0 return r2> (real)0.0 ? (real)1.0d0/sqrt(r2) : 0; #else return r2> (real)0.0 ? rsqrt((float)r2) : 0; @@ -114,7 +114,7 @@ void computeForces( const real dy = jposy - iposy; const real dz = jposz - iposz; const real r2 = dx*dx + dy*dy + dz*dz; -#if 0 /* faster */ +#if 0 /* faster when used with full dp */ const real rinv = r2> (real)0.0 ? (real)1.0d0/sqrt(r2) : 0; #else const real rinv = rsqrt_real(r2);