Skip to content

Commit ea4205c

Browse files
committed
[GR-17686] Update Numpy patch.
PullRequest: graalpython/615
2 parents 3b95409 + 8dbfff5 commit ea4205c

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

graalpython/lib-graalpython/modules/ginstall.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ def _get_machar(ftype):
267267
268268
typedef int (PyArray_SortFunc)(void *, npy_intp, void *);
269269
typedef int (PyArray_ArgSortFunc)(void *, npy_intp *, npy_intp, void *);
270-
271270
diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py
272271
index f837df1..d3ce70d 100644
273272
--- a/numpy/core/setup_common.py
@@ -283,6 +282,25 @@ def _get_machar(ftype):
283282
src, obj = cmd._compile(body, None, None, 'c')
284283
cmd.temp_files.append("_configtest")
285284
cmd.compiler.link_executable([obj], "_configtest")
285+
diff --git a/numpy/core/src/multiarray/alloc.c b/numpy/core/src/multiarray/alloc.c
286+
index 6755095..e2fbae6 100644
287+
--- a/numpy/core/src/multiarray/alloc.c
288+
+++ b/numpy/core/src/multiarray/alloc.c
289+
@@ -74,14 +74,6 @@ _npy_alloc_cache(npy_uintp nelem, npy_uintp esz, npy_uint msz,
290+
#ifdef _PyPyGC_AddMemoryPressure
291+
_PyPyPyGC_AddMemoryPressure(nelem * esz);
292+
#endif
293+
-#ifdef HAVE_MADV_HUGEPAGE
294+
- /* allow kernel allocating huge pages for large arrays */
295+
- if (NPY_UNLIKELY(nelem * esz >= ((1u<<22u)))) {
296+
- npy_uintp offset = 4096u - (npy_uintp)p % (4096u);
297+
- npy_uintp length = nelem * esz - offset;
298+
- madvise((void*)((npy_uintp)p + offset), length, MADV_HUGEPAGE);
299+
- }
300+
-#endif
301+
}
302+
return p;
303+
}
286304
diff --git a/numpy/core/src/multiarray/typeinfo.c b/numpy/core/src/multiarray/typeinfo.c
287305
index 14c4f27..c5a72b1 100644
288306
--- a/numpy/core/src/multiarray/typeinfo.c
@@ -844,7 +862,6 @@ def _get_machar(ftype):
844862
845863
diff --git a/numpy/linalg/setup.py b/numpy/linalg/setup.py
846864
index 66c07c9..847116f 100644
847-
848865
--- a/numpy/linalg/setup.py
849866
+++ b/numpy/linalg/setup.py
850867
@@ -29,6 +29,7 @@ def configuration(parent_package='', top_path=None):
@@ -911,19 +928,6 @@ def get_lapack_lite_sources(ext, build_dir):
911928
'console_scripts': f2py_cmds
912929
},
913930
914-
diff --git a/numpy/core/src/multiarray/shape.c b/numpy/core/src/multiarray/shape.c
915-
index 30820737e..d8a350f0d 100644
916-
--- a/numpy/core/src/multiarray/shape.c
917-
+++ b/numpy/core/src/multiarray/shape.c
918-
@@ -94,3 +94,4 @@ PyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape, int refcheck,
919-
"Use the np.resize function or refcheck=False");
920-
- return NULL;
921-
+ PyErr_Clear();
922-
+ refcnt = 1;
923-
#else
924-
refcnt = PyArray_REFCOUNT(self);
925-
#endif /* PYPY_VERSION */
926-
927931
'''
928932
install_from_pypi("numpy==1.16.4", patch=patch, env={"NPY_NUM_BUILD_JOBS": "1"})
929933

0 commit comments

Comments
 (0)