Commit 83c830fd authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

port kspace refactor to GPU and KOKKOS package

parent 3a4bef35
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -89,10 +89,8 @@ void PPPM_GPU_API(forces)(double **f);

/* ---------------------------------------------------------------------- */

PPPMGPU::PPPMGPU(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
PPPMGPU::PPPMGPU(LAMMPS *lmp) : PPPM(lmp)
{
  if (narg != 1) error->all(FLERR,"Illegal kspace_style pppm/gpu command");

  triclinic_support = 0;
  density_brick_gpu = vd_brick = NULL;
  kspace_split = false;
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ namespace LAMMPS_NS {

class PPPMGPU : public PPPM {
 public:
  PPPMGPU(class LAMMPS *, int, char **);
  PPPMGPU(class LAMMPS *);
  virtual ~PPPMGPU();
  void init();
  void setup();
+8 −5
Original line number Diff line number Diff line
@@ -64,10 +64,8 @@ enum{FORWARD_IK,FORWARD_IK_PERATOM};
/* ---------------------------------------------------------------------- */

template<class DeviceType>
PPPMKokkos<DeviceType>::PPPMKokkos(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
PPPMKokkos<DeviceType>::PPPMKokkos(LAMMPS *lmp) : PPPM(lmp)
{
  if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm command");

  atomKK = (AtomKokkos *) atom;
  execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
  datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK;
@@ -77,8 +75,6 @@ PPPMKokkos<DeviceType>::PPPMKokkos(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp
  group_group_enable = 0;
  triclinic_support = 0;

  accuracy_relative = fabs(force->numeric(FLERR,arg[0]));

  nfactors = 3;
  //factors = new int[nfactors];
  factors[0] = 2;
@@ -148,6 +144,13 @@ PPPMKokkos<DeviceType>::PPPMKokkos(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp
  k_flag = DAT::tdual_int_scalar("PPPM:flag");
}

template<class DeviceType>
void PPPMKokkos<DeviceType>::settings(int narg, char **arg)
{
  if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm/kk command");
  accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
}

/* ----------------------------------------------------------------------
   free all memory
------------------------------------------------------------------------- */
+2 −1
Original line number Diff line number Diff line
@@ -92,11 +92,12 @@ class PPPMKokkos : public PPPM, public KokkosBase {
  typedef DeviceType device_type;
  typedef ArrayTypes<DeviceType> AT;

  PPPMKokkos(class LAMMPS *, int, char **);
  PPPMKokkos(class LAMMPS *);
  virtual ~PPPMKokkos();
  virtual void init();
  virtual void setup();
  void setup_grid();
  virtual void settings(int, char **);
  virtual void compute(int, int);
  virtual int timing_1d(int, double &);
  virtual int timing_3d(int, double &);