Gromacs  2024.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::ListedForcesGpu::Impl Class Reference

#include <gromacs/listed_forces/listed_forces_gpu_impl.h>

Description

Implements GPU bondeds.

Public Member Functions

 Impl (const gmx_ffparams_t &ffparams, float electrostaticsScaleFactor, int numEnergyGroupsForListedForces, const DeviceInformation &deviceInfo, const DeviceContext &deviceContext, const DeviceStream &deviceStream, gmx_wallcycle *wcycle)
 Constructor.
 
 ~Impl ()
 Destructor, non-default needed for freeing device-side buffers.
 
void updateHaveInteractions (const InteractionDefinitions &idef)
 Update flag that tells whether there are bonded interactions suitable for the GPU. More...
 
void updateInteractionListsAndDeviceBuffers (ArrayRef< const int > nbnxnAtomOrder, const InteractionDefinitions &idef, DeviceBuffer< Float4 > d_xqPtr, DeviceBuffer< RVec > d_fPtr, DeviceBuffer< RVec > d_fShiftPtr)
 Update lists of interactions from idef suitable for the GPU, using the data structures prepared for PP work. More...
 
void setPbc (PbcType pbcType, const matrix box, bool canMoleculeSpanPbc)
 Update PBC data. More...
 
template<bool calcVir, bool calcEner>
void launchKernel ()
 Launches bonded kernel on a GPU.
 
bool haveInteractions () const
 Returns whether there are bonded interactions assigned to the GPU.
 
void launchEnergyTransfer ()
 Launches the transfer of computed bonded energies.
 
void waitAccumulateEnergyTerms (gmx_enerdata_t *enerd)
 Waits on the energy transfer, and accumulates bonded energies to enerd.
 
void clearEnergies ()
 Clears the device side energy buffer.
 

Member Function Documentation

void gmx::ListedForcesGpu::Impl::setPbc ( PbcType  pbcType,
const matrix  box,
bool  canMoleculeSpanPbc 
)

Update PBC data.

Converts PBC data from t_pbc into the PbcAiuc format and stores the latter.

Parameters
[in]pbcTypeThe type of the periodic boundary.
[in]boxThe periodic boundary box matrix.
[in]canMoleculeSpanPbcWhether one molecule can have atoms in different PBC cells.
void gmx::ListedForcesGpu::Impl::updateHaveInteractions ( const InteractionDefinitions &  idef)

Update flag that tells whether there are bonded interactions suitable for the GPU.

Intended to be called early during search steps so domainWork flags can be populated.

void gmx::ListedForcesGpu::Impl::updateInteractionListsAndDeviceBuffers ( ArrayRef< const int >  nbnxnAtomOrder,
const InteractionDefinitions &  idef,
DeviceBuffer< Float4 d_xqPtr,
DeviceBuffer< RVec d_fPtr,
DeviceBuffer< RVec d_fShiftPtr 
)

Update lists of interactions from idef suitable for the GPU, using the data structures prepared for PP work.

Intended to be called after each neighbour search stage. Copies the bonded interactions assigned to the GPU to device data structures, and updates device buffers that may have been updated after search.

Divides bonded interactions over threads and GPU. The bonded interactions are assigned by interaction type to GPU threads. The interaction types are assigned in blocks sized as kernelParams_.deviceSubGroupSize. The beginning and end (thread index) of each interaction type are stored in kernelParams_. Pointers to the relevant data structures on the GPU are also stored in kernelParams_.


The documentation for this class was generated from the following files: