Overallocate slightly to reduce memory reallocs

This commit is contained in:
Stan Gerald Moore
2022-04-12 16:20:21 -06:00
parent 2998462743
commit 622a4a6d51
2 changed files with 4 additions and 4 deletions

View File

@ -136,10 +136,10 @@ void PairSWKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
if (((int) d_neighbors_short.extent(1) < max_neighs) ||
((int) d_neighbors_short.extent(0) < ignum)) {
d_neighbors_short = Kokkos::View<int**,DeviceType>("SW::neighbors_short",ignum,max_neighs);
d_neighbors_short = Kokkos::View<int**,DeviceType>("SW::neighbors_short",ignum*1.2,max_neighs);
}
if ((int)d_numneigh_short.extent(0) < ignum)
d_numneigh_short = Kokkos::View<int*,DeviceType>("SW::numneighs_short",ignum);
d_numneigh_short = Kokkos::View<int*,DeviceType>("SW::numneighs_short",ignum*1.2);
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType,TagPairSWComputeShortNeigh>(0,neighflag==FULL?ignum:inum), *this);
// loop over neighbor list of my atoms

View File

@ -219,10 +219,10 @@ void PairTersoffKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
if (((int)d_neighbors_short.extent(1) < max_neighs) ||
((int)d_neighbors_short.extent(0) < ignum)) {
d_neighbors_short = Kokkos::View<int**,DeviceType>("Tersoff::neighbors_short",ignum,max_neighs);
d_neighbors_short = Kokkos::View<int**,DeviceType>("Tersoff::neighbors_short",ignum*1.2,max_neighs);
}
if ((int)d_numneigh_short.extent(0) < ignum)
d_numneigh_short = Kokkos::View<int*,DeviceType>("Tersoff::numneighs_short",ignum);
d_numneigh_short = Kokkos::View<int*,DeviceType>("Tersoff::numneighs_short",ignum*1.2);
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType,TagPairTersoffComputeShortNeigh>(0,neighflag==FULL?ignum:inum), *this);
if (neighflag == HALF) {