summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2023-06-29 11:29:09 +0800
committerSteve Sakoman <steve@sakoman.com>2023-07-04 05:32:29 -1000
commit3ee2522d8a879c13dd0cc394be6fc9b385b5f68f (patch)
tree8fd311a2fa26dd67afb180d0f4521e9e9031e138
parent8bf60de4768c0966577241313da5d99fe10b8489 (diff)
downloadpoky-3ee2522d8a879c13dd0cc394be6fc9b385b5f68f.tar.gz
python3-numpy: remove NPY_INLINE, use inline instead
The build fails when DEBUG_BUILD is enabled with GCC-13 as [1] and [2]. Fixes: | numpy/core/src/umath/simd.inc.src:977:20: note: called from here | 977 | @vtype@ zeros = _mm512_setzero_@vsuffix@(); | ^~~~~~~~~~~~~~~~~~~ | numpy/core/src/umath/simd.inc.src:596:1: error: inlining failed in call to ‘always_inline’ ‘avx512_get_full_load_mask_ps’: target specific option mismatch 596 | avx512_get_full_load_mask_ps(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | numpy/core/src/umath/simd.inc.src:976:27: note: called from here 976 | @mask@ load_mask = avx512_get_full_load_mask_@vsuffix@(); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | /usr/lib/gcc/x86_64-redhat-linux/13/include/avx512fintrin.h:6499:1: error: inlining failed in call to ‘always_inline’ ‘_mm512_loadu_si512’: target specific option mismatch Reference: https://github.com/numpy/numpy/pull/22674/commits/3947b1a023a07a55522de65b4d302339bac2bad7 [1] https://git.openembedded.org/openembedded-core/commit/?id=8596678667797971559aed962b1c204266032186 [2] http://errors.yoctoproject.org/Errors/Details/689841/ (From OE-Core rev: 77a64a8686b6c9ef3bc6adbce6cdc442096decfd) Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-devtools/python/python3-numpy/0001-simd.inc.src-Change-NPY_INLINE-to-inline.patch135
-rw-r--r--meta/recipes-devtools/python/python3-numpy_1.24.2.bb1
2 files changed, 136 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-numpy/0001-simd.inc.src-Change-NPY_INLINE-to-inline.patch b/meta/recipes-devtools/python/python3-numpy/0001-simd.inc.src-Change-NPY_INLINE-to-inline.patch
new file mode 100644
index 0000000000..d733dda333
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-numpy/0001-simd.inc.src-Change-NPY_INLINE-to-inline.patch
@@ -0,0 +1,135 @@
1From f2a722aa30a29709bb9b5f60fc6d20a10fe6b4f5 Mon Sep 17 00:00:00 2001
2From: Mingli Yu <mingli.yu@windriver.com>
3Date: Wed, 28 Jun 2023 17:58:52 +0800
4Subject: [PATCH] simd.inc.src: Change NPY_INLINE to inline
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Fixes:
10 | numpy/core/src/umath/simd.inc.src:977:20: note: called from here
11 | 977 | @vtype@ zeros = _mm512_setzero_@vsuffix@();
12 | ^~~~~~~~~~~~~~~~~~~
13 | numpy/core/src/umath/simd.inc.src:596:1: error: inlining failed in call to ‘always_inline’ ‘avx512_get_full_load_mask_ps’: target specific option mismatch
14 596 | avx512_get_full_load_mask_ps(void)
15 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 | numpy/core/src/umath/simd.inc.src:976:27: note: called from here
17 976 | @mask@ load_mask = avx512_get_full_load_mask_@vsuffix@();
18 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 | /usr/lib/gcc/x86_64-redhat-linux/13/include/avx512fintrin.h:6499:1: error: inlining failed in call to ‘always_inline’ ‘_mm512_loadu_si512’: target specific option mismatch
20
21Upstream-Status: Inappropriate [The file simd.inc.src have been removed in new version as
22 https://github.com/numpy/numpy/commit/640e85017aa8eac3e9be68b475acf27d623b16b7]
23
24Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
25---
26 numpy/core/src/umath/simd.inc.src | 24 ++++++++++++------------
27 1 file changed, 12 insertions(+), 12 deletions(-)
28
29diff --git a/numpy/core/src/umath/simd.inc.src b/numpy/core/src/umath/simd.inc.src
30index d6c9a7e..39aec9a 100644
31--- a/numpy/core/src/umath/simd.inc.src
32+++ b/numpy/core/src/umath/simd.inc.src
33@@ -61,11 +61,11 @@
34 */
35
36 #if defined HAVE_ATTRIBUTE_TARGET_AVX512F_WITH_INTRINSICS && defined NPY_HAVE_SSE2_INTRINSICS
37-static NPY_INLINE NPY_GCC_TARGET_AVX512F void
38+static inline NPY_GCC_TARGET_AVX512F void
39 AVX512F_@func@_@TYPE@(@type@*, @type@*, const npy_intp n, const npy_intp stride);
40 #endif
41
42-static NPY_INLINE int
43+static inline int
44 run_unary_avx512f_@func@_@TYPE@(char **args, const npy_intp *dimensions, const npy_intp *steps)
45 {
46 #if defined HAVE_ATTRIBUTE_TARGET_AVX512F_WITH_INTRINSICS && defined NPY_HAVE_SSE2_INTRINSICS
47@@ -99,11 +99,11 @@ run_unary_avx512f_@func@_@TYPE@(char **args, const npy_intp *dimensions, const n
48 */
49
50 #if defined HAVE_ATTRIBUTE_TARGET_AVX512_SKX_WITH_INTRINSICS && defined NPY_HAVE_SSE2_INTRINSICS && @EXISTS@
51-static NPY_INLINE NPY_GCC_TARGET_AVX512_SKX void
52+static inline NPY_GCC_TARGET_AVX512_SKX void
53 AVX512_SKX_@func@_@TYPE@(npy_bool*, @type@*, const npy_intp n, const npy_intp stride);
54 #endif
55
56-static NPY_INLINE int
57+static inline int
58 run_@func@_avx512_skx_@TYPE@(char **args, npy_intp const *dimensions, npy_intp const *steps)
59 {
60 #if defined HAVE_ATTRIBUTE_TARGET_AVX512_SKX_WITH_INTRINSICS && defined NPY_HAVE_SSE2_INTRINSICS && @EXISTS@
61@@ -144,7 +144,7 @@ sse2_@func@_@TYPE@(@type@ *, @type@ *, const npy_intp n);
62
63 #endif
64
65-static NPY_INLINE int
66+static inline int
67 run_@name@_simd_@func@_@TYPE@(char **args, npy_intp const *dimensions, npy_intp const *steps)
68 {
69 #if @vector@ && defined NPY_HAVE_SSE2_INTRINSICS
70@@ -169,7 +169,7 @@ sse2_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, npy_intp n);
71
72 #endif
73
74-static NPY_INLINE int
75+static inline int
76 run_@kind@_simd_@TYPE@(char **args, npy_intp const *dimensions, npy_intp const *steps)
77 {
78 #if @vector@ && defined NPY_HAVE_SSE2_INTRINSICS
79@@ -205,7 +205,7 @@ static void
80 sse2_reduce_@kind@_BOOL(npy_bool * op, npy_bool * ip, npy_intp n);
81 #endif
82
83-static NPY_INLINE int
84+static inline int
85 run_binary_simd_@kind@_BOOL(char **args, npy_intp const *dimensions, npy_intp const *steps)
86 {
87 #if defined NPY_HAVE_SSE2_INTRINSICS
88@@ -220,7 +220,7 @@ run_binary_simd_@kind@_BOOL(char **args, npy_intp const *dimensions, npy_intp co
89 }
90
91
92-static NPY_INLINE int
93+static inline int
94 run_reduce_simd_@kind@_BOOL(char **args, npy_intp const *dimensions, npy_intp const *steps)
95 {
96 #if defined NPY_HAVE_SSE2_INTRINSICS
97@@ -245,7 +245,7 @@ static void
98 sse2_@kind@_BOOL(npy_bool *, npy_bool *, const npy_intp n);
99 #endif
100
101-static NPY_INLINE int
102+static inline int
103 run_unary_simd_@kind@_BOOL(char **args, npy_intp const *dimensions, npy_intp const *steps)
104 {
105 #if defined NPY_HAVE_SSE2_INTRINSICS
106@@ -875,7 +875,7 @@ NPY_FINLINE NPY_GCC_OPT_3 NPY_GCC_TARGET_@ISA@ @vtype@d
107 */
108
109 #if defined HAVE_ATTRIBUTE_TARGET_AVX512_SKX_WITH_INTRINSICS && defined NPY_HAVE_SSE2_INTRINSICS
110-static NPY_INLINE NPY_GCC_TARGET_AVX512_SKX void
111+static inline NPY_GCC_TARGET_AVX512_SKX void
112 AVX512_SKX_@func@_@TYPE@(npy_bool* op, @type@* ip, const npy_intp array_size, const npy_intp steps)
113 {
114 const npy_intp stride_ip = steps/(npy_intp)sizeof(@type@);
115@@ -954,7 +954,7 @@ AVX512_SKX_@func@_@TYPE@(npy_bool* op, @type@* ip, const npy_intp array_size, co
116 */
117
118 #if defined HAVE_ATTRIBUTE_TARGET_AVX512F_WITH_INTRINSICS && defined NPY_HAVE_SSE2_INTRINSICS
119-static NPY_GCC_OPT_3 NPY_INLINE NPY_GCC_TARGET_AVX512F void
120+static NPY_GCC_OPT_3 inline NPY_GCC_TARGET_AVX512F void
121 AVX512F_@func@_@TYPE@(@type@ * op,
122 @type@ * ip,
123 const npy_intp array_size,
124@@ -1001,7 +1001,7 @@ AVX512F_@func@_@TYPE@(@type@ * op,
125 /**end repeat1**/
126
127 #if defined HAVE_ATTRIBUTE_TARGET_AVX512F_WITH_INTRINSICS && defined NPY_HAVE_SSE2_INTRINSICS
128-static NPY_GCC_OPT_3 NPY_INLINE NPY_GCC_TARGET_AVX512F void
129+static NPY_GCC_OPT_3 inline NPY_GCC_TARGET_AVX512F void
130 AVX512F_absolute_@TYPE@(@type@ * op,
131 @type@ * ip,
132 const npy_intp array_size,
133--
1342.25.1
135
diff --git a/meta/recipes-devtools/python/python3-numpy_1.24.2.bb b/meta/recipes-devtools/python/python3-numpy_1.24.2.bb
index bfcfc52729..5f88948de2 100644
--- a/meta/recipes-devtools/python/python3-numpy_1.24.2.bb
+++ b/meta/recipes-devtools/python/python3-numpy_1.24.2.bb
@@ -10,6 +10,7 @@ SRCNAME = "numpy"
10SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${SRCNAME}-${PV}.tar.gz \ 10SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${SRCNAME}-${PV}.tar.gz \
11 file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \ 11 file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
12 file://0001-numpy-core-Define-RISCV-32-support.patch \ 12 file://0001-numpy-core-Define-RISCV-32-support.patch \
13 file://0001-simd.inc.src-Change-NPY_INLINE-to-inline.patch \
13 file://run-ptest \ 14 file://run-ptest \
14 " 15 "
15SRC_URI[sha256sum] = "003a9f530e880cb2cd177cba1af7220b9aa42def9c4afc2a2fc3ee6be7eb2b22" 16SRC_URI[sha256sum] = "003a9f530e880cb2cd177cba1af7220b9aa42def9c4afc2a2fc3ee6be7eb2b22"