Skip to content

Commit 0d72d48

Browse files
committed
Include graalpy/handles.h header in numpy for now
1 parent d61fb77 commit 0d72d48

File tree

3 files changed

+74
-14
lines changed

3 files changed

+74
-14
lines changed

graalpython/lib-graalpython/patches/numpy-1.26.2.patch

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,20 @@ index 0bf500e..ad7a06e 100644
6161
#define NPY_ELIDE_DEBUG 0
6262
#define NPY_MAX_STACKSIZE 10
6363
diff --git a/numpy/core/src/npymath/ieee754.c.src b/numpy/core/src/npymath/ieee754.c.src
64-
index 8fccc9a..3bb9cf0 100644
64+
index 8fccc9a..93ee333 100644
6565
--- a/numpy/core/src/npymath/ieee754.c.src
6666
+++ b/numpy/core/src/npymath/ieee754.c.src
67-
@@ -362,6 +362,11 @@ int npy_get_floatstatus_barrier(char* param)
67+
@@ -8,6 +8,9 @@
68+
#include "npy_math_private.h"
69+
#include "numpy/utils.h"
70+
71+
+// GraalPy change
72+
+#include <graalpy/handles.h>
73+
+
74+
/*
75+
The below code is provided for compilers which do not yet provide C11 compatibility (gcc 4.5 and older)
76+
*/
77+
@@ -362,6 +365,11 @@ int npy_get_floatstatus_barrier(char* param)
6878
* By using a volatile, the compiler cannot reorder this call
6979
*/
7080
if (param != NULL) {
@@ -77,10 +87,20 @@ index 8fccc9a..3bb9cf0 100644
7787
}
7888

