1 /* -*- c++ -*- ----------------------------------------------------------
2    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
3    https://www.lammps.org/, Sandia National Laboratories
4    Steve Plimpton, sjplimp@sandia.gov
5 
6    Copyright (2003) Sandia Corporation.  Under the terms of Contract
7    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
8    certain rights in this software.  This software is distributed under
9    the GNU General Public License.
10 
11    See the README file in the top-level LAMMPS directory.
12 ------------------------------------------------------------------------- */
13 
14 #ifdef PAIR_CLASS
15 // clang-format off
16 PairStyle(coul/dsf/kk,PairCoulDSFKokkos<LMPDeviceType>);
17 PairStyle(coul/dsf/kk/device,PairCoulDSFKokkos<LMPDeviceType>);
18 PairStyle(coul/dsf/kk/host,PairCoulDSFKokkos<LMPHostType>);
19 // clang-format on
20 #else
21 
22 // clang-format off
23 #ifndef LMP_PAIR_COUL_DSF_KOKKOS_H
24 #define LMP_PAIR_COUL_DSF_KOKKOS_H
25 
26 #include "pair_kokkos.h"
27 #include "pair_coul_dsf.h"
28 #include "neigh_list_kokkos.h"
29 
30 namespace LAMMPS_NS {
31 
32 template<int NEIGHFLAG, int NEWTON_PAIR, int EVFLAG>
33 struct TagPairCoulDSFKernelA{};
34 
35 template<class DeviceType>
36 class PairCoulDSFKokkos : public PairCoulDSF {
37  public:
38   enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
39   enum {COUL_FLAG=1};
40   typedef DeviceType device_type;
41   typedef ArrayTypes<DeviceType> AT;
42   typedef EV_FLOAT value_type;
43   PairCoulDSFKokkos(class LAMMPS *);
44   ~PairCoulDSFKokkos();
45 
46   void compute(int, int);
47   void init_style();
48 
49   template<int NEIGHFLAG, int NEWTON_PAIR, int EVFLAG>
50   KOKKOS_INLINE_FUNCTION
51   void operator()(TagPairCoulDSFKernelA<NEIGHFLAG,NEWTON_PAIR,EVFLAG>, const int&, EV_FLOAT&) const;
52 
53   template<int NEIGHFLAG, int NEWTON_PAIR, int EVFLAG>
54   KOKKOS_INLINE_FUNCTION
55   void operator()(TagPairCoulDSFKernelA<NEIGHFLAG,NEWTON_PAIR,EVFLAG>, const int&) const;
56 
57   template<int NEIGHFLAG, int NEWTON_PAIR>
58   KOKKOS_INLINE_FUNCTION
59   void ev_tally(EV_FLOAT &ev, const int &i, const int &j,
60       const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx,
61                   const F_FLOAT &dely, const F_FLOAT &delz) const;
62 
63   KOKKOS_INLINE_FUNCTION
64   int sbmask(const int& j) const;
65 
66   typename AT::t_x_array_randomread x;
67   typename AT::t_f_array f;
68   typename AT::t_float_1d_randomread q;
69 
70  protected:
71 
72   DAT::tdual_efloat_1d k_eatom;
73   DAT::tdual_virial_array k_vatom;
74   typename AT::t_efloat_1d d_eatom;
75   typename AT::t_virial_array d_vatom;
76 
77 
78   int neighflag,newton_pair;
79   int nlocal,nall,eflag,vflag;
80 
81   double special_coul[4];
82   double qqrd2e;
83 
84   typename AT::t_neighbors_2d d_neighbors;
85   typename AT::t_int_1d_randomread d_ilist;
86   typename AT::t_int_1d_randomread d_numneigh;
87   //NeighListKokkos<DeviceType> k_list;
88 
89   friend void pair_virial_fdotr_compute<PairCoulDSFKokkos>(PairCoulDSFKokkos*);
90 
91 };
92 
93 }
94 
95 #endif
96 #endif
97 
98 /* ERROR/WARNING messages:
99 
100 E: Cannot use chosen neighbor list style with coul/dsf/kk
101 
102 That style is not supported by Kokkos.
103 
104 */
105