Unverified Commit 0a90032b authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1563 from stanmoore1/kk_setforce

Fix segfault in fix_setforce_kokkos
parents 6742f371 a51479a6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;