Merge branch 'simd_2_native' into 'master'

Consider SIMD width 2 as "native" on all platforms

See merge request ngsolve/netgen!588
This commit is contained in:
Hochsteger, Matthias 2023-07-28 12:14:50 +02:00
commit a15bd179ba

View File

@ -18,16 +18,10 @@ namespace ngcore
{ {
#if defined __AVX512F__ #if defined __AVX512F__
#define NETGEN_DEFAULT_SIMD_SIZE 8 #define NETGEN_DEFAULT_SIMD_SIZE 8
#define NETGEN_NATIVE_SIMD_SIZE 8
#elif defined __AVX__ #elif defined __AVX__
#define NETGEN_DEFAULT_SIMD_SIZE 4 #define NETGEN_DEFAULT_SIMD_SIZE 4
#define NETGEN_NATIVE_SIMD_SIZE 4
#elif defined NETGEN_ARCH_AMD64
#define NETGEN_DEFAULT_SIMD_SIZE 2
#define NETGEN_NATIVE_SIMD_SIZE 2
#else #else
#define NETGEN_DEFAULT_SIMD_SIZE 2 #define NETGEN_DEFAULT_SIMD_SIZE 2
#define NETGEN_NATIVE_SIMD_SIZE 1
#endif #endif
constexpr int GetDefaultSIMDSize() { constexpr int GetDefaultSIMDSize() {
@ -36,9 +30,7 @@ namespace ngcore
constexpr bool IsNativeSIMDSize(int n) { constexpr bool IsNativeSIMDSize(int n) {
if(n==1) return true; if(n==1) return true;
#if defined NETGEN_ARCH_AMD64 || defined __SSE__ || defined __aarch64__
if(n==2) return true; if(n==2) return true;
#endif
#if defined __AVX__ #if defined __AVX__
if(n==4) return true; if(n==4) return true;
#endif #endif