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

dpnp ufuncs do not define the nin attribute #1313

Open
diptorupd opened this issue Feb 23, 2023 · 1 comment
Open

dpnp ufuncs do not define the nin attribute #1313

diptorupd opened this issue Feb 23, 2023 · 1 comment

Comments

@diptorupd
Copy link
Contributor

NumPy ufuncs have an attribute called nin. nin returns the number of input arguments accepted by the ufunc.

dpnp presently does not provide the attribute. The attribute is needed to compile dpnp ufuncs using numba-dpex. Numba-dpex relies on Numba's existing NumPy ufunc registry to add a JIT-able implementation of each ufunc. Numba needs the nin attribute to properly derive the ufunc signature (refer: https://github.com/numba/numba/blob/135d15047c5237f751d4b81347effe2a3704288b/numba/np/npyimpl.py#L497)

For the time being, we are monkey-patching dpnp to add a nin attribute based on NumPy when registering dpnp ufuncs with numba-dpex.

@ndgrigorian
Copy link

@diptorupd
We are going to implement nin into dpctl, and then it will be available to dpnp and Numba-dpex.

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

No branches or pull requests

2 participants