forked from lijiext/lammps
Merge pull request #358 from ibaned/warnings
warning fixes (Kokkos+CUDA)
This commit is contained in:
commit
5971d4c994
|
@ -42,12 +42,11 @@ namespace MathSpecialKokkos {
|
||||||
{
|
{
|
||||||
x *= x;
|
x *= x;
|
||||||
x *= 1.4426950408889634074; // log_2(e)
|
x *= 1.4426950408889634074; // log_2(e)
|
||||||
#if defined(__BYTE_ORDER__)
|
#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
|
||||||
return (x < 1023.0) ? exp2_x86(-x) : 0.0;
|
return (x < 1023.0) ? exp2_x86(-x) : 0.0;
|
||||||
#endif
|
#else
|
||||||
#endif
|
|
||||||
return (x < 1023.0) ? exp2(-x) : 0.0;
|
return (x < 1023.0) ? exp2(-x) : 0.0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// x**2, use instead of pow(x,2.0)
|
// x**2, use instead of pow(x,2.0)
|
||||||
|
|
|
@ -147,9 +147,9 @@ void NeighborKokkos::init_ex_mol_bit_kokkos()
|
||||||
int NeighborKokkos::check_distance()
|
int NeighborKokkos::check_distance()
|
||||||
{
|
{
|
||||||
if (device_flag)
|
if (device_flag)
|
||||||
check_distance_kokkos<LMPDeviceType>();
|
return check_distance_kokkos<LMPDeviceType>();
|
||||||
else
|
else
|
||||||
check_distance_kokkos<LMPHostType>();
|
return check_distance_kokkos<LMPHostType>();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class DeviceType>
|
template<class DeviceType>
|
||||||
|
@ -157,7 +157,7 @@ int NeighborKokkos::check_distance_kokkos()
|
||||||
{
|
{
|
||||||
typedef DeviceType device_type;
|
typedef DeviceType device_type;
|
||||||
|
|
||||||
double delx,dely,delz,rsq;
|
double delx,dely,delz;
|
||||||
double delta,delta1,delta2;
|
double delta,delta1,delta2;
|
||||||
|
|
||||||
if (boxcheck) {
|
if (boxcheck) {
|
||||||
|
|
|
@ -44,7 +44,9 @@ class PairBuckCoulCutKokkos : public PairBuckCoulCut {
|
||||||
double init_one(int, int);
|
double init_one(int, int);
|
||||||
|
|
||||||
struct params_buck_coul{
|
struct params_buck_coul{
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_buck_coul(){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
params_buck_coul(){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_buck_coul(int i){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
params_buck_coul(int i){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
||||||
F_FLOAT cut_ljsq,cut_coulsq,a,c,rhoinv,buck1,buck2,offset;
|
F_FLOAT cut_ljsq,cut_coulsq,a,c,rhoinv,buck1,buck2,offset;
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,7 +45,9 @@ class PairBuckCoulLongKokkos : public PairBuckCoulLong {
|
||||||
double init_one(int, int);
|
double init_one(int, int);
|
||||||
|
|
||||||
struct params_buck_coul{
|
struct params_buck_coul{
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_buck_coul(){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
params_buck_coul(){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_buck_coul(int i){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
params_buck_coul(int i){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
||||||
F_FLOAT cut_ljsq,cut_coulsq,a,c,rhoinv,buck1,buck2,offset;
|
F_FLOAT cut_ljsq,cut_coulsq,a,c,rhoinv,buck1,buck2,offset;
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,7 +43,9 @@ class PairBuckKokkos : public PairBuck {
|
||||||
double init_one(int, int);
|
double init_one(int, int);
|
||||||
|
|
||||||
struct params_buck{
|
struct params_buck{
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_buck(){cutsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
params_buck(){cutsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_buck(int i){cutsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
params_buck(int i){cutsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
|
||||||
F_FLOAT cutsq,a,c,rhoinv,buck1,buck2,offset;
|
F_FLOAT cutsq,a,c,rhoinv,buck1,buck2,offset;
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,7 +44,9 @@ class PairCoulDebyeKokkos : public PairCoulDebye {
|
||||||
double init_one(int, int);
|
double init_one(int, int);
|
||||||
|
|
||||||
struct params_coul{
|
struct params_coul{
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_coul(){cutsq=0,scale=0;};
|
params_coul(){cutsq=0,scale=0;};
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_coul(int i){cutsq=0,scale=0;};
|
params_coul(int i){cutsq=0,scale=0;};
|
||||||
F_FLOAT cutsq, scale;
|
F_FLOAT cutsq, scale;
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,7 +44,9 @@ class PairLJClass2Kokkos : public PairLJClass2 {
|
||||||
double init_one(int, int);
|
double init_one(int, int);
|
||||||
|
|
||||||
struct params_lj{
|
struct params_lj{
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_lj(){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
|
params_lj(){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_lj(int i){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
|
params_lj(int i){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
|
||||||
F_FLOAT cutsq,lj1,lj2,lj3,lj4,offset;
|
F_FLOAT cutsq,lj1,lj2,lj3,lj4,offset;
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,7 +44,9 @@ class PairLJExpandKokkos : public PairLJExpand {
|
||||||
double init_one(int, int);
|
double init_one(int, int);
|
||||||
|
|
||||||
struct params_lj{
|
struct params_lj{
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_lj(){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;shift=0;};
|
params_lj(){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;shift=0;};
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_lj(int i){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;shift=0;};
|
params_lj(int i){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;shift=0;};
|
||||||
F_FLOAT cutsq,lj1,lj2,lj3,lj4,offset,shift;
|
F_FLOAT cutsq,lj1,lj2,lj3,lj4,offset,shift;
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,7 +44,9 @@ class PairLJGromacsKokkos : public PairLJGromacs {
|
||||||
double init_one(int, int);
|
double init_one(int, int);
|
||||||
|
|
||||||
struct params_lj{
|
struct params_lj{
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_lj(){cut_inner_sq=0;cut_inner=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;ljsw1=0;ljsw2=0;ljsw3=0;ljsw4=0;ljsw5=0;};
|
params_lj(){cut_inner_sq=0;cut_inner=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;ljsw1=0;ljsw2=0;ljsw3=0;ljsw4=0;ljsw5=0;};
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
params_lj(int i){cut_inner_sq=0;cut_inner=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;ljsw1=0;ljsw2=0;ljsw3=0;ljsw4=0;ljsw5=0;};
|
params_lj(int i){cut_inner_sq=0;cut_inner=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;ljsw1=0;ljsw2=0;ljsw3=0;ljsw4=0;ljsw5=0;};
|
||||||
F_FLOAT cut_inner_sq,cut_inner,lj1,lj2,lj3,lj4,offset,ljsw1,ljsw2,ljsw3,ljsw4,ljsw5;
|
F_FLOAT cut_inner_sq,cut_inner,lj1,lj2,lj3,lj4,offset,ljsw1,ljsw2,ljsw3,ljsw4,ljsw5;
|
||||||
};
|
};
|
||||||
|
|
|
@ -191,7 +191,6 @@ void ComputeCoordAtom::compute_peratom()
|
||||||
c_orientorder->invoked_flag |= INVOKED_PERATOM;
|
c_orientorder->invoked_flag |= INVOKED_PERATOM;
|
||||||
}
|
}
|
||||||
nqlist = c_orientorder->nqlist;
|
nqlist = c_orientorder->nqlist;
|
||||||
int ltmp = l;
|
|
||||||
normv = c_orientorder->array_atom;
|
normv = c_orientorder->array_atom;
|
||||||
comm->forward_comm_compute(this);
|
comm->forward_comm_compute(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1600,10 +1600,10 @@ int Domain::ownatom(int id, double *x, imageint *image, int shrinkexceed)
|
||||||
if (coord[0] < blo[0] && boundary[0][0] > 1) newcoord[0] = blo[0];
|
if (coord[0] < blo[0] && boundary[0][0] > 1) newcoord[0] = blo[0];
|
||||||
else if (coord[0] >= bhi[0] && boundary[0][1] > 1) newcoord[0] = bhi[0];
|
else if (coord[0] >= bhi[0] && boundary[0][1] > 1) newcoord[0] = bhi[0];
|
||||||
else newcoord[0] = coord[0];
|
else newcoord[0] = coord[0];
|
||||||
if (coord[1] < blo[1] && boundary[1][1] > 1) newcoord[1] = blo[1];
|
if (coord[1] < blo[1] && boundary[1][0] > 1) newcoord[1] = blo[1];
|
||||||
else if (coord[1] >= bhi[1] && boundary[1][1] > 1) newcoord[1] = bhi[1];
|
else if (coord[1] >= bhi[1] && boundary[1][1] > 1) newcoord[1] = bhi[1];
|
||||||
else newcoord[1] = coord[1];
|
else newcoord[1] = coord[1];
|
||||||
if (coord[2] < blo[2] && boundary[2][2] > 1) newcoord[2] = blo[2];
|
if (coord[2] < blo[2] && boundary[2][0] > 1) newcoord[2] = blo[2];
|
||||||
else if (coord[2] >= bhi[2] && boundary[2][1] > 1) newcoord[2] = bhi[2];
|
else if (coord[2] >= bhi[2] && boundary[2][1] > 1) newcoord[2] = bhi[2];
|
||||||
else newcoord[2] = coord[2];
|
else newcoord[2] = coord[2];
|
||||||
|
|
||||||
|
|
|
@ -317,8 +317,6 @@ void lammps_free(void *ptr)
|
||||||
|
|
||||||
int lammps_extract_setting(void *ptr, char *name)
|
int lammps_extract_setting(void *ptr, char *name)
|
||||||
{
|
{
|
||||||
LAMMPS *lmp = (LAMMPS *) ptr;
|
|
||||||
|
|
||||||
if (strcmp(name,"bigint") == 0) return sizeof(bigint);
|
if (strcmp(name,"bigint") == 0) return sizeof(bigint);
|
||||||
if (strcmp(name,"tagint") == 0) return sizeof(tagint);
|
if (strcmp(name,"tagint") == 0) return sizeof(tagint);
|
||||||
if (strcmp(name,"imageint") == 0) return sizeof(imageint);
|
if (strcmp(name,"imageint") == 0) return sizeof(imageint);
|
||||||
|
|
|
@ -41,12 +41,11 @@ namespace MathSpecial {
|
||||||
{
|
{
|
||||||
x *= x;
|
x *= x;
|
||||||
x *= 1.4426950408889634074; // log_2(e)
|
x *= 1.4426950408889634074; // log_2(e)
|
||||||
#if defined(__BYTE_ORDER__)
|
#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
|
||||||
return (x < 1023.0) ? exp2_x86(-x) : 0.0;
|
return (x < 1023.0) ? exp2_x86(-x) : 0.0;
|
||||||
#endif
|
#else
|
||||||
#endif
|
|
||||||
return (x < 1023.0) ? exp2(-x) : 0.0;
|
return (x < 1023.0) ? exp2(-x) : 0.0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// x**2, use instead of pow(x,2.0)
|
// x**2, use instead of pow(x,2.0)
|
||||||
|
|
Loading…
Reference in New Issue