Merge branch 'master' (21893539cb Aug 25) into USER-DPD_kokkos_merge

Resolved conflicts in src/KOKKOS/npair_kokkos.cpp
This commit is contained in:
Tim Mattox
2017-08-28 14:26:31 -05:00
75 changed files with 227 additions and 186 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -15,7 +15,7 @@ $$
$$ $$
$$ $$
v(t+\Delta t) = v(t+\frac{\Delta t}{2}) + \frac{\Delta t}{2}\cdot a(t++\Delta t), v(t+\Delta t) = v(t+\frac{\Delta t}{2}) + \frac{\Delta t}{2}\cdot a(t+\Delta t)
$$ $$
\end{document} \end{document}

View File

@ -271,10 +271,10 @@ void AngleCharmmKokkos<DeviceType>::coeff(int narg, char **arg)
Kokkos::DualView<F_FLOAT*,DeviceType> k_k_ub("AngleCharmm::k_ub",n+1); Kokkos::DualView<F_FLOAT*,DeviceType> k_k_ub("AngleCharmm::k_ub",n+1);
Kokkos::DualView<F_FLOAT*,DeviceType> k_r_ub("AngleCharmm::r_ub",n+1); Kokkos::DualView<F_FLOAT*,DeviceType> k_r_ub("AngleCharmm::r_ub",n+1);
d_k = k_k.d_view; d_k = k_k.template view<DeviceType>();
d_theta0 = k_theta0.d_view; d_theta0 = k_theta0.template view<DeviceType>();
d_k_ub = k_k_ub.d_view; d_k_ub = k_k_ub.template view<DeviceType>();
d_r_ub = k_r_ub.d_view; d_r_ub = k_r_ub.template view<DeviceType>();
for (int i = 1; i <= n; i++) { for (int i = 1; i <= n; i++) {
k_k.h_view[i] = k[i]; k_k.h_view[i] = k[i];

View File

@ -14,6 +14,8 @@
#ifdef ATOM_CLASS #ifdef ATOM_CLASS
AtomStyle(angle/kk,AtomVecAngleKokkos) AtomStyle(angle/kk,AtomVecAngleKokkos)
AtomStyle(angle/kk/device,AtomVecAngleKokkos)
AtomStyle(angle/kk/host,AtomVecAngleKokkos)
#else #else

View File

@ -14,6 +14,8 @@
#ifdef ATOM_CLASS #ifdef ATOM_CLASS
AtomStyle(atomic/kk,AtomVecAtomicKokkos) AtomStyle(atomic/kk,AtomVecAtomicKokkos)
AtomStyle(atomic/kk/device,AtomVecAtomicKokkos)
AtomStyle(atomic/kk/host,AtomVecAtomicKokkos)
#else #else

View File

@ -14,6 +14,8 @@
#ifdef ATOM_CLASS #ifdef ATOM_CLASS
AtomStyle(bond/kk,AtomVecBondKokkos) AtomStyle(bond/kk,AtomVecBondKokkos)
AtomStyle(bond/kk/device,AtomVecBondKokkos)
AtomStyle(bond/kk/host,AtomVecBondKokkos)
#else #else

View File

@ -14,6 +14,8 @@
#ifdef ATOM_CLASS #ifdef ATOM_CLASS
AtomStyle(charge/kk,AtomVecChargeKokkos) AtomStyle(charge/kk,AtomVecChargeKokkos)
AtomStyle(charge/kk/device,AtomVecChargeKokkos)
AtomStyle(charge/kk/host,AtomVecChargeKokkos)
#else #else

View File

@ -14,6 +14,8 @@
#ifdef ATOM_CLASS #ifdef ATOM_CLASS
AtomStyle(full/kk,AtomVecFullKokkos) AtomStyle(full/kk,AtomVecFullKokkos)
AtomStyle(full/kk/device,AtomVecFullKokkos)
AtomStyle(full/kk/host,AtomVecFullKokkos)
#else #else

View File

@ -14,6 +14,8 @@
#ifdef ATOM_CLASS #ifdef ATOM_CLASS
AtomStyle(molecular/kk,AtomVecMolecularKokkos) AtomStyle(molecular/kk,AtomVecMolecularKokkos)
AtomStyle(molecular/kk/device,AtomVecMolecularKokkos)
AtomStyle(molecular/kk/host,AtomVecMolecularKokkos)
#else #else

View File

@ -253,10 +253,10 @@ void BondFENEKokkos<DeviceType>::allocate()
k_epsilon = DAT::tdual_ffloat_1d("BondFene::epsilon",n+1); k_epsilon = DAT::tdual_ffloat_1d("BondFene::epsilon",n+1);
k_sigma = DAT::tdual_ffloat_1d("BondFene::sigma",n+1); k_sigma = DAT::tdual_ffloat_1d("BondFene::sigma",n+1);
d_k = k_k.d_view; d_k = k_k.template view<DeviceType>();
d_r0 = k_r0.d_view; d_r0 = k_r0.template view<DeviceType>();
d_epsilon = k_epsilon.d_view; d_epsilon = k_epsilon.template view<DeviceType>();
d_sigma = k_sigma.d_view; d_sigma = k_sigma.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -85,10 +85,10 @@ class BondFENEKokkos : public BondFENE {
DAT::tdual_ffloat_1d k_epsilon; DAT::tdual_ffloat_1d k_epsilon;
DAT::tdual_ffloat_1d k_sigma; DAT::tdual_ffloat_1d k_sigma;
DAT::t_ffloat_1d d_k; typename AT::t_ffloat_1d d_k;
DAT::t_ffloat_1d d_r0; typename AT::t_ffloat_1d d_r0;
DAT::t_ffloat_1d d_epsilon; typename AT::t_ffloat_1d d_epsilon;
DAT::t_ffloat_1d d_sigma; typename AT::t_ffloat_1d d_sigma;
virtual void allocate(); virtual void allocate();
}; };

View File

@ -488,6 +488,7 @@ void CommKokkos::exchange_device()
if (true) { if (true) {
if (k_sendflag.h_view.dimension_0()<nlocal) k_sendflag.resize(nlocal); if (k_sendflag.h_view.dimension_0()<nlocal) k_sendflag.resize(nlocal);
k_sendflag.sync<DeviceType>();
k_count.h_view(0) = k_exchange_sendlist.h_view.dimension_0(); k_count.h_view(0) = k_exchange_sendlist.h_view.dimension_0();
while (k_count.h_view(0)>=k_exchange_sendlist.h_view.dimension_0()) { while (k_count.h_view(0)>=k_exchange_sendlist.h_view.dimension_0()) {
k_count.h_view(0) = 0; k_count.h_view(0) = 0;

View File

@ -432,12 +432,12 @@ void DihedralCharmmKokkos<DeviceType>::coeff(int narg, char **arg)
Kokkos::DualView<F_FLOAT*,DeviceType> k_sin_shift("DihedralCharmm::sin_shift",nd+1); Kokkos::DualView<F_FLOAT*,DeviceType> k_sin_shift("DihedralCharmm::sin_shift",nd+1);
Kokkos::DualView<F_FLOAT*,DeviceType> k_weight("DihedralCharmm::weight",nd+1); Kokkos::DualView<F_FLOAT*,DeviceType> k_weight("DihedralCharmm::weight",nd+1);
d_k = k_k.d_view; d_k = k_k.template view<DeviceType>();
d_multiplicity = k_multiplicity.d_view; d_multiplicity = k_multiplicity.template view<DeviceType>();
d_shift = k_shift.d_view; d_shift = k_shift.template view<DeviceType>();
d_cos_shift = k_cos_shift.d_view; d_cos_shift = k_cos_shift.template view<DeviceType>();
d_sin_shift = k_sin_shift.d_view; d_sin_shift = k_sin_shift.template view<DeviceType>();
d_weight = k_weight.d_view; d_weight = k_weight.template view<DeviceType>();
int n = atom->ndihedraltypes; int n = atom->ndihedraltypes;
for (int i = 1; i <= n; i++) { for (int i = 1; i <= n; i++) {
@ -479,10 +479,10 @@ void DihedralCharmmKokkos<DeviceType>::init_style()
Kokkos::DualView<F_FLOAT**,Kokkos::LayoutRight,DeviceType> k_lj14_3("DihedralCharmm:lj14_3",n+1,n+1); Kokkos::DualView<F_FLOAT**,Kokkos::LayoutRight,DeviceType> k_lj14_3("DihedralCharmm:lj14_3",n+1,n+1);
Kokkos::DualView<F_FLOAT**,Kokkos::LayoutRight,DeviceType> k_lj14_4("DihedralCharmm:lj14_4",n+1,n+1); Kokkos::DualView<F_FLOAT**,Kokkos::LayoutRight,DeviceType> k_lj14_4("DihedralCharmm:lj14_4",n+1,n+1);
d_lj14_1 = k_lj14_1.d_view; d_lj14_1 = k_lj14_1.template view<DeviceType>();
d_lj14_2 = k_lj14_2.d_view; d_lj14_2 = k_lj14_2.template view<DeviceType>();
d_lj14_3 = k_lj14_3.d_view; d_lj14_3 = k_lj14_3.template view<DeviceType>();
d_lj14_4 = k_lj14_4.d_view; d_lj14_4 = k_lj14_4.template view<DeviceType>();
if (weightflag) { if (weightflag) {

View File

@ -348,10 +348,10 @@ void DihedralOPLSKokkos<DeviceType>::allocate()
k_k3 = DAT::tdual_ffloat_1d("DihedralOPLS::k3",n+1); k_k3 = DAT::tdual_ffloat_1d("DihedralOPLS::k3",n+1);
k_k4 = DAT::tdual_ffloat_1d("DihedralOPLS::k4",n+1); k_k4 = DAT::tdual_ffloat_1d("DihedralOPLS::k4",n+1);
d_k1 = k_k1.d_view; d_k1 = k_k1.template view<DeviceType>();
d_k2 = k_k2.d_view; d_k2 = k_k2.template view<DeviceType>();
d_k3 = k_k3.d_view; d_k3 = k_k3.template view<DeviceType>();
d_k4 = k_k4.d_view; d_k4 = k_k4.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -83,10 +83,10 @@ class DihedralOPLSKokkos : public DihedralOPLS {
DAT::tdual_ffloat_1d k_k3; DAT::tdual_ffloat_1d k_k3;
DAT::tdual_ffloat_1d k_k4; DAT::tdual_ffloat_1d k_k4;
DAT::t_ffloat_1d d_k1; typename AT::t_ffloat_1d d_k1;
DAT::t_ffloat_1d d_k2; typename AT::t_ffloat_1d d_k2;
DAT::t_ffloat_1d d_k3; typename AT::t_ffloat_1d d_k3;
DAT::t_ffloat_1d d_k4; typename AT::t_ffloat_1d d_k4;
virtual void allocate(); virtual void allocate();
}; };

View File

@ -14,6 +14,8 @@
#ifdef FIX_CLASS #ifdef FIX_CLASS
FixStyle(deform/kk,FixDeformKokkos) FixStyle(deform/kk,FixDeformKokkos)
FixStyle(deform/kk/device,FixDeformKokkos)
FixStyle(deform/kk/host,FixDeformKokkos)
#else #else

View File

@ -80,7 +80,7 @@ void FixNHKokkos<DeviceType>::init()
FixNH::init(); FixNH::init();
atomKK->k_mass.modify<LMPHostType>(); atomKK->k_mass.modify<LMPHostType>();
atomKK->k_mass.sync<LMPDeviceType>(); atomKK->k_mass.sync<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -46,7 +46,7 @@ void FixNVEKokkos<DeviceType>::init()
FixNVE::init(); FixNVE::init();
atomKK->k_mass.modify<LMPHostType>(); atomKK->k_mass.modify<LMPHostType>();
atomKK->k_mass.sync<LMPDeviceType>(); atomKK->k_mass.sync<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -79,7 +79,7 @@ template<class DeviceType>
void FixQEqReaxKokkos<DeviceType>::init() void FixQEqReaxKokkos<DeviceType>::init()
{ {
atomKK->k_q.modify<LMPHostType>(); atomKK->k_q.modify<LMPHostType>();
atomKK->k_q.sync<LMPDeviceType>(); atomKK->k_q.sync<DeviceType>();
FixQEqReax::init(); FixQEqReax::init();

View File

@ -64,7 +64,7 @@ FixReaxCBondsKokkos::~FixReaxCBondsKokkos()
void FixReaxCBondsKokkos::init() void FixReaxCBondsKokkos::init()
{ {
Pair *pair_kk = force->pair_match("reax/c/kk",1); Pair *pair_kk = force->pair_match("reax/c/kk",0);
if (pair_kk == NULL) error->all(FLERR,"Cannot use fix reax/c/bonds without " if (pair_kk == NULL) error->all(FLERR,"Cannot use fix reax/c/bonds without "
"pair_style reax/c/kk"); "pair_style reax/c/kk");

View File

@ -14,6 +14,8 @@
#ifdef FIX_CLASS #ifdef FIX_CLASS
FixStyle(reax/c/bonds/kk,FixReaxCBondsKokkos) FixStyle(reax/c/bonds/kk,FixReaxCBondsKokkos)
FixStyle(reax/c/bonds/kk/device,FixReaxCBondsKokkos)
FixStyle(reax/c/bonds/kk/host,FixReaxCBondsKokkos)
#else #else

View File

@ -66,7 +66,7 @@ FixReaxCSpeciesKokkos::~FixReaxCSpeciesKokkos()
void FixReaxCSpeciesKokkos::init() void FixReaxCSpeciesKokkos::init()
{ {
Pair* pair_kk = force->pair_match("reax/c/kk",1); Pair* pair_kk = force->pair_match("reax/c/kk",0);
if (pair_kk == NULL) error->all(FLERR,"Cannot use fix reax/c/species/kk without " if (pair_kk == NULL) error->all(FLERR,"Cannot use fix reax/c/species/kk without "
"pair_style reax/c/kk"); "pair_style reax/c/kk");

View File

@ -14,6 +14,8 @@
#ifdef FIX_CLASS #ifdef FIX_CLASS
FixStyle(reax/c/species/kk,FixReaxCSpeciesKokkos) FixStyle(reax/c/species/kk,FixReaxCSpeciesKokkos)
FixStyle(reax/c/species/kk/device,FixReaxCSpeciesKokkos)
FixStyle(reax/c/species/kk/host,FixReaxCSpeciesKokkos)
#else #else

View File

@ -89,8 +89,10 @@ void FixSetForceKokkos<DeviceType>::post_force(int vflag)
if (iregion >= 0) { if (iregion >= 0) {
region = domain->regions[iregion]; region = domain->regions[iregion];
region->prematch(); region->prematch();
d_match = DAT::t_int_1d("setforce:d_match",nlocal); DAT::tdual_int_1d k_match = DAT::tdual_int_1d("setforce:k_match",nlocal);
region->match_all_kokkos(groupbit,d_match); region->match_all_kokkos(groupbit,k_match);
k_match.template sync<DeviceType>();
d_match = k_match.template view<DeviceType>();
} }
// reallocate sforce array if necessary // reallocate sforce array if necessary

View File

@ -75,8 +75,8 @@ class FixSetForceKokkos : public FixSetForce {
private: private:
DAT::tdual_ffloat_2d k_sforce; DAT::tdual_ffloat_2d k_sforce;
DAT::t_ffloat_2d_randomread d_sforce; typename AT::t_ffloat_2d_randomread d_sforce;
DAT::t_int_1d d_match; typename AT::t_int_1d d_match;
typename AT::t_x_array_randomread x; typename AT::t_x_array_randomread x;
typename AT::t_f_array f; typename AT::t_f_array f;

View File

@ -309,8 +309,8 @@ void ImproperHarmonicKokkos<DeviceType>::allocate()
k_k = Kokkos::DualView<F_FLOAT*,DeviceType>("ImproperHarmonic::k",n+1); k_k = Kokkos::DualView<F_FLOAT*,DeviceType>("ImproperHarmonic::k",n+1);
k_chi = Kokkos::DualView<F_FLOAT*,DeviceType>("ImproperHarmonic::chi",n+1); k_chi = Kokkos::DualView<F_FLOAT*,DeviceType>("ImproperHarmonic::chi",n+1);
d_k = k_k.d_view; d_k = k_k.template view<DeviceType>();
d_chi = k_chi.d_view; d_chi = k_chi.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -307,6 +307,8 @@ void NeighBondKokkos<DeviceType>::bond_all()
"Bond atoms missing at step " BIGINT_FORMAT,update->ntimestep); "Bond atoms missing at step " BIGINT_FORMAT,update->ntimestep);
if (me == 0) error->warning(FLERR,str); if (me == 0) error->warning(FLERR,str);
} }
k_bondlist.modify<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>
@ -401,6 +403,8 @@ void NeighBondKokkos<DeviceType>::bond_partial()
"Bond atoms missing at step " BIGINT_FORMAT,update->ntimestep); "Bond atoms missing at step " BIGINT_FORMAT,update->ntimestep);
if (me == 0) error->warning(FLERR,str); if (me == 0) error->warning(FLERR,str);
} }
k_bondlist.modify<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>
@ -435,6 +439,8 @@ void NeighBondKokkos<DeviceType>::bond_check()
int flag = 0; int flag = 0;
update_domain_variables(); update_domain_variables();
atomKK->sync(execution_space, X_MASK);
k_bondlist.sync<DeviceType>();
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagNeighBondBondCheck>(0,neighbor->nbondlist),*this,flag); Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagNeighBondBondCheck>(0,neighbor->nbondlist),*this,flag);
DeviceType::fence(); DeviceType::fence();
@ -521,6 +527,8 @@ void NeighBondKokkos<DeviceType>::angle_all()
"Angle atoms missing at step " BIGINT_FORMAT,update->ntimestep); "Angle atoms missing at step " BIGINT_FORMAT,update->ntimestep);
if (me == 0) error->warning(FLERR,str); if (me == 0) error->warning(FLERR,str);
} }
k_anglelist.modify<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>
@ -622,6 +630,8 @@ void NeighBondKokkos<DeviceType>::angle_partial()
"Angle atoms missing at step " BIGINT_FORMAT,update->ntimestep); "Angle atoms missing at step " BIGINT_FORMAT,update->ntimestep);
if (me == 0) error->warning(FLERR,str); if (me == 0) error->warning(FLERR,str);
} }
k_anglelist.modify<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>
@ -664,6 +674,8 @@ void NeighBondKokkos<DeviceType>::angle_check()
// in case angle potential computes any of them // in case angle potential computes any of them
update_domain_variables(); update_domain_variables();
atomKK->sync(execution_space, X_MASK);
k_anglelist.sync<DeviceType>();
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagNeighBondAngleCheck>(0,neighbor->nanglelist),*this,flag); Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagNeighBondAngleCheck>(0,neighbor->nanglelist),*this,flag);
DeviceType::fence(); DeviceType::fence();
@ -762,6 +774,8 @@ void NeighBondKokkos<DeviceType>::dihedral_all()
"Dihedral atoms missing at step " BIGINT_FORMAT,update->ntimestep); "Dihedral atoms missing at step " BIGINT_FORMAT,update->ntimestep);
if (me == 0) error->warning(FLERR,str); if (me == 0) error->warning(FLERR,str);
} }
k_dihedrallist.modify<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>
@ -868,6 +882,8 @@ void NeighBondKokkos<DeviceType>::dihedral_partial()
"Dihedral atoms missing at step " BIGINT_FORMAT,update->ntimestep); "Dihedral atoms missing at step " BIGINT_FORMAT,update->ntimestep);
if (me == 0) error->warning(FLERR,str); if (me == 0) error->warning(FLERR,str);
} }
k_dihedrallist.modify<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>
@ -915,6 +931,8 @@ void NeighBondKokkos<DeviceType>::dihedral_check(int nlist, typename AT::t_int_2
// in case dihedral/improper potential computes any of them // in case dihedral/improper potential computes any of them
update_domain_variables(); update_domain_variables();
atomKK->sync(execution_space, X_MASK);
k_dihedrallist.sync<DeviceType>();
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagNeighBondDihedralCheck>(0,nlist),*this,flag); Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagNeighBondDihedralCheck>(0,nlist),*this,flag);
DeviceType::fence(); DeviceType::fence();
@ -1030,6 +1048,8 @@ void NeighBondKokkos<DeviceType>::improper_all()
"Improper atoms missing at step " BIGINT_FORMAT,update->ntimestep); "Improper atoms missing at step " BIGINT_FORMAT,update->ntimestep);
if (me == 0) error->warning(FLERR,str); if (me == 0) error->warning(FLERR,str);
} }
k_improperlist.modify<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>
@ -1136,6 +1156,8 @@ void NeighBondKokkos<DeviceType>::improper_partial()
"Improper atoms missing at step " BIGINT_FORMAT,update->ntimestep); "Improper atoms missing at step " BIGINT_FORMAT,update->ntimestep);
if (me == 0) error->warning(FLERR,str); if (me == 0) error->warning(FLERR,str);
} }
k_improperlist.modify<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>

