27 #ifndef EWOMS_PREFETCH_HH 28 #define EWOMS_PREFETCH_HH 38 template <
int temporalLocality = 3,
int writeOnly = 0,
class T =
void>
41 #if __clang__ || __GNUC__ 44 static const int cacheLineSize = 64;
46 const char *beginPtr =
reinterpret_cast<const char*
>(&val);
47 const char *endPtr =
reinterpret_cast<const char*
>(&val + n);
48 for (; beginPtr < endPtr; beginPtr += cacheLineSize)
49 __builtin_prefetch(beginPtr, writeOnly, temporalLocality);
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
void prefetch(const T &val, unsigned n=1)
Template function which emits prefetch instructions for a range of memory.
Definition: prefetch.hh:39