Fix 32-bit integer overflow in Kokkos neighlist build

This commit is contained in:
Stan Moore 2020-05-11 15:11:24 -06:00
parent b799e44e5c
commit b1ac51f721
1 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ class AtomNeighbors
num_neighs(_num_neighs), _firstneigh(firstneigh), _stride(stride) {};
KOKKOS_INLINE_FUNCTION
int& operator()(const int &i) const {
return _firstneigh[i*_stride];
return _firstneigh[(bigint) i*_stride];
}
private:
@ -51,7 +51,7 @@ class AtomNeighborsConst
_firstneigh(firstneigh), num_neighs(_num_neighs), _stride(stride) {};
KOKKOS_INLINE_FUNCTION
const int& operator()(const int &i) const {
return _firstneigh[i*_stride];
return _firstneigh[(bigint) i*_stride];
}
private: