diff --git a/src/KOKKOS/pair_coul_debye_kokkos.cpp b/src/KOKKOS/pair_coul_debye_kokkos.cpp index a3332e6997..e380a874ff 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_coul_debye_kokkos.cpp @@ -56,9 +56,8 @@ PairCoulDebyeKokkos::PairCoulDebyeKokkos(LAMMPS *lmp):PairCoulDebye( template PairCoulDebyeKokkos::~PairCoulDebyeKokkos() { - if (!copymode) { + if (allocated) memoryKK->destroy_kokkos(k_cutsq, cutsq); - } } /* ---------------------------------------------------------------------- */ @@ -125,15 +124,12 @@ void PairCoulDebyeKokkos::compute(int eflag_in, int vflag_in) // loop over neighbors of my atoms - copymode = 1; - EV_FLOAT ev = pair_compute,void > (this,(NeighListKokkos*)list); - if (eflag) { - eng_vdwl += ev.evdwl; + if (eflag) eng_coul += ev.ecoul; - } + if (vflag_global) { virial[0] += ev.v[0]; virial[1] += ev.v[1]; @@ -154,8 +150,6 @@ void PairCoulDebyeKokkos::compute(int eflag_in, int vflag_in) } if (vflag_fdotr) pair_virial_fdotr_compute(this); - - copymode = 0; } /* ---------------------------------------------------------------------- @@ -214,6 +208,12 @@ void PairCoulDebyeKokkos::allocate() memory->destroy(cutsq); memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); + + k_cut_ljsq = typename ArrayTypes::tdual_ffloat_2d("pair:cut_ljsq",n+1,n+1); + d_cut_ljsq = k_cut_ljsq.template view(); + k_cut_coulsq = typename ArrayTypes::tdual_ffloat_2d("pair:cut_coulsq",n+1,n+1); + d_cut_coulsq = k_cut_coulsq.template view(); + k_params = Kokkos::DualView("PairCoulDebye::params",n+1,n+1); params = k_params.template view(); } @@ -250,16 +250,6 @@ void PairCoulDebyeKokkos::init_style() { PairCoulDebye::init_style(); - // error if rRESPA with inner levels - - if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { - int respa = 0; - if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; - if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; - if (respa) - error->all(FLERR,"Cannot use Kokkos pair style with rRESPA inner/middle"); - } - // irequest = neigh request made by parent class neighflag = lmp->kokkos->neighflag; @@ -303,9 +293,9 @@ double PairCoulDebyeKokkos::init_one(int i, int j) } k_cutsq.h_view(i,j) = cutone*cutone; k_cutsq.template modify(); - //k_cut_ljsq.h_view(i,j) = cutone*cutone; + k_cut_ljsq.h_view(i,j) = cutone*cutone; k_cut_ljsq.template modify(); - //k_cut_coulsq.h_view(i,j) = cutone*cutone; + k_cut_coulsq.h_view(i,j) = cutone*cutone; k_cut_coulsq.template modify(); k_params.template modify();