Replace __float2int_rn with __float2int_rd so that it gives the same answer as static_cast<int>

This commit is contained in:
Nguyen
2011-11-16 09:45:42 -05:00
parent 0fd91e084e
commit 64ec9a8cd0
2 changed files with 2 additions and 6 deletions

View File

@ -77,7 +77,7 @@ __kernel void kernel_pair(__global numtyp4 *x_, __global numtyp *fp_,
if (rsq<cutforcesq) {
numtyp r = ucl_sqrt(rsq);
numtyp p = r*rdr + (numtyp)1.0;
int m=__float2int_rn(p);
int m=__float2int_rd(p);
m = MIN(m,nr-1);
p -= m;
p = MIN(p,(numtyp)1.0);
@ -192,7 +192,7 @@ __kernel void kernel_pair_fast(__global numtyp4 *x_, __global numtyp *fp_,
if (rsq<cutforcesq) {
numtyp r = ucl_sqrt(rsq);
numtyp p = r*rdr + (numtyp)1.0;
int m=__float2int_rn(p);
int m=__float2int_rd(p);
m = MIN(m,nr-1);
p -= m;
p = MIN(p,(numtyp)1.0);

View File

@ -2,11 +2,7 @@
newton off
<<<<<<< HEAD
package gpu force 0 0 1
=======
package gpu force 0 0 1.0
>>>>>>> ea346772202c63b86b63ef58a94b89365e209909
units metal
boundary p p p