*
* \param[in,out] pme The PME structure.
* \param[in] numAtoms The number of particles.
- * \param[in] charges The pointer to the array of particle charges.
+ * \param[in] chargesA The pointer to the array of particle charges in the normal state or FEP
+ * state A. Can be nullptr if PME is not performed on the GPU.
+ * \param[in] chargesB The pointer to the array of particle charges in state B. Only used if
+ * charges are perturbed and can otherwise be nullptr.
*/
-void gmx_pme_reinit_atoms(gmx_pme_t* pme, int numAtoms, const real* charges);
+void gmx_pme_reinit_atoms(gmx_pme_t* pme, int numAtoms, const real* chargesA, const real* chargesB);
/* A block of PME GPU functions */
* formed gmx_pme_t structure. Should that one go away/work with inputrec?
*
* \param[in] ir Input system.
- * \param[in] mtop Complete system topology to check if an FE simulation perturbs charges.
* \param[out] error If non-null, the error message if the input is not supported on GPU.
*
* \returns true if PME can run on GPU with this input, false otherwise.
*/
-bool pme_gpu_supports_input(const t_inputrec& ir, const gmx_mtop_t& mtop, std::string* error);
+bool pme_gpu_supports_input(const t_inputrec& ir, std::string* error);
/*! \brief
* Returns the active PME codepath (CPU, GPU, mixed).
* Launches first stage of PME on GPU - spreading kernel.
*
* \param[in] pme The PME data structure.
- * \param[in] xReadyOnDevice Event synchronizer indicating that the coordinates are ready in the device memory; nullptr allowed only on separate PME ranks.
+ * \param[in] xReadyOnDevice Event synchronizer indicating that the coordinates
+ * are ready in the device memory; nullptr allowed only on separate PME ranks.
* \param[in] wcycle The wallclock counter.
+ * \param[in] lambdaQ The Coulomb lambda of the current state of the
+ * system. Only used if FEP of Coulomb is active.
*/
GPU_FUNC_QUALIFIER void pme_gpu_launch_spread(gmx_pme_t* GPU_FUNC_ARGUMENT(pme),
GpuEventSynchronizer* GPU_FUNC_ARGUMENT(xReadyOnDevice),
- gmx_wallcycle* GPU_FUNC_ARGUMENT(wcycle)) GPU_FUNC_TERM;
+ gmx_wallcycle* GPU_FUNC_ARGUMENT(wcycle),
+ const real GPU_FUNC_ARGUMENT(lambdaQ)) GPU_FUNC_TERM;
/*! \brief
* Launches middle stages of PME (FFT R2C, solving, FFT C2R) either on GPU or on CPU, depending on the run mode.
/*! \brief
* Launches last stage of PME on GPU - force gathering and D2H force transfer.
*
- * \param[in] pme The PME data structure.
- * \param[in] wcycle The wallclock counter.
+ * \param[in] pme The PME data structure.
+ * \param[in] wcycle The wallclock counter.
+ * \param[in] lambdaQ The Coulomb lambda to use when calculating the results.
*/
GPU_FUNC_QUALIFIER void pme_gpu_launch_gather(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme),
- gmx_wallcycle* GPU_FUNC_ARGUMENT(wcycle)) GPU_FUNC_TERM;
+ gmx_wallcycle* GPU_FUNC_ARGUMENT(wcycle),
+ const real GPU_FUNC_ARGUMENT(lambdaQ)) GPU_FUNC_TERM;
/*! \brief
* Attempts to complete PME GPU tasks.
* \param[in] wcycle The wallclock counter.
* \param[out] forceWithVirial The output force and virial
* \param[out] enerd The output energies
+ * \param[in] lambdaQ The Coulomb lambda to use when calculating the results.
* \param[in] completionKind Indicates whether PME task completion should only be checked rather
* than waited for
* \returns True if the PME GPU tasks have completed
gmx_wallcycle* GPU_FUNC_ARGUMENT(wcycle),
gmx::ForceWithVirial* GPU_FUNC_ARGUMENT(forceWithVirial),
gmx_enerdata_t* GPU_FUNC_ARGUMENT(enerd),
+ const real GPU_FUNC_ARGUMENT(lambdaQ),
GpuTaskCompletion GPU_FUNC_ARGUMENT(completionKind))
GPU_FUNC_TERM_WITH_RETURN(false);
* \param[in] wcycle The wallclock counter.
* \param[out] forceWithVirial The output force and virial
* \param[out] enerd The output energies
+ * \param[in] lambdaQ The Coulomb lambda to use when calculating the results.
*/
GPU_FUNC_QUALIFIER void pme_gpu_wait_and_reduce(gmx_pme_t* GPU_FUNC_ARGUMENT(pme),
const gmx::StepWorkload& GPU_FUNC_ARGUMENT(stepWork),
gmx_wallcycle* GPU_FUNC_ARGUMENT(wcycle),
gmx::ForceWithVirial* GPU_FUNC_ARGUMENT(forceWithVirial),
- gmx_enerdata_t* GPU_FUNC_ARGUMENT(enerd)) GPU_FUNC_TERM;
+ gmx_enerdata_t* GPU_FUNC_ARGUMENT(enerd),
+ const real GPU_FUNC_ARGUMENT(lambdaQ)) GPU_FUNC_TERM;
/*! \brief
* The PME GPU reinitialization function that is called both at the end of any PME computation and on any load balancing.