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

Partially revert 01d0a5c4, avoid atomics, safe because of the while loop. Worst...

Partially revert 01d0a5c4, avoid atomics, safe because of the while loop. Worst case is the resize will happen again because max wasn't accurate
parent d7aac2fe
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -434,7 +434,7 @@ void NeighborKokkosExecute<DeviceType>::
  if(n > neigh_list.maxneighs) {
    resize() = 1;

    if(n > new_maxneighs()) Kokkos::atomic_fetch_max(&new_maxneighs(),n);
    if(n > new_maxneighs()) new_maxneighs() = n; // avoid atomics, safe because in while loop
  }

  neigh_list.d_ilist(i) = i;
@@ -644,7 +644,7 @@ void NeighborKokkosExecute<DeviceType>::build_ItemCuda(typename Kokkos::TeamPoli
  if(n > neigh_list.maxneighs) {
    resize() = 1;

    if(n > new_maxneighs()) Kokkos::atomic_fetch_max(&new_maxneighs(),n);
    if(n > new_maxneighs()) new_maxneighs() = n; // avoid atomics, safe because in while loop
  }
  }
}
@@ -767,7 +767,7 @@ void NeighborKokkosExecute<DeviceType>::
  if(n > neigh_list.maxneighs) {
    resize() = 1;

    if(n > new_maxneighs()) Kokkos::atomic_fetch_max(&new_maxneighs(),n);
    if(n > new_maxneighs()) new_maxneighs() = n; // avoid atomics, safe because in while loop
  }
  neigh_list.d_ilist(i) = i;
}