Second try for CUDA

This commit is contained in:
mkanski
2022-11-10 17:03:55 +01:00
parent ee5d40984f
commit 9a78f45c09
2 changed files with 6 additions and 1 deletions

View File

@ -61,8 +61,12 @@ void FixViscousKokkos<DeviceType>::init()
k_gamma = Kokkos::DualView<double*, Kokkos::LayoutRight, DeviceType>("FixViscousKokkos:gamma",atom->ntypes+1);
gamma2 = k_gamma.template view<DeviceType>();
for (int i = 1; i <= atom->ntypes; i++) k_gamma.h_view(i) = gamma[i];
k_gamma.template sync<DeviceType>();
if (utils::strmatch(update->integrate_style,"^respa"))
error->all(FLERR,"Cannot (yet) use respa with Kokkos");
}
@ -93,7 +97,7 @@ template<class DeviceType>
KOKKOS_INLINE_FUNCTION
void FixViscousKokkos<DeviceType>::operator()(TagFixViscous, const int &i) const {
if (mask[i] & groupbit) {
double drag = k_gamma.h_view(type[i]);
double drag = gamma2(type[i]);
f(i,0) -= drag*v(i,0);
f(i,1) -= drag*v(i,1);
f(i,2) -= drag*v(i,2);

View File

@ -54,6 +54,7 @@ class FixViscousKokkos : public FixViscous {
typename AT::t_int_1d_randomread type;
Kokkos::DualView<double*, Kokkos::LayoutRight, DeviceType> k_gamma;
typename Kokkos::DualView<double*,Kokkos::LayoutRight,DeviceType>::t_dev_const_um gamma2;
};
}