Merge pull request #1563 from stanmoore1/kk_setforce

Fix segfault in fix_setforce_kokkos
This commit is contained in:
Axel Kohlmeyer
2019-07-15 18:07:10 -04:00
committed by GitHub

View File

@ -47,6 +47,7 @@ FixSetForceKokkos<DeviceType>::FixSetForceKokkos(LAMMPS *lmp, int narg, char **a
memory->destroy(sforce);
memoryKK->create_kokkos(k_sforce,sforce,maxatom,3,"setforce:sforce");
d_sforce = k_sforce.view<DeviceType>();
}
/* ---------------------------------------------------------------------- */
@ -103,6 +104,7 @@ void FixSetForceKokkos<DeviceType>::post_force(int vflag)
maxatom = atom->nmax;
memoryKK->destroy_kokkos(k_sforce,sforce);
memoryKK->create_kokkos(k_sforce,sforce,maxatom,3,"setforce:sforce");
d_sforce = k_sforce.view<DeviceType>();
}
foriginal[0] = foriginal[1] = foriginal[2] = 0.0;