Gromacs  2025-dev-20240614-602a366
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::EnergyAccumulator< true, true > Class Template Reference

#include <gromacs/nbnxm/simd_energy_accumulator.h>

Description

template<>
class gmx::EnergyAccumulator< true, true >

Specialized energy accumulator class for energy accumulation with energy groups.

Sums energies into a temporary buffer with bins for each combination of an i-atom energy group with a pair of energy groups for two j-atoms. Reduction of this list of bins into the final energy group pair matrix is done outside the non-bonded kernel.

Public Member Functions

 EnergyAccumulator (int numEnergyGroups, int iClusterSize, int jClusterSize)
 Constructor. More...
 
void clearEnergiesAndSetEnergyGroupsForJClusters (const EnergyGroupsPerCluster &energyGroupsPerCluster)
 Clears all energy buffers and sets the energy group indices for the j-clusters.
 
template<int iClusterSize>
void initICluster (const int iCluster)
 Sets (internal) parameters for the atom in i-cluster iCluster.
 
void addCoulombEnergy (const int iAtomInCluster, const real energy)
 Adds a single Coulomb energy contribution for atom with index in cluster: iAtomInCluster.
 
void addVdwEnergy (const int iAtomInCluster, const real energy)
 Adds a single VdW energy contribution for atom with index in cluster: iAtomInCluster.
 
void reduceIEnergies (const bool gmx_unused calculateCoulomb)
 Nothing do to here, reduction happens after the kernel call.
 
void getEnergies (ArrayRef< real > coulombEnergies, ArrayRef< real > vdwEnergies) const
 Reduce the group-pair energy buffers produced by a SIMD kernels and return the results in the output buffers. More...
 

Constructor & Destructor Documentation

gmx::EnergyAccumulator< true, true >::EnergyAccumulator ( int  numEnergyGroups,
int  iClusterSize,
int  jClusterSize 
)

Constructor.

Parameters
numEnergyGroupsThe number of energy groups
iClusterSizeThe i-cluster size
jClusterSizeThe j-cluster size

Member Function Documentation

template<int jClusterSize>
void gmx::EnergyAccumulator< true, true >::getEnergies ( ArrayRef< real coulombEnergies,
ArrayRef< real vdwEnergies 
) const

Reduce the group-pair energy buffers produced by a SIMD kernels and return the results in the output buffers.

The SIMD kernels produce a large number of energy buffer in SIMD registers to avoid scattered reads and writes.

Parameters
coulombEnergiesBuffer of Coulomb energies to accumulate to
vdwEnergiesBuffer of VdW energies to accumulate to

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