Add auto-generated ctypes bindings to C API#16067
Open
jakelishman wants to merge 2 commits intoQiskit:mainfrom
Open
Add auto-generated ctypes bindings to C API#16067jakelishman wants to merge 2 commits intoQiskit:mainfrom
ctypes bindings to C API#16067jakelishman wants to merge 2 commits intoQiskit:mainfrom
Conversation
This is minor code reorganisation to avoid the `cext` build script getting out of hand; we're about to add an extra `ctypes`-like backend to it, which coudl do with being in its own module.
Collaborator
|
One or more of the following people are relevant to this code:
|
1 similar comment
Collaborator
|
One or more of the following people are relevant to this code:
|
This is similar to how Python exposes its own C API through `ctypes` as `ctypes.pythonapi`. It's unlikely to be immediately useful as a feature for downstream users, but it simplifies the process of us testing our own code from Python space. I had originally hoped / thought that `numba` would support calling these `ctypes` functions, but while `numba` (as of current version 0.65) does have support for calling `ctypes` functions defined purely in terms of primitive non-pointer integral types, it doesn't yet support `ctypes.py_object` or arbitrary pointers.
Coverage Report for CI Build 24678475550Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.1%) to 87.563%Details
Uncovered Changes
Coverage Regressions8 previously-covered lines in 3 files lost coverage.
Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is similar to how Python exposes its own C API through
ctypesasctypes.pythonapi. It's unlikely to be immediately useful as a feature for downstream users, but it simplifies the process of us testing our own code from Python space.I had originally hoped / thought that
numbawould support calling thesectypesfunctions, but whilenumba(as of current version 0.65) does have support for callingctypesfunctions defined purely in terms of primitive non-pointer integral types, it doesn't yet supportctypes.py_objector arbitrary pointers.Close #15144
AI/LLM disclosure