Skip to content

Commit 6d429c7

Browse files
authored
add support for out keyword (#157)
* add support for out keyword * update docstring * use NumpyVersion * update README.md * fix typos
1 parent 49949a0 commit 6d429c7

File tree

13 files changed

+495
-1224
lines changed

13 files changed

+495
-1224
lines changed

CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# changelog
22
All notable changes to this project will be documented in this file.
33

4-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [dev] (MM/DD/YY)
88

99
### Added
10-
* SciPy interface `mkl_fft.interfaces.scipy_fft` now includes Hermitian FFT functions: `hfft`, `ihfft`, `hfftn`, `ihfftn`, `hfft2`, and `ihfft2` [gh-161](https://github.com/IntelPython/mkl_fft/pull/161)
10+
* Added Hermitian FFT functions to SciPy interface `mkl_fft.interfaces.scipy_fft`: `hfft`, `ihfft`, `hfftn`, `ihfftn`, `hfft2`, and `ihfft2` [gh-161](https://github.com/IntelPython/mkl_fft/pull/161)
11+
* Added support for `out` kwarg to all FFT functions in `mkl_fft` and `mkl_fft.interfaces.numpy_fft` [gh-157](https://github.com/IntelPython/mkl_fft/pull/157)
12+
13+
### Changed
14+
* NumPy interface `mkl_fft.interfaces.numpy_fft` is aligned with numpy-2.* [gh-139](https://github.com/IntelPython/mkl_fft/pull/139), [gh-157](https://github.com/IntelPython/mkl_fft/pull/157)
1115

1216
## [1.3.14] (04/10/2025)
1317

README.md

+37-28
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
## `mkl_fft` -- a NumPy-based Python interface to Intel (R) MKL FFT functionality
1+
## `mkl_fft` -- a NumPy-based Python interface to Intel® oneAPI Math Kernel Library (OneMKL) FFT functionality
22
[![Conda package](https://github.com/IntelPython/mkl_fft/actions/workflows/conda-package.yml/badge.svg)](https://github.com/IntelPython/mkl_fft/actions/workflows/conda-package.yml)
33
[![Editable build using pip and pre-release NumPy](https://github.com/IntelPython/mkl_fft/actions/workflows/build_pip.yaml/badge.svg)](https://github.com/IntelPython/mkl_fft/actions/workflows/build_pip.yaml)
44
[![Conda package with conda-forge channel only](https://github.com/IntelPython/mkl_fft/actions/workflows/conda-package-cf.yml/badge.svg)](https://github.com/IntelPython/mkl_fft/actions/workflows/conda-package-cf.yml)
55
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/IntelPython/mkl_fft/badge)](https://securityscorecards.dev/viewer/?uri=github.com/IntelPython/mkl_fft)
66

7-
`mkl_fft` started as a part of Intel (R) Distribution for Python* optimizations to NumPy, and is now being released
8-
as a stand-alone package. It can be installed into conda environment using
7+
`mkl_fft` started as a part of Intel® Distribution for Python* optimizations to NumPy, and is now being released
8+
as a stand-alone package. It can be installed into conda environment from Intel's channel using:
99

1010
```
1111
conda install -c https://software.repos.intel.com/python/conda mkl_fft
@@ -19,13 +19,13 @@ or from conda-forge channel:
1919

2020
---
2121

22-
To install mkl_fft Pypi package please use following command:
22+
To install `mkl_fft` PyPI package please use following command:
2323

2424
```
2525
python -m pip install --index-url https://software.repos.intel.com/python/pypi --extra-index-url https://pypi.org/simple mkl_fft
2626
```
2727

28-
If command above installs NumPy package from the Pypi, please use following command to install Intel optimized NumPy wheel package from Intel Pypi Cloud:
28+
If command above installs NumPy package from the PyPI, please use following command to install Intel optimized NumPy wheel package from Intel PyPI Cloud:
2929

3030
```
3131
python -m pip install --index-url https://software.repos.intel.com/python/pypi --extra-index-url https://pypi.org/simple mkl_fft numpy==<numpy_version>
@@ -35,7 +35,7 @@ Where `<numpy_version>` should be the latest version from https://software.repos
3535

3636
---
3737

38-
Since MKL FFT supports performing discrete Fourier transforms over non-contiguously laid out arrays, MKL can be directly
38+
Since MKL FFT supports performing discrete Fourier transforms over non-contiguously laid out arrays, OneMKL can be directly
3939
used on any well-behaved floating point array with no internal overlaps for both in-place and not in-place transforms of
4040
arrays in single and double floating point precision.
4141

@@ -50,38 +50,47 @@ More details can be found in SciPy 2017 conference proceedings:
5050

5151
`mkl_fft` implements the following functions:
5252

53-
### Complex transforms, similar to those in `scipy.fft`:
53+
### complex-to-complex (c2c) transforms:
5454

55-
`fft(x, n=None, axis=-1, overwrite_x=False)`
55+
`fft(x, n=None, axis=-1, overwrite_x=False, fwd_scale=1.0, out=out)` - 1D FFT, similar to `scipy.fft.fft`
5656

57-
`ifft(x, n=None, axis=-1, overwrite_x=False)`
57+
`fft2(x, s=None, axes=(-2, -1), overwrite_x=False, fwd_scale=1.0, out=out)` - 2D FFT, similar to `scipy.fft.fft2`
5858

59-
`fft2(x, shape=None, axes=(-2,-1), overwrite_x=False)`
59+
`fftn(x, s=None, axes=None, overwrite_x=False, fwd_scale=1.0, out=out)` - ND FFT, similar to `scipy.fft.fftn`
6060

61-
`ifft2(x, shape=None, axes=(-2,-1), overwrite_x=False)`
61+
and similar inverse FFT (`ifft*`) functions.
6262

63-
`fftn(x, n=None, axes=None, overwrite_x=False)`
63+
### real-to-complex (r2c) and complex-to-real (c2r) transforms:
6464

65-
`ifftn(x, n=None, axes=None, overwrite_x=False)`
65+
`rfft(x, n=None, axis=-1, fwd_scale=1.0, out=out)` - r2c 1D FFT, similar to `numpy.fft.rfft`
6666

67-
### Real transforms
67+
`rfft2(x, s=None, axes=(-2, -1), fwd_scale=1.0, out=out)` - r2c 2D FFT, similar to `numpy.fft.rfft2`
6868

69-
`rfftpack(x, n=None, axis=-1, overwrite_x=False)` - real 1D Fourier transform, like `scipy.fftpack.rfft`
69+
`rfftn(x, s=None, axes=None, fwd_scale=1.0, out=out)` - r2c ND FFT, similar to `numpy.fft.rfftn`
7070

71-
`rfft(x, n=None, axis=-1)` - real 1D Fourier transform, like `numpy.fft.rfft`
71+
and similar inverse c2r FFT (`irfft*`) functions.
7272

73-
`rfft2(x, s=None, axes=(-2,-1))` - real 2D Fourier transform, like `numpy.fft.rfft2`
74-
75-
`rfftn(x, s=None, axes=None)` - real ND Fourier transform, like `numpy.fft.rfftn`
76-
77-
... and similar `irfft*` functions.
78-
79-
80-
The package also provides `mkl_fft.interfaces.numpy_fft` and `mkl_fft.interfaces.scipy_fft` interfaces which provide drop-in replacements for equivalent functions in NumPy and SciPy respectively.
73+
The package also provides `mkl_fft.interfaces.numpy_fft` and `mkl_fft.interfaces.scipy_fft` interfaces which provide drop-in replacements for equivalent functions in NumPy and SciPy, respectively.
8174

8275
---
8376

84-
To build `mkl_fft` from sources on Linux:
85-
- install a recent version of MKL, if necessary;
86-
- execute `source /path_to_oneapi/mkl/latest/env/vars.sh`;
87-
- execute `python -m pip install .`
77+
To build `mkl_fft` from sources on Linux with Intel® OneMKL:
78+
- create a virtual environment: `python3 -m venv fft_env`
79+
- activate the environment: `source fft_env/bin/activate`
80+
- install a recent version of OneMKL, if necessary
81+
- execute `source /path_to_oneapi/mkl/latest/env/vars.sh`
82+
- `git clone https://github.com/IntelPython/mkl_fft.git mkl_fft`
83+
- `cd mkl_fft`
84+
- `python -m pip install .`
85+
- `cd ..`
86+
- `python -c "import mkl_fft"`
87+
88+
To build `mkl_fft` from sources on Linux with conda follow these steps:
89+
- `conda create -n fft_env python=3.12 mkl-devel`
90+
- `conda activate fft_env`
91+
- `export MKLROOT=$CONDA_PREFIX`
92+
- `git clone https://github.com/IntelPython/mkl_fft.git mkl_fft`
93+
- `cd mkl_fft`
94+
- `python -m pip install .`
95+
- `cd ..`
96+
- `python -c "import mkl_fft"`

conda-recipe-cf/meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ about:
4343
home: http://github.com/IntelPython/mkl_fft
4444
license: BSD-3-Clause
4545
license_file: LICENSE.txt
46-
summary: NumPy-based implementation of Fast Fourier Transform using Intel (R) Math Kernel Library
46+
summary: NumPy-based implementation of Fast Fourier Transform using Intel® oneAPI Math Kernel Library (OneMKL)

conda-recipe/meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ about:
4343
home: http://github.com/IntelPython/mkl_fft
4444
license: BSD-3-Clause
4545
license_file: LICENSE.txt
46-
summary: NumPy-based implementation of Fast Fourier Transform using Intel (R) Math Kernel Library
46+
summary: NumPy-based implementation of Fast Fourier Transform using Intel® oneAPI Math Kernel Library (OneMKL)

0 commit comments

Comments
 (0)