View File

@ -387,16 +387,6 @@ void NeighborKokkos::build_topology() {
k_dihedrallist = neighbond_device.k_dihedrallist; k_dihedrallist = neighbond_device.k_dihedrallist;
k_improperlist = neighbond_device.k_improperlist; k_improperlist = neighbond_device.k_improperlist;
k_bondlist.sync<LMPDeviceType>();
k_anglelist.sync<LMPDeviceType>();
k_dihedrallist.sync<LMPDeviceType>();
k_improperlist.sync<LMPDeviceType>();
k_bondlist.modify<LMPDeviceType>();
k_anglelist.modify<LMPDeviceType>();
k_dihedrallist.modify<LMPDeviceType>();
k_improperlist.modify<LMPDeviceType>();
// Transfer topology neighbor lists to Host for non-Kokkos styles // Transfer topology neighbor lists to Host for non-Kokkos styles
if (force->bond && force->bond->execution_space == Host) if (force->bond && force->bond->execution_space == Host)
@ -415,15 +405,5 @@ void NeighborKokkos::build_topology() {
k_anglelist = neighbond_host.k_anglelist; k_anglelist = neighbond_host.k_anglelist;
k_dihedrallist = neighbond_host.k_dihedrallist; k_dihedrallist = neighbond_host.k_dihedrallist;
k_improperlist = neighbond_host.k_improperlist; k_improperlist = neighbond_host.k_improperlist;
k_bondlist.sync<LMPHostType>();
k_anglelist.sync<LMPHostType>();
k_dihedrallist.sync<LMPHostType>();
k_improperlist.sync<LMPHostType>();
k_bondlist.modify<LMPHostType>();
k_anglelist.modify<LMPHostType>();
k_dihedrallist.modify<LMPHostType>();
k_improperlist.modify<LMPHostType>();
} }
} }

