-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
ENH: Add SIMD operation signbit #19748
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
Conversation
2a73080
to
a7a5676
Compare
Thanks! Can this vectorization deal with NaN? In [1]: np.signbit(np.nan)
Out[1]: False
In [2]: np.signbit(-np.nan)
Out[2]: True It looks a bit like using a comparison in the float case, and I am not sure that is correct there? I think you added signbit also for integers? |
dda6f5e
to
f729b11
Compare
08fa7e6
to
d04f3a1
Compare
3e6f831
to
4b4b98c
Compare
@seiko2plus I have removed the integer implementations. And test cases for |
Hi @seiko2plus I recently want to finish some of lacking SIMD operations in numpy. However, I am meeting a problem that how can I find the mapping between names in https://github.com/numpy/numpy/blob/main/numpy/core/umath.py and the names under |
@seiko2plus Please respond to this comment when you get a chance. |
I'm so sorry for taking forever, just get confused between this pr and pr #19770.
The universal intrinsics are completely independent of universal functions(ufunc) which we use within the umath module. You can follow the SIMD code within dispatch-able sources
Sometimes for future use or required by other kernels. Regards to
Again, I do not see any benefit in implementing a separate universal intrinsic for signbit, same case as copysign(#19770). The following code can fairly extract the signbit of both precision on all supported SIMD extensions: npyv_shri_u32(npyv_reinterpret_u32_f32(v), 31);
npyv_shri_u64(npyv_reinterpret_u64_f64(v), 63); |
@seiko2plus Should we pursue this? |
@charris, no, my last comment was clear enough I guess. so it should be closed. |
No description provided.