Gromacs  2022.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
kernel_common.cpp File Reference
#include "gmxpre.h"
#include "kernel_common.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/utility/gmxassert.h"
+ Include dependency graph for kernel_common.cpp:

Description

Implements utility functions used by all nbnxm CPU kernels.

Author
Berk Hess hess@.nosp@m.kth..nosp@m.se

Functions

static void clearBufferAll (gmx::ArrayRef< real > buffer)
 Clears all elements of buffer.
 
template<int numComponentsPerElement>
static void clearBufferFlagged (const nbnxn_atomdata_t &nbat, int outputIndex, gmx::ArrayRef< real > buffer)
 Clears elements of size and stride numComponentsPerElement. More...
 
void clearForceBuffer (nbnxn_atomdata_t *nbat, int outputIndex)
 Clears the force buffer. More...
 
void clear_fshift (real *fshift)
 Clears the shift forces.
 
void reduce_energies_over_lists (const nbnxn_atomdata_t *nbat, int nlist, real *Vvdw, real *Vc)
 Reduces the collected energy terms over the pair-lists/threads.
 

Function Documentation

template<int numComponentsPerElement>
static void clearBufferFlagged ( const nbnxn_atomdata_t nbat,
int  outputIndex,
gmx::ArrayRef< real buffer 
)
static

Clears elements of size and stride numComponentsPerElement.

Only elements with flags in nbat set for index outputIndex are cleared.

void clearForceBuffer ( nbnxn_atomdata_t nbat,
int  outputIndex 
)

Clears the force buffer.

Either the whole buffer is cleared or only the parts used by thread/task outputIndex when nbat->bUseBufferFlags is set.

Parameters
[in,out]nbatThe Nbnxm atom data
[in]outputIndexThe index of the output object to clear