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

Add special functions from the CUDA Math API #6317

Merged
merged 16 commits into from
Jan 30, 2022

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Jan 14, 2022

This is a small PR adding simple ufunc wrappers for a handful of other CUDA Math API functions that overlap with functions in cupyx.scipy.special.

One question:

  • For sinc: scipy.special.sinc is numpy.sinc. This function promotes any integer dtype to double while the implementation here does not. For example, for cupy.sinc as used here, providing cp.int8 input will result in a cp.float16 array being returned. Should we make a wrapper that promotes any ints to cp.float64 for consistency with SciPy?

In practice order is likely to be a very small integer, but it is annoying to
users if they have to cast the first input to int32 rather than allowing the
default Python int type.
@grlee77
Copy link
Contributor Author

grlee77 commented Jan 14, 2022

I guess the sinc question is not specific to cupyx.scipy.special. In general it is cupy.sinc that behaves differently from numpy.sinc in regards to integer type promotions.

@mergify
Copy link
Contributor

mergify bot commented Jan 15, 2022

This pull request is now in conflicts. Could you fix it @grlee77? 🙏

@mergify
Copy link
Contributor

mergify bot commented Jan 22, 2022

This pull request is now in conflicts. Could you fix it @grlee77? 🙏

@asi1024
Copy link
Member

asi1024 commented Jan 28, 2022

/test mini

@grlee77
Copy link
Contributor Author

grlee77 commented Jan 29, 2022

Please test again (the prior failure in test_yn should now be fixed).

@leofang
Copy link
Member

leofang commented Jan 29, 2022

/test mini

@asi1024
Copy link
Member

asi1024 commented Jan 30, 2022

LGTM! Thanks!

@asi1024 asi1024 merged commit baeb38a into cupy:master Jan 30, 2022
@asi1024 asi1024 added this to the v11.0.0a2 milestone Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants