}
/* Copies (and reorders) the coordinates to nbnxn_atomdata_t */
+template <bool useGpu>
void nbnxn_atomdata_copy_x_to_nbat_x(const Nbnxm::GridSet &gridSet,
const Nbnxm::AtomLocality locality,
gmx_bool FillLocal,
const rvec *x,
nbnxn_atomdata_t *nbat,
- bool useGpu,
gmx_nbnxn_gpu_t *gpu_nbv,
void *xPmeDevicePtr)
{
}
}
+template
+void nbnxn_atomdata_copy_x_to_nbat_x<true>(const Nbnxm::GridSet &,
+ const Nbnxm::AtomLocality,
+ gmx_bool,
+ const rvec*,
+ nbnxn_atomdata_t *,
+ gmx_nbnxn_gpu_t*,
+ void *);
+template
+void nbnxn_atomdata_copy_x_to_nbat_x<false>(const Nbnxm::GridSet &,
+ const Nbnxm::AtomLocality,
+ gmx_bool,
+ const rvec*,
+ nbnxn_atomdata_t *,
+ gmx_nbnxn_gpu_t*,
+ void *);
+
static void
nbnxn_atomdata_clear_reals(gmx::ArrayRef<real> dest,
int i0, int i1)
/* Copy x to nbat->x.
* FillLocal tells if the local filler particle coordinates should be zeroed.
*/
-void nbnxn_atomdata_copy_x_to_nbat_x(const Nbnxm::GridSet &gridSet,
- Nbnxm::AtomLocality locality,
- gmx_bool FillLocal,
- const rvec *x,
- nbnxn_atomdata_t *nbat,
- bool useGpu,
- gmx_nbnxn_gpu_t *gpu_nbv,
- void *xPmeDevicePtr);
+template <bool useGpu>
+void nbnxn_atomdata_copy_x_to_nbat_x(const Nbnxm::GridSet &gridSet,
+ Nbnxm::AtomLocality locality,
+ gmx_bool FillLocal,
+ const rvec *x,
+ nbnxn_atomdata_t *nbat,
+ gmx_nbnxn_gpu_t *gpu_nbv,
+ void *xPmeDevicePtr);
+
+extern template
+void nbnxn_atomdata_copy_x_to_nbat_x<true>(const Nbnxm::GridSet &,
+ const Nbnxm::AtomLocality,
+ gmx_bool,
+ const rvec*,
+ nbnxn_atomdata_t *,
+ gmx_nbnxn_gpu_t*,
+ void *);
+extern template
+void nbnxn_atomdata_copy_x_to_nbat_x<false>(const Nbnxm::GridSet &,
+ const Nbnxm::AtomLocality,
+ gmx_bool,
+ const rvec*,
+ nbnxn_atomdata_t *,
+ gmx_nbnxn_gpu_t*,
+ void *);
//! Add the computed forces to \p f, an internal reduction might be performed as well
void reduceForces(nbnxn_atomdata_t *nbat,
{
wallcycle_start(wcycle, ewcNB_XF_BUF_OPS);
wallcycle_sub_start(wcycle, ewcsNB_X_BUF_OPS);
- nbnxn_atomdata_copy_x_to_nbat_x(pairSearch_->gridSet(), locality, fillLocal,
- as_rvec_array(x.data()),
- nbat.get(), useGpu, gpu_nbv, xPmeDevicePtr);
+
+ auto fnPtr = useGpu ?
+ nbnxn_atomdata_copy_x_to_nbat_x<true> :
+ nbnxn_atomdata_copy_x_to_nbat_x<false>;
+
+ fnPtr(pairSearch_->gridSet(), locality, fillLocal,
+ as_rvec_array(x.data()),
+ nbat.get(), gpu_nbv, xPmeDevicePtr);
+
wallcycle_sub_stop(wcycle, ewcsNB_X_BUF_OPS);
wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
}