You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MAINT,ENH: Use non-error functions isless, isgreater, etc. #19398
That would both slightly speed things up (at least if errors did occur npy_clear_floatstatus_barrier is pretty slow), and just be slightly more correct not to worry set the flags in the first place.
In the long-run, I am also thinking of chaining (e.g. by numexpr), where a call to npy_clear_floatstatus_barrier could silence floating point warnings, if the ufuncs are chained in lowlevel C.
I had done this in gh-19476, but it turns out that:
MSVC ≤19 is incapable to optimize isnan, isfinite, isless, etc. (because they are defined in math.h), making them extremely slow in general (maybe global, link-time, optimization can safe that a bit, but I am not sure. They are compiled into a function call, instead the single CPU instruction they should be).
clang <10.0 seems to not honor the request properly with optimization at least.
Mac CI showed problem (even though it reports clang 11.0.0)? (Not sure why...)
So: We can probably use these functions as in gh-19316, where Mac breaks correctness anyway and the MSVC slowdown is likely acceptable, but unfortunately probably not yet(?) for things like maximum/minimum.
Activity
seberg commentedon Jul 22, 2021
I had done this in gh-19476, but it turns out that:
≤19is incapable to optimizeisnan,isfinite,isless, etc. (because they are defined inmath.h), making them extremely slow in general (maybe global, link-time, optimization can safe that a bit, but I am not sure. They are compiled into a function call, instead the single CPU instruction they should be).<10.0seems to not honor the request properly with optimization at least.So: We can probably use these functions as in gh-19316, where Mac breaks correctness anyway and the MSVC slowdown is likely acceptable, but unfortunately probably not yet(?) for things like maximum/minimum.