27#ifndef EWOMS_PREFETCH_HH
28#define EWOMS_PREFETCH_HH
37template <
int temporalLocality = 3,
int writeOnly = 0,
class T =
void>
40#if __clang__ || __GNUC__
43 static const int cacheLineSize = 64;
45 const char *beginPtr =
reinterpret_cast<const char*
>(&val);
46 const char *endPtr =
reinterpret_cast<const char*
>(&val + n);
47 for (; beginPtr < endPtr; beginPtr += cacheLineSize)
48 __builtin_prefetch(beginPtr, writeOnly, temporalLocality);
Definition: blackoilboundaryratevector.hh:37
void prefetch(const T &val, unsigned n=1)
Template function which emits prefetch instructions for a range of memory.
Definition: prefetch.hh:38