This commit is contained in:
Evghenii
2014-02-02 19:04:26 +01:00
parent 6d034596d3
commit e6a6df1052
2 changed files with 3 additions and 3 deletions

View File

@@ -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;

View File

@@ -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);