View File

@ -201,14 +201,20 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::build(NeighList *list_)
if (newton_pair) { if (newton_pair) {
NPairKokkosBuildFunctor<DeviceType,TRI?0:HALF_NEIGH,1,TRI> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); NPairKokkosBuildFunctor<DeviceType,TRI?0:HALF_NEIGH,1,TRI> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor);
#ifdef KOKKOS_HAVE_CUDA #ifdef KOKKOS_HAVE_CUDA
Kokkos::parallel_for(config, f); if (ExecutionSpaceFromDevice<DeviceType>::space == Device)
Kokkos::parallel_for(config, f);
else
Kokkos::parallel_for(nall, f);
#else #else
Kokkos::parallel_for(nall, f); Kokkos::parallel_for(nall, f);
#endif #endif
} else { } else {
NPairKokkosBuildFunctor<DeviceType,HALF_NEIGH,0,0> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); NPairKokkosBuildFunctor<DeviceType,HALF_NEIGH,0,0> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor);
#ifdef KOKKOS_HAVE_CUDA #ifdef KOKKOS_HAVE_CUDA
Kokkos::parallel_for(config, f); if (ExecutionSpaceFromDevice<DeviceType>::space == Device)
Kokkos::parallel_for(config, f);
else
Kokkos::parallel_for(nall, f);
#else #else
Kokkos::parallel_for(nall, f); Kokkos::parallel_for(nall, f);
#endif #endif

View File

@ -406,7 +406,7 @@ struct NPairKokkosBuildFunctor<LMPHostType,HALF_NEIGH,GHOST_NEWTON,TRI> {
c.template build_Item<HALF_NEIGH,GHOST_NEWTON,TRI>(i); c.template build_Item<HALF_NEIGH,GHOST_NEWTON,TRI>(i);
} }
void operator() (typename Kokkos::TeamPolicy<LMPHostType>::member_type dev) const {} void operator() (typename Kokkos::TeamPolicy<LMPHostType>::member_type dev) const {} // Should error out
}; };
template<class DeviceType,int HALF_NEIGH> template<class DeviceType,int HALF_NEIGH>