7989
diff --git a/numpy/core/src/npymath/ieee754.cpp b/numpy/core/src/npymath/ieee754.cpp
80-
index 1c59bf3..519fabc 100644
90+
index 1c59bf3..0d8cb63 100644
8191
--- a/numpy/core/src/npymath/ieee754.cpp
8292
+++ b/numpy/core/src/npymath/ieee754.cpp
83-
@@ -428,6 +428,11 @@ npy_get_floatstatus_barrier(char *param)
93+
@@ -9,6 +9,9 @@
94+
#include "npy_math_common.h"
95+
#include "npy_math_private.h"
96+
97+
+// GraalPy change
98+
+#include <graalpy/handles.h>
99+
+
100+
/*
101+
The below code is provided for compilers which do not yet provide C11
102+
compatibility (gcc 4.5 and older)
103+
@@ -428,6 +431,11 @@ npy_get_floatstatus_barrier(char *param)
84104
* By using a volatile, the compiler cannot reorder this call
85105
*/
86106
if (param != NULL) {

graalpython/lib-graalpython/patches/numpy-1.26.4.patch

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,20 @@ index 2890406..353a657 100644
6161
#include <feature_detection_misc.h>
6262

6363
diff --git a/numpy/core/src/npymath/ieee754.c.src b/numpy/core/src/npymath/ieee754.c.src
64-
index 8fccc9a..3bb9cf0 100644
64+
index 8fccc9a..93ee333 100644
6565
--- a/numpy/core/src/npymath/ieee754.c.src
6666
+++ b/numpy/core/src/npymath/ieee754.c.src
67-
@@ -362,6 +362,11 @@ int npy_get_floatstatus_barrier(char* param)
67+
@@ -8,6 +8,9 @@
68+
#include "npy_math_private.h"
69+
#include "numpy/utils.h"
70+
71+
+// GraalPy change
72+
+#include <graalpy/handles.h>
73+
+
74+
/*
75+
The below code is provided for compilers which do not yet provide C11 compatibility (gcc 4.5 and older)
76+
*/
77+
@@ -362,6 +365,11 @@ int npy_get_floatstatus_barrier(char* param)
6878
* By using a volatile, the compiler cannot reorder this call
6979
*/
7080
if (param != NULL) {
@@ -77,10 +87,20 @@ index 8fccc9a..3bb9cf0 100644
7787
}
7888

7989
diff --git a/numpy/core/src/npymath/ieee754.cpp b/numpy/core/src/npymath/ieee754.cpp
80-
index 1c59bf3..519fabc 100644
90+
index 1c59bf3..0d8cb63 100644
8191
--- a/numpy/core/src/npymath/ieee754.cpp
8292
+++ b/numpy/core/src/npymath/ieee754.cpp
83-
@@ -428,6 +428,11 @@ npy_get_floatstatus_barrier(char *param)
93+
@@ -9,6 +9,9 @@
94+
#include "npy_math_common.h"
95+
#include "npy_math_private.h"
96+
97+
+// GraalPy change
98+
+#include <graalpy/handles.h>
99+
+
100+
/*
101+
The below code is provided for compilers which do not yet provide C11
102+
compatibility (gcc 4.5 and older)
103+
@@ -428,6 +431,11 @@ npy_get_floatstatus_barrier(char *param)
84104
* By using a volatile, the compiler cannot reorder this call
85105
*/
86106
if (param != NULL) {

graalpython/lib-graalpython/patches/numpy-2.0.0.patch

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ index ede7a61..21ae17b 100644
4848
refcnt = Py_REFCNT(self);
4949
#endif /* PYPY_VERSION */
5050
diff --git a/numpy/_core/src/multiarray/stringdtype/dtype.c b/numpy/_core/src/multiarray/stringdtype/dtype.c
51-
index b94ab7e..6148268 100644
51+
index 6d10191..ed4d0d7 100644
5252
--- a/numpy/_core/src/multiarray/stringdtype/dtype.c
5353
+++ b/numpy/_core/src/multiarray/stringdtype/dtype.c
54-
@@ -817,7 +817,7 @@ init_string_dtype(void)
54+
@@ -832,7 +832,7 @@ init_string_dtype(void)
5555
};
5656

5757
/* Loaded dynamically, so needs to be set here: */
@@ -74,10 +74,20 @@ index 2890406..353a657 100644
7474
#include <feature_detection_misc.h>
7575

7676
diff --git a/numpy/_core/src/npymath/ieee754.c.src b/numpy/_core/src/npymath/ieee754.c.src
77-
index 8fccc9a..3bb9cf0 100644
77+
index 8fccc9a..93ee333 100644
7878
--- a/numpy/_core/src/npymath/ieee754.c.src
7979
+++ b/numpy/_core/src/npymath/ieee754.c.src
80-
@@ -362,6 +362,11 @@ int npy_get_floatstatus_barrier(char* param)
80+
@@ -8,6 +8,9 @@
81+
#include "npy_math_private.h"
82+
#include "numpy/utils.h"
83+
84+
+// GraalPy change
85+
+#include <graalpy/handles.h>
86+
+
87+
/*
88+
The below code is provided for compilers which do not yet provide C11 compatibility (gcc 4.5 and older)
89+
*/
90+
@@ -362,6 +365,11 @@ int npy_get_floatstatus_barrier(char* param)
8191
* By using a volatile, the compiler cannot reorder this call
8292
*/
8393
if (param != NULL) {
@@ -90,10 +100,20 @@ index 8fccc9a..3bb9cf0 100644
90100
}
91101

92102
diff --git a/numpy/_core/src/npymath/ieee754.cpp b/numpy/_core/src/npymath/ieee754.cpp
93-
index 1c59bf3..519fabc 100644
103+
index 1c59bf3..0d8cb63 100644
94104
--- a/numpy/_core/src/npymath/ieee754.cpp
95105
+++ b/numpy/_core/src/npymath/ieee754.cpp
96-
@@ -428,6 +428,11 @@ npy_get_floatstatus_barrier(char *param)
106+
@@ -9,6 +9,9 @@
107+
#include "npy_math_common.h"
108+
#include "npy_math_private.h"
109+
110+
+// GraalPy change
111+
+#include <graalpy/handles.h>
112+
+
113+
/*
114+
The below code is provided for compilers which do not yet provide C11
115+
compatibility (gcc 4.5 and older)
116+
@@ -428,6 +431,11 @@ npy_get_floatstatus_barrier(char *param)
97117
* By using a volatile, the compiler cannot reorder this call
98118
*/
99119
if (param != NULL) {

0 commit comments

Comments
 (0)