diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-09-10 04:21:55 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-09-10 04:21:55 +0100 |
commit | 677b7ba5c317778df2ad7e70df94b9b7eec4adbc (patch) | |
tree | 6c418a1546fff5becab5d8b9ed6803323e7f316e /dev-python/numpy/files | |
parent | fbda87924e6faa7a1919f1a2b4182490bde5ec5c (diff) |
gentoo resync : 10.09.2021
Diffstat (limited to 'dev-python/numpy/files')
4 files changed, 0 insertions, 318 deletions
diff --git a/dev-python/numpy/files/numpy-1.20.1-no-hardcode-blasv2.patch b/dev-python/numpy/files/numpy-1.20.1-no-hardcode-blasv2.patch deleted file mode 100644 index e24e0edb926d..000000000000 --- a/dev-python/numpy/files/numpy-1.20.1-no-hardcode-blasv2.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py -index 13f9da0..b696ef5 100644 ---- a/numpy/distutils/system_info.py -+++ b/numpy/distutils/system_info.py -@@ -505,32 +505,7 @@ def get_info(name, notfound_action=0): - 1 - display warning message - 2 - raise error - """ -- cl = {'atlas': atlas_info, # use lapack_opt or blas_opt instead -- 'atlas_threads': atlas_threads_info, # ditto -- 'atlas_blas': atlas_blas_info, -- 'atlas_blas_threads': atlas_blas_threads_info, -- 'lapack_atlas': lapack_atlas_info, # use lapack_opt instead -- 'lapack_atlas_threads': lapack_atlas_threads_info, # ditto -- 'atlas_3_10': atlas_3_10_info, # use lapack_opt or blas_opt instead -- 'atlas_3_10_threads': atlas_3_10_threads_info, # ditto -- 'atlas_3_10_blas': atlas_3_10_blas_info, -- 'atlas_3_10_blas_threads': atlas_3_10_blas_threads_info, -- 'lapack_atlas_3_10': lapack_atlas_3_10_info, # use lapack_opt instead -- 'lapack_atlas_3_10_threads': lapack_atlas_3_10_threads_info, # ditto -- 'flame': flame_info, # use lapack_opt instead -- 'mkl': mkl_info, -- # openblas which may or may not have embedded lapack -- 'openblas': openblas_info, # use blas_opt instead -- # openblas with embedded lapack -- 'openblas_lapack': openblas_lapack_info, # use blas_opt instead -- 'openblas_clapack': openblas_clapack_info, # use blas_opt instead -- 'blis': blis_info, # use blas_opt instead -- 'lapack_mkl': lapack_mkl_info, # use lapack_opt instead -- 'blas_mkl': blas_mkl_info, # use blas_opt instead -- 'openblas64_': openblas64__info, -- 'openblas64__lapack': openblas64__lapack_info, -- 'openblas_ilp64': openblas_ilp64_info, -- 'openblas_ilp64_lapack': openblas_ilp64_lapack_info, -+ cl = {'flame': flame_info, # use lapack_opt instead - 'x11': x11_info, - 'fft_opt': fft_opt_info, - 'fftw': fftw_info, -@@ -950,10 +925,7 @@ class system_info: - return [b for b in [a.strip() for a in libs.split(',')] if b] - - def get_libraries(self, key='libraries'): -- if hasattr(self, '_lib_names'): -- return self.get_libs(key, default=self._lib_names) -- else: -- return self.get_libs(key, '') -+ return self.get_libs(key, '') - - def library_extensions(self): - c = customized_ccompiler() diff --git a/dev-python/numpy/files/numpy-1.20.2-fix-ccompiler-tests.patch b/dev-python/numpy/files/numpy-1.20.2-fix-ccompiler-tests.patch deleted file mode 100644 index 2312dd89a9b2..000000000000 --- a/dev-python/numpy/files/numpy-1.20.2-fix-ccompiler-tests.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 6f2f26e08c6e0d476593c82ad31d13847f30cbf4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> -Date: Sun, 28 Mar 2021 10:00:14 +0200 -Subject: [PATCH] BUG: Fix test_ccompiler_opt when path contains dots - -Fix test_ccompiler_opt not to be confused by dots occurring on the path -to the temporary directory, by using only the source file's basename -when grabbing options. Otherwise, the test can fail with mismatches -such as: - - E AssertionError: 'sources_status' returns different targets than the compiled targets - E ['AVX512F', 'AVX2'] != ['(20 2/TEMP/TMPB0YHSCAI/TEST_TARGETS AVX512F)', '(20 2/TEMP/TMPB0YHSCAI/TEST_TARGETS AVX2)'] - -This is because our TMPDIR value includes numpy version, i.e. 1.20.2. -The splitting happens on the first dot that is part of the directory -path rather than test filename. ---- - numpy/distutils/tests/test_ccompiler_opt.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/numpy/distutils/tests/test_ccompiler_opt.py b/numpy/distutils/tests/test_ccompiler_opt.py -index 287a683c8..d2b0a4c58 100644 ---- a/numpy/distutils/tests/test_ccompiler_opt.py -+++ b/numpy/distutils/tests/test_ccompiler_opt.py -@@ -112,7 +112,7 @@ class _Test_CCompilerOpt(object): - gflags = {} - fake_objects = opt.try_dispatch([file]) - for source, flags in fake_objects: -- gtar = source.split('.')[1:-1] -+ gtar = path.basename(source).split('.')[1:-1] - glen = len(gtar) - if glen == 0: - gtar = "baseline" --- -2.31.1 - diff --git a/dev-python/numpy/files/numpy-1.20.2-fix-popcnt-detection.patch b/dev-python/numpy/files/numpy-1.20.2-fix-popcnt-detection.patch deleted file mode 100644 index 85f4bb11b768..000000000000 --- a/dev-python/numpy/files/numpy-1.20.2-fix-popcnt-detection.patch +++ /dev/null @@ -1,103 +0,0 @@ -https://github.com/numpy/numpy/pull/19074 -https://bugs.gentoo.org/788184 - -From 8dc768964b5578a8aa9db1ef2c55134a00731e10 Mon Sep 17 00:00:00 2001 -From: Carl Michal <michal@physics.ubc.ca> -Date: Sat, 22 May 2021 20:43:10 -0700 -Subject: [PATCH 1/2] Fix compile-time test of POPCNT - -The compile-time test of POPCNT, cpu_popcnt.c produced code that would -execute without error even if the machine didn't support the popcnt -instruction. This patch attempts to use popcnt on random numbers so the -compiler can't substitute the answer at compile time. ---- - numpy/distutils/checks/cpu_popcnt.c | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - -diff --git a/numpy/distutils/checks/cpu_popcnt.c b/numpy/distutils/checks/cpu_popcnt.c -index e6a80fb40be4..f6c785dd2a97 100644 ---- a/numpy/distutils/checks/cpu_popcnt.c -+++ b/numpy/distutils/checks/cpu_popcnt.c -@@ -4,20 +4,26 @@ - #include <popcntintrin.h> - #endif - -+#include <stdlib.h> -+ - int main(void) - { - long long a = 0; - int b; -+ -+ a = random(); -+ b = random(); -+ - #ifdef _MSC_VER - #ifdef _M_X64 -- a = _mm_popcnt_u64(1); -+ a = _mm_popcnt_u64(a); - #endif -- b = _mm_popcnt_u32(1); -+ b = _mm_popcnt_u32(b); - #else - #ifdef __x86_64__ -- a = __builtin_popcountll(1); -+ a = __builtin_popcountll(a); - #endif -- b = __builtin_popcount(1); -+ b = __builtin_popcount(b); - #endif - return (int)a + b; - } - -From 52d5fe1ede45083d0783c3e2bbaee5c44df9d553 Mon Sep 17 00:00:00 2001 -From: Carl Michal <michal@physics.ubc.ca> -Date: Sun, 23 May 2021 08:24:52 -0700 -Subject: [PATCH 2/2] Change fix of cpu_popcnt.c to use - _mm_popcnt_u64/_mm_popcnt_u32 on GCC - -_builtin_popcount is always available, so the compile-time check always -succeeds. ---- - numpy/distutils/checks/cpu_popcnt.c | 26 ++++++++------------------ - 1 file changed, 8 insertions(+), 18 deletions(-) - -diff --git a/numpy/distutils/checks/cpu_popcnt.c b/numpy/distutils/checks/cpu_popcnt.c -index f6c785dd2a97..540c98dab05d 100644 ---- a/numpy/distutils/checks/cpu_popcnt.c -+++ b/numpy/distutils/checks/cpu_popcnt.c -@@ -4,26 +4,16 @@ - #include <popcntintrin.h> - #endif - --#include <stdlib.h> -- --int main(void) -+int main(int argc, char **argv) - { -- long long a = 0; -- int b; -- -- a = random(); -- b = random(); -- --#ifdef _MSC_VER -- #ifdef _M_X64 -+ // To make sure popcnt instructions are generated -+ // and been tested against the assembler -+ unsigned long long a = *((unsigned long long*)argv[argc-1]); -+ unsigned int b = *((unsigned int*)argv[argc-2]); -+ -+#if defined(_M_X64) || defined(__x86_64__) - a = _mm_popcnt_u64(a); -- #endif -- b = _mm_popcnt_u32(b); --#else -- #ifdef __x86_64__ -- a = __builtin_popcountll(a); -- #endif -- b = __builtin_popcount(b); - #endif -+ b = _mm_popcnt_u32(b); - return (int)a + b; - } diff --git a/dev-python/numpy/files/numpy-1.20.3-float-hashing-py310.patch b/dev-python/numpy/files/numpy-1.20.3-float-hashing-py310.patch deleted file mode 100644 index f3b2ea3ef0ca..000000000000 --- a/dev-python/numpy/files/numpy-1.20.3-float-hashing-py310.patch +++ /dev/null @@ -1,129 +0,0 @@ -From ad2a73c18dcff95d844c382c94ab7f73b5571cf3 Mon Sep 17 00:00:00 2001 -From: Sebastian Berg <sebastian@sipsolutions.net> -Date: Tue, 4 May 2021 17:43:26 -0500 -Subject: [PATCH] MAINT: Adjust NumPy float hashing to Python's slightly - changed hash - -This is necessary, since we use the Python double hash and the -semi-private function to calculate it in Python has a new signature -to return the identity-hash when the value is NaN. - -closes gh-18833, gh-18907 ---- - numpy/core/src/common/npy_pycompat.h | 16 ++++++++++ - numpy/core/src/multiarray/scalartypes.c.src | 13 ++++---- - numpy/core/tests/test_scalarmath.py | 34 +++++++++++++++++++++ - 3 files changed, 57 insertions(+), 6 deletions(-) - -diff --git a/numpy/core/src/common/npy_pycompat.h b/numpy/core/src/common/npy_pycompat.h -index aa0b5c1224d..9e94a971090 100644 ---- a/numpy/core/src/common/npy_pycompat.h -+++ b/numpy/core/src/common/npy_pycompat.h -@@ -3,4 +3,20 @@ - - #include "numpy/npy_3kcompat.h" - -+ -+/* -+ * In Python 3.10a7 (or b1), python started using the identity for the hash -+ * when a value is NaN. See https://bugs.python.org/issue43475 -+ */ -+#if PY_VERSION_HEX > 0x030a00a6 -+#define Npy_HashDouble _Py_HashDouble -+#else -+static NPY_INLINE Py_hash_t -+Npy_HashDouble(PyObject *NPY_UNUSED(identity), double val) -+{ -+ return _Py_HashDouble(val); -+} -+#endif -+ -+ - #endif /* _NPY_COMPAT_H_ */ -diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src -index a001500b0a9..9930f7791d6 100644 ---- a/numpy/core/src/multiarray/scalartypes.c.src -+++ b/numpy/core/src/multiarray/scalartypes.c.src -@@ -3172,7 +3172,7 @@ static npy_hash_t - static npy_hash_t - @lname@_arrtype_hash(PyObject *obj) - { -- return _Py_HashDouble((double) PyArrayScalar_VAL(obj, @name@)); -+ return Npy_HashDouble(obj, (double)PyArrayScalar_VAL(obj, @name@)); - } - - /* borrowed from complex_hash */ -@@ -3180,14 +3180,14 @@ static npy_hash_t - c@lname@_arrtype_hash(PyObject *obj) - { - npy_hash_t hashreal, hashimag, combined; -- hashreal = _Py_HashDouble((double) -- PyArrayScalar_VAL(obj, C@name@).real); -+ hashreal = Npy_HashDouble( -+ obj, (double)PyArrayScalar_VAL(obj, C@name@).real); - - if (hashreal == -1) { - return -1; - } -- hashimag = _Py_HashDouble((double) -- PyArrayScalar_VAL(obj, C@name@).imag); -+ hashimag = Npy_HashDouble( -+ obj, (double)PyArrayScalar_VAL(obj, C@name@).imag); - if (hashimag == -1) { - return -1; - } -@@ -3202,7 +3202,8 @@ c@lname@_arrtype_hash(PyObject *obj) - static npy_hash_t - half_arrtype_hash(PyObject *obj) - { -- return _Py_HashDouble(npy_half_to_double(PyArrayScalar_VAL(obj, Half))); -+ return Npy_HashDouble( -+ obj, npy_half_to_double(PyArrayScalar_VAL(obj, Half))); - } - - static npy_hash_t -diff --git a/numpy/core/tests/test_scalarmath.py b/numpy/core/tests/test_scalarmath.py -index d91b4a39146..09a734284a7 100644 ---- a/numpy/core/tests/test_scalarmath.py -+++ b/numpy/core/tests/test_scalarmath.py -@@ -712,6 +712,40 @@ def test_shift_all_bits(self, type_code, op): - assert_equal(res_arr, res_scl) - - -+class TestHash: -+ @pytest.mark.parametrize("type_code", np.typecodes['AllInteger']) -+ def test_integer_hashes(self, type_code): -+ scalar = np.dtype(type_code).type -+ for i in range(128): -+ assert hash(i) == hash(scalar(i)) -+ -+ @pytest.mark.parametrize("type_code", np.typecodes['AllFloat']) -+ def test_float_and_complex_hashes(self, type_code): -+ scalar = np.dtype(type_code).type -+ for val in [np.pi, np.inf, 3, 6.]: -+ numpy_val = scalar(val) -+ # Cast back to Python, in case the NumPy scalar has less precision -+ if numpy_val.dtype.kind == 'c': -+ val = complex(numpy_val) -+ else: -+ val = float(numpy_val) -+ assert val == numpy_val -+ print(repr(numpy_val), repr(val)) -+ assert hash(val) == hash(numpy_val) -+ -+ if hash(float(np.nan)) != hash(float(np.nan)): -+ # If Python distinguises different NaNs we do so too (gh-18833) -+ assert hash(scalar(np.nan)) != hash(scalar(np.nan)) -+ -+ @pytest.mark.parametrize("type_code", np.typecodes['Complex']) -+ def test_complex_hashes(self, type_code): -+ # Test some complex valued hashes specifically: -+ scalar = np.dtype(type_code).type -+ for val in [np.pi+1j, np.inf-3j, 3j, 6.+1j]: -+ numpy_val = scalar(val) -+ assert hash(complex(numpy_val)) == hash(numpy_val) -+ -+ - @contextlib.contextmanager - def recursionlimit(n): - o = sys.getrecursionlimit() |