Gromacs
2026.0-dev-20250215-e896270
|
#include "gmxpre.h"
#include "config.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/simd/simd.h"
#include "gromacs/simd/simd_math.h"
#include "gromacs/simd/vector_operations.h"
#include "kernel_common.h"
#include "nbnxm_simd.h"
#include "simd_coulomb_functions.h"
#include "simd_diagonal_masker.h"
#include "simd_energy_accumulator.h"
#include "simd_lennardjones_functions.h"
#include "simd_load_store_functions.h"
#include "simd_kernel_inner.h"
Declares and defines the NBNxM SIMD pair interaction kernel function.
This definition is in an include file and not in a source file to enable parallel compilation of different template instantiations in different compilation units. The compilation units and a kernel lookup table are currently manually generated offline by a python script (not at build time) any time something changes in the interface.
This kernel makes uses of many, templated, helper classes, so this file can contain only the skeleton of the outer part of the kernel. The inner loop of the SIMD kernel is defined in simd_kernel_inner.h, which is currently included six times in the simdKernelInner()
function to optimize performance for different properties on pair list entries.
Many, but not all, combinations of the Cartesian product of the different possible values of all template parameters are instantiated for this kernel. In particular, vdwCutoffCheck
is only enabled with Ewald type electrostatics and only certain combinations of ljCombinationRule
and vdwModifier
are used.
Which kernel layouts are instantiated depends on the extent of SIMD support of the architecture and on which layouts are assumed to produce the best performance. Currently we have two kernel layouts:
Classes | |
class | gmx::anonymous_namespace{simd_kernel.h}::EnergyAccumulatorGetter< haveEnergyGroups, computeEnergies > |
General template for EnergyAccumulator getter, only specializations are used. More... | |
class | gmx::anonymous_namespace{simd_kernel.h}::EnergyAccumulatorGetter< false, false > |
Specialized EnergyAccumulator getter for no energy output. More... | |
class | gmx::anonymous_namespace{simd_kernel.h}::EnergyAccumulatorGetter< false, true > |
Specialized EnergyAccumulator getter for single energy group output. More... | |
class | gmx::anonymous_namespace{simd_kernel.h}::EnergyAccumulatorGetter< true, true > |
Specialized EnergyAccumulator getter for multiple energy groups output. More... | |
Functions | |
template<KernelLayout kernelLayout, KernelCoulombType coulombType, VdwCutoffCheck vdwCutoffCheck, LJCombinationRule ljCombinationRule, InteractionModifiers vdwModifier, LJEwald ljEwald, EnergyOutput energyOutput> | |
void | gmx::nbnxmKernelSimd (const NbnxnPairlistCpu *nbl, const nbnxn_atomdata_t *nbat, const interaction_const_t *ic, const rvec *shift_vec, nbnxn_atomdata_output_t *out) |
The actual NBNxM SIMD kernel. More... | |
Variables | |
static constexpr bool | gmx::sc_calculateShiftForces = true |
Whether we calculate shift forces, always true, because it's cheap anyhow. | |
static EnergyAccumulator < false, false > | gmx::anonymous_namespace{simd_kernel.h}::s_energyAccumulator |
Energy accumulator without data members can be static. | |