Commit 9f058f19 authored by Stan Moore's avatar Stan Moore
Browse files

Deallocate duplicated memory

parent 44d7c79f
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -260,9 +260,6 @@ void FixQEqReaxKokkos<DeviceType>::pre_force(int vflag)
  // 2nd cg solve over b_t, t
  cg_solve2();

  if (need_dup)
    dup_o = decltype(dup_o)(); // free duplicated memory

  // calculate_Q();
  calculate_q();
  k_s_hist.template modify<DeviceType>();
@@ -272,6 +269,10 @@ void FixQEqReaxKokkos<DeviceType>::pre_force(int vflag)

  if (!allocated_flag)
    allocated_flag = 1;

  // free duplicated memory
  if (need_dup)
    dup_o = decltype(dup_o)();
}

/* ---------------------------------------------------------------------- */
+8 −0
Original line number Diff line number Diff line
@@ -277,6 +277,14 @@ void PairEAMAlloyKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
  if (vflag_fdotr) pair_virial_fdotr_compute(this);

  copymode = 0;

  // free duplicated memory
  if (need_dup) {
    dup_rho   = decltype(dup_rho)();
    dup_f     = decltype(dup_f)();
    dup_eatom = decltype(dup_eatom)();
    dup_vatom = decltype(dup_vatom)();
  }
}

/* ----------------------------------------------------------------------
+8 −0
Original line number Diff line number Diff line
@@ -276,6 +276,14 @@ void PairEAMFSKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
  }

  copymode = 0;

  // free duplicated memory
  if (need_dup) {
    dup_rho   = decltype(dup_rho)();
    dup_f     = decltype(dup_f)();
    dup_eatom = decltype(dup_eatom)();
    dup_vatom = decltype(dup_vatom)();
  }
}

/* ----------------------------------------------------------------------
+8 −0
Original line number Diff line number Diff line
@@ -271,6 +271,14 @@ void PairEAMKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
  }

  copymode = 0;

  // free duplicated memory
  if (need_dup) {
    dup_rho   = decltype(dup_rho)();
    dup_f     = decltype(dup_f)();
    dup_eatom = decltype(dup_eatom)();
    dup_vatom = decltype(dup_vatom)();
  }
}

/* ----------------------------------------------------------------------
+2 −2
Original line number Diff line number Diff line
@@ -1063,6 +1063,8 @@ void PairReaxCKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
  if (fixspecies_flag)
    FindBondSpecies();

  copymode = 0;

  // free duplicated memory
  if (need_dup) {
    dup_f            = decltype(dup_f)();
@@ -1075,8 +1077,6 @@ void PairReaxCKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
    dup_eatom        = decltype(dup_eatom)();
    dup_vatom        = decltype(dup_vatom)();
  }

  copymode = 0;
}

/* ---------------------------------------------------------------------- */
Loading