View File

@ -261,7 +261,7 @@ void PairBuckCoulCutKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq");
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_buck_coul**,Kokkos::LayoutRight,DeviceType>("PairBuckCoulCut::params",n+1,n+1); k_params = Kokkos::DualView<params_buck_coul**,Kokkos::LayoutRight,DeviceType>("PairBuckCoulCut::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -319,7 +319,7 @@ void PairBuckCoulLongKokkos<DeviceType>::allocate()
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_buck_coul**,Kokkos::LayoutRight,DeviceType>("PairBuckCoulLong::params",n+1,n+1); k_params = Kokkos::DualView<params_buck_coul**,Kokkos::LayoutRight,DeviceType>("PairBuckCoulLong::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>

View File

@ -197,7 +197,7 @@ void PairBuckKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
d_cutsq = k_cutsq.template view<DeviceType>(); d_cutsq = k_cutsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_buck**,Kokkos::LayoutRight,DeviceType>("PairBuck::params",n+1,n+1); k_params = Kokkos::DualView<params_buck**,Kokkos::LayoutRight,DeviceType>("PairBuck::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -199,7 +199,7 @@ void PairCoulCutKokkos<DeviceType>::allocate()
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_coul**,Kokkos::LayoutRight,DeviceType>("PairCoulCut::params",n+1,n+1); k_params = Kokkos::DualView<params_coul**,Kokkos::LayoutRight,DeviceType>("PairCoulCut::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -221,7 +221,7 @@ void PairCoulDebyeKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
d_cutsq = k_cutsq.template view<DeviceType>(); d_cutsq = k_cutsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_coul**,Kokkos::LayoutRight,DeviceType>("PairCoulDebye::params",n+1,n+1); k_params = Kokkos::DualView<params_coul**,Kokkos::LayoutRight,DeviceType>("PairCoulDebye::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -279,7 +279,7 @@ void PairCoulLongKokkos<DeviceType>::allocate()
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_coul**,Kokkos::LayoutRight,DeviceType>("PairCoulLong::params",n+1,n+1); k_params = Kokkos::DualView<params_coul**,Kokkos::LayoutRight,DeviceType>("PairCoulLong::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>

View File

@ -101,8 +101,8 @@ void PairEAMAlloyKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
nmax = atom->nmax; nmax = atom->nmax;
k_rho = DAT::tdual_ffloat_1d("pair:rho",nmax); k_rho = DAT::tdual_ffloat_1d("pair:rho",nmax);
k_fp = DAT::tdual_ffloat_1d("pair:fp",nmax); k_fp = DAT::tdual_ffloat_1d("pair:fp",nmax);
d_rho = k_rho.d_view; d_rho = k_rho.template view<DeviceType>();
d_fp = k_fp.d_view; d_fp = k_fp.template view<DeviceType>();
h_rho = k_rho.h_view; h_rho = k_rho.h_view;
h_fp = k_fp.h_view; h_fp = k_fp.h_view;
} }
@ -322,9 +322,9 @@ void PairEAMAlloyKokkos<DeviceType>::file2array()
k_type2z2r.template modify<LMPHostType>(); k_type2z2r.template modify<LMPHostType>();
k_type2z2r.template sync<DeviceType>(); k_type2z2r.template sync<DeviceType>();
d_type2frho = k_type2frho.d_view; d_type2frho = k_type2frho.template view<DeviceType>();
d_type2rhor = k_type2rhor.d_view; d_type2rhor = k_type2rhor.template view<DeviceType>();
d_type2z2r = k_type2z2r.d_view; d_type2z2r = k_type2z2r.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -358,9 +358,9 @@ void PairEAMAlloyKokkos<DeviceType>::array2spline()
k_z2r_spline.template modify<LMPHostType>(); k_z2r_spline.template modify<LMPHostType>();
k_z2r_spline.template sync<DeviceType>(); k_z2r_spline.template sync<DeviceType>();
d_frho_spline = k_frho_spline.d_view; d_frho_spline = k_frho_spline.template view<DeviceType>();
d_rhor_spline = k_rhor_spline.d_view; d_rhor_spline = k_rhor_spline.template view<DeviceType>();
d_z2r_spline = k_z2r_spline.d_view; d_z2r_spline = k_z2r_spline.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -405,7 +405,7 @@ int PairEAMAlloyKokkos<DeviceType>::pack_forward_comm_kokkos(int n, DAT::tdual_i
d_sendlist = k_sendlist.view<DeviceType>(); d_sendlist = k_sendlist.view<DeviceType>();
iswap = iswap_in; iswap = iswap_in;
v_buf = buf.view<DeviceType>(); v_buf = buf.view<DeviceType>();
Kokkos::parallel_for(Kokkos::RangePolicy<LMPDeviceType, TagPairEAMAlloyPackForwardComm>(0,n),*this); Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairEAMAlloyPackForwardComm>(0,n),*this);
return n; return n;
} }
@ -423,7 +423,7 @@ void PairEAMAlloyKokkos<DeviceType>::unpack_forward_comm_kokkos(int n, int first
{ {
first = first_in; first = first_in;
v_buf = buf.view<DeviceType>(); v_buf = buf.view<DeviceType>();
Kokkos::parallel_for(Kokkos::RangePolicy<LMPDeviceType, TagPairEAMAlloyUnpackForwardComm>(0,n),*this); Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairEAMAlloyUnpackForwardComm>(0,n),*this);
} }
template<class DeviceType> template<class DeviceType>

View File

@ -130,15 +130,15 @@ class PairEAMAlloyKokkos : public PairEAM {
DAT::tdual_ffloat_1d k_rho; DAT::tdual_ffloat_1d k_rho;
DAT::tdual_ffloat_1d k_fp; DAT::tdual_ffloat_1d k_fp;
DAT::t_ffloat_1d d_rho; typename AT::t_ffloat_1d d_rho;
typename AT::t_ffloat_1d v_rho; typename AT::t_ffloat_1d v_rho;
DAT::t_ffloat_1d d_fp; typename AT::t_ffloat_1d d_fp;
HAT::t_ffloat_1d h_rho; HAT::t_ffloat_1d h_rho;
HAT::t_ffloat_1d h_fp; HAT::t_ffloat_1d h_fp;
DAT::t_int_1d_randomread d_type2frho; typename AT::t_int_1d_randomread d_type2frho;
DAT::t_int_2d_randomread d_type2rhor; typename AT::t_int_2d_randomread d_type2rhor;
DAT::t_int_2d_randomread d_type2z2r; typename AT::t_int_2d_randomread d_type2z2r;
typedef Kokkos::DualView<F_FLOAT**[7],Kokkos::LayoutRight,DeviceType> tdual_ffloat_2d_n7; typedef Kokkos::DualView<F_FLOAT**[7],Kokkos::LayoutRight,DeviceType> tdual_ffloat_2d_n7;
typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread; typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread;

View File

@ -101,8 +101,8 @@ void PairEAMFSKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
nmax = atom->nmax; nmax = atom->nmax;
k_rho = DAT::tdual_ffloat_1d("pair:rho",nmax); k_rho = DAT::tdual_ffloat_1d("pair:rho",nmax);
k_fp = DAT::tdual_ffloat_1d("pair:fp",nmax); k_fp = DAT::tdual_ffloat_1d("pair:fp",nmax);
d_rho = k_rho.d_view; d_rho = k_rho.template view<DeviceType>();
d_fp = k_fp.d_view; d_fp = k_fp.template view<DeviceType>();
h_rho = k_rho.h_view; h_rho = k_rho.h_view;
h_fp = k_fp.h_view; h_fp = k_fp.h_view;
} }
@ -322,9 +322,9 @@ void PairEAMFSKokkos<DeviceType>::file2array()
k_type2z2r.template modify<LMPHostType>(); k_type2z2r.template modify<LMPHostType>();
k_type2z2r.template sync<DeviceType>(); k_type2z2r.template sync<DeviceType>();
d_type2frho = k_type2frho.d_view; d_type2frho = k_type2frho.template view<DeviceType>();
d_type2rhor = k_type2rhor.d_view; d_type2rhor = k_type2rhor.template view<DeviceType>();
d_type2z2r = k_type2z2r.d_view; d_type2z2r = k_type2z2r.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -358,9 +358,9 @@ void PairEAMFSKokkos<DeviceType>::array2spline()
k_z2r_spline.template modify<LMPHostType>(); k_z2r_spline.template modify<LMPHostType>();
k_z2r_spline.template sync<DeviceType>(); k_z2r_spline.template sync<DeviceType>();
d_frho_spline = k_frho_spline.d_view; d_frho_spline = k_frho_spline.template view<DeviceType>();
d_rhor_spline = k_rhor_spline.d_view; d_rhor_spline = k_rhor_spline.template view<DeviceType>();
d_z2r_spline = k_z2r_spline.d_view; d_z2r_spline = k_z2r_spline.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -405,7 +405,7 @@ int PairEAMFSKokkos<DeviceType>::pack_forward_comm_kokkos(int n, DAT::tdual_int_
d_sendlist = k_sendlist.view<DeviceType>(); d_sendlist = k_sendlist.view<DeviceType>();
iswap = iswap_in; iswap = iswap_in;
v_buf = buf.view<DeviceType>(); v_buf = buf.view<DeviceType>();
Kokkos::parallel_for(Kokkos::RangePolicy<LMPDeviceType, TagPairEAMFSPackForwardComm>(0,n),*this); Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairEAMFSPackForwardComm>(0,n),*this);
return n; return n;
} }
@ -423,7 +423,7 @@ void PairEAMFSKokkos<DeviceType>::unpack_forward_comm_kokkos(int n, int first_in
{ {
first = first_in; first = first_in;
v_buf = buf.view<DeviceType>(); v_buf = buf.view<DeviceType>();
Kokkos::parallel_for(Kokkos::RangePolicy<LMPDeviceType, TagPairEAMFSUnpackForwardComm>(0,n),*this); Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairEAMFSUnpackForwardComm>(0,n),*this);
} }
template<class DeviceType> template<class DeviceType>

