diff options
author | Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> | 2022-10-10 22:31:02 -0700 |
---|---|---|
committer | Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> | 2023-01-30 13:38:39 -0800 |
commit | 92bd9902d4233d9f5befe05fd47bfb8b2d4e102a (patch) | |
tree | 8dd2626a99125c126cb628e037e2a07748da12d0 /numpy/core/setup.py | |
parent | fba06e75e4865168f5c3b6637c8a792fc1d9a2d7 (diff) | |
download | numpy-92bd9902d4233d9f5befe05fd47bfb8b2d4e102a.tar.gz |
MAINT: Disable AVX-512 qsort on macOS and WIN32
Diffstat (limited to 'numpy/core/setup.py')
-rw-r--r-- | numpy/core/setup.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py index 912867709..fb91f8e68 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -68,6 +68,15 @@ class CallOnceOnly: out = copy.deepcopy(pickle.loads(self._check_complex)) return out +# Temporarily disable AVX512 sorting on WIN32 and macOS until we can figure +# out why the build fails +def enable_avx512_qsort(): + enable = True + platform = sysconfig.get_platform() + if "win32" in platform or "macos" in platform: + enable = False + return enable + def can_link_svml(): """SVML library is supported only on x86_64 architecture and currently only on linux @@ -484,6 +493,9 @@ def configuration(parent_package='',top_path=None): if can_link_svml(): moredefs.append(('NPY_CAN_LINK_SVML', 1)) + if enable_avx512_qsort(): + moredefs.append(('NPY_ENABLE_AVX512_QSORT', 1)) + # Use bogus stride debug aid to flush out bugs where users use # strides of dimensions with length 1 to index a full contiguous # array. @@ -943,7 +955,6 @@ def configuration(parent_package='',top_path=None): join('src', 'multiarray', 'usertypes.c'), join('src', 'multiarray', 'vdot.c'), join('src', 'common', 'npy_sort.h.src'), - join('src', 'npysort', 'x86-qsort-skx.dispatch.cpp'), join('src', 'npysort', 'quicksort.cpp'), join('src', 'npysort', 'mergesort.cpp'), join('src', 'npysort', 'timsort.cpp'), @@ -967,6 +978,11 @@ def configuration(parent_package='',top_path=None): join('src', 'npymath', 'arm64_exports.c'), ] + if enable_avx512_qsort(): + multiarray_src += [ + join('src', 'npysort', 'x86-qsort-skx.dispatch.cpp'), + ] + ####################################################################### # _multiarray_umath module - umath part # ####################################################################### |