There is a maintenance of MPCDF Gitlab on Thursday, April 22st 2020, 9:00 am CEST - Expect some service interruptions during this time

Commit d1874b1d authored by Martin Reinecke's avatar Martin Reinecke

no more problematic macros / r2hc -> real2hermitian

parent 83408785
...@@ -108,8 +108,8 @@ def bench_nd(ndim, nmax, ntry, tp, funcs, nrepeat, ttl="", filename=""): ...@@ -108,8 +108,8 @@ def bench_nd(ndim, nmax, ntry, tp, funcs, nrepeat, ttl="", filename=""):
plt.show() plt.show()
funcs = (measure_pypocketfft, measure_fftw_np_interface) funcs = (measure_pypocketfft, measure_fftw)
ttl = "pypocketfft/fftw_numpy_interface" ttl = "pypocketfft/FFTW()"
bench_nd(1, 8192, 100, "c16", funcs, 10, ttl, "1d.png") bench_nd(1, 8192, 100, "c16", funcs, 10, ttl, "1d.png")
bench_nd(2, 2048, 100, "c16", funcs, 2, ttl, "2d.png") bench_nd(2, 2048, 100, "c16", funcs, 2, ttl, "2d.png")
bench_nd(3, 256, 100, "c16", funcs, 2, ttl, "3d.png") bench_nd(3, 256, 100, "c16", funcs, 2, ttl, "3d.png")
......
This diff is collapsed.
...@@ -200,7 +200,7 @@ py::array r2c(const py::array &in, const py::object &axes_, bool forward, ...@@ -200,7 +200,7 @@ py::array r2c(const py::array &in, const py::object &axes_, bool forward,
} }
template<typename T> py::array r2r_fftpack_internal(const py::array &in, template<typename T> py::array r2r_fftpack_internal(const py::array &in,
const py::object &axes_, bool r2hc, bool forward, int inorm, const py::object &axes_, bool real2hermitian, bool forward, int inorm,
py::object &out_, size_t nthreads) py::object &out_, size_t nthreads)
{ {
auto axes = makeaxes(in, axes_); auto axes = makeaxes(in, axes_);
...@@ -213,18 +213,18 @@ template<typename T> py::array r2r_fftpack_internal(const py::array &in, ...@@ -213,18 +213,18 @@ template<typename T> py::array r2r_fftpack_internal(const py::array &in,
{ {
py::gil_scoped_release release; py::gil_scoped_release release;
T fct = norm_fct<T>(inorm, dims, axes); T fct = norm_fct<T>(inorm, dims, axes);
pocketfft::r2r_fftpack(dims, s_in, s_out, axes, r2hc, forward, pocketfft::r2r_fftpack(dims, s_in, s_out, axes, real2hermitian, forward,
d_in, d_out, fct, nthreads); d_in, d_out, fct, nthreads);
} }
return res; return res;
} }
py::array r2r_fftpack(const py::array &in, const py::object &axes_, py::array r2r_fftpack(const py::array &in, const py::object &axes_,
bool r2hc, bool forward, int inorm, py::object &out_, bool real2hermitian, bool forward, int inorm, py::object &out_,
size_t nthreads) size_t nthreads)
{ {
DISPATCH(in, f64, f32, flong, r2r_fftpack_internal, (in, axes_, r2hc, DISPATCH(in, f64, f32, flong, r2r_fftpack_internal, (in, axes_,
forward, inorm, out_, nthreads)) real2hermitian, forward, inorm, out_, nthreads))
} }
template<typename T> py::array c2r_internal(const py::array &in, template<typename T> py::array c2r_internal(const py::array &in,
...@@ -437,9 +437,10 @@ a : numpy.ndarray (any real type) ...@@ -437,9 +437,10 @@ a : numpy.ndarray (any real type)
axes : list of integers axes : list of integers
The axes along which the FFT is carried out. The axes along which the FFT is carried out.
If not set, all axes will be transformed. If not set, all axes will be transformed.
r2hc : bool real2hermitian : bool
if True, the input is purely real and the output will be halfcomplex, if True, the input is purely real and the output will have Hermitian
otherwise the opposite symmetry and be stored in FFTPACK's halfcomplex ordering, otherwise the
opposite.
forward : bool forward : bool
If `True`, a negative sign is used in the exponent, else a positive one. If `True`, a negative sign is used in the exponent, else a positive one.
inorm : int inorm : int
...@@ -538,7 +539,7 @@ PYBIND11_MODULE(pypocketfft, m) ...@@ -538,7 +539,7 @@ PYBIND11_MODULE(pypocketfft, m)
m.def("c2r", c2r, c2r_DS, "a"_a, "axes"_a=None, "lastsize"_a=0, m.def("c2r", c2r, c2r_DS, "a"_a, "axes"_a=None, "lastsize"_a=0,
"forward"_a=true, "inorm"_a=0, "out"_a=None, "nthreads"_a=1); "forward"_a=true, "inorm"_a=0, "out"_a=None, "nthreads"_a=1);
m.def("r2r_fftpack", r2r_fftpack, r2r_fftpack_DS, "a"_a, "axes"_a, m.def("r2r_fftpack", r2r_fftpack, r2r_fftpack_DS, "a"_a, "axes"_a,
"r2hc"_a, "forward"_a, "inorm"_a=0, "out"_a=None, "nthreads"_a=1); "real2hermitian"_a, "forward"_a, "inorm"_a=0, "out"_a=None, "nthreads"_a=1);
m.def("separable_hartley", separable_hartley, separable_hartley_DS, "a"_a, m.def("separable_hartley", separable_hartley, separable_hartley_DS, "a"_a,
"axes"_a=None, "inorm"_a=0, "out"_a=None, "nthreads"_a=1); "axes"_a=None, "inorm"_a=0, "out"_a=None, "nthreads"_a=1);
m.def("genuine_hartley", genuine_hartley, genuine_hartley_DS, "a"_a, m.def("genuine_hartley", genuine_hartley, genuine_hartley_DS, "a"_a,
......
...@@ -38,13 +38,13 @@ def irfftn(a, axes=None, lastsize=0, inorm=0, nthreads=1): ...@@ -38,13 +38,13 @@ def irfftn(a, axes=None, lastsize=0, inorm=0, nthreads=1):
def rfft_scipy(a, axis, inorm=0, out=None, nthreads=1): def rfft_scipy(a, axis, inorm=0, out=None, nthreads=1):
return pypocketfft.r2r_fftpack(a, axes=(axis,), r2hc=True, return pypocketfft.r2r_fftpack(a, axes=(axis,), real2hermitian=True,
forward=True, inorm=inorm, out=out, forward=True, inorm=inorm, out=out,
nthreads=nthreads) nthreads=nthreads)
def irfft_scipy(a, axis, inorm=0, out=None, nthreads=1): def irfft_scipy(a, axis, inorm=0, out=None, nthreads=1):
return pypocketfft.r2r_fftpack(a, axes=(axis,), r2hc=False, return pypocketfft.r2r_fftpack(a, axes=(axis,), real2hermitian=False,
forward=False, inorm=inorm, out=out, forward=False, inorm=inorm, out=out,
nthreads=nthreads) nthreads=nthreads)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment