forked from lijiext/lammps
Favor copymode instead of cleanup_copy
This commit is contained in:
parent
db75232957
commit
0c1dcfb617
|
@ -77,6 +77,7 @@ void FixEnforce2DKokkos<DeviceType>::post_force(int vflag)
|
|||
if( atomKK->angmom_flag ) flag_mask |= 2;
|
||||
if( atomKK->torque_flag ) flag_mask |= 4;
|
||||
|
||||
copymode = 1;
|
||||
switch( flag_mask ){
|
||||
case 0:{
|
||||
FixEnforce2DKokkosPostForceFunctor<DeviceType,0,0,0> functor(this);
|
||||
|
@ -121,7 +122,7 @@ void FixEnforce2DKokkos<DeviceType>::post_force(int vflag)
|
|||
default:
|
||||
error->all(FLERR, "flag_mask outside of what it should be");
|
||||
}
|
||||
|
||||
copymode = 0;
|
||||
|
||||
// Probably sync here again?
|
||||
atomKK->sync(execution_space,datamask_read);
|
||||
|
@ -159,14 +160,6 @@ void FixEnforce2DKokkos<DeviceType>::post_force_item( int i ) const
|
|||
}
|
||||
|
||||
|
||||
template<class DeviceType>
|
||||
void FixEnforce2DKokkos<DeviceType>::cleanup_copy()
|
||||
{
|
||||
id = style = NULL;
|
||||
vatom = NULL;
|
||||
}
|
||||
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
template class FixEnforce2DKokkos<LMPDeviceType>;
|
||||
#ifdef KOKKOS_HAVE_CUDA
|
||||
|
|
|
@ -33,7 +33,6 @@ class FixEnforce2DKokkos : public FixEnforce2D {
|
|||
FixEnforce2DKokkos(class LAMMPS *, int, char **);
|
||||
// ~FixEnforce2DKokkos() {}
|
||||
// void init();
|
||||
void cleanup_copy();
|
||||
void setup(int);
|
||||
void post_force(int);
|
||||
|
||||
|
@ -63,7 +62,7 @@ struct FixEnforce2DKokkosPostForceFunctor {
|
|||
FixEnforce2DKokkos<DeviceType> c;
|
||||
|
||||
FixEnforce2DKokkosPostForceFunctor(FixEnforce2DKokkos<DeviceType>* c_ptr):
|
||||
c(*c_ptr) {c.cleanup_copy();};
|
||||
c(*c_ptr) {};
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(const int i) const {
|
||||
|
|
|
@ -38,6 +38,8 @@ FixEnforce2D::FixEnforce2D(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
FixEnforce2D::~FixEnforce2D()
|
||||
{
|
||||
if (copymode) return;
|
||||
|
||||
delete [] flist;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue