Simplify view deallocation code

This commit is contained in:
Stan Moore
2024-09-23 16:14:06 -06:00
parent e95de835c0
commit 7e31a4f482
21 changed files with 89 additions and 89 deletions

View File

@ -365,7 +365,7 @@ void FixACKS2ReaxFFKokkos<DeviceType>::pre_force(int /*vflag*/)
// free duplicated memory
dup_X_diag = decltype(dup_X_diag)();
dup_X_diag = {};
}
if (neighflag != FULL) {
@ -1419,7 +1419,7 @@ void FixACKS2ReaxFFKokkos<DeviceType>::sparse_matvec_acks2(typename AT::t_ffloat
// free duplicated memory
dup_bb = decltype(dup_bb)();
dup_bb = {};
}
}

View File

@ -291,7 +291,7 @@ void FixQEqReaxFFKokkos<DeviceType>::pre_force(int /*vflag*/)
// free duplicated memory
if (need_dup)
dup_o = decltype(dup_o)();
dup_o = {};
atomKK->modified(execution_space,datamask_modify);

View File

@ -459,8 +459,8 @@ void FixShakeKokkos<DeviceType>::post_force(int vflag)
// free duplicated memory
if (need_dup) {
dup_f = decltype(dup_f)();
dup_vatom = decltype(dup_vatom)();
dup_f = {};
dup_vatom = {};
}
}

View File

@ -294,20 +294,20 @@ MEAMKokkos<DeviceType>::meam_dens_init(int inum_half, int ntype, typename AT::t_
Kokkos::Experimental::contribute(d_arho3mb, dup_arho3mb);
// free duplicated memory
dup_rho0 = decltype(dup_rho0)();
dup_arho2b = decltype(dup_arho2b)();
dup_arho1 = decltype(dup_arho1)();
dup_arho2 = decltype(dup_arho2)();
dup_arho3 = decltype(dup_arho3)();
dup_arho3b = decltype(dup_arho3b)();
dup_t_ave = decltype(dup_t_ave)();
dup_tsq_ave = decltype(dup_tsq_ave)();
dup_rho0 = {};
dup_arho2b = {};
dup_arho1 = {};
dup_arho2 = {};
dup_arho3 = {};
dup_arho3b = {};
dup_t_ave = {};
dup_tsq_ave = {};
// msmeam
dup_arho2mb = decltype(dup_arho2mb)();
dup_arho1m = decltype(dup_arho1m)();
dup_arho2m = decltype(dup_arho2m)();
dup_arho3m = decltype(dup_arho3m)();
dup_arho3mb = decltype(dup_arho3mb)();
dup_arho2mb = {};
dup_arho1m = {};
dup_arho2m = {};
dup_arho3m = {};
dup_arho3mb = {};
}
}

View File

@ -75,9 +75,9 @@ void MEAMKokkos<DeviceType>::meam_force(
if (vflag_atom) Kokkos::Experimental::contribute(d_vatom, dup_vatom);
// free duplicated memory
dup_f = decltype(dup_f)();
if (eflag_atom) dup_eatom = decltype(dup_eatom)();
if (vflag_atom) dup_vatom = decltype(dup_vatom)();
dup_f = {};
if (eflag_atom) dup_eatom = {};
if (vflag_atom) dup_vatom = {};
}
}

View File

@ -297,12 +297,12 @@ void PairADPKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// free duplicated memory
if (need_dup) {
dup_rho = decltype(dup_rho)();
dup_mu = decltype(dup_mu)();
dup_lambda = decltype(dup_lambda)();
dup_f = decltype(dup_f)();
dup_eatom = decltype(dup_eatom)();
dup_vatom = decltype(dup_vatom)();
dup_rho = {};
dup_mu = {};
dup_lambda = {};
dup_f = {};
dup_eatom = {};
dup_vatom = {};
}
}

View File

@ -207,9 +207,9 @@ void PairDPDExtKokkos<DeviceType>::compute(int eflagin, int vflagin)
// free duplicated memory
if (need_dup) {
dup_f = decltype(dup_f)();
dup_eatom = decltype(dup_eatom)();
dup_vatom = decltype(dup_vatom)();
dup_f = {};
dup_eatom = {};
dup_vatom = {};
}
}

View File

@ -212,8 +212,8 @@ void PairDPDExtTstatKokkos<DeviceType>::compute(int eflagin, int vflagin)
// free duplicated memory
if (need_dup) {
dup_f = decltype(dup_f)();
dup_vatom = decltype(dup_vatom)();
dup_f = {};
dup_vatom = {};
}
}

View File

@ -207,9 +207,9 @@ void PairDPDKokkos<DeviceType>::compute(int eflagin, int vflagin)
// free duplicated memory
if (need_dup) {
dup_f = decltype(dup_f)();
dup_eatom = decltype(dup_eatom)();
dup_vatom = decltype(dup_vatom)();
dup_f = {};
dup_eatom = {};
dup_vatom = {};
}
}

View File

@ -211,8 +211,8 @@ void PairDPDTstatKokkos<DeviceType>::compute(int eflagin, int vflagin)
// free duplicated memory
if (need_dup) {
dup_f = decltype(dup_f)();
dup_vatom = decltype(dup_vatom)();
dup_f = {};
dup_vatom = {};
}
}

View File

@ -309,10 +309,10 @@ void PairEAMAlloyKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// 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)();
dup_rho = {};
dup_f = {};
dup_eatom = {};
dup_vatom = {};
}
}

View File

@ -309,10 +309,10 @@ void PairEAMFSKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// 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)();
dup_rho = {};
dup_f = {};
dup_eatom = {};
dup_vatom = {};
}
}

View File

@ -304,10 +304,10 @@ void PairEAMKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// 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)();
dup_rho = {};
dup_f = {};
dup_eatom = {};
dup_vatom = {};
}
}

View File

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

View File

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

View File

@ -118,10 +118,10 @@ void PairReaxFFKokkos<DeviceType>::deallocate_views_of_views()
for (int i = 0; i < (int)k_LR.extent(0); i++) {
for (int j = 0; j < (int)k_LR.extent(1); j++) {
k_LR.h_view(i,j).d_vdW = decltype(k_LR.h_view(i,j).d_vdW )();
k_LR.h_view(i,j).d_CEvd = decltype(k_LR.h_view(i,j).d_CEvd )();
k_LR.h_view(i,j).d_ele = decltype(k_LR.h_view(i,j).d_ele )();
k_LR.h_view(i,j).d_CEclmb = decltype(k_LR.h_view(i,j).d_CEclmb)();
k_LR.h_view(i,j).d_vdW = {};
k_LR.h_view(i,j).d_CEvd = {};
k_LR.h_view(i,j).d_ele = {};
k_LR.h_view(i,j).d_CEclmb = {};
}
}
}
@ -1101,19 +1101,19 @@ void PairReaxFFKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// free scatterview memory
if (need_dup) {
dup_f = decltype(dup_f)();
dup_eatom = decltype(dup_eatom)();
dup_vatom = decltype(dup_vatom)();
dup_dDeltap_self = decltype(dup_dDeltap_self)();
dup_total_bo = decltype(dup_total_bo)();
dup_CdDelta = decltype(dup_CdDelta)();
dup_f = {};
dup_eatom = {};
dup_vatom = {};
dup_dDeltap_self = {};
dup_total_bo = {};
dup_CdDelta = {};
} else {
ndup_f = decltype(ndup_f)();
ndup_eatom = decltype(ndup_eatom)();
ndup_vatom = decltype(ndup_vatom)();
ndup_dDeltap_self = decltype(ndup_dDeltap_self)();
ndup_total_bo = decltype(ndup_total_bo)();
ndup_CdDelta = decltype(ndup_CdDelta)();
ndup_f = {};
ndup_eatom = {};
ndup_vatom = {};
ndup_dDeltap_self = {};
ndup_total_bo = {};
ndup_CdDelta = {};
}
d_neighbors = typename AT::t_neighbors_2d();
@ -1501,13 +1501,13 @@ void PairReaxFFKokkos<DeviceType>::allocate_array()
{
// free scatterview memory
if (need_dup) {
dup_dDeltap_self = decltype(dup_dDeltap_self)();
dup_total_bo = decltype(dup_total_bo)();
dup_CdDelta = decltype(dup_CdDelta)();
dup_dDeltap_self = {};
dup_total_bo = {};
dup_CdDelta = {};
} else {
ndup_dDeltap_self = decltype(ndup_dDeltap_self)();
ndup_total_bo = decltype(ndup_total_bo)();
ndup_CdDelta = decltype(ndup_CdDelta)();
ndup_dDeltap_self = {};
ndup_total_bo = {};
ndup_CdDelta = {};
}
if (cut_hbsq > 0.0) {

View File

@ -525,8 +525,8 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::compute(int eflag_in,
// free duplicated memory
if (need_dup) {
dup_f = decltype(dup_f)();
dup_vatom = decltype(dup_vatom)();
dup_f = {};
dup_vatom = {};
}
}

View File

@ -186,9 +186,9 @@ void PairSWKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// free duplicated memory
if (need_dup) {
dup_f = decltype(dup_f)();
dup_eatom = decltype(dup_eatom)();
dup_vatom = decltype(dup_vatom)();
dup_f = {};
dup_eatom = {};
dup_vatom = {};
}
}

View File

@ -293,9 +293,9 @@ void PairTersoffKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// free duplicated memory
if (need_dup) {
dup_f = decltype(dup_f)();
dup_eatom = decltype(dup_eatom)();
dup_vatom = decltype(dup_vatom)();
dup_f = {};
dup_eatom = {};
dup_vatom = {};
}
}

View File

@ -283,9 +283,9 @@ void PairTersoffMODKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// free duplicated memory
if (need_dup) {
dup_f = decltype(dup_f)();
dup_eatom = decltype(dup_eatom)();
dup_vatom = decltype(dup_vatom)();
dup_f = {};
dup_eatom = {};
dup_vatom = {};
}
}

View File

@ -296,9 +296,9 @@ void PairTersoffZBLKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// free duplicated memory
if (need_dup) {
dup_f = decltype(dup_f)();
dup_eatom = decltype(dup_eatom)();
dup_vatom = decltype(dup_vatom)();
dup_f = {};
dup_eatom = {};
dup_vatom = {};
}
}