diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/setup_common.py | 2 | ||||
-rw-r--r-- | numpy/core/src/umath/cpuid.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py index bf6abcf02..307fab334 100644 --- a/numpy/core/setup_common.py +++ b/numpy/core/setup_common.py @@ -138,6 +138,8 @@ OPTIONAL_INTRINSICS = [("__builtin_isnan", '5.'), # broken on OSX 10.11, make sure its not optimized away ("volatile int r = __builtin_cpu_supports", '"sse"', "stdio.h", "__BUILTIN_CPU_SUPPORTS"), + ("volatile int r = __builtin_cpu_supports", '"avx512f"', + "stdio.h", "__BUILTIN_CPU_SUPPORTS_AVX512F"), # MMX only needed for icc, but some clangs don't have it ("_m_from_int64", '0', "emmintrin.h"), ("_mm_load_ps", '(float*)0', "xmmintrin.h"), # SSE diff --git a/numpy/core/src/umath/cpuid.c b/numpy/core/src/umath/cpuid.c index 51c540457..8673f1736 100644 --- a/numpy/core/src/umath/cpuid.c +++ b/numpy/core/src/umath/cpuid.c @@ -57,10 +57,10 @@ npy_cpu_supports(const char * feature) { #ifdef HAVE___BUILTIN_CPU_SUPPORTS if (strcmp(feature, "avx512f") == 0) { -#if defined(__GNUC__) && (__GNUC__ < 5) - return 0; -#else +#ifdef HAVE___BUILTIN_CPU_SUPPORTS_AVX512F return __builtin_cpu_supports("avx512f") && os_avx512_support(); +#else + return 0; #endif } else if (strcmp(feature, "avx2") == 0) { |