| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
NumPy has SIMD versions of BOOL `logical_and`, `logical_or`, `logical_not`, and `absolute` for SSE2. The changes here replace that implementation with one that uses their universal intrinsics. This allows other architectures to have SIMD versions of the functions too.
BOOL `logical_and` and `logical_or` are particularly important for NumPy as that's how `np.any()` / `np.all()` are implemented.
|
|
|
|
| |
NumPy already has SSE2 versions of `negative`. Changes here convert that to universal intrinsics so other architectures can benefit. Previously there was no unroll and SIMD was only used in contiguous cases. We're now unrolling 4x/2x depending on whether destination is contiguous. x86 doesn't perform as well for non-contiguous cases here, so we leave previous implementation / fall back to scalar. Additionally, we've added SIMD versions for ints.
|
|\
| |
| | |
MAINT: fix `.gitignore` issues, and remove remaining `NPY_INLINE` usages
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
To find such files:
```
import os
with open('../numpy/.gitignore') as f:
ignored = f.readlines()
ignored = [s.split('\n')[0] for s in ignored if s.startswith('numpy')]
for fname in ignored:
if os.path.exists(fname):
print(fname)
```
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This does several things
- Uses a virtual environment for the documentent build. This allows
installing the proper NumPy version with pip and works with all
recent Python versions.
- Installs the dependencies current in the {doc|test}requirements files.
That makes it easier to insure that the proper versions are used.
- Removes the latex/pdf builds. Those builds are currently buggy and
hard to maintain and we have chosen to remove the pdf documents until
that is fixed. Removing them cleans up the file to some extent.
This all makes it easier to document how to build the docs. I was
editing the Makefile on the fly before this, and that sort of knowledge
is tricky to pass on to new maintainers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
np.concatenate and np.stack are similar methods, but only np.concatenate has the casting option.
This PR puts the casting option into the np.stack method to control what kind of data casting may occur
Closes gh-20959
* ENH: adding casting option to numpy.stack.
See #20959
* ENH: adding dtype option to numpy.stack.
See #20959
* REV: removing auto-generated file loops_modulo.dispatch.c
See numpy#20959
* REV: removing auto-generated file loops_modulo.dispatch.c
See numpy#20959
* REV: removing inserted newlines
See numpy#20959
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: JessePires <jesserocha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
* DOC: inserting versionadded info in dtype and casting parameters.
See numpy#20959
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: JessePires <jesserocha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
* TST: writing tests to stack method with dtype and casting options
See numpy#20959
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: JessePires <jesserocha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
* DOC: adding upcoming_change file for new options casting and dtype in method stack.
See numpy#20959
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: JessePires <jesserocha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
* REV: reverting lint errors.
See numpy#20959
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: JessePires <jesserocha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
* DOC: inserting hstack and vstack methods in upcoming changes
See numpy#20959
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: JessePires <jesserocha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
* ENH: adding dtype and casting keyword arguments to numpy.vstack and numpy.hstack.
See numpy#20959
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: JessePires <jesserocha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
* TST: writing tests to vstack and hstack methods with dtype and casting keyword arguments.
See numpy#20959
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: JessePires <jesserocha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
* REV: reverting the 'out' option type in stack method.
See numpy#20959
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: JessePires <jesserocha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
* REV: Reverting out type changes in overload of shape_base.pyi file.
See numpy#20959
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: jhonatancunha <jhonatancunha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
* DOC: correcting some english erros in upcoming_changes file.
See numpy#20959
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: JessePires <jesserocha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
Co-authored-by: JessePires <jessepires2010@gmail.com>
Co-authored-by: alescrocaro <alescrocaro@gmail.com>
Co-authored-by: JessePires <jesserocha@alunos.utfpr.edu.br>
Co-authored-by: patriarka <matheussantanapatriarca2019@outlook.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* umath/loops_hyperbolic.dispatch.c
* multiarray/argfunc.dispatch.c
* multiarray/arraytypes.h
|
| |
|
|\
| |
| | |
BUG: min/max is slow, re-implement using NEON (#17989)
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This fixes numpy/numpy#17989 by adding ARM NEON implementations for min/max and fmin/max.
Before: Rosetta faster than native arm64 by `1.2x - 8.6x`.
After: Native arm64 faster than Rosetta by `1.6x - 6.7x`. (2.8x - 15.5x improvement)
**Benchmarks**
```
before after ratio
[b0e1a445] [8301ffd7]
<main> <gh-issue-17989/improve-neon-min-max>
+ 32.6±0.04μs 37.5±0.08μs 1.15 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'ceil'>, 2, 1, 'd')
+ 32.6±0.06μs 37.5±0.04μs 1.15 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'floor'>, 2, 1, 'd')
+ 37.8±0.09μs 43.2±0.09μs 1.14 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'floor'>, 4, 4, 'f')
+ 37.7±0.09μs 42.9±0.1μs 1.14 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'floor'>, 2, 2, 'd')
+ 37.9±0.2μs 43.0±0.02μs 1.14 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'ceil'>, 2, 2, 'd')
+ 37.7±0.01μs 42.3±1μs 1.12 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'conjugate'>, 2, 2, 'd')
+ 34.2±0.07μs 38.1±0.05μs 1.12 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'floor'>, 4, 2, 'f')
+ 32.6±0.03μs 35.8±0.04μs 1.10 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'floor'>, 4, 1, 'f')
+ 37.1±0.1μs 40.3±0.1μs 1.09 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'ceil'>, 1, 2, 'd')
+ 37.2±0.1μs 40.3±0.04μs 1.08 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'floor'>, 2, 4, 'f')
+ 37.1±0.09μs 40.3±0.07μs 1.08 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'floor'>, 1, 2, 'd')
+ 68.6±0.5μs 74.2±0.3μs 1.08 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'ceil'>, 4, 4, 'd')
+ 37.1±0.2μs 40.0±0.1μs 1.08 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'conjugate'>, 1, 2, 'd')
+ 2.42±0μs 2.61±0.05μs 1.08 bench_core.CountNonzero.time_count_nonzero_axis(3, 100, <class 'numpy.int16'>)
+ 69.1±0.7μs 73.5±0.7μs 1.06 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'conjugate'>, 4, 4, 'd')
+ 54.7±0.3μs 58.0±0.2μs 1.06 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'ceil'>, 2, 4, 'd')
+ 54.5±0.2μs 57.8±0.2μs 1.06 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'conjugate'>, 2, 4, 'd')
+ 3.78±0.04μs 4.00±0.02μs 1.06 bench_core.CountNonzero.time_count_nonzero_multi_axis(2, 100, <class 'str'>)
+ 54.8±0.2μs 57.9±0.3μs 1.06 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'floor'>, 2, 4, 'd')
+ 3.68±0.01μs 3.87±0.02μs 1.05 bench_core.CountNonzero.time_count_nonzero_multi_axis(1, 100, <class 'object'>)
+ 69.6±0.2μs 73.1±0.2μs 1.05 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'floor'>, 4, 4, 'd')
+ 229±2μs 241±0.2μs 1.05 bench_random.Bounded.time_bounded('PCG64', [<class 'numpy.uint64'>, 1535])
- 73.0±0.8μs 69.5±0.2μs 0.95 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'trunc'>, 4, 4, 'd')
- 37.6±0.1μs 35.7±0.3μs 0.95 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'trunc'>, 1, 4, 'f')
- 88.7±0.04μs 84.2±0.7μs 0.95 bench_lib.Pad.time_pad((256, 128, 1), 1, 'wrap')
- 57.9±0.2μs 54.8±0.2μs 0.95 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'trunc'>, 2, 4, 'd')
- 39.9±0.2μs 37.2±0.04μs 0.93 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'positive'>, 1, 2, 'd')
- 2.66±0.01μs 2.47±0.01μs 0.93 bench_lib.Nan.time_nanmin(200, 0)
- 2.65±0.02μs 2.46±0.04μs 0.93 bench_lib.Nan.time_nanmin(200, 50.0)
- 2.64±0.01μs 2.45±0.01μs 0.93 bench_lib.Nan.time_nanmax(200, 90.0)
- 2.64±0μs 2.44±0.02μs 0.92 bench_lib.Nan.time_nanmax(200, 0)
- 2.68±0.02μs 2.48±0μs 0.92 bench_lib.Nan.time_nanmax(200, 2.0)
- 40.2±0.01μs 37.1±0.1μs 0.92 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'ceil'>, 2, 4, 'f')
- 2.69±0μs 2.47±0μs 0.92 bench_lib.Nan.time_nanmin(200, 2.0)
- 2.70±0.02μs 2.48±0.02μs 0.92 bench_lib.Nan.time_nanmax(200, 0.1)
- 2.70±0μs 2.47±0μs 0.91 bench_lib.Nan.time_nanmin(200, 90.0)
- 2.70±0μs 2.46±0μs 0.91 bench_lib.Nan.time_nanmin(200, 0.1)
- 2.70±0μs 2.42±0.01μs 0.90 bench_lib.Nan.time_nanmax(200, 50.0)
- 11.8±0.6ms 10.6±0.6ms 0.89 bench_core.CountNonzero.time_count_nonzero_axis(2, 1000000, <class 'str'>)
- 42.7±0.1μs 37.8±0.02μs 0.88 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'positive'>, 2, 2, 'd')
- 42.8±0.03μs 37.8±0.2μs 0.88 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'rint'>, 2, 2, 'd')
- 43.1±0.2μs 37.7±0.09μs 0.87 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'ceil'>, 4, 4, 'f')
- 37.5±0.07μs 32.6±0.06μs 0.87 bench_ufunc_strides.Unary.time_ufunc(<ufunc 'rint'>, 2, 1, 'd')
- 41.7±0.03μs 36.3±0.07μs 0.87 bench_ufunc_strides.Unary.time_ufunc(<ufunc '_ones_like'>, 1, 4, 'd')
- 166±0.8μs 144±1μs 0.87 bench_ufunc.UFunc.time_ufunc_types('fmin')
- 11.6±0.8ms 10.0±0.01ms 0.87 bench_core.CountNonzero.time_count_nonzero_multi_axis(2, 1000000, <class 'str'>)
- 167±0.9μs 144±2μs 0.86 bench_ufunc.UFunc.time_ufunc_types('minimum')
- 168±4μs 143±0.5μs 0.85 bench_ufunc.UFunc.time_ufunc_types('fmax')
- 167±1μs 142±0.8μs 0.85 bench_ufunc.UFunc.time_ufunc_types('maximum')
- 7.10±0μs 4.97±0.01μs 0.70 bench_ufunc_strides.AVX_BFunc.time_ufunc('minimum', 'd', 2)
- 7.11±0.07μs 4.96±0.01μs 0.70 bench_ufunc_strides.AVX_BFunc.time_ufunc('maximum', 'd', 2)
- 7.05±0.07μs 4.68±0μs 0.66 bench_ufunc_strides.AVX_BFunc.time_ufunc('minimum', 'f', 4)
- 7.13±0μs 4.68±0.01μs 0.66 bench_ufunc_strides.AVX_BFunc.time_ufunc('maximum', 'f', 4)
- 461±0.2μs 297±7μs 0.64 bench_app.MaxesOfDots.time_it
- 7.04±0.07μs 3.95±0μs 0.56 bench_ufunc_strides.AVX_BFunc.time_ufunc('maximum', 'f', 2)
- 7.06±0.06μs 3.95±0.01μs 0.56 bench_ufunc_strides.AVX_BFunc.time_ufunc('minimum', 'f', 2)
- 7.09±0.06μs 3.24±0μs 0.46 bench_ufunc_strides.AVX_BFunc.time_ufunc('minimum', 'd', 1)
- 7.12±0.07μs 3.25±0.02μs 0.46 bench_ufunc_strides.AVX_BFunc.time_ufunc('maximum', 'd', 1)
- 14.5±0.02μs 3.98±0μs 0.27 bench_reduce.MinMax.time_max(<class 'numpy.int64'>)
- 14.6±0.1μs 4.00±0.01μs 0.27 bench_reduce.MinMax.time_min(<class 'numpy.int64'>)
- 6.88±0.06μs 1.34±0μs 0.19 bench_ufunc_strides.AVX_BFunc.time_ufunc('maximum', 'f', 1)
- 7.00±0μs 1.33±0μs 0.19 bench_ufunc_strides.AVX_BFunc.time_ufunc('minimum', 'f', 1)
- 39.4±0.01μs 3.95±0.01μs 0.10 bench_reduce.MinMax.time_min(<class 'numpy.float64'>)
- 39.4±0.01μs 3.95±0.02μs 0.10 bench_reduce.MinMax.time_max(<class 'numpy.float64'>)
- 254±0.02μs 22.8±0.2μs 0.09 bench_lib.Nan.time_nanmax(200000, 50.0)
- 253±0.1μs 22.7±0.1μs 0.09 bench_lib.Nan.time_nanmin(200000, 0)
- 254±0.06μs 22.7±0.09μs 0.09 bench_lib.Nan.time_nanmin(200000, 2.0)
- 254±0.01μs 22.7±0.03μs 0.09 bench_lib.Nan.time_nanmin(200000, 0.1)
- 254±0.04μs 22.7±0.02μs 0.09 bench_lib.Nan.time_nanmin(200000, 50.0)
- 253±0.1μs 22.7±0.04μs 0.09 bench_lib.Nan.time_nanmax(200000, 0.1)
- 253±0.03μs 22.7±0.04μs 0.09 bench_lib.Nan.time_nanmin(200000, 90.0)
- 253±0.02μs 22.7±0.07μs 0.09 bench_lib.Nan.time_nanmax(200000, 0)
- 254±0.03μs 22.7±0.02μs 0.09 bench_lib.Nan.time_nanmax(200000, 90.0)
- 254±0.09μs 22.7±0.04μs 0.09 bench_lib.Nan.time_nanmax(200000, 2.0)
- 39.2±0.01μs 2.51±0.01μs 0.06 bench_reduce.MinMax.time_max(<class 'numpy.float32'>)
- 39.2±0.01μs 2.50±0.01μs 0.06 bench_reduce.MinMax.time_min(<class 'numpy.float32'>)
```
Size change of _multiarray_umath.cpython-39-darwin.so:
Before: 3,890,723
After: 3,924,035
Change: +33,312 (~ +0.856 %)
|
| | | |
|
| |/
|/|
| |
| | |
There's no templating annotation in _operand_flag_tests.c.src
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The second patch in a series of pull-requests aims to facilitate the migration
process to our new SIMD interface(NPYV).
It is basically a process that focuses on getting rid of the main umath SIMD source `simd.inc`,
which contains almost all SIMD kernels, by splitting it into several dispatch-able sources without
changing the base code, which facilitates the review process during the move to NPYV(universal intrinsics).
In this patch, we have moved the the following raw SIMD loops to the new dispatcher:
- FLOAT_exp, DOUBLE_exp
- FLOAT_log, DOUBLE_log
- FLOAT_frexp, DOUBLE_frexp
- FLOAT_ldexp, DOUBLE_ldexp
|
|
|
|
|
|
|
|
|
|
| |
The new path becomes `build/src.*/numpy/distutils/include/npy_cpu_dispatch_config.h`
instead of `numpy/core/src/common/_cpu_dispatch.h`.
The new path allows other projects to re-use the CPU dispatcher
once we decide to expose the following headers:
- `numpy/core/src/common/npy_cpu_dispatch.h`
- `numpy/core/src/common/npy_cpu_features.h`
|
|
|
|
|
|
| |
The new code improves the performance of non-contiguous memory access
for the output array without any reduction in performance.
For PPC64LE the performance increased by 2-3.0, and 1.5-2.0 on aarch64.
|
|\
| |
| | |
ENH, SIMD: Ditching the old CPU dispatcher(Arithmetic)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The first patch in a series of pull-requests aims to facilitate the migration
process to our new SIMD interface(NPYV).
It is basically a process that focuses on getting rid of the main umath SIMD source `simd.inc`,
which contains almost all SIMD kernels, by splitting it into several dispatch-able sources without
changing the base code, which facilitates the review process in order to speed up access to the nominal target.
In this patch, we have moved the arithmetic operations of real and complex for single/double precision
to the new CPU dispatcher.
NOTE: previously, the SIMD code of AVX2 and AVX512F for single/double precision wasn't dispatched in runtime before.
|
|/
|
|
|
|
|
|
|
|
|
|
| |
The new tags look like '1.21.0.dev0+98.gaa0453721f', where '98' is the
number of commits since the 1.21.0 branch was started and 'aa0453721f'.
The chosen form may be specified in the 'setup.cfg' file. This PR adds
two new files 'numpy/_version.py' and 'numpy/version.py'. The latter
is kept because it is part of the public API and is actually used by
some downstream projects, but it is no longer dynamically created.
See https://github.com/python-versioneer/python-versioneer/ for more
information.
|
| |
|
| |
|
|
|
|
|
| |
This patch allows passing `-j`, `--cpu-baseline`, `--cpu-dispatch` and `--disable-optimization`
to ASV build when argument `--bench-compare` is used.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Put `CCompilerOpt` in action through add two command line
arguments that passed directly to `CCompilerOpt`'s
parameters which explained as follows:
* `--cpu-baseline` minimal set of required optimizations,
default is 'min' which provides the minimum CPU features
that can safely run on a wide range of users platforms.
* `--cpu-dispatch` dispatched set of additional optimizations,
default is 'max-xop-fma4' which enables all CPU features,
except for AMD legacy features.
the new arguments can be reached from `build`, `build_clib`,
`build_ext`, if `build_clib` or `build_ext` are not specified
by the user the arguments of `build` will be used, which also
hold the default values.
- Activate the new compiler dispatcher that comes with `CCompilerOpt`,
through adding a hock inside `build_clib` and `build_ext`
that works as a filter taking any C source files ends with
`.dispatch.c` and pass it directly to `CCompilerOpt` and
then take returned objects and linked to the final C lib.
- Add a third command-line argument `--disable-optimization` which
explicitly disable the whole new infrastructure, also
It adds a new compiler definition called `NPY_DISABLE_OPTIMIZATION`.
when `--disable-optimization` is enabled the dispatch-able sources
that end with `.dispatch.c` will be treated as a normal
C sources, also due to this disabling any C headers that
generated by `CCompilerOpt` must guard it with `NPY_DISABLE_OPTIMIZATION`,
otherwise, it will definitely break the build.
- New auto-generated C header located at `core/include/numpy/_cpu_dispatch.h`,
the new header contains all definitions and headers of CPU features that
enabled according to specified configuration in `--cpu-baseline`
and `--cpu-dispatch`.
|
|
|
|
|
|
| |
Simplified annotations for functions requiring >=1D ArrayLike
objects. Affects a set of <20 functions from
``np.core.fromnumeric``. Based on feedback from
https://github.com/numpy/numpy-stubs/pull/71.
|
|
|
|
|
|
|
|
|
| |
See issue gh-15297 and related mailing list discussion.
This PR bring scalar.__round__() in line with python, so that `round(scalar)` always returns a python integer, while `round(scalar, ndigits=0)` returns the same type. Since complex numbers are not supported in Python, and cannot be reasonably cast to integers they are deprecated.
Closes gh-15297
|
|
|
|
|
| |
resize typemap issue
python 3 bytes vs str issue
|
|
|
|
|
|
|
|
|
|
| |
This commit removes lines 127-130 as they are duplicates of 149-152.
These lines correspond to the files:
* numpy/core/src/common/npy_binsearch.h
* numpy/core/src/common/npy_partition.h
* numpy/core/src/common/npy_sort.h
* numpy/core/src/common/templ_common.h
|
| |
|
|
|
|
|
|
| |
skip doctests that require scipy
move original mtrand module to _mtrand
adjust documentation for namespace change
|
|
|
|
|
|
|
| |
remove files that were part of the origal repo
rework randomgen docs to integrate with numpy and fix some links
remove convenience functions, require explicit call to gen.brng
move code out of numpy.random.randomgen into numpy.random
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
first cut at building randomgen
upgrade 'cythonize' and fix absolute imports to relative
define NPY_NO_DEPRECATED_API and fix other warnings
enable pgc64 by always using PCG_EMULATED_MATH
refactor so import randomgen works
add TODO comments for pcg64 improvements
fix imports, module name in setup.py; remove _testing
make cythonize non-recursive, restore examples to proper place
update to randomgen 7bca296c0b9
replace mtrand with LegacyGenerator, tweak for compatibility
port f879ef4 to fix GH10839
minimized difference between generator.pyx and _legacy.pyx
fix namespace in doctests, mark results that are random
update to randomgen commit 95c8cdd1c
Incorporate testing of edge cases into main tests
Rename test files to describe their purpose
Import import locations to reflect numpy paths
Correct tolerance on float32 tests
Remove set_printoptions
Remove complex normal
Remove future imports
Pull in BasicRNG source changes from original author
Small doc fixes
_mtrand => _rand
Improve consistency of nan handling
Prevent nans prducing values from int functions
add randomgen documentation to the tree
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This file is typically created and used by the file manager Dolphin
from KDE.
|
| |
|
|
|
|
| |
[ci skip] [skip ci]
|
| |
|
|\
| |
| | |
ENH: Add pytest support
|