Split lines with many copyright years
[alexxy/gromacs.git] / src / gromacs / ewald / pme.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team.
6  * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
7  * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
8  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
9  * and including many others, as listed in the AUTHORS file in the
10  * top-level source directory and at http://www.gromacs.org.
11  *
12  * GROMACS is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public License
14  * as published by the Free Software Foundation; either version 2.1
15  * of the License, or (at your option) any later version.
16  *
17  * GROMACS is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with GROMACS; if not, see
24  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
26  *
27  * If you want to redistribute modifications to GROMACS, please
28  * consider that scientific software is very special. Version
29  * control is crucial - bugs must be traceable. We will be happy to
30  * consider code for inclusion in the official distribution, but
31  * derived work must not be called official GROMACS. Details are found
32  * in the README & COPYING files - if they are missing, get the
33  * official version at http://www.gromacs.org.
34  *
35  * To help us fund GROMACS development, we humbly ask that you cite
36  * the research papers on the package. Check out http://www.gromacs.org.
37  */
38 /*! \libinternal \file
39  *
40  * \brief This file contains function declarations necessary for
41  * computing energies and forces for the PME long-ranged part (Coulomb
42  * and LJ).
43  *
44  * \author Berk Hess <hess@kth.se>
45  * \inlibraryapi
46  * \ingroup module_ewald
47  */
48
49 #ifndef GMX_EWALD_PME_H
50 #define GMX_EWALD_PME_H
51
52 #include <string>
53
54 #include "gromacs/gpu_utils/devicebuffer_datatype.h"
55 #include "gromacs/gpu_utils/gpu_macros.h"
56 #include "gromacs/math/vectypes.h"
57 #include "gromacs/timing/walltime_accounting.h"
58 #include "gromacs/utility/arrayref.h"
59 #include "gromacs/utility/basedefinitions.h"
60 #include "gromacs/utility/real.h"
61
62 struct gmx_hw_info_t;
63 struct interaction_const_t;
64 struct t_commrec;
65 struct t_forcerec;
66 struct t_inputrec;
67 struct t_nrnb;
68 struct PmeGpu;
69 struct gmx_wallclock_gpu_pme_t;
70 struct gmx_device_info_t;
71 struct gmx_enerdata_t;
72 struct gmx_mtop_t;
73 struct gmx_pme_t;
74 struct gmx_wallcycle;
75 struct NumPmeDomains;
76
77 enum class GpuTaskCompletion;
78 class PmeGpuProgram;
79 class GpuEventSynchronizer;
80 //! Convenience name.
81 using PmeGpuProgramHandle = const PmeGpuProgram*;
82
83 namespace gmx
84 {
85 class PmePpCommGpu;
86 class ForceWithVirial;
87 class MDLogger;
88 enum class PinningPolicy : int;
89 } // namespace gmx
90
91 enum
92 {
93     GMX_SUM_GRID_FORWARD,
94     GMX_SUM_GRID_BACKWARD
95 };
96
97 /*! \brief Possible PME codepaths on a rank.
98  * \todo: make this enum class with gmx_pme_t C++ refactoring
99  */
100 enum class PmeRunMode
101 {
102     None,  //!< No PME task is done
103     CPU,   //!< Whole PME computation is done on CPU
104     GPU,   //!< Whole PME computation is done on GPU
105     Mixed, //!< Mixed mode: only spread and gather run on GPU; FFT and solving are done on CPU.
106 };
107
108 //! PME gathering output forces treatment
109 enum class PmeForceOutputHandling
110 {
111     Set,             /**< Gather simply writes into provided force buffer */
112     ReduceWithInput, /**< Gather adds its output to the buffer.
113                         On GPU, that means additional H2D copy before the kernel launch. */
114 };
115
116 /*! \brief Return the smallest allowed PME grid size for \p pmeOrder */
117 int minimalPmeGridSize(int pmeOrder);
118
119 /*! \brief Check restrictions on pme_order and the PME grid nkx,nky,nkz.
120  *
121  * With errorsAreFatal=true, an exception or fatal error is generated
122  * on violation of restrictions.
123  * With errorsAreFatal=false, false is returned on violation of restrictions.
124  * When all restrictions are obeyed, true is returned.
125  * Argument useThreads tells if any MPI rank doing PME uses more than 1 threads.
126  * If at calling useThreads is unknown, pass true for conservative checking.
127  *
128  * The PME GPU restrictions are checked separately during pme_gpu_init().
129  */
130 bool gmx_pme_check_restrictions(int  pme_order,
131                                 int  nkx,
132                                 int  nky,
133                                 int  nkz,
134                                 int  numPmeDomainsAlongX,
135                                 bool useThreads,
136                                 bool errorsAreFatal);
137
138 /*! \brief Construct PME data
139  *
140  * \throws   gmx::InconsistentInputError if input grid sizes/PME order are inconsistent.
141  * \returns  Pointer to newly allocated and initialized PME data.
142  *
143  * \todo We should evolve something like a \c GpuManager that holds \c
144  * gmx_device_info_t * and \c PmeGpuProgramHandle and perhaps other
145  * related things whose lifetime can/should exceed that of a task (or
146  * perhaps task manager). See Redmine #2522.
147  */
148 gmx_pme_t* gmx_pme_init(const t_commrec*         cr,
149                         const NumPmeDomains&     numPmeDomains,
150                         const t_inputrec*        ir,
151                         gmx_bool                 bFreeEnergy_q,
152                         gmx_bool                 bFreeEnergy_lj,
153                         gmx_bool                 bReproducible,
154                         real                     ewaldcoeff_q,
155                         real                     ewaldcoeff_lj,
156                         int                      nthread,
157                         PmeRunMode               runMode,
158                         PmeGpu*                  pmeGpu,
159                         const gmx_device_info_t* gpuInfo,
160                         PmeGpuProgramHandle      pmeGpuProgram,
161                         const gmx::MDLogger&     mdlog);
162
163 /*! \brief Destroys the PME data structure.*/
164 void gmx_pme_destroy(gmx_pme_t* pme);
165
166 //@{
167 /*! \brief Flag values that control what gmx_pme_do() will calculate
168  *
169  * These can be combined with bitwise-OR if more than one thing is required.
170  */
171 #define GMX_PME_SPREAD (1 << 0)
172 #define GMX_PME_SOLVE (1 << 1)
173 #define GMX_PME_CALC_F (1 << 2)
174 #define GMX_PME_CALC_ENER_VIR (1 << 3)
175 /* This forces the grid to be backtransformed even without GMX_PME_CALC_F */
176 #define GMX_PME_CALC_POT (1 << 4)
177
178 #define GMX_PME_DO_ALL_F (GMX_PME_SPREAD | GMX_PME_SOLVE | GMX_PME_CALC_F)
179 //@}
180
181 /*! \brief Do a PME calculation on a CPU for the long range electrostatics and/or LJ.
182  *
183  * Computes the PME forces and the energy and viral, when requested,
184  * for all atoms in \p coordinates. Forces, when requested, are added
185  * to the buffer \p forces, which is allowed to contain more elements
186  * than the number of elements in \p coordinates.
187  * The meaning of \p flags is defined above, and determines which
188  * parts of the calculation are performed.
189  *
190  * \return 0 indicates all well, non zero is an error code.
191  */
192 int gmx_pme_do(struct gmx_pme_t*              pme,
193                gmx::ArrayRef<const gmx::RVec> coordinates,
194                gmx::ArrayRef<gmx::RVec>       forces,
195                real                           chargeA[],
196                real                           chargeB[],
197                real                           c6A[],
198                real                           c6B[],
199                real                           sigmaA[],
200                real                           sigmaB[],
201                const matrix                   box,
202                const t_commrec*               cr,
203                int                            maxshift_x,
204                int                            maxshift_y,
205                t_nrnb*                        nrnb,
206                gmx_wallcycle*                 wcycle,
207                matrix                         vir_q,
208                matrix                         vir_lj,
209                real*                          energy_q,
210                real*                          energy_lj,
211                real                           lambda_q,
212                real                           lambda_lj,
213                real*                          dvdlambda_q,
214                real*                          dvdlambda_lj,
215                int                            flags);
216
217 /*! \brief Called on the nodes that do PME exclusively */
218 int gmx_pmeonly(struct gmx_pme_t*         pme,
219                 const t_commrec*          cr,
220                 t_nrnb*                   mynrnb,
221                 gmx_wallcycle*            wcycle,
222                 gmx_walltime_accounting_t walltime_accounting,
223                 t_inputrec*               ir,
224                 PmeRunMode                runMode);
225
226 /*! \brief Calculate the PME grid energy V for n charges.
227  *
228  * The potential (found in \p pme) must have been found already with a
229  * call to gmx_pme_do() with at least GMX_PME_SPREAD and GMX_PME_SOLVE
230  * specified. Note that the charges are not spread on the grid in the
231  * pme struct. Currently does not work in parallel or with free
232  * energy.
233  */
234 void gmx_pme_calc_energy(gmx_pme_t* pme, gmx::ArrayRef<const gmx::RVec> x, gmx::ArrayRef<const real> q, real* V);
235
236 /*! \brief Send the charges and maxshift to out PME-only node. */
237 void gmx_pme_send_parameters(const t_commrec*           cr,
238                              const interaction_const_t* ic,
239                              gmx_bool                   bFreeEnergy_q,
240                              gmx_bool                   bFreeEnergy_lj,
241                              real*                      chargeA,
242                              real*                      chargeB,
243                              real*                      sqrt_c6A,
244                              real*                      sqrt_c6B,
245                              real*                      sigmaA,
246                              real*                      sigmaB,
247                              int                        maxshift_x,
248                              int                        maxshift_y);
249
250 /*! \brief Send the coordinates to our PME-only node and request a PME calculation */
251 void gmx_pme_send_coordinates(t_forcerec*           fr,
252                               const t_commrec*      cr,
253                               const matrix          box,
254                               const rvec*           x,
255                               real                  lambda_q,
256                               real                  lambda_lj,
257                               gmx_bool              bEnerVir,
258                               int64_t               step,
259                               bool                  useGpuPmePpComms,
260                               bool                  reinitGpuPmePpComms,
261                               bool                  sendCoordinatesFromGpu,
262                               GpuEventSynchronizer* coordinatesReadyOnDeviceEvent,
263                               gmx_wallcycle*        wcycle);
264
265 /*! \brief Tell our PME-only node to finish */
266 void gmx_pme_send_finish(const t_commrec* cr);
267
268 /*! \brief Tell our PME-only node to reset all cycle and flop counters */
269 void gmx_pme_send_resetcounters(const t_commrec* cr, int64_t step);
270
271 /*! \brief PP nodes receive the long range forces from the PME nodes */
272 void gmx_pme_receive_f(gmx::PmePpCommGpu*    pmePpCommGpu,
273                        const t_commrec*      cr,
274                        gmx::ForceWithVirial* forceWithVirial,
275                        real*                 energy_q,
276                        real*                 energy_lj,
277                        real*                 dvdlambda_q,
278                        real*                 dvdlambda_lj,
279                        bool                  useGpuPmePpComms,
280                        bool                  receivePmeForceToGpu,
281                        float*                pme_cycles);
282
283 /*! \brief
284  * This function updates the local atom data on GPU after DD (charges, coordinates, etc.).
285  * TODO: it should update the PME CPU atom data as well.
286  * (currently PME CPU call gmx_pme_do() gets passed the input pointers for each computation).
287  *
288  * \param[in,out] pme        The PME structure.
289  * \param[in]     numAtoms   The number of particles.
290  * \param[in]     charges    The pointer to the array of particle charges.
291  */
292 void gmx_pme_reinit_atoms(gmx_pme_t* pme, int numAtoms, const real* charges);
293
294 /* A block of PME GPU functions */
295
296 /*! \brief Checks whether the GROMACS build allows to run PME on GPU.
297  * TODO: this partly duplicates an internal PME assert function
298  * pme_gpu_check_restrictions(), except that works with a
299  * formed gmx_pme_t structure. Should that one go away/work with inputrec?
300  *
301  * \param[out] error   If non-null, the error message when PME is not supported on GPU.
302  *
303  * \returns true if PME can run on GPU on this build, false otherwise.
304  */
305 bool pme_gpu_supports_build(std::string* error);
306
307 /*! \brief Checks whether the detected (GPU) hardware allows to run PME on GPU.
308  *
309  * \param[in]  hwinfo  Information about the detected hardware
310  * \param[out] error   If non-null, the error message when PME is not supported on GPU.
311  *
312  * \returns true if PME can run on GPU on this build, false otherwise.
313  */
314 bool pme_gpu_supports_hardware(const gmx_hw_info_t& hwinfo, std::string* error);
315
316 /*! \brief Checks whether the input system allows to run PME on GPU.
317  * TODO: this partly duplicates an internal PME assert function
318  * pme_gpu_check_restrictions(), except that works with a
319  * formed gmx_pme_t structure. Should that one go away/work with inputrec?
320  *
321  * \param[in]  ir     Input system.
322  * \param[in]  mtop   Complete system topology to check if an FE simulation perturbs charges.
323  * \param[out] error  If non-null, the error message if the input is not supported on GPU.
324  *
325  * \returns true if PME can run on GPU with this input, false otherwise.
326  */
327 bool pme_gpu_supports_input(const t_inputrec& ir, const gmx_mtop_t& mtop, std::string* error);
328
329 /*! \brief
330  * Returns the active PME codepath (CPU, GPU, mixed).
331  * \todo This is a rather static data that should be managed by the higher level task scheduler.
332  *
333  * \param[in]  pme            The PME data structure.
334  * \returns active PME codepath.
335  */
336 PmeRunMode pme_run_mode(const gmx_pme_t* pme);
337
338 /*! \libinternal \brief
339  * Return the pinning policy appropriate for this build configuration
340  * for relevant buffers used for PME task on this rank (e.g. running
341  * on a GPU). */
342 gmx::PinningPolicy pme_get_pinning_policy();
343
344 /*! \brief
345  * Tells if PME is enabled to run on GPU (not necessarily active at the moment).
346  * \todo This is a rather static data that should be managed by the hardware assignment manager.
347  * For now, it is synonymous with the active PME codepath (in the absence of dynamic switching).
348  *
349  * \param[in]  pme            The PME data structure.
350  * \returns true if PME can run on GPU, false otherwise.
351  */
352 inline bool pme_gpu_task_enabled(const gmx_pme_t* pme)
353 {
354     return (pme != nullptr) && (pme_run_mode(pme) != PmeRunMode::CPU);
355 }
356
357 /*! \brief Returns the size of the padding needed by GPU version of PME in the coordinates array.
358  *
359  * \param[in]  pme  The PME data structure.
360  */
361 GPU_FUNC_QUALIFIER int pme_gpu_get_padding_size(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme))
362         GPU_FUNC_TERM_WITH_RETURN(0);
363
364 // The following functions are all the PME GPU entry points,
365 // currently inlining to nothing on non-CUDA builds.
366
367 /*! \brief
368  * Resets the PME GPU timings. To be called at the reset step.
369  *
370  * \param[in] pme            The PME structure.
371  */
372 GPU_FUNC_QUALIFIER void pme_gpu_reset_timings(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme)) GPU_FUNC_TERM;
373
374 /*! \brief
375  * Copies the PME GPU timings to the gmx_wallclock_gpu_pme_t structure (for log output). To be called at the run end.
376  *
377  * \param[in] pme               The PME structure.
378  * \param[in] timings           The gmx_wallclock_gpu_pme_t structure.
379  */
380 GPU_FUNC_QUALIFIER void pme_gpu_get_timings(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme),
381                                             gmx_wallclock_gpu_pme_t* GPU_FUNC_ARGUMENT(timings)) GPU_FUNC_TERM;
382
383 /* The main PME GPU functions */
384
385 /*! \brief
386  * Prepares PME on GPU computation (updating the box if needed)
387  * \param[in] pme               The PME data structure.
388  * \param[in] needToUpdateBox   Tells if the stored unit cell parameters should be updated from \p box.
389  * \param[in] box               The unit cell box.
390  * \param[in] wcycle            The wallclock counter.
391  * \param[in] flags             The combination of flags to affect this PME computation.
392  *                              The flags are the GMX_PME_ flags from pme.h.
393  * \param[in]  useGpuForceReduction Whether PME forces are reduced on GPU this step or should be downloaded for CPU reduction
394  */
395 GPU_FUNC_QUALIFIER void pme_gpu_prepare_computation(gmx_pme_t*   GPU_FUNC_ARGUMENT(pme),
396                                                     bool         GPU_FUNC_ARGUMENT(needToUpdateBox),
397                                                     const matrix GPU_FUNC_ARGUMENT(box),
398                                                     gmx_wallcycle* GPU_FUNC_ARGUMENT(wcycle),
399                                                     int            GPU_FUNC_ARGUMENT(flags),
400                                                     bool GPU_FUNC_ARGUMENT(useGpuForceReduction)) GPU_FUNC_TERM;
401
402 /*! \brief
403  * Launches first stage of PME on GPU - spreading kernel.
404  *
405  * \param[in] pme                The PME data structure.
406  * \param[in] xReadyOnDevice     Event synchronizer indicating that the coordinates are ready in the device memory; nullptr allowed only on separate PME ranks.
407  * \param[in] wcycle             The wallclock counter.
408  */
409 GPU_FUNC_QUALIFIER void pme_gpu_launch_spread(gmx_pme_t*            GPU_FUNC_ARGUMENT(pme),
410                                               GpuEventSynchronizer* GPU_FUNC_ARGUMENT(xReadyOnDevice),
411                                               gmx_wallcycle* GPU_FUNC_ARGUMENT(wcycle)) GPU_FUNC_TERM;
412
413 /*! \brief
414  * Launches middle stages of PME (FFT R2C, solving, FFT C2R) either on GPU or on CPU, depending on the run mode.
415  *
416  * \param[in] pme               The PME data structure.
417  * \param[in] wcycle            The wallclock counter.
418  */
419 GPU_FUNC_QUALIFIER void pme_gpu_launch_complex_transforms(gmx_pme_t* GPU_FUNC_ARGUMENT(pme),
420                                                           gmx_wallcycle* GPU_FUNC_ARGUMENT(wcycle)) GPU_FUNC_TERM;
421
422 /*! \brief
423  * Launches last stage of PME on GPU - force gathering and D2H force transfer.
424  *
425  * \param[in]  pme               The PME data structure.
426  * \param[in]  wcycle            The wallclock counter.
427  * \param[in]  forceTreatment    Tells how data should be treated. The gathering kernel either
428  * stores the output reciprocal forces into the host array, or copies its contents to the GPU first
429  *                               and accumulates. The reduction is non-atomic.
430  */
431 GPU_FUNC_QUALIFIER void pme_gpu_launch_gather(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme),
432                                               gmx_wallcycle*   GPU_FUNC_ARGUMENT(wcycle),
433                                               PmeForceOutputHandling GPU_FUNC_ARGUMENT(forceTreatment)) GPU_FUNC_TERM;
434
435 /*! \brief
436  * Attempts to complete PME GPU tasks.
437  *
438  * The \p completionKind argument controls whether the function blocks until all
439  * PME GPU tasks enqueued completed (as pme_gpu_wait_finish_task() does) or only
440  * checks and returns immediately if they did not.
441  * When blocking or the tasks have completed it also gets the output forces
442  * by assigning the ArrayRef to the \p forces pointer passed in.
443  * Virial/energy are also outputs if they were to be computed.
444  *
445  * \param[in]  pme            The PME data structure.
446  * \param[in]  flags          The combination of flags to affect this PME computation.
447  *                            The flags are the GMX_PME_ flags from pme.h.
448  * \param[in]  wcycle         The wallclock counter.
449  * \param[out] forceWithVirial The output force and virial
450  * \param[out] enerd           The output energies
451  * \param[in] flags            The combination of flags to affect this PME computation.
452  *                             The flags are the GMX_PME_ flags from pme.h.
453  * \param[in]  completionKind  Indicates whether PME task completion should only be checked rather
454  * than waited for \returns                   True if the PME GPU tasks have completed
455  */
456 GPU_FUNC_QUALIFIER bool pme_gpu_try_finish_task(gmx_pme_t*            GPU_FUNC_ARGUMENT(pme),
457                                                 int                   GPU_FUNC_ARGUMENT(flags),
458                                                 gmx_wallcycle*        GPU_FUNC_ARGUMENT(wcycle),
459                                                 gmx::ForceWithVirial* GPU_FUNC_ARGUMENT(forceWithVirial),
460                                                 gmx_enerdata_t*       GPU_FUNC_ARGUMENT(enerd),
461                                                 GpuTaskCompletion GPU_FUNC_ARGUMENT(completionKind))
462         GPU_FUNC_TERM_WITH_RETURN(false);
463
464 /*! \brief
465  * Blocks until PME GPU tasks are completed, and gets the output forces and virial/energy
466  * (if they were to be computed).
467  *
468  * \param[in]  pme             The PME data structure.
469  * \param[in]  flags           The combination of flags to affect this PME computation.
470  *                             The flags are the GMX_PME_ flags from pme.h.
471  * \param[in]  wcycle          The wallclock counter.
472  * \param[out] forceWithVirial The output force and virial
473  * \param[out] enerd           The output energies
474  */
475 GPU_FUNC_QUALIFIER void pme_gpu_wait_and_reduce(gmx_pme_t*            GPU_FUNC_ARGUMENT(pme),
476                                                 int                   GPU_FUNC_ARGUMENT(flags),
477                                                 gmx_wallcycle*        GPU_FUNC_ARGUMENT(wcycle),
478                                                 gmx::ForceWithVirial* GPU_FUNC_ARGUMENT(forceWithVirial),
479                                                 gmx_enerdata_t* GPU_FUNC_ARGUMENT(enerd)) GPU_FUNC_TERM;
480
481 /*! \brief
482  * The PME GPU reinitialization function that is called both at the end of any PME computation and on any load balancing.
483  *
484  * Clears the internal grid and energy/virial buffers; it is not safe to start
485  * the PME computation without calling this.
486  * Note that unlike in the nbnxn module, the force buffer does not need clearing.
487  *
488  * \todo Rename this function to *clear* -- it clearly only does output resetting
489  * and we should be clear about what the function does..
490  *
491  * \param[in] pme            The PME data structure.
492  * \param[in] wcycle         The wallclock counter.
493  */
494 GPU_FUNC_QUALIFIER void pme_gpu_reinit_computation(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme),
495                                                    gmx_wallcycle* GPU_FUNC_ARGUMENT(wcycle)) GPU_FUNC_TERM;
496
497
498 /*! \brief Get pointer to device copy of coordinate data.
499  * \param[in] pme            The PME data structure.
500  * \returns                  Pointer to coordinate data
501  */
502 GPU_FUNC_QUALIFIER DeviceBuffer<float> pme_gpu_get_device_x(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme))
503         GPU_FUNC_TERM_WITH_RETURN(DeviceBuffer<float>{});
504
505 /*! \brief Set pointer to device copy of coordinate data.
506  * \param[in] pme            The PME data structure.
507  * \param[in] d_x            The pointer to the positions buffer to be set
508  */
509 GPU_FUNC_QUALIFIER void pme_gpu_set_device_x(const gmx_pme_t*    GPU_FUNC_ARGUMENT(pme),
510                                              DeviceBuffer<float> GPU_FUNC_ARGUMENT(d_x)) GPU_FUNC_TERM;
511
512 /*! \brief Get pointer to device copy of force data.
513  * \param[in] pme            The PME data structure.
514  * \returns                  Pointer to force data
515  */
516 GPU_FUNC_QUALIFIER void* pme_gpu_get_device_f(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme))
517         GPU_FUNC_TERM_WITH_RETURN(nullptr);
518
519 /*! \brief Returns the pointer to the GPU stream.
520  *  \param[in] pme            The PME data structure.
521  *  \returns                  Pointer to GPU stream object.
522  */
523 GPU_FUNC_QUALIFIER void* pme_gpu_get_device_stream(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme))
524         GPU_FUNC_TERM_WITH_RETURN(nullptr);
525
526 /*! \brief Returns the pointer to the GPU context.
527  *  \param[in] pme            The PME data structure.
528  *  \returns                  Pointer to GPU context object.
529  */
530 GPU_FUNC_QUALIFIER void* pme_gpu_get_device_context(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme))
531         GPU_FUNC_TERM_WITH_RETURN(nullptr);
532
533 /*! \brief Get pointer to the device synchronizer object that allows syncing on PME force calculation completion
534  * \param[in] pme            The PME data structure.
535  * \returns                  Pointer to sychronizer
536  */
537 GPU_FUNC_QUALIFIER GpuEventSynchronizer* pme_gpu_get_f_ready_synchronizer(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme))
538         GPU_FUNC_TERM_WITH_RETURN(nullptr);
539
540 #endif