fix a CUDA constructor warning

The class params_lj_coul was copy-pasted
into many different pair styles, and only
one of them had the proper KOKKOS_INLINE_FUNCTION
annotations for CUDA.
created a header file for this class that
most of the pair styles now include.
One pair style did add extra members,
so it keeps a local copy of the class.
This commit is contained in:
Dan Ibanez 2017-01-11 09:11:35 -07:00
parent 7162cafdf5
commit 9f4e5e0661
11 changed files with 12 additions and 53 deletions

View File

@ -143,6 +143,7 @@ action pair_eam_alloy_kokkos.h pair_eam_alloy.h
action pair_eam_fs_kokkos.cpp pair_eam_fs.cpp
action pair_eam_fs_kokkos.h pair_eam_fs.h
action pair_kokkos.h
action params_lj_coul.h
action pair_lj_charmm_coul_charmm_implicit_kokkos.cpp pair_lj_charmm_coul_charmm_implicit.cpp
action pair_lj_charmm_coul_charmm_implicit_kokkos.h pair_lj_charmm_coul_charmm_implicit.h
action pair_lj_charmm_coul_charmm_kokkos.cpp pair_lj_charmm_coul_charmm.cpp

View File

@ -25,6 +25,7 @@ PairStyle(lj/charmm/coul/charmm/implicit/kk/host,PairLJCharmmCoulCharmmImplicitK
#include "pair_kokkos.h"
#include "pair_lj_charmm_coul_charmm_implicit.h"
#include "neigh_list_kokkos.h"
#include "params_lj_coul.h"
namespace LAMMPS_NS {
@ -44,11 +45,6 @@ class PairLJCharmmCoulCharmmImplicitKokkos : public PairLJCharmmCoulCharmmImplic
void init_style();
double init_one(int, int);
struct params_lj_coul{
params_lj_coul(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
params_lj_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset;
};
protected:
void cleanup_copy();

View File

@ -25,6 +25,7 @@ PairStyle(lj/charmm/coul/charmm/kk/host,PairLJCharmmCoulCharmmKokkos<LMPHostType
#include "pair_kokkos.h"
#include "pair_lj_charmm_coul_charmm.h"
#include "neigh_list_kokkos.h"
#include "params_lj_coul.h"
namespace LAMMPS_NS {
@ -44,11 +45,6 @@ class PairLJCharmmCoulCharmmKokkos : public PairLJCharmmCoulCharmm {
void init_style();
double init_one(int, int);
struct params_lj_coul{
params_lj_coul(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
params_lj_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset;
};
protected:
void cleanup_copy();

View File

@ -25,6 +25,7 @@ PairStyle(lj/charmm/coul/long/kk/host,PairLJCharmmCoulLongKokkos<LMPHostType>)
#include "pair_kokkos.h"
#include "pair_lj_charmm_coul_long.h"
#include "neigh_list_kokkos.h"
#include "params_lj_coul.h"
namespace LAMMPS_NS {
@ -43,12 +44,6 @@ class PairLJCharmmCoulLongKokkos : public PairLJCharmmCoulLong {
void init_style();
double init_one(int, int);
struct params_lj_coul{
params_lj_coul(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
params_lj_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset;
};
protected:
void cleanup_copy();

View File

@ -25,6 +25,7 @@ PairStyle(lj/class2/coul/cut/kk/host,PairLJClass2CoulCutKokkos<LMPHostType>)
#include "pair_kokkos.h"
#include "pair_lj_class2_coul_cut.h"
#include "neigh_list_kokkos.h"
#include "params_lj_coul.h"
namespace LAMMPS_NS {
@ -43,11 +44,6 @@ class PairLJClass2CoulCutKokkos : public PairLJClass2CoulCut {
void init_style();
double init_one(int, int);
struct params_lj_coul{
params_lj_coul(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
params_lj_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset;
};
protected:
void cleanup_copy();

View File

@ -25,6 +25,7 @@ PairStyle(lj/class2/coul/long/kk/host,PairLJClass2CoulLongKokkos<LMPHostType>)
#include "pair_kokkos.h"
#include "pair_lj_class2_coul_long.h"
#include "neigh_list_kokkos.h"
#include "params_lj_coul.h"
namespace LAMMPS_NS {
@ -44,12 +45,6 @@ class PairLJClass2CoulLongKokkos : public PairLJClass2CoulLong {
void init_style();
double init_one(int, int);
struct params_lj_coul{
params_lj_coul(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
params_lj_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset;
};
protected:
void cleanup_copy();

View File

@ -25,6 +25,7 @@ PairStyle(lj/cut/coul/cut/kk/host,PairLJCutCoulCutKokkos<LMPHostType>)
#include "pair_kokkos.h"
#include "pair_lj_cut_coul_cut.h"
#include "neigh_list_kokkos.h"
#include "params_lj_coul.h"
namespace LAMMPS_NS {
@ -43,14 +44,6 @@ class PairLJCutCoulCutKokkos : public PairLJCutCoulCut {
void init_style();
double init_one(int, int);
struct params_lj_coul{
KOKKOS_INLINE_FUNCTION
params_lj_coul(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
KOKKOS_INLINE_FUNCTION
params_lj_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset;
};
protected:
void cleanup_copy();

View File

@ -25,6 +25,7 @@ PairStyle(lj/cut/coul/debye/kk/host,PairLJCutCoulDebyeKokkos<LMPHostType>)
#include "pair_kokkos.h"
#include "pair_lj_cut_coul_debye.h"
#include "neigh_list_kokkos.h"
#include "params_lj_coul.h"
namespace LAMMPS_NS {
@ -43,12 +44,6 @@ class PairLJCutCoulDebyeKokkos : public PairLJCutCoulDebye {
void init_style();
double init_one(int, int);
struct params_lj_coul{
params_lj_coul(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
params_lj_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset;
};
protected:
void cleanup_copy();

View File

@ -25,6 +25,7 @@ PairStyle(lj/cut/coul/dsf/kk/host,PairLJCutCoulDSFKokkos<LMPHostType>)
#include "pair_kokkos.h"
#include "pair_lj_cut_coul_dsf.h"
#include "neigh_list_kokkos.h"
#include "params_lj_coul.h"
namespace LAMMPS_NS {
@ -42,12 +43,6 @@ class PairLJCutCoulDSFKokkos : public PairLJCutCoulDSF {
void init_style();
double init_one(int, int);
struct params_lj_coul{
params_lj_coul(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
params_lj_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset;
};
protected:
void cleanup_copy();

View File

@ -25,6 +25,7 @@ PairStyle(lj/cut/coul/long/kk/host,PairLJCutCoulLongKokkos<LMPHostType>)
#include "pair_kokkos.h"
#include "pair_lj_cut_coul_long.h"
#include "neigh_list_kokkos.h"
#include "params_lj_coul.h"
namespace LAMMPS_NS {
@ -44,12 +45,6 @@ class PairLJCutCoulLongKokkos : public PairLJCutCoulLong {
void init_style();
double init_one(int, int);
struct params_lj_coul{
params_lj_coul(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
params_lj_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset;
};
protected:
void cleanup_copy();

View File

@ -45,7 +45,9 @@ class PairLJGromacsCoulGromacsKokkos : public PairLJGromacsCoulGromacs {
double init_one(int, int);
struct params_lj_coul{
KOKKOS_INLINE_FUNCTION
params_lj_coul(){cut_ljsq=0;cut_coulsq=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_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;ljsw1=0;ljsw2=0;ljsw3=0;ljsw4=0;ljsw5=0;};
F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset,ljsw1,ljsw2,ljsw3,ljsw4,ljsw5;
};