Gromacs  2019
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
scalar_util.h File Reference
#include <cmath>
+ Include dependency graph for scalar_util.h:
+ This graph shows which files directly or indirectly include this file:

Description

Scalar utility functions mimicking GROMACS SIMD utility functions.

These versions make it possible to write functions that are templated with either a SIMD or scalar type. While some of these functions might not appear SIMD-specific, we have placed them here because the only reason to use these instead of generic function is in templated combined SIMD/non-SIMD code.

Author
Erik Lindahl erik..nosp@m.lind.nosp@m.ahl@g.nosp@m.mail.nosp@m..com

Functions

template<int align>
static void gmx::gatherLoadTranspose (const float *base, const std::int32_t offset[], float *v0, float *v1, float *v2, float *v3)
 Load 4 consecutive floats from base/offset into four variables. More...
 
template<int align>
static void gmx::gatherLoadTranspose (const float *base, const std::int32_t offset[], float *v0, float *v1)
 Load 2 consecutive floats from base/offset into four variables. More...
 
template<int align>
static void gmx::gatherLoadUTranspose (const float *base, const std::int32_t offset[], float *v0, float *v1, float *v2)
 Load 3 consecutive floats from base/offsets, store into three vars. More...
 
template<int align>
static void gmx::transposeScatterStoreU (float *base, const std::int32_t offset[], float v0, float v1, float v2)
 Store 3 floats to 3 to base/offset. More...
 
template<int align>
static void gmx::transposeScatterIncrU (float *base, const std::int32_t offset[], float v0, float v1, float v2)
 Add 3 floats to base/offset. More...
 
template<int align>
static void gmx::transposeScatterDecrU (float *base, const std::int32_t offset[], float v0, float v1, float v2)
 Subtract 3 floats from base/offset. More...
 
static void gmx::expandScalarsToTriplets (float scalar, float *triplets0, float *triplets1, float *triplets2)
 Copy single float to three variables. More...
 
template<int align>
static void gmx::gatherLoadBySimdIntTranspose (const float *base, std::int32_t offset, float *v0, float *v1, float *v2, float *v3)
 Load 4 floats from base/offsets and store into variables. More...
 
template<int align>
static void gmx::gatherLoadUBySimdIntTranspose (const float *base, std::int32_t offset, float *v0, float *v1)
 Load 2 floats from base/offsets and store into variables (unaligned). More...
 
template<int align>
static void gmx::gatherLoadBySimdIntTranspose (const float *base, std::int32_t offset, float *v0, float *v1)
 Load 2 floats from base/offsets and store into variables (aligned). More...
 
static float gmx::reduceIncr4ReturnSum (float *m, float v0, float v1, float v2, float v3)
 Add each float to four consecutive memory locations, return sum. More...
 
template<int align>
static void gmx::gatherLoadTranspose (const double *base, const std::int32_t offset[], double *v0, double *v1, double *v2, double *v3)
 Load 4 consecutive doubles from base/offset into four variables. More...
 
template<int align>
static void gmx::gatherLoadTranspose (const double *base, const std::int32_t offset[], double *v0, double *v1)
 Load 2 consecutive doubles from base/offset into four variables. More...
 
template<int align>
static void gmx::gatherLoadUTranspose (const double *base, const std::int32_t offset[], double *v0, double *v1, double *v2)
 Load 3 consecutive doubles from base/offsets, store into three vars. More...
 
template<int align>
static void gmx::transposeScatterStoreU (double *base, const std::int32_t offset[], double v0, double v1, double v2)
 Store 3 doubles to 3 to base/offset. More...
 
template<int align>
static void gmx::transposeScatterIncrU (double *base, const std::int32_t offset[], double v0, double v1, double v2)
 Add 3 doubles to base/offset. More...
 
template<int align>
static void gmx::transposeScatterDecrU (double *base, const std::int32_t offset[], double v0, double v1, double v2)
 Subtract 3 doubles from base/offset. More...
 
static void gmx::expandScalarsToTriplets (double scalar, double *triplets0, double *triplets1, double *triplets2)
 Copy single double to three variables. More...
 
template<int align>
static void gmx::gatherLoadBySimdIntTranspose (const double *base, std::int32_t offset, double *v0, double *v1, double *v2, double *v3)
 Load 4 doubles from base/offsets and store into variables. More...
 
template<int align>
static void gmx::gatherLoadUBySimdIntTranspose (const double *base, std::int32_t offset, double *v0, double *v1)
 Load 2 doubles from base/offsets and store into variables (unaligned). More...
 
template<int align>
static void gmx::gatherLoadBySimdIntTranspose (const double *base, std::int32_t offset, double *v0, double *v1)
 Load 2 doubles from base/offsets and store into variables (aligned). More...
 
static double gmx::reduceIncr4ReturnSum (double *m, double v0, double v1, double v2, double v3)
 Add each double to four consecutive memory locations, return sum. More...