View File

@ -130,15 +130,15 @@ class PairEAMFSKokkos : public PairEAM {
DAT::tdual_ffloat_1d k_rho; DAT::tdual_ffloat_1d k_rho;
DAT::tdual_ffloat_1d k_fp; DAT::tdual_ffloat_1d k_fp;
DAT::t_ffloat_1d d_rho; typename AT::t_ffloat_1d d_rho;
typename AT::t_ffloat_1d v_rho; typename AT::t_ffloat_1d v_rho;
DAT::t_ffloat_1d d_fp; typename AT::t_ffloat_1d d_fp;
HAT::t_ffloat_1d h_rho; HAT::t_ffloat_1d h_rho;
HAT::t_ffloat_1d h_fp; HAT::t_ffloat_1d h_fp;
DAT::t_int_1d_randomread d_type2frho; typename AT::t_int_1d_randomread d_type2frho;
DAT::t_int_2d_randomread d_type2rhor; typename AT::t_int_2d_randomread d_type2rhor;
DAT::t_int_2d_randomread d_type2z2r; typename AT::t_int_2d_randomread d_type2z2r;
typedef Kokkos::DualView<F_FLOAT**[7],Kokkos::LayoutRight,DeviceType> tdual_ffloat_2d_n7; typedef Kokkos::DualView<F_FLOAT**[7],Kokkos::LayoutRight,DeviceType> tdual_ffloat_2d_n7;
typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread; typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread;

View File

@ -96,8 +96,8 @@ void PairEAMKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
nmax = atom->nmax; nmax = atom->nmax;
k_rho = DAT::tdual_ffloat_1d("pair:rho",nmax); k_rho = DAT::tdual_ffloat_1d("pair:rho",nmax);
k_fp = DAT::tdual_ffloat_1d("pair:fp",nmax); k_fp = DAT::tdual_ffloat_1d("pair:fp",nmax);
d_rho = k_rho.d_view; d_rho = k_rho.template view<DeviceType>();
d_fp = k_fp.d_view; d_fp = k_fp.template view<DeviceType>();
h_rho = k_rho.h_view; h_rho = k_rho.h_view;
h_fp = k_fp.h_view; h_fp = k_fp.h_view;
} }
@ -322,9 +322,9 @@ void PairEAMKokkos<DeviceType>::file2array()
k_type2z2r.template modify<LMPHostType>(); k_type2z2r.template modify<LMPHostType>();
k_type2z2r.template sync<DeviceType>(); k_type2z2r.template sync<DeviceType>();
d_type2frho = k_type2frho.d_view; d_type2frho = k_type2frho.template view<DeviceType>();
d_type2rhor = k_type2rhor.d_view; d_type2rhor = k_type2rhor.template view<DeviceType>();
d_type2z2r = k_type2z2r.d_view; d_type2z2r = k_type2z2r.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -358,9 +358,9 @@ void PairEAMKokkos<DeviceType>::array2spline()
k_z2r_spline.template modify<LMPHostType>(); k_z2r_spline.template modify<LMPHostType>();
k_z2r_spline.template sync<DeviceType>(); k_z2r_spline.template sync<DeviceType>();
d_frho_spline = k_frho_spline.d_view; d_frho_spline = k_frho_spline.template view<DeviceType>();
d_rhor_spline = k_rhor_spline.d_view; d_rhor_spline = k_rhor_spline.template view<DeviceType>();
d_z2r_spline = k_z2r_spline.d_view; d_z2r_spline = k_z2r_spline.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -405,7 +405,7 @@ int PairEAMKokkos<DeviceType>::pack_forward_comm_kokkos(int n, DAT::tdual_int_2d
d_sendlist = k_sendlist.view<DeviceType>(); d_sendlist = k_sendlist.view<DeviceType>();
iswap = iswap_in; iswap = iswap_in;
v_buf = buf.view<DeviceType>(); v_buf = buf.view<DeviceType>();
Kokkos::parallel_for(Kokkos::RangePolicy<LMPDeviceType, TagPairEAMPackForwardComm>(0,n),*this); Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairEAMPackForwardComm>(0,n),*this);
return n; return n;
} }
@ -423,7 +423,7 @@ void PairEAMKokkos<DeviceType>::unpack_forward_comm_kokkos(int n, int first_in,
{ {
first = first_in; first = first_in;
v_buf = buf.view<DeviceType>(); v_buf = buf.view<DeviceType>();
Kokkos::parallel_for(Kokkos::RangePolicy<LMPDeviceType, TagPairEAMUnpackForwardComm>(0,n),*this); Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairEAMUnpackForwardComm>(0,n),*this);
} }
template<class DeviceType> template<class DeviceType>

View File

