Add helper functions for setting up Nbnxm gpu object in nblib
[alexxy/gromacs.git] / api / nblib / nbnxmsetuphelpers.h
index 2f22bd825b80699aca222bce185f8bdb4b94c6b0..5c70811e5de134aef1527b829987204ec2af6d4f 100644 (file)
@@ -91,6 +91,9 @@ void checkKernelSetupSimd(SimdKernels nbnxmSimd);
 //! Creates and returns the kernel setup for CPU
 Nbnxm::KernelSetup createKernelSetupCPU(const SimdKernels nbnxmSimd, const bool useTabulatedEwaldCorr);
 
+//! Creates and returns the kernel setup for GPU
+Nbnxm::KernelSetup createKernelSetupGPU(const bool useTabulatedEwaldCorr);
+
 //! Create Particle info array to mark those that undergo VdV interaction
 std::vector<int64_t> createParticleInfoAllVdw(size_t numParticles);
 
@@ -101,6 +104,13 @@ std::vector<real> createNonBondedParameters(const std::vector<ParticleType>& par
 //! Create a step work object
 gmx::StepWorkload createStepWorkload();
 
+//! Create a SimulationWorkload object for use with createDeviceStreamManager
+gmx::SimulationWorkload createSimulationWorkloadGpu();
+
+//! Create a DeviceStreamManager; could be shared among multiple force calculators
+std::shared_ptr<gmx::DeviceStreamManager> createDeviceStreamManager(const DeviceInformation& deviceInfo,
+                                                                    const gmx::SimulationWorkload& simulationWorkload);
+
 //! Computes the Ewald splitting coefficient for Coulomb
 real ewaldCoeff(real ewald_rtol, real pairlistCutoff);
 
@@ -113,6 +123,13 @@ std::unique_ptr<nonbonded_verlet_t> createNbnxmCPU(size_t                    num
                                                    int                       numEnergyGroups,
                                                    gmx::ArrayRef<const real> nonbondedParameters);
 
+//! Create nonbonded_verlet_gpu object
+std::unique_ptr<nonbonded_verlet_t> createNbnxmGPU(size_t                     numParticleTypes,
+                                                   const NBKernelOptions&     options,
+                                                   const std::vector<real>&   nonbondedParameters,
+                                                   const interaction_const_t& interactionConst,
+                                                   const gmx::DeviceStreamManager& deviceStreamManager);
+
 //! Set number of OpenMP threads in the GROMACS backend
 void setGmxNonBondedNThreads(int numThreads);