mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 04:50:34 +05:00
define macro NETGEN_DEFAULT_SIMD_SIZE
This commit is contained in:
parent
ddc8282318
commit
c354118fb9
@ -15,17 +15,22 @@
|
||||
|
||||
namespace ngcore
|
||||
{
|
||||
#if defined __AVX512F__
|
||||
#define NETGEN_DEFAULT_SIMD_SIZE 8
|
||||
#define NETGEN_NATIVE_SIMD_SIZE 8
|
||||
#elif defined __AVX__
|
||||
#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
|
||||
#define NETGEN_DEFAULT_SIMD_SIZE 2
|
||||
#define NETGEN_NATIVE_SIMD_SIZE 1
|
||||
#endif
|
||||
|
||||
constexpr int GetDefaultSIMDSize() {
|
||||
#if defined __AVX512F__
|
||||
return 8;
|
||||
#elif defined __AVX__
|
||||
return 4;
|
||||
#elif defined NETGEN_ARCH_AMD64
|
||||
return 2;
|
||||
#else
|
||||
return 2;
|
||||
#endif
|
||||
return NETGEN_DEFAULT_SIMD_SIZE;
|
||||
}
|
||||
|
||||
constexpr bool IsNativeSIMDSize(int n) {
|
||||
|
Loading…
Reference in New Issue
Block a user