Prevent double free of CPU memory

This commit is contained in:
Stan Gerald Moore
2022-12-14 13:58:10 -07:00
parent 82147f1eb6
commit 85ed8edfcb
2 changed files with 10 additions and 0 deletions

View File

@ -40,6 +40,15 @@ AtomVecKokkos::AtomVecKokkos(LAMMPS *lmp) : AtomVec(lmp)
/* ---------------------------------------------------------------------- */
AtomVecKokkos::~AtomVecKokkos()
{
// Kokkos already deallocated host memory
ngrow = 0;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType,int PBC_FLAG,int TRICLINIC>
struct AtomVecKokkos_PackComm {
typedef DeviceType device_type;

View File

@ -36,6 +36,7 @@ union d_ubuf {
class AtomVecKokkos : virtual public AtomVec {
public:
AtomVecKokkos(class LAMMPS *);
~AtomVecKokkos();
virtual void sync(ExecutionSpace space, unsigned int mask) = 0;
virtual void modified(ExecutionSpace space, unsigned int mask) = 0;