summaryrefslogtreecommitdiff
path: root/numpy/core/setup_common.py
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2018-03-27 22:29:17 +0200
committerJulian Taylor <jtaylor.debian@googlemail.com>2018-03-29 18:40:28 +0200
commitcde5583abda2bd3da410058b2e1ea4108073b4d3 (patch)
treec551fe1f09b314c79f6aceb5ff810b6eb03b0487 /numpy/core/setup_common.py
parente4d678a2f5859d29a853d617e9e5bbd4b6241898 (diff)
downloadnumpy-cde5583abda2bd3da410058b2e1ea4108073b4d3.tar.gz
BUG: verify the OS supports avx instruction
On some systems you can disable avx registers but the gcc builtin does only checks if the cpu has the feature. Before using avx functions check the OS support with xgetbv. Closes gh-10787 Closes gh-9534
Diffstat (limited to 'numpy/core/setup_common.py')
-rw-r--r--numpy/core/setup_common.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py
index 1fe953910..f36d61f55 100644
--- a/numpy/core/setup_common.py
+++ b/numpy/core/setup_common.py
@@ -146,6 +146,7 @@ OPTIONAL_INTRINSICS = [("__builtin_isnan", '5.'),
"stdio.h", "LINK_AVX"),
("__asm__ volatile", '"vpand %ymm1, %ymm2, %ymm3"',
"stdio.h", "LINK_AVX2"),
+ ("__asm__ volatile", '"xgetbv"', "stdio.h", "XGETBV"),
]
# function attributes