@ -127,15 +127,15 @@ class PairEAMKokkos : public PairEAM {
DAT::tdual_ffloat_1d k_rho; DAT::tdual_ffloat_1d k_rho;
DAT::tdual_ffloat_1d k_fp; DAT::tdual_ffloat_1d k_fp;
DAT::t_ffloat_1d d_rho; typename AT::t_ffloat_1d d_rho;
typename AT::t_ffloat_1d v_rho; typename AT::t_ffloat_1d v_rho;
DAT::t_ffloat_1d d_fp; typename AT::t_ffloat_1d d_fp;
HAT::t_ffloat_1d h_rho; HAT::t_ffloat_1d h_rho;
HAT::t_ffloat_1d h_fp; HAT::t_ffloat_1d h_fp;
DAT::t_int_1d_randomread d_type2frho; typename AT::t_int_1d_randomread d_type2frho;
DAT::t_int_2d_randomread d_type2rhor; typename AT::t_int_2d_randomread d_type2rhor;
DAT::t_int_2d_randomread d_type2z2r; typename AT::t_int_2d_randomread d_type2z2r;
typedef Kokkos::DualView<F_FLOAT**[7],Kokkos::LayoutRight,DeviceType> tdual_ffloat_2d_n7; typedef Kokkos::DualView<F_FLOAT**[7],Kokkos::LayoutRight,DeviceType> tdual_ffloat_2d_n7;
typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread; typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread;

View File

@ -513,6 +513,7 @@ EV_FLOAT pair_compute (PairStyle* fpair, NeighListKokkos<typename PairStyle::dev
template<class DeviceType> template<class DeviceType>
struct PairVirialFDotRCompute { struct PairVirialFDotRCompute {
typedef DeviceType device_type;
typedef ArrayTypes<DeviceType> AT; typedef ArrayTypes<DeviceType> AT;
typedef EV_FLOAT value_type; typedef EV_FLOAT value_type;
typename AT::t_x_array_const_um x; typename AT::t_x_array_const_um x;

View File

@ -326,7 +326,7 @@ void PairLJCharmmCoulCharmmImplicitKokkos<DeviceType>::allocate()
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCharmmCoulCharmmImplicit::params",n+1,n+1); k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCharmmCoulCharmmImplicit::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>

View File

@ -327,7 +327,7 @@ void PairLJCharmmCoulCharmmKokkos<DeviceType>::allocate()
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCharmmCoulCharmm::params",n+1,n+1); k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCharmmCoulCharmm::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>

View File

@ -347,7 +347,7 @@ void PairLJCharmmCoulLongKokkos<DeviceType>::allocate()
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCharmmCoulLong::params",n+1,n+1); k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCharmmCoulLong::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>

View File

@ -264,7 +264,7 @@ void PairLJClass2CoulCutKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq");
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJClass2CoulCut::params",n+1,n+1); k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJClass2CoulCut::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -316,7 +316,7 @@ void PairLJClass2CoulLongKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq");
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJClass2CoulLong::params",n+1,n+1); k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJClass2CoulLong::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>

View File

@ -203,7 +203,7 @@ void PairLJClass2Kokkos<DeviceType>::allocate()
memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
d_cutsq = k_cutsq.template view<DeviceType>(); d_cutsq = k_cutsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>("PairLJClass2::params",n+1,n+1); k_params = Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>("PairLJClass2::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -256,7 +256,7 @@ void PairLJCutCoulCutKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq");
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCutCoulCut::params",n+1,n+1); k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCutCoulCut::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -270,7 +270,7 @@ void PairLJCutCoulDebyeKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq");
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCutCoulDebye::params",n+1,n+1); k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCutCoulDebye::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -288,7 +288,7 @@ void PairLJCutCoulDSFKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq");
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCutCoulDSF::params",n+1,n+1); k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCutCoulDSF::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -313,7 +313,7 @@ void PairLJCutCoulLongKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq");
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCutCoulLong::params",n+1,n+1); k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCutCoulLong::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>

View File

