New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support compiled functions as arguments in nopython mode #821
Comments
So it would call the function, not inline it? Otherwise I can't see a way of precompiling the outer function. |
The initial implementation would just call the function by pointer, as you would in C. This is good enough for most cases, as it still eliminates the overhead of boxing and unboxing Python arguments. A followup to this feature would be updating the autojit to recompile the outer function with the user function inlined. This would require some heuristic or flag in the API to enable. I think automatic inlining of user functions will be a powerful use of the JIT, but we can worry about it later. |
Additionally, call by pointer would be the only option for ctypes and cffi functions, of course. With Numba functions, we have the option of eventually supporting inlining of the LLVM IR as well. |
Issue #821: allow ctypes and cffi functions as arguments in nopython mode
@seibert is this sufficiently covered by |
Closing as numerous variants of the above are implemented, including passing jitted functions, first class function types, |
We would like to be able to support Numba-compiled implementations of algorithms (like solvers) that can call user-supplied JIT functions (or ctypes/cffi wrappped functions) without any Python overhead.
The primary use case is for automatic jitting, although we will need a syntax to specify an argument function type explicitly in type signature.
The text was updated successfully, but these errors were encountered: