summaryrefslogtreecommitdiff
path: root/numpy/core/setup.py
diff options
context:
space:
mode:
authorSayed Adel <seiko@imavr.com>2020-01-21 11:56:33 +0200
committerSayed Adel <seiko@imavr.com>2020-02-05 05:09:21 +0200
commitad174001a869f42bb89ccff77ac3eec04a9d71e8 (patch)
tree3dbcad1b3e121d499ec2f072b7e80b32bb9a62ef /numpy/core/setup.py
parentf71d9937d1e8a1e709f325f689f1e971e64c26a7 (diff)
downloadnumpy-ad174001a869f42bb89ccff77ac3eec04a9d71e8.tar.gz
ENH: improve runtime detection of CPU features
- Put the old CPU detection code to rest The current CPU detection code only supports x86 and it's count on compiler built-in functions that not widely supported by other compilers or platforms. NOTE: `npy_cpu_supports` is removed rather than deprecated, use the macro `NPY_CPU_HAVE(FEATURE_NAME_WITHOUT_QUOTES)` instead. - Initialize the new CPU features runtime detector Almost similar to GCC built-in functions, so instead of `__builtin_cpu_init`, `__builtin_cpu_supports` its provide `npy_cpu_init`, `npy_cpu_have` and `NPY_CPU_HAVE`. NOTE: `npy_cpu_init` must be called before any use of `npy_cpu_have` and `NPY_CPU_HAVE`, however `npy_cpu_init` already called during the load of module `umath` so there's no reason to call it again in most of the cases. - Add X86 support detect almost all x86 features, also provide CPU feature groups that gather several features. e.g. `AVX512_KNM` detect Knights Mill's `AVX512` features - Add IBM/Power support only supports Linux and count here on `glibc(getauxval)` to detect VSX support and fail-back to the compiler definitions for other platforms. - Add ARM support Same as IBM/Power but its parse `/proc/self/auxv` if `glibc(getauxval)` isn't available. - Update umath generator - Add testing unit for Linux only - Add new attribute `__cpu_features__` to umath module `__cpu_features__` is a dictionary contains all supported CPU feature names with runtime availability
Diffstat (limited to 'numpy/core/setup.py')
-rw-r--r--numpy/core/setup.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index e376d5a23..d1216d169 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -745,6 +745,7 @@ def configuration(parent_package='',top_path=None):
join('src', 'common', 'ucsnarrow.c'),
join('src', 'common', 'ufunc_override.c'),
join('src', 'common', 'numpyos.c'),
+ join('src', 'common', 'npy_cpu_features.c.src'),
]
if os.environ.get('NPY_USE_BLAS_ILP64', "0") != "0":
@@ -898,7 +899,6 @@ def configuration(parent_package='',top_path=None):
join('src', 'umath', 'clip.c.src'),
join('src', 'umath', 'ufunc_object.c'),
join('src', 'umath', 'extobj.c'),
- join('src', 'umath', 'cpuid.c'),
join('src', 'umath', 'scalarmath.c.src'),
join('src', 'umath', 'ufunc_type_resolution.c'),
join('src', 'umath', 'override.c'),