Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Recent SNAP changes to Kokkos #1540

Merged
merged 12 commits into from
Jul 1, 2019
25 changes: 20 additions & 5 deletions src/KOKKOS/pair_snap_kokkos.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ PairStyle(snap/kk/host,PairSNAPKokkos<LMPHostType>)
namespace LAMMPS_NS {

template<int NEIGHFLAG, int EVFLAG>
struct TagPairSNAP{};
struct TagPairSNAPCompute{};

struct TagPairSNAPBeta{};
struct TagPairSNAPBispectrum{};

template<class DeviceType>
class PairSNAPKokkos : public PairSNAP {
Expand All @@ -53,11 +56,17 @@ class PairSNAPKokkos : public PairSNAP {

template<int NEIGHFLAG, int EVFLAG>
KOKKOS_INLINE_FUNCTION
void operator() (TagPairSNAP<NEIGHFLAG,EVFLAG>,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAP<NEIGHFLAG,EVFLAG> >::member_type& team) const;
void operator() (TagPairSNAPCompute<NEIGHFLAG,EVFLAG>,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPCompute<NEIGHFLAG,EVFLAG> >::member_type& team) const;

template<int NEIGHFLAG, int EVFLAG>
KOKKOS_INLINE_FUNCTION
void operator() (TagPairSNAP<NEIGHFLAG,EVFLAG>,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAP<NEIGHFLAG,EVFLAG> >::member_type& team, EV_FLOAT&) const;
void operator() (TagPairSNAPCompute<NEIGHFLAG,EVFLAG>,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPCompute<NEIGHFLAG,EVFLAG> >::member_type& team, EV_FLOAT&) const;

KOKKOS_INLINE_FUNCTION
void operator() (TagPairSNAPBeta,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPBeta>::member_type& team) const;

KOKKOS_INLINE_FUNCTION
void operator() (TagPairSNAPBispectrum,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPBispectrum>::member_type& team) const;

template<int NEIGHFLAG>
KOKKOS_INLINE_FUNCTION
Expand All @@ -82,10 +91,14 @@ class PairSNAPKokkos : public PairSNAP {
SNAKokkos<DeviceType> snaKK;

// How much parallelism to use within an interaction
int vector_length;
int vector_length,team_size;
int team_scratch_size;
int thread_scratch_size;

int eflag,vflag;

void compute_beta();
void compute_bispectrum();
void allocate();
//void read_files(char *, char *);
/*template<class DeviceType>
Expand Down Expand Up @@ -117,7 +130,9 @@ inline double dist2(double* x,double* y);
Kokkos::View<F_FLOAT*, DeviceType> d_radelem; // element radii
Kokkos::View<F_FLOAT*, DeviceType> d_wjelem; // elements weights
Kokkos::View<F_FLOAT**, Kokkos::LayoutRight, DeviceType> d_coeffelem; // element bispectrum coefficients
Kokkos::View<T_INT*, DeviceType> d_map; // mapping from atom types to elements
Kokkos::View<T_INT*, DeviceType> d_map; // mapping from atom types to elements
Kokkos::View<F_FLOAT**, DeviceType> d_beta; // betas for all atoms in list
Kokkos::View<F_FLOAT**, DeviceType> d_bispectrum; // bispectrum components for all atoms in list

typedef Kokkos::DualView<F_FLOAT**, DeviceType> tdual_fparams;
tdual_fparams k_cutsq;
Expand Down
Loading