Skip to content
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 writing custom NumPy ufuncs in Rust #399

Open
mhostetter opened this issue Oct 29, 2023 Discussed in #398 · 1 comment · May be fixed by #400
Open

Support writing custom NumPy ufuncs in Rust #399

mhostetter opened this issue Oct 29, 2023 Discussed in #398 · 1 comment · May be fixed by #400

Comments

@mhostetter
Copy link

Add support for writing custom NumPy ufuncs in Rust.

Discussed in #398

Originally posted by mhostetter October 29, 2023
Is it possible to write a custom NumPy ufunc in Rust and then apply it on arrays (with the requisite broadcasting) from either Rust or Python?

My application is writing finite field arithmetic ufuncs. I previously implemented this in Python and wrapped in Numba. I'm curious if I can replicate in Rust and achieve better performance.

Forgive the question if it's obvious. I didn't find an answer in documentation.

@kngwyu
Copy link
Member

kngwyu commented Oct 30, 2023

I think this is possible through the unsafe raw NumPy API we are exposing now, but we haven't provided a higher-level Rust API for achieving this. This is not our intention, but we just haven't received an urgent request. Definitely worth considering to implement that, but I'm not sure how difficult it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants