Clear sharedsize for flat method
This commit is contained in:
@ -219,12 +219,12 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI,SIZE>::build(NeighList *list_)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (GHOST) {
|
if (GHOST) {
|
||||||
NPairKokkosBuildFunctorGhost<DeviceType,HALF_NEIGH> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor);
|
NPairKokkosBuildFunctorGhost<DeviceType,HALF_NEIGH> f(data);
|
||||||
Kokkos::parallel_for(nall, f);
|
Kokkos::parallel_for(nall, f);
|
||||||
} else {
|
} else {
|
||||||
if (newton_pair) {
|
if (newton_pair) {
|
||||||
if (SIZE) {
|
if (SIZE) {
|
||||||
NPairKokkosBuildFunctorSize<DeviceType,TRI?0:HALF_NEIGH,1,TRI> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor);
|
NPairKokkosBuildFunctorSize<DeviceType,TRI?1:HALF_NEIGH,1,TRI> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor);
|
||||||
#ifdef KOKKOS_ENABLE_CUDA
|
#ifdef KOKKOS_ENABLE_CUDA
|
||||||
if (ExecutionSpaceFromDevice<DeviceType>::space == Device) {
|
if (ExecutionSpaceFromDevice<DeviceType>::space == Device) {
|
||||||
int team_size = atoms_per_bin*factor;
|
int team_size = atoms_per_bin*factor;
|
||||||
@ -232,7 +232,10 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI,SIZE>::build(NeighList *list_)
|
|||||||
if (team_size <= team_size_max) {
|
if (team_size <= team_size_max) {
|
||||||
Kokkos::TeamPolicy<DeviceType> config((mbins+factor-1)/factor,team_size);
|
Kokkos::TeamPolicy<DeviceType> config((mbins+factor-1)/factor,team_size);
|
||||||
Kokkos::parallel_for(config, f);
|
Kokkos::parallel_for(config, f);
|
||||||
} else Kokkos::parallel_for(nall, f); // fall back to flat method
|
} else { // fall back to flat method
|
||||||
|
f.sharedsize = 0;
|
||||||
|
Kokkos::parallel_for(nall, f);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
Kokkos::parallel_for(nall, f);
|
Kokkos::parallel_for(nall, f);
|
||||||
#else
|
#else
|
||||||
@ -247,7 +250,10 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI,SIZE>::build(NeighList *list_)
|
|||||||
if (team_size <= team_size_max) {
|
if (team_size <= team_size_max) {
|
||||||
Kokkos::TeamPolicy<DeviceType> config((mbins+factor-1)/factor,team_size);
|
Kokkos::TeamPolicy<DeviceType> config((mbins+factor-1)/factor,team_size);
|
||||||
Kokkos::parallel_for(config, f);
|
Kokkos::parallel_for(config, f);
|
||||||
} else Kokkos::parallel_for(nall, f); // fall back to flat method
|
} else { // fall back to flat method
|
||||||
|
f.sharedsize = 0;
|
||||||
|
Kokkos::parallel_for(nall, f);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
Kokkos::parallel_for(nall, f);
|
Kokkos::parallel_for(nall, f);
|
||||||
#else
|
#else
|
||||||
@ -264,7 +270,10 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI,SIZE>::build(NeighList *list_)
|
|||||||
if (team_size <= team_size_max) {
|
if (team_size <= team_size_max) {
|
||||||
Kokkos::TeamPolicy<DeviceType> config((mbins+factor-1)/factor,team_size);
|
Kokkos::TeamPolicy<DeviceType> config((mbins+factor-1)/factor,team_size);
|
||||||
Kokkos::parallel_for(config, f);
|
Kokkos::parallel_for(config, f);
|
||||||
} else Kokkos::parallel_for(nall, f); // fall back to flat method
|
} else { // fall back to flat method
|
||||||
|
f.sharedsize = 0;
|
||||||
|
Kokkos::parallel_for(nall, f);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
Kokkos::parallel_for(nall, f);
|
Kokkos::parallel_for(nall, f);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -379,11 +379,11 @@ struct NPairKokkosBuildFunctor {
|
|||||||
typedef DeviceType device_type;
|
typedef DeviceType device_type;
|
||||||
|
|
||||||
const NeighborKokkosExecute<DeviceType> c;
|
const NeighborKokkosExecute<DeviceType> c;
|
||||||
const size_t sharedsize;
|
size_t sharedsize;
|
||||||
|
|
||||||
NPairKokkosBuildFunctor(const NeighborKokkosExecute<DeviceType> &_c,
|
NPairKokkosBuildFunctor(const NeighborKokkosExecute<DeviceType> &_c,
|
||||||
const size_t _sharedsize):c(_c),
|
size_t _sharedsize):c(_c),
|
||||||
sharedsize(_sharedsize) {};
|
sharedsize(_sharedsize) {}
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void operator() (const int & i) const {
|
void operator() (const int & i) const {
|
||||||
@ -404,11 +404,11 @@ struct NPairKokkosBuildFunctor<LMPHostType,HALF_NEIGH,GHOST_NEWTON,TRI> {
|
|||||||
typedef LMPHostType device_type;
|
typedef LMPHostType device_type;
|
||||||
|
|
||||||
const NeighborKokkosExecute<LMPHostType> c;
|
const NeighborKokkosExecute<LMPHostType> c;
|
||||||
const size_t sharedsize;
|
size_t sharedsize;
|
||||||
|
|
||||||
NPairKokkosBuildFunctor(const NeighborKokkosExecute<LMPHostType> &_c,
|
NPairKokkosBuildFunctor(const NeighborKokkosExecute<LMPHostType> &_c,
|
||||||
const size_t _sharedsize):c(_c),
|
size_t _sharedsize):c(_c),
|
||||||
sharedsize(_sharedsize) {};
|
sharedsize(_sharedsize) {}
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void operator() (const int & i) const {
|
void operator() (const int & i) const {
|
||||||
@ -423,11 +423,8 @@ struct NPairKokkosBuildFunctorGhost {
|
|||||||
typedef DeviceType device_type;
|
typedef DeviceType device_type;
|
||||||
|
|
||||||
const NeighborKokkosExecute<DeviceType> c;
|
const NeighborKokkosExecute<DeviceType> c;
|
||||||
const size_t sharedsize;
|
|
||||||
|
|
||||||
NPairKokkosBuildFunctorGhost(const NeighborKokkosExecute<DeviceType> &_c,
|
NPairKokkosBuildFunctorGhost(const NeighborKokkosExecute<DeviceType> &_c):c(_c) {}
|
||||||
const size_t _sharedsize):c(_c),
|
|
||||||
sharedsize(_sharedsize) {};
|
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void operator() (const int & i) const {
|
void operator() (const int & i) const {
|
||||||
@ -440,10 +437,10 @@ struct NPairKokkosBuildFunctorSize {
|
|||||||
typedef DeviceType device_type;
|
typedef DeviceType device_type;
|
||||||
|
|
||||||
const NeighborKokkosExecute<DeviceType> c;
|
const NeighborKokkosExecute<DeviceType> c;
|
||||||
const size_t sharedsize;
|
size_t sharedsize;
|
||||||
|
|
||||||
NPairKokkosBuildFunctorSize(const NeighborKokkosExecute<DeviceType> &_c,
|
NPairKokkosBuildFunctorSize(const NeighborKokkosExecute<DeviceType> &_c,
|
||||||
const size_t _sharedsize): c(_c), sharedsize(_sharedsize) {};
|
size_t _sharedsize): c(_c), sharedsize(_sharedsize) {}
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void operator() (const int & i) const {
|
void operator() (const int & i) const {
|
||||||
@ -464,10 +461,10 @@ struct NPairKokkosBuildFunctorSize<LMPHostType,HALF_NEIGH,GHOST_NEWTON,TRI> {
|
|||||||
typedef LMPHostType device_type;
|
typedef LMPHostType device_type;
|
||||||
|
|
||||||
const NeighborKokkosExecute<LMPHostType> c;
|
const NeighborKokkosExecute<LMPHostType> c;
|
||||||
const size_t sharedsize;
|
size_t sharedsize;
|
||||||
|
|
||||||
NPairKokkosBuildFunctorSize(const NeighborKokkosExecute<LMPHostType> &_c,
|
NPairKokkosBuildFunctorSize(const NeighborKokkosExecute<LMPHostType> &_c,
|
||||||
const size_t _sharedsize): c(_c), sharedsize(_sharedsize) {};
|
size_t _sharedsize): c(_c), sharedsize(_sharedsize) {}
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void operator() (const int & i) const {
|
void operator() (const int & i) const {
|
||||||
|
|||||||
Reference in New Issue
Block a user