| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
- optimize float/double conversions on x86, requires for now
raising up the baseline features to `f16c` at least
during the build.
- optimize float/double conversions on ppc64le, requires for now
raising up the baseline features to `VSX3` at least
during the build.
- Brings `np::Half` to npymath
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a follow up to gh-22679 which addressed gh-22673.
The main thing is that we want the functions to be available after
importing NumPy, so they need to be part of multiarray.
However, `npymath` is a static library, so the symbols are not really
exported there. The former PR did actually work in practice but this
seems like it is technically the right place?
For some reason, I had to add nextafter to be able to do:
from scipy.spatial.distance import euclidean
with the SciPy 1.9.3 wheels. SciPy test collection works with this for
the 1.9.3 wheel, so this should be all the symbols hopefully.
|
| | |
|
| |\
| |
| | |
BUG: Fix <complex 0>^{non-zero}
|
| | |
| |
| | |
Co-authored-by: Matti Picus <matti.picus@gmail.com>
|
| | |
| |
| |
| | |
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Co-authored-by: Ivan Gonzalez <scratchmex@gmail.com>
|
| | |
| |
| | |
Co-authored-by: Ivan Gonzalez <scratchmex@gmail.com>
|
| | |
| |
| | |
Co-authored-by: Ivan Gonzalez <scratchmex@gmail.com>
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
(#22684)
* make isnan, isinf, isfinite, signbit, nextafter aliases
* fixes from review
Co-authored-by: Sebastian Berg <sebastianb@nvidia.com>
|
| | | |
|
| | |
| |
| |
| | |
Closes gh-22100
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Error was:
npy_math_internal.h.src:570:24: error: no matching function for call to 'isless(npy_float&, int)'
570 | if (isless(b, 0) != isless(mod, 0)) {
| ^
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Signed-off-by: mattip <matti.picus@gmail.com>
|
| | |
| |
| |
| | |
Signed-off-by: mattip <matti.picus@gmail.com>
|
| | | |
|
| | | |
|
| |/ |
|
| |
|
|
|
|
|
| |
This builds on the previous, but just redefines them in the C/C++ file
since this is not a header and defining an undefined macro value should
not be a problem locally.
Also tweaks the comment a bit.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For instance wasm has no fenv support. musl-libc defines all the
fenv functions unconditionally (fesetexcept, feclearexcept, etc)
but on unsupported platforms they are no-ops:
https://git.musl-libc.org/cgit/musl/tree/src/fenv/fenv.c
However, the platform is expected to only define flags like
FE_OVERFLOW if they are supported. I haven't found an explanation
of the design decision, but it seems to be aimed at fine-grained
feature detection. musl-libc-test has code that uses fenv and wants
it to silently decay to a no-op on platforms missing support. I
copied their implementation of this behavior:
http://nsz.repo.hu/git/?p=libc-test;a=blob;f=src/common/mtest.h;h=706c1ba23ea8989b17a2f72ed1a919e187c06b6a;hb=HEAD#l30
|
| |
|
|
|
|
|
|
|
|
|
| |
C99 and C++11 standardize `fenv.h`, so we should not need the manual
definitions for these functions for platforms that do not support it.
See e.g.: https://en.cppreference.com/w/c/numeric/fenv
If issues come up, the code can be restored.
This applies gh-21421 again, since we had to revert using the cpp file
and the change thus got lost.
|
| | |
|
| |
|
|
|
|
|
|
| |
C99 and C++11 standardize `fenv.h`, so we should not need the manual
definitions for these functions for platforms that do not support it.
See e.g.: https://en.cppreference.com/w/c/numeric/fenv
If issues come up, the code can be restored.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [Road to C++] Rename ieee754.c.src into ieee754.cpp.src
* [Road to C++] Remove all use of internal template engine
Replace them by regular C++ templates.
* [Road to C++] mv ieee754.cpp.src ro ieee754.cpp
Clang-format it, and update build system accordingly.
* Fix 'unnecessary parentheses in declaration of ‘__NPY_UNUSED_TAGGEDc’ [-Wparentheses]'
* [Road to C++] Fix misc conversion issues in ieee754.cpp
- hex float literal are not supported in C++
- avoid overload issues when numpy_longdouble ultimately is equal to double
- _statusfp2 exepcts unsigned arguments
|
| | |
|
| | |
|
| |
|
|
| |
Do not use __popcnt and variants for windows/arm64 target
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
`npy_longdouble` (#20360)
In some certain cases mostly workarounds, there's a necessity to define `npy_longdouble`
as `double` even if that was against the compiler
implementation(sizeof(long double) != sizeof(double)).
Therefore, avoid `long double`, use `npy_longdouble` instead,
and when it comes to standard math functions make sure of using
the double version when `NPY_SIZEOF_LONGDOUBLE` == `NPY_SIZEOF_DOUBLE`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding bitcount method to scalars, e.g.:
a = np.int32(1023).bit_count()
* ENH: Implementation of bit_count (popcount)
* ENH: Add bit_count to integer scalar type
* ENH: Annotations for bit_count
* ENH, WIP: Documentation for bit_count
* DOC: Added `bit_count` (#19355)
* BUG: Fixed windows 32 bit issue with no `__popcnt64`
* DOC: Refined docstring for bit_count
* TST: Tests for bit_count
* ENH, MAINT: Changed return type to uint_8 | Removed extra braces and fixed typo
* BUG: Fixed syntax of bit_count
* DOC, BUG: Fixed bit_count example
* DOC, BUG: (#19355) Removed bit_count from routines.math.rst | Improved release notes
* BUG: Added type suffix to magic constants
* ENH: Handle 32 bit windows popcount | Refactored popcount implementation to new function
* MAINT: Refactor type_methods, separate integer definitions
* DOC: Added double-ticks
|
| |
|
|
| |
Should fix #20180
|
| |
|
|
|
| |
This is just a technical prototype to measure and discuss the impact and
implication of moving to C++ for kernel code generation.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Numpy has a test failure where `np.tan(np.inf)` is not raising "invalid". The bug is due to an underlying bug in Apple's Libm. The bug is only present on arm64 and does not affect x86_64.
The changes here apply to sin, cos, and tan. If the input is a non-finite value, then return `(x - x)`, which will raise "invalid" for `x=INFINITY` as well as return `NAN` for both `INFINITY` and `NAN` as input.
Testing:
(Note, the testing below is on top of another branch that fixes divide-by-zero failures in reciprocal)
Before change:
```
FAILED numpy/core/tests/test_umath.py::TestSpecialFloats::test_tan - AssertionError: FloatingPointError not raised by tan
1 failed, 15589 passed, 302 skipped, 1268 deselected, 31 xfailed, 3 xpassed in 70.99s (0:01:10)
```
After change:
```
15590 passed, 302 skipped, 1268 deselected, 31 xfailed, 3 xpassed in 71.38s (0:01:11)
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This puts the following numpy defines at the top of the files before
the includes.
define NPY_NO_DEPRECATED_API NPY_API_VERSION
define _MULTIARRAYMODULE
define _UMATHMODULE
There are also minor cleanups of <...> vs "..." include styles together
with a small fix to the .clang-format file to include "pymem.h" among
the Python supplied headers.
Further cleanups will follow if clang-format is used on the files but
that is not done here.
|
| | |
|
| | |
|