summaryrefslogtreecommitdiff
path: root/numpy/core/include
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #23505 from cbrt64/fix-2256Matti Picus2023-05-171-1/+1
|\ | | | | BUG: Use 2GiB chunking code for fwrite() on mingw32/64
| * BUG: Use 2GiB chunking code for fwrite() on mingw32/64Edward E2023-03-311-1/+1
| | | | | | | | Addresses #2256
* | Merge pull request #23528 from seberg/allow-backcomp-buildsMatti Picus2023-04-284-40/+88
|\ \ | | | | | | ENH: Allow, and default to, downstream building with old API
| * | DOC: Align default with what the NEP draft saysSebastian Berg2023-04-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have three choices: 1. Be compatible with limited API (oldest supported Python version) 2. Be compatible with everything on the same Python version (this) 3. Be strict and default to NEP 29 This just rephrases things to be 2. Because our API version was not bumped over the relevant time frame, it is actually also compatible with the first.
| * | Tweak to just warn for low versionsSebastian Berg2023-04-061-9/+9
| | |
| * | BUG: Fix typo in new version checksSebastian Berg2023-04-041-1/+1
| | |
| * | ENH: Allow compiling compatibly to old NumPy versionsSebastian Berg2023-04-043-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default compiles compatibly with 1.17.x, we allow going back to 1.15 (mainly because it is easy). There were few additions in this time, a few structs grew and very few API functions were added. Added a way to mark API functions as requiring a specific target version. If a user wishes to use the *new* API, they have to add the definition: #define NPY_TARGET_VERSION NPY_1_22_API_VERSION Before importing NumPy. (Our version numbering is a bit funny I first thought to use a hex version of the main NumPy version, but since we already have the `NPY_1_22_API_VERSION` defines...)
| * | BLD: Add support for NPY_TARGET_VERSION macroSebastian Berg2023-04-042-33/+69
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | This is a way for downstream users to specify which NumPy version they wish to be compaible with. Note that we provide a conservative default here (because almost nobody actually uses new API as they would lose backwards compatibility). Initially I had thought we should just redefine it so that the target version uses the same scheme as the Python hex version (and limited API), but since we have `NPY_1_15_API_VERSION` defines, use those... This commit does not include any actual use of this!
* | ENH: float64 sin/cos using Numpy intrinsics (#23399)Christopher Sidebottom2023-04-251-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This takes the [sin](https://github.com/ARM-software/optimized-routines/blob/master/math/v_sin.c) and [cos](https://github.com/ARM-software/optimized-routines/blob/master/math/v_cos.c) algorithms from Optimized Routines under MIT license, and converts them to Numpy intrinsics. The routines are within the ULP boundaries of other vectorised math routines (<4ULP). The routines reduce performance in some special cases but improves normal cases. Comparing to the SVML implementation, these routines are more performant in special cases, we're therefore safe to assume the performance is acceptable for AArch64 as well. | performance ratio (lower is better) | benchmark | | ---- | ---- | | 1.8 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 4 2 'd') | | 1.79 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 4 4 'd') | | 1.77 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 4 1 'd') | | 1.74 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 2 2 'd') | | 1.74 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 2 4 'd') | | 1.72 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 2 1 'd') | | 1.6 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 1 2 'd') | | 1.6 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 1 4 'd') | | 1.56 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 1 1 'd') | | 1.42 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 2 2 'd') | | 1.41 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 2 4 'd') | | 1.37 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 2 1 'd') | | 1.26 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 4 2 'd') | | 1.26 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 4 4 'd') | | 1.2 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 4 1 'd') | | 1.18 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 1 2 'd') | | 1.18 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 1 4 'd') | | 1.12 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 1 1 'd') | | 0.65 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 4 2 'd') | | 0.64 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 2 4 'd') | | 0.64 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 4 4 'd') | | 0.64 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 2 2 'd') | | 0.61 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 1 4 'd') | | 0.61 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 1 2 'd') | | 0.6 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 2 1 'd') | | 0.6 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 4 1 'd') | | 0.56 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 1 1 'd') | | 0.52 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 4 2 'd') | | 0.52 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 4 4 'd') | | 0.52 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 2 4 'd') | | 0.52 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 2 2 'd') | | 0.47 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 1 4 'd') | | 0.47 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 1 2 'd') | | 0.46 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 4 1 'd') | | 0.46 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 2 1 'd') | | 0.42 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 1 1 'd') | Co-authored-by: Pierre Blanchard <Pierre.Blanchard@arm.com>
* | MAINT: refactor zero-filling to use a traversal loopNathan Goldbaum2023-04-181-19/+10
| |
* | ENH: Refactor special zero-filling to be managed by the DTypeNathan Goldbaum2023-04-181-1/+10
| |
* | MAINT: correct typos in dtype API documentation commentsNathan Goldbaum2023-04-181-3/+3
|/
* Merge pull request #22982 from yamadafuyuka/add_fujitsuccompiler_and_SSL2Sebastian Berg2023-03-061-1/+1
|\ | | | | ENH: add support for fujitsu C/C++ compiler and SSL2 to numpy.
| * ENH: add support for fujitsu C/C++ compiler and SSL2 to numpy.yamadafuyuka2023-03-021-1/+1
| |
* | MAINT: remove out-of-date commentNathan Goldbaum2023-02-241-2/+1
| |
* | API: expose traversal typedefs and get_clear_function slotNathan Goldbaum2023-02-241-1/+43
| |
* | MAINT: refactor custom dtype slot setupNathan Goldbaum2023-02-241-30/+38
| | | | | | | | | | | | | | Moves some #defines from public to private headers. Also checks for invalid slots between the maximum dtype slot and miminum arrfuncs slot Also moves get_clear_function to a spot where it and only it can be made public
* | Merge pull request #23153 from seiko2plus/removes_old_cpu_dispatcherCharles Harris2023-02-221-49/+1
|\ \ | | | | | | SIMD: Get rid of attribute-based CPU dispatching
| * | MAINT, SIMD: Removes compiler definitions of attribute-based CPU dispatchingSayed Adel2023-02-201-49/+1
| | |
* | | Merge pull request #23190 from ngoldbaum/is-numericCharles Harris2023-02-221-0/+1
|\ \ \ | | | | | | | | ENH: add `_is_numeric` attribute for DType classes
| * | | ENH: add _is_numeric attribute for DType classesNathan Goldbaum2023-02-161-1/+2
| | | |
* | | | BLD: fix review commentsmattip2023-02-211-0/+2
| | | |
* | | | MAINT: minor CI job, comments, and style changes to meson.build filesRalf Gommers2023-02-201-1/+1
| | | |
* | | | BUG: use a _invalid_parameter_handler around _fdopen to prevent crashes when ↵Matti Picus2023-02-201-1/+23
| |/ / |/| | | | | | | | call fails
* | | ENH: Add PyArray_ArrFunc compare support for NEP42 dtypespdmurray2023-02-171-3/+42
|/ /
* | MAINT: Merge public and private dtype API as much as possibleSebastian Berg2023-02-143-181/+331
|/ | | | | | | | This merges header definitions that are private (enough) so that we use the same definitions within NumPy as externally made available through the experimental dtype API header. Tested with string and mpfdtype from the experimental dtype API.
* ENH: update and sync the public APImattip2023-01-311-1/+2
|
* BUG: fix type in resolve_descriptors_function typedefNathan Goldbaum2023-01-251-1/+1
|
* DOC: Adept code comments for clarity based on code reviewSebastian Berg2023-01-201-2/+4
| | | | Co-authored-by: Matti Picus <matti.picus@gmail.com>
* MAINT: Address review comments by NathanSebastian Berg2023-01-201-12/+12
|
* MAINT: Address many of Marten's commentsSebastian Berg2023-01-201-4/+3
|
* API: Bumpy experimental dtype api versionSebastian Berg2023-01-201-1/+1
| | | | | Its a new version (it changed ;)), plus I took the liberty to move things around a bit ABI wise.
* MAINT: Rework things to make reorderability static and default to no initial ↵Sebastian Berg2023-01-201-40/+28
| | | | value
* MAINT: Rename arraymethod reduction identity getterSebastian Berg2023-01-201-14/+22
| | | | | Need to look into whether to cut out the dynamic discovery of reorderability though.
* DOC,MAINT: Address "simple" review comments by MartenSebastian Berg2023-01-201-2/+3
|
* ENH: Support identity-function in experimental DType APISebastian Berg2023-01-201-0/+32
| | | | | Also add it to the wrapped array-method (ufunc) implementation so that a Unit dtype can reasonably use an identity for reductions.
* MAINT: Move export for scipy arm64 helper into main moduleSebastian Berg2023-01-051-11/+3
| | | | | | | | | | | | | | | | | 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.
* REV: revert change to `numpyconfig.h` for sizeof(type) hardcoding on macOSRalf Gommers2022-12-151-0/+52
| | | | | | | | | | Reverts gh-22614, and adds more detail about why that code is needed and when it can be removed. Closes gh-22796 [skip cirrus] [skip circle]
* MAINT: npymath cleanups for isnan, isinf, isinfinite, signbit, nextafter ↵Matti Picus2022-11-282-38/+9
| | | | | | | | | (#22684) * make isnan, isinf, isfinite, signbit, nextafter aliases * fixes from review Co-authored-by: Sebastian Berg <sebastianb@nvidia.com>
* Merge pull request #22679 from mattip/issue22673Ralf Gommers2022-11-271-3/+10
|\ | | | | BLD: revert function() -> #define for 3 npymath functions
| * BUILD: revert function() -> #define for 3 npymath functionsmattip2022-11-271-3/+10
| |
* | Merge pull request #22663 from rgommers/build-with-mesonRalf Gommers2022-11-272-0/+87
|\ \ | |/ |/| | | | | BLD: enable building NumPy with Meson [ci skip]
| * BLD: enable building NumPy with MesonRalf Gommers2022-11-252-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables building with NumPy on Linux and macOS. Windows support should be complete to, but is untested as of now and may need a few tweaks. This contains: - A set of `meson.build` files and related code generation script tweaks, header templates, etc. - One CI job on Linux - Basic docs on using Meson to build NumPy (not yet integrated in the html docs, it's too early for that - this is for early adopters right now). The build should be complete, with the major exception of SIMD support. The full test suite passes. See gh-22546 for the tracking issue with detailed notes on the plan for switching NumPy to Meson as its build system. Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu>
* | MAINT: replace `NPY_INLINE` with `inline`Ralf Gommers2022-11-258-90/+65
|/ | | | Closes gh-22100
* REL: Prepare main for NumPy 1.25.0 developmentCharles Harris2022-11-221-0/+1
|
* MAINT: remove macOS specific long double handling in numpyconfig.hRalf Gommers2022-11-171-45/+0
| | | | | | | | | | | | | This was put in place for universal builds (the old kind, PPC/Intel), and then extended for arm64 support. It was only needed when building for two architectures in a single build. We no longer support i386/PPC/universal, and for producing universal2 wheels for those users that want that, the way to do it is to take a x86-64 wheel and an arm64 wheel and fuse those with the `delocate-fuse` utility from `delocate`. Hence this code is no longer needed.
* MAINT: refactor mandatory npymath functions to #define macrosmattip2022-10-201-92/+93
|
* MAINT: Fix typos found by codespellDimitri Papadopoulos2022-10-071-1/+1
|
* MAINT, Haiku defines neither __STDC_NO_THREADS__ nor __GLIBC__begasus2022-09-161-0/+2
|
* MAINT: fix defines for universal2 python builds of NumPymattip2022-08-241-0/+8
|