Gromacs
2025-dev-20241003-bd59e46
|
#include <gromacs/nbnxm/simd_energy_accumulator.h>
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... | |
gmx::EnergyAccumulator< true, true >::EnergyAccumulator | ( | int | numEnergyGroups, |
int | iClusterSize, | ||
int | jClusterSize | ||
) |
Constructor.
numEnergyGroups | The number of energy groups |
iClusterSize | The i-cluster size |
jClusterSize | The j-cluster size |
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.
coulombEnergies | Buffer of Coulomb energies to accumulate to |
vdwEnergies | Buffer of VdW energies to accumulate to |