@ -198,7 +198,7 @@ void PairLJCutKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
d_cutsq = k_cutsq.template view<DeviceType>(); d_cutsq = k_cutsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>("PairLJCut::params",n+1,n+1); k_params = Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>("PairLJCut::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -205,7 +205,7 @@ void PairLJExpandKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
d_cutsq = k_cutsq.template view<DeviceType>(); d_cutsq = k_cutsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>("PairLJExpand::params",n+1,n+1); k_params = Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>("PairLJExpand::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -310,7 +310,7 @@ void PairLJGromacsCoulGromacsKokkos<DeviceType>::allocate()
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>(); d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj_coul_gromacs**,Kokkos::LayoutRight,DeviceType>("PairLJGromacsCoulGromacs::params",n+1,n+1); k_params = Kokkos::DualView<params_lj_coul_gromacs**,Kokkos::LayoutRight,DeviceType>("PairLJGromacsCoulGromacs::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>

View File

@ -252,7 +252,7 @@ void PairLJGromacsKokkos<DeviceType>::allocate()
d_cut_inner_sq = k_cut_inner_sq.template view<DeviceType>(); d_cut_inner_sq = k_cut_inner_sq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>("PairLJGromacs::params",n+1,n+1); k_params = Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>("PairLJGromacs::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -234,7 +234,7 @@ void PairLJSDKKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
d_cutsq = k_cutsq.template view<DeviceType>(); d_cutsq = k_cutsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>("PairLJSDK::params",n+1,n+1); k_params = Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>("PairLJSDK::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -212,7 +212,7 @@ void PairMorseKokkos<DeviceType>::allocate()
memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
d_cutsq = k_cutsq.template view<DeviceType>(); d_cutsq = k_cutsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_morse**,Kokkos::LayoutRight,DeviceType>("PairMorse::params",n+1,n+1); k_params = Kokkos::DualView<params_morse**,Kokkos::LayoutRight,DeviceType>("PairMorse::params",n+1,n+1);
params = k_params.d_view; params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -99,26 +99,26 @@ void PairReaxCKokkos<DeviceType>::allocate()
k_params_sing = Kokkos::DualView<params_sing*,typename DeviceType::array_layout,DeviceType> k_params_sing = Kokkos::DualView<params_sing*,typename DeviceType::array_layout,DeviceType>
("PairReaxC::params_sing",n+1); ("PairReaxC::params_sing",n+1);
paramssing = k_params_sing.d_view; paramssing = k_params_sing.template view<DeviceType>();
k_params_twbp = Kokkos::DualView<params_twbp**,typename DeviceType::array_layout,DeviceType> k_params_twbp = Kokkos::DualView<params_twbp**,typename DeviceType::array_layout,DeviceType>
("PairReaxC::params_twbp",n+1,n+1); ("PairReaxC::params_twbp",n+1,n+1);
paramstwbp = k_params_twbp.d_view; paramstwbp = k_params_twbp.template view<DeviceType>();
k_params_thbp = Kokkos::DualView<params_thbp***,typename DeviceType::array_layout,DeviceType> k_params_thbp = Kokkos::DualView<params_thbp***,typename DeviceType::array_layout,DeviceType>
("PairReaxC::params_thbp",n+1,n+1,n+1); ("PairReaxC::params_thbp",n+1,n+1,n+1);
paramsthbp = k_params_thbp.d_view; paramsthbp = k_params_thbp.template view<DeviceType>();
k_params_fbp = Kokkos::DualView<params_fbp****,typename DeviceType::array_layout,DeviceType> k_params_fbp = Kokkos::DualView<params_fbp****,typename DeviceType::array_layout,DeviceType>
("PairReaxC::params_fbp",n+1,n+1,n+1,n+1); ("PairReaxC::params_fbp",n+1,n+1,n+1,n+1);
paramsfbp = k_params_fbp.d_view; paramsfbp = k_params_fbp.template view<DeviceType>();
k_params_hbp = Kokkos::DualView<params_hbp***,typename DeviceType::array_layout,DeviceType> k_params_hbp = Kokkos::DualView<params_hbp***,typename DeviceType::array_layout,DeviceType>
("PairReaxC::params_hbp",n+1,n+1,n+1); ("PairReaxC::params_hbp",n+1,n+1,n+1);
paramshbp = k_params_hbp.d_view; paramshbp = k_params_hbp.template view<DeviceType>();
k_tap = DAT::tdual_ffloat_1d("pair:tap",8); k_tap = DAT::tdual_ffloat_1d("pair:tap",8);
d_tap = k_tap.d_view; d_tap = k_tap.template view<DeviceType>();
h_tap = k_tap.h_view; h_tap = k_tap.h_view;
} }
@ -367,7 +367,7 @@ void PairReaxCKokkos<DeviceType>::init_md()
Init_Lookup_Tables(); Init_Lookup_Tables();
k_LR = tdual_LR_lookup_table_kk_2d("lookup:LR",ntypes+1,ntypes+1); k_LR = tdual_LR_lookup_table_kk_2d("lookup:LR",ntypes+1,ntypes+1);
d_LR = k_LR.d_view; d_LR = k_LR.template view<DeviceType>();
for (int i = 1; i <= ntypes; ++i) { for (int i = 1; i <= ntypes; ++i) {
for (int j = i; j <= ntypes; ++j) { for (int j = i; j <= ntypes; ++j) {
@ -382,19 +382,19 @@ void PairReaxCKokkos<DeviceType>::init_md()
k_LR.h_view(i,j).m = LR[i][j].m; k_LR.h_view(i,j).m = LR[i][j].m;
k_LR.h_view(i,j).c = LR[i][j].c; k_LR.h_view(i,j).c = LR[i][j].c;
tdual_LR_data_1d k_y = tdual_LR_data_1d("lookup:LR[i,j].y",n); typename LR_lookup_table_kk<DeviceType>::tdual_LR_data_1d k_y = typename LR_lookup_table_kk<DeviceType>::tdual_LR_data_1d("lookup:LR[i,j].y",n);
tdual_cubic_spline_coef_1d k_H = tdual_cubic_spline_coef_1d("lookup:LR[i,j].H",n); typename LR_lookup_table_kk<DeviceType>::tdual_cubic_spline_coef_1d k_H = typename LR_lookup_table_kk<DeviceType>::tdual_cubic_spline_coef_1d("lookup:LR[i,j].H",n);
tdual_cubic_spline_coef_1d k_vdW = tdual_cubic_spline_coef_1d("lookup:LR[i,j].vdW",n); typename LR_lookup_table_kk<DeviceType>::tdual_cubic_spline_coef_1d k_vdW = typename LR_lookup_table_kk<DeviceType>::tdual_cubic_spline_coef_1d("lookup:LR[i,j].vdW",n);
tdual_cubic_spline_coef_1d k_CEvd = tdual_cubic_spline_coef_1d("lookup:LR[i,j].CEvd",n); typename LR_lookup_table_kk<DeviceType>::tdual_cubic_spline_coef_1d k_CEvd = typename LR_lookup_table_kk<DeviceType>::tdual_cubic_spline_coef_1d("lookup:LR[i,j].CEvd",n);
tdual_cubic_spline_coef_1d k_ele = tdual_cubic_spline_coef_1d("lookup:LR[i,j].ele",n); typename LR_lookup_table_kk<DeviceType>::tdual_cubic_spline_coef_1d k_ele = typename LR_lookup_table_kk<DeviceType>::tdual_cubic_spline_coef_1d("lookup:LR[i,j].ele",n);
tdual_cubic_spline_coef_1d k_CEclmb = tdual_cubic_spline_coef_1d("lookup:LR[i,j].CEclmb",n); typename LR_lookup_table_kk<DeviceType>::tdual_cubic_spline_coef_1d k_CEclmb = typename LR_lookup_table_kk<DeviceType>::tdual_cubic_spline_coef_1d("lookup:LR[i,j].CEclmb",n);
k_LR.h_view(i,j).d_y = k_y.d_view; k_LR.h_view(i,j).d_y = k_y.template view<DeviceType>();
k_LR.h_view(i,j).d_H = k_H.d_view; k_LR.h_view(i,j).d_H = k_H.template view<DeviceType>();
k_LR.h_view(i,j).d_vdW = k_vdW.d_view; k_LR.h_view(i,j).d_vdW = k_vdW.template view<DeviceType>();
k_LR.h_view(i,j).d_CEvd = k_CEvd.d_view; k_LR.h_view(i,j).d_CEvd = k_CEvd.template view<DeviceType>();
k_LR.h_view(i,j).d_ele = k_ele.d_view; k_LR.h_view(i,j).d_ele = k_ele.template view<DeviceType>();
k_LR.h_view(i,j).d_CEclmb = k_CEclmb.d_view; k_LR.h_view(i,j).d_CEclmb = k_CEclmb.template view<DeviceType>();
for (int k = 0; k < n; k++) { for (int k = 0; k < n; k++) {
k_y.h_view(k) = LR[i][j].y[k]; k_y.h_view(k) = LR[i][j].y[k];
@ -1213,7 +1213,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeTabulatedLJCoulomb<N
const int tmin = MIN( itype, jtype ); const int tmin = MIN( itype, jtype );
const int tmax = MAX( itype, jtype ); const int tmax = MAX( itype, jtype );
const LR_lookup_table_kk t = d_LR(tmin,tmax); const LR_lookup_table_kk<DeviceType> t = d_LR(tmin,tmax);
/* Cubic Spline Interpolation */ /* Cubic Spline Interpolation */

View File

@ -39,14 +39,15 @@ PairStyle(reax/c/kk/host,PairReaxCKokkos<LMPHostType>)
namespace LAMMPS_NS { namespace LAMMPS_NS {
typedef Kokkos::DualView<LR_data*,Kokkos::LayoutRight,LMPDeviceType> tdual_LR_data_1d; template<class DeviceType>
typedef typename tdual_LR_data_1d::t_dev t_LR_data_1d;
typedef Kokkos::DualView<cubic_spline_coef*,Kokkos::LayoutRight,LMPDeviceType> tdual_cubic_spline_coef_1d;
typedef typename tdual_cubic_spline_coef_1d::t_dev t_cubic_spline_coef_1d;
struct LR_lookup_table_kk struct LR_lookup_table_kk
{ {
typedef Kokkos::DualView<LR_data*,Kokkos::LayoutRight,DeviceType> tdual_LR_data_1d;
typedef typename tdual_LR_data_1d::t_dev t_LR_data_1d;
typedef Kokkos::DualView<cubic_spline_coef*,Kokkos::LayoutRight,DeviceType> tdual_cubic_spline_coef_1d;
typedef typename tdual_cubic_spline_coef_1d::t_dev t_cubic_spline_coef_1d;
double xmin, xmax; double xmin, xmax;
int n; int n;
double dx, inv_dx; double dx, inv_dx;
@ -397,7 +398,7 @@ class PairReaxCKokkos : public PairReaxC {
HAT::t_virial_array h_vatom; HAT::t_virial_array h_vatom;
DAT::tdual_float_1d k_tap; DAT::tdual_float_1d k_tap;
DAT::t_float_1d d_tap; typename AT::t_float_1d d_tap;
HAT::t_float_1d h_tap; HAT::t_float_1d h_tap;
typename AT::t_float_1d d_bo_rij, d_hb_rsq, d_Deltap, d_Deltap_boc, d_total_bo; typename AT::t_float_1d d_bo_rij, d_hb_rsq, d_Deltap, d_Deltap_boc, d_total_bo;
@ -438,7 +439,9 @@ class PairReaxCKokkos : public PairReaxC {
int bocnt,hbcnt; int bocnt,hbcnt;
typedef Kokkos::DualView<LR_lookup_table_kk**,LMPDeviceType::array_layout,DeviceType> tdual_LR_lookup_table_kk_2d; typedef LR_lookup_table_kk<DeviceType> LR_lookup_table_kk_DT;
typedef Kokkos::DualView<LR_lookup_table_kk_DT**,LMPDeviceType::array_layout,DeviceType> tdual_LR_lookup_table_kk_2d;
typedef typename tdual_LR_lookup_table_kk_2d::t_dev t_LR_lookup_table_kk_2d; typedef typename tdual_LR_lookup_table_kk_2d::t_dev t_LR_lookup_table_kk_2d;
tdual_LR_lookup_table_kk_2d k_LR; tdual_LR_lookup_table_kk_2d k_LR;

View File

@ -572,7 +572,7 @@ void PairSWKokkos<DeviceType>::coeff(int narg, char **arg)
k_map.template modify<LMPHostType>(); k_map.template modify<LMPHostType>();
k_map.template sync<DeviceType>(); k_map.template sync<DeviceType>();
d_map = k_map.d_view; d_map = k_map.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -637,8 +637,8 @@ void PairSWKokkos<DeviceType>::setup_params()
k_params.template modify<LMPHostType>(); k_params.template modify<LMPHostType>();
k_params.template sync<DeviceType>(); k_params.template sync<DeviceType>();
d_elem2param = k_elem2param.d_view; d_elem2param = k_elem2param.template view<DeviceType>();
d_params = k_params.d_view; d_params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -103,7 +103,7 @@ class PairSWKokkos : public PairSW {
typedef typename tdual_int_3d::t_host t_host_int_3d; typedef typename tdual_int_3d::t_host t_host_int_3d;
t_int_3d_randomread d_elem2param; t_int_3d_randomread d_elem2param;
DAT::t_int_1d_randomread d_map; typename AT::t_int_1d_randomread d_map;
typedef Kokkos::DualView<Param*,DeviceType> tdual_param_1d; typedef Kokkos::DualView<Param*,DeviceType> tdual_param_1d;
typedef typename tdual_param_1d::t_dev t_param_1d; typedef typename tdual_param_1d::t_dev t_param_1d;
@ -125,12 +125,12 @@ class PairSWKokkos : public PairSW {
DAT::tdual_efloat_1d k_eatom; DAT::tdual_efloat_1d k_eatom;
DAT::tdual_virial_array k_vatom; DAT::tdual_virial_array k_vatom;
typename ArrayTypes<DeviceType>::t_efloat_1d d_eatom; typename AT::t_efloat_1d d_eatom;
typename ArrayTypes<DeviceType>::t_virial_array d_vatom; typename AT::t_virial_array d_vatom;
DAT::t_int_1d_randomread d_type2frho; typename AT::t_int_1d_randomread d_type2frho;
DAT::t_int_2d_randomread d_type2rhor; typename AT::t_int_2d_randomread d_type2rhor;
DAT::t_int_2d_randomread d_type2z2r; typename AT::t_int_2d_randomread d_type2z2r;
typename AT::t_neighbors_2d d_neighbors; typename AT::t_neighbors_2d d_neighbors;
typename AT::t_int_1d_randomread d_ilist; typename AT::t_int_1d_randomread d_ilist;

View File

@ -76,7 +76,7 @@ void PairTersoffKokkos<DeviceType>::allocate()
k_params = Kokkos::DualView<params_ters***,Kokkos::LayoutRight,DeviceType> k_params = Kokkos::DualView<params_ters***,Kokkos::LayoutRight,DeviceType>
("PairTersoff::paramskk",n+1,n+1,n+1); ("PairTersoff::paramskk",n+1,n+1,n+1);
paramskk = k_params.d_view; paramskk = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -76,7 +76,7 @@ void PairTersoffMODKokkos<DeviceType>::allocate()
k_params = Kokkos::DualView<params_ters***,Kokkos::LayoutRight,DeviceType> k_params = Kokkos::DualView<params_ters***,Kokkos::LayoutRight,DeviceType>
("PairTersoffMOD::paramskk",n+1,n+1,n+1); ("PairTersoffMOD::paramskk",n+1,n+1,n+1);
paramskk = k_params.d_view; paramskk = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -87,7 +87,7 @@ void PairTersoffZBLKokkos<DeviceType>::allocate()
k_params = Kokkos::DualView<params_ters***,Kokkos::LayoutRight,DeviceType> k_params = Kokkos::DualView<params_ters***,Kokkos::LayoutRight,DeviceType>
("PairTersoffZBL::paramskk",n+1,n+1,n+1); ("PairTersoffZBL::paramskk",n+1,n+1,n+1);
paramskk = k_params.d_view; paramskk = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -573,7 +573,7 @@ void PairVashishtaKokkos<DeviceType>::coeff(int narg, char **arg)
k_map.template modify<LMPHostType>(); k_map.template modify<LMPHostType>();
k_map.template sync<DeviceType>(); k_map.template sync<DeviceType>();
d_map = k_map.d_view; d_map = k_map.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -638,8 +638,8 @@ void PairVashishtaKokkos<DeviceType>::setup_params()
k_params.template modify<LMPHostType>(); k_params.template modify<LMPHostType>();
k_params.template sync<DeviceType>(); k_params.template sync<DeviceType>();
d_elem2param = k_elem2param.d_view; d_elem2param = k_elem2param.template view<DeviceType>();
d_params = k_params.d_view; d_params = k_params.template view<DeviceType>();
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -103,7 +103,7 @@ class PairVashishtaKokkos : public PairVashishta {
typedef typename tdual_int_3d::t_host t_host_int_3d; typedef typename tdual_int_3d::t_host t_host_int_3d;
t_int_3d_randomread d_elem2param; t_int_3d_randomread d_elem2param;
DAT::t_int_1d_randomread d_map; typename AT::t_int_1d_randomread d_map;
typedef Kokkos::DualView<Param*,DeviceType> tdual_param_1d; typedef Kokkos::DualView<Param*,DeviceType> tdual_param_1d;
typedef typename tdual_param_1d::t_dev t_param_1d; typedef typename tdual_param_1d::t_dev t_param_1d;
@ -128,9 +128,9 @@ class PairVashishtaKokkos : public PairVashishta {
typename ArrayTypes<DeviceType>::t_efloat_1d d_eatom; typename ArrayTypes<DeviceType>::t_efloat_1d d_eatom;
typename ArrayTypes<DeviceType>::t_virial_array d_vatom; typename ArrayTypes<DeviceType>::t_virial_array d_vatom;
DAT::t_int_1d_randomread d_type2frho; typename AT::t_int_1d_randomread d_type2frho;
DAT::t_int_2d_randomread d_type2rhor; typename AT::t_int_2d_randomread d_type2rhor;
DAT::t_int_2d_randomread d_type2z2r; typename AT::t_int_2d_randomread d_type2z2r;
typename AT::t_neighbors_2d d_neighbors; typename AT::t_neighbors_2d d_neighbors;
typename AT::t_int_1d_randomread d_ilist; typename AT::t_int_1d_randomread d_ilist;

View File

@ -54,10 +54,10 @@ int RegBlockKokkos<DeviceType>::k_inside(double x, double y, double z) const
} }
template<class DeviceType> template<class DeviceType>
void RegBlockKokkos<DeviceType>::match_all_kokkos(int groupbit_in, DAT::t_int_1d d_match_in) void RegBlockKokkos<DeviceType>::match_all_kokkos(int groupbit_in, DAT::tdual_int_1d k_match_in)
{ {
groupbit = groupbit_in; groupbit = groupbit_in;
d_match = d_match_in; d_match = k_match_in.template view<DeviceType>();
atomKK->sync(Device, X_MASK | MASK_MASK); atomKK->sync(Device, X_MASK | MASK_MASK);
@ -69,6 +69,8 @@ void RegBlockKokkos<DeviceType>::match_all_kokkos(int groupbit_in, DAT::t_int_1d
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagRegBlockMatchAll>(0,nlocal),*this); Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagRegBlockMatchAll>(0,nlocal),*this);
DeviceType::fence(); DeviceType::fence();
copymode = 0; copymode = 0;
k_match_in.template modify<DeviceType>();
} }
template<class DeviceType> template<class DeviceType>

View File

@ -39,14 +39,14 @@ class RegBlockKokkos : public RegBlock {
RegBlockKokkos(class LAMMPS *, int, char **); RegBlockKokkos(class LAMMPS *, int, char **);
~RegBlockKokkos(); ~RegBlockKokkos();
void match_all_kokkos(int, DAT::t_int_1d); void match_all_kokkos(int, DAT::tdual_int_1d);
KOKKOS_INLINE_FUNCTION KOKKOS_INLINE_FUNCTION
void operator()(TagRegBlockMatchAll, const int&) const; void operator()(TagRegBlockMatchAll, const int&) const;
private: private:
int groupbit; int groupbit;
DAT::t_int_1d d_match; typename AT::t_int_1d d_match;
typename AT::t_x_array_randomread x; typename AT::t_x_array_randomread x;
typename AT::t_int_1d_randomread mask; typename AT::t_int_1d_randomread mask;

View File

@ -14,6 +14,8 @@
#ifdef INTEGRATE_CLASS #ifdef INTEGRATE_CLASS
IntegrateStyle(verlet/kk,VerletKokkos) IntegrateStyle(verlet/kk,VerletKokkos)
IntegrateStyle(verlet/kk/device,VerletKokkos)
IntegrateStyle(verlet/kk/host,VerletKokkos)
#else #else

View File

@ -99,7 +99,7 @@ class DAT {
public: public:
typedef double tdual_xfloat_1d; typedef double tdual_xfloat_1d;
typedef double tdual_FFT_SCALAR_1d; typedef double tdual_FFT_SCALAR_1d;
typedef int t_int_1d; typedef int tdual_int_1d;
typedef int tdual_int_2d; typedef int tdual_int_2d;
}; };

View File

@ -22,6 +22,10 @@
#include "neighbor.h" #include "neighbor.h"
#include "neigh_list.h" #include "neigh_list.h"
#include "neigh_request.h" #include "neigh_request.h"
#include "nbin.h"
#include "nstencil.h"
#include "npair.h"
#include "ntopo.h"
#include "style_nbin.h" #include "style_nbin.h"
#include "style_nstencil.h" #include "style_nstencil.h"
#include "style_npair.h" #include "style_npair.h"

View File

@ -146,7 +146,7 @@ int Region::match(double x, double y, double z)
generate error if Kokkos function defaults to base class generate error if Kokkos function defaults to base class
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Region::match_all_kokkos(int, DAT::t_int_1d) void Region::match_all_kokkos(int, DAT::tdual_int_1d)
{ {
error->all(FLERR,"Can only use Kokkos supported regions with Kokkos package"); error->all(FLERR,"Can only use Kokkos supported regions with Kokkos package");
} }

View File

@ -99,7 +99,7 @@ class Region : protected Pointers {
// Kokkos function, implemented by each Kokkos region // Kokkos function, implemented by each Kokkos region
virtual void match_all_kokkos(int, DAT::t_int_1d); virtual void match_all_kokkos(int, DAT::tdual_int_1d);
protected: protected:
void add_contact(int, double *, double, double, double); void add_contact(int, double *, double, double, double);