Commit 7d742dff authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

update prefetch

parent 32c106bf
......@@ -76,38 +76,22 @@ typedef long long MortonIndex;
///////////////////////////////////////////////////////
#ifdef __GNUC__
#define Prefetch_Read0(X) __builtin_prefetch(X,0,2)
#define Prefetch_Write0(X) __builtin_prefetch(X,1,2)
#define Prefetch_Read1(X) __builtin_prefetch(X,0,2)
#define Prefetch_Write1(X) __builtin_prefetch(X,1,2)
#define Prefetch_Read2(X) __builtin_prefetch(X,0,2)
#define Prefetch_Write2(X) __builtin_prefetch(X,1,2)
#define Prefetch_Read0(X) _mm_prefetch((char*)(X), _MM_HINT_T0);
inline void Prefetch_Write0_core(const char* ptr){
asm("prefetchw %0": : "g"(ptr) :);
}
#define Prefetch_Write0(X) Prefetch_Write0_core((const char*)X);
#define Prefetch_Read1(X) _mm_prefetch((char*)(X), _MM_HINT_T1);
#define Prefetch_Write1(X) _mm_prefetch((char*)(X), _MM_HINT_T1);
#define Prefetch_Read2(X) _mm_prefetch((char*)(X), _MM_HINT_T2);
#define Prefetch_Write2(X) _mm_prefetch((char*)(X), _MM_HINT_T2);
#else
#ifdef __INTEL_COMPILER
#ifdef SCALFMM_USE_AVX2
#define Prefetch_Read0(X) _mm512_prefetch(X,_MM_HINT_T0)
#define Prefetch_Write0(X) _mm512_prefetch(X,_MM_HINT_T0)
#define Prefetch_Read1(X) _mm512_prefetch(X,_MM_HINT_T1)
#define Prefetch_Write1(X) _mm512_prefetch(X,_MM_HINT_T1)
#define Prefetch_Read2(X) _mm512_prefetch(X,_MM_HINT_T2)
#define Prefetch_Write2(X) _mm512_prefetch(X,_MM_HINT_T2)
#else
#define Prefetch_Read0(X) _mm_prefetch(X,_MM_HINT_T0)
#define Prefetch_Write0(X) _mm_prefetch(X,_MM_HINT_T0)
#define Prefetch_Read1(X) _mm_prefetch(X,_MM_HINT_T1)
#define Prefetch_Write1(X) _mm_prefetch(X,_MM_HINT_T1)
#define Prefetch_Read2(X) _mm_prefetch(X,_MM_HINT_T2)
#define Prefetch_Write2(X) _mm_prefetch(X,_MM_HINT_T2)
#endif
#else
#warning compiler is not defined
#define Prefetch_Read0(X)
#define Prefetch_Write0(X)
#define Prefetch_Read1(X)
#define Prefetch_Write1(X)
#define Prefetch_Read2(X)
#define Prefetch_Write2(X)
#endif
#define Prefetch_Read0(X) _mm_prefetch((char*)(X), _MM_HINT_T0);
#define Prefetch_Write0(X) _mm_prefetch((char*)(X), _MM_HINT_T0);
#define Prefetch_Read1(X) _mm_prefetch((char*)(X), _MM_HINT_T1);
#define Prefetch_Write1(X) _mm_prefetch((char*)(X), _MM_HINT_T1);
#define Prefetch_Read2(X) _mm_prefetch((char*)(X), _MM_HINT_T2);
#define Prefetch_Write2(X) _mm_prefetch((char*)(X), _MM_HINT_T2);
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment