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 NPAIR_CLASS
15 // clang-format off
16 typedef NPairSkipKokkos<LMPDeviceType> NPairKokkosSkipDevice;
17 NPairStyle(skip/kk/device,
18            NPairKokkosSkipDevice,
19            NP_SKIP | NP_HALF | NP_FULL |
20            NP_NSQ | NP_BIN | NP_MULTI |
21            NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_KOKKOS_DEVICE);
22 
23 typedef NPairSkipKokkos<LMPDeviceType> NPairKokkosSkipGhostDevice;
24 NPairStyle(skip/ghost/kk/device,
25            NPairKokkosSkipGhostDevice,
26            NP_SKIP | NP_HALF | NP_FULL |
27            NP_NSQ | NP_BIN | NP_MULTI |
28            NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_DEVICE);
29 
30 typedef NPairSkipKokkos<LMPHostType> NPairKokkosSkipHost;
31 NPairStyle(skip/kk/host,
32            NPairKokkosSkipHost,
33            NP_SKIP | NP_HALF | NP_FULL |
34            NP_NSQ | NP_BIN | NP_MULTI |
35            NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_KOKKOS_HOST);
36 
37 typedef NPairSkipKokkos<LMPHostType> NPairKokkosSkipGhostHost;
38 NPairStyle(skip/ghost/kk/host,
39            NPairKokkosSkipGhostHost,
40            NP_SKIP | NP_HALF | NP_FULL |
41            NP_NSQ | NP_BIN | NP_MULTI |
42            NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_HOST);
43 // clang-format on
44 #else
45 
46 // clang-format off
47 #ifndef LMP_NPAIR_SKIP_KOKKOS_H
48 #define LMP_NPAIR_SKIP_KOKKOS_H
49 
50 #include "npair.h"
51 #include "kokkos_type.h"
52 
53 namespace LAMMPS_NS {
54 
55 struct TagNPairSkipCompute{};
56 struct TagNPairSkipCountLocal{};
57 
58 template<class DeviceType>
59 class NPairSkipKokkos : public NPair {
60  public:
61   typedef DeviceType device_type;
62   typedef int value_type;
63   typedef ArrayTypes<DeviceType> AT;
64 
65   NPairSkipKokkos(class LAMMPS *);
~NPairSkipKokkos()66   ~NPairSkipKokkos() {}
67   void build(class NeighList *);
68 
69   KOKKOS_INLINE_FUNCTION
70   void operator()(TagNPairSkipCompute, const int&, int&, const bool&) const;
71 
72   KOKKOS_INLINE_FUNCTION
73   void operator()(TagNPairSkipCountLocal, const int&, int&) const;
74 
75  private:
76   int nlocal,num_skip;
77 
78   typename AT::t_int_1d_randomread type;
79 
80   typename AT::t_int_scalar d_inum;
81 
82   typename AT::t_neighbors_2d_const d_neighbors_skip;
83   typename AT::t_int_1d_const d_ilist_skip;
84   typename AT::t_int_1d_const d_numneigh_skip;
85 
86   typename AT::t_neighbors_2d d_neighbors;
87   typename AT::t_int_1d d_ilist;
88   typename AT::t_int_1d d_numneigh;
89 
90   DAT::tdual_int_1d k_iskip;
91   DAT::tdual_int_2d k_ijskip;
92   typename AT::t_int_1d d_iskip;
93   typename AT::t_int_2d d_ijskip;
94 };
95 
96 }
97 
98 #endif
99 #endif
100 
101 /* ERROR/WARNING messages:
102 
103 */
104