Skip to content

ENH: Port numpy._core._simd to the Limited API - #32244

Open
prathamhole14 wants to merge 4 commits into
numpy:mainfrom
prathamhole14:simd_limited_api
Open

ENH: Port numpy._core._simd to the Limited API#32244
prathamhole14 wants to merge 4 commits into
numpy:mainfrom
prathamhole14:simd_limited_api

Conversation

@prathamhole14

Copy link
Copy Markdown
Contributor

PR summary

Related to: #31913
I will update this soon with benchmarks. For now I will look how CI reacts, locally all the tests are passing for python 3.13 linux build with limted api flag on.

AI Disclosure

In researching and brainstorming specially the meson build part and for writing comments.

Replace the constructs that are not part of the Limited API: the static
PyTypeObject and its PySequenceMethods become a PyType_Spec heap type,
PyObject_New() becomes PyType_GenericAlloc(), and the fast sequence,
tuple and list accessors become their checked equivalents. Add the libc
includes that Python.h stops providing at Py_LIMITED_API >= 3.11.

Nearly all of the module's Python-facing code is compiled into the
_simd_mtargets archive, which the `limited_api:` kwarg does not reach,
so add py_limited_api_args and pass it there.
python.allow_limited_api defaults to false, so this is a no-op for
shipped wheels.
@prathamhole14
prathamhole14 marked this pull request as ready for review August 11, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant