struct t_mdatoms;
struct tMPI_Atomic;
+enum class BufferOpsUseGpu;
+
namespace Nbnxm
{
class GridSet;
enum class KernelType;
}
+enum class GpuBufferOpsAccumulateForce;
+
/* Convenience type for vector with aligned memory */
template<typename T>
using AlignedVector = std::vector < T, gmx::AlignedAllocator < T>>;
void *);
//! Add the computed forces to \p f, an internal reduction might be performed as well
-void reduceForces(nbnxn_atomdata_t *nbat,
- Nbnxm::AtomLocality locality,
- const Nbnxm::GridSet &gridSet,
- rvec *f);
+template <bool useGpu>
+void reduceForces(nbnxn_atomdata_t *nbat,
+ Nbnxm::AtomLocality locality,
+ const Nbnxm::GridSet &gridSet,
+ rvec *f,
+ gmx_nbnxn_gpu_t *gpu_nbv,
+ GpuBufferOpsAccumulateForce accumulateForce);
+
+
+extern template
+void reduceForces<true>(nbnxn_atomdata_t *nbat,
+ const Nbnxm::AtomLocality locality,
+ const Nbnxm::GridSet &gridSet,
+ rvec *f,
+ gmx_nbnxn_gpu_t *gpu_nbv,
+ GpuBufferOpsAccumulateForce accumulateForce);
+
+extern template
+void reduceForces<false>(nbnxn_atomdata_t *nbat,
+ const Nbnxm::AtomLocality locality,
+ const Nbnxm::GridSet &gridSet,
+ rvec *f,
+ gmx_nbnxn_gpu_t *gpu_nbv,
+ GpuBufferOpsAccumulateForce accumulateForce);
/* Add the fshift force stored in nbat to fshift */
void nbnxn_atomdata_add_nbat_fshift_to_fshift(const nbnxn_atomdata_t *nbat,
rvec *fshift);
+/* Get the atom start index and number of atoms for a given locality */
+void nbnxn_get_atom_range(Nbnxm::AtomLocality atomLocality,
+ const Nbnxm::GridSet &gridSet,
+ int *atomStart,
+ int *nAtoms);
#endif