Task assignment for bonded interactions on CUDA GPUs
[alexxy/gromacs.git] / src / gromacs / taskassignment / decidegpuusage.h
index 0730d52b9a0e13d586760055d88cb1b9b3454fee..9b8279cea775c32388623fe454c51bd0987639a8 100644 (file)
@@ -186,6 +186,30 @@ bool decideWhetherToUseGpusForPme(bool                    useGpuForNonbonded,
                                   int                     numPmeRanksPerSimulation,
                                   bool                    gpusWereDetected);
 
+/*! \brief Decide whether the simulation will try to run bonded tasks on GPUs.
+ *
+ * \param[in]  useGpuForNonbonded        Whether GPUs will be used for nonbonded interactions.
+ * \param[in]  useGpuForPme              Whether GPUs will be used for PME interactions.
+ * \param[in]  usingVerletScheme         Whether the nonbondeds are using the Verlet scheme.
+ * \param[in]  bondedTarget              The user's choice for mdrun -bonded for where to assign tasks.
+ * \param[in]  canUseGpuForBonded        Whether the bonded interactions can run on a GPU
+ * \param[in]  numRanksPerSimulation     The number of ranks in each simulation.
+ * \param[in]  numPmeRanksPerSimulation  The number of PME ranks in each simulation.
+ * \param[in]  gpusWereDetected          Whether compatible GPUs were detected on any node.
+ *
+ * \returns    Whether the simulation will run bondeded tasks on GPUs.
+ *
+ * \throws     std::bad_alloc          If out of memory
+ *             InconsistentInputError  If the user requirements are inconsistent. */
+bool decideWhetherToUseGpusForBonded(bool       useGpuForNonbonded,
+                                     bool       useGpuForPme,
+                                     bool       usingVerletScheme,
+                                     TaskTarget bondedTarget,
+                                     bool       canUseGpuForBonded,
+                                     int        numRanksPerSimulation,
+                                     int        numPmeRanksPerSimulation,
+                                     bool       gpusWereDetected);
+
 }  // namespace gmx
 
 #endif