Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pypocketfft
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martin Reinecke
pypocketfft
Commits
d1874b1d
Commit
d1874b1d
authored
Jun 25, 2019
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no more problematic macros / r2hc -> real2hermitian
parent
83408785
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
96 deletions
+114
-96
bench.py
bench.py
+2
-2
pocketfft_hdronly.h
pocketfft_hdronly.h
+100
-83
pypocketfft.cc
pypocketfft.cc
+10
-9
test.py
test.py
+2
-2
No files found.
bench.py
View file @
d1874b1d
...
...
@@ -108,8 +108,8 @@ def bench_nd(ndim, nmax, ntry, tp, funcs, nrepeat, ttl="", filename=""):
plt
.
show
()
funcs
=
(
measure_pypocketfft
,
measure_fftw
_np_interface
)
ttl
=
"pypocketfft/
fftw_numpy_interface
"
funcs
=
(
measure_pypocketfft
,
measure_fftw
)
ttl
=
"pypocketfft/
FFTW()
"
bench_nd
(
1
,
8192
,
100
,
"c16"
,
funcs
,
10
,
ttl
,
"1d.png"
)
bench_nd
(
2
,
2048
,
100
,
"c16"
,
funcs
,
2
,
ttl
,
"2d.png"
)
bench_nd
(
3
,
256
,
100
,
"c16"
,
funcs
,
2
,
ttl
,
"3d.png"
)
...
...
pocketfft_hdronly.h
View file @
d1874b1d
This diff is collapsed.
Click to expand it.
pypocketfft.cc
View file @
d1874b1d
...
...
@@ -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
,
const
py
::
object
&
axes_
,
bool
r
2hc
,
bool
forward
,
int
inorm
,
const
py
::
object
&
axes_
,
bool
r
eal2hermitian
,
bool
forward
,
int
inorm
,
py
::
object
&
out_
,
size_t
nthreads
)
{
auto
axes
=
makeaxes
(
in
,
axes_
);
...
...
@@ -213,18 +213,18 @@ template<typename T> py::array r2r_fftpack_internal(const py::array &in,
{
py
::
gil_scoped_release
release
;
T
fct
=
norm_fct
<
T
>
(
inorm
,
dims
,
axes
);
pocketfft
::
r2r_fftpack
(
dims
,
s_in
,
s_out
,
axes
,
r
2hc
,
forward
,
pocketfft
::
r2r_fftpack
(
dims
,
s_in
,
s_out
,
axes
,
r
eal2hermitian
,
forward
,
d_in
,
d_out
,
fct
,
nthreads
);
}
return
res
;
}
py
::
array
r2r_fftpack
(
const
py
::
array
&
in
,
const
py
::
object
&
axes_
,
bool
r
2hc
,
bool
forward
,
int
inorm
,
py
::
object
&
out_
,
bool
r
eal2hermitian
,
bool
forward
,
int
inorm
,
py
::
object
&
out_
,
size_t
nthreads
)
{
DISPATCH
(
in
,
f64
,
f32
,
flong
,
r2r_fftpack_internal
,
(
in
,
axes_
,
r2hc
,
forward
,
inorm
,
out_
,
nthreads
))
DISPATCH
(
in
,
f64
,
f32
,
flong
,
r2r_fftpack_internal
,
(
in
,
axes_
,
real2hermitian
,
forward
,
inorm
,
out_
,
nthreads
))
}
template
<
typename
T
>
py
::
array
c2r_internal
(
const
py
::
array
&
in
,
...
...
@@ -437,9 +437,10 @@ a : numpy.ndarray (any real type)
axes : list of integers
The axes along which the FFT is carried out.
If not set, all axes will be transformed.
r2hc : bool
if True, the input is purely real and the output will be halfcomplex,
otherwise the opposite
real2hermitian : bool
if True, the input is purely real and the output will have Hermitian
symmetry and be stored in FFTPACK's halfcomplex ordering, otherwise the
opposite.
forward : bool
If `True`, a negative sign is used in the exponent, else a positive one.
inorm : int
...
...
@@ -538,7 +539,7 @@ PYBIND11_MODULE(pypocketfft, m)
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
);
m
.
def
(
"r2r_fftpack"
,
r2r_fftpack
,
r2r_fftpack_DS
,
"a"
_a
,
"axes"
_a
,
"r
2hc
"
_a
,
"forward"
_a
,
"inorm"
_a
=
0
,
"out"
_a
=
None
,
"nthreads"
_a
=
1
);
"r
eal2hermitian
"
_a
,
"forward"
_a
,
"inorm"
_a
=
0
,
"out"
_a
=
None
,
"nthreads"
_a
=
1
);
m
.
def
(
"separable_hartley"
,
separable_hartley
,
separable_hartley_DS
,
"a"
_a
,
"axes"
_a
=
None
,
"inorm"
_a
=
0
,
"out"
_a
=
None
,
"nthreads"
_a
=
1
);
m
.
def
(
"genuine_hartley"
,
genuine_hartley
,
genuine_hartley_DS
,
"a"
_a
,
...
...
test.py
View file @
d1874b1d
...
...
@@ -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
):
return
pypocketfft
.
r2r_fftpack
(
a
,
axes
=
(
axis
,),
r
2hc
=
True
,
return
pypocketfft
.
r2r_fftpack
(
a
,
axes
=
(
axis
,),
r
eal2hermitian
=
True
,
forward
=
True
,
inorm
=
inorm
,
out
=
out
,
nthreads
=
nthreads
)
def
irfft_scipy
(
a
,
axis
,
inorm
=
0
,
out
=
None
,
nthreads
=
1
):
return
pypocketfft
.
r2r_fftpack
(
a
,
axes
=
(
axis
,),
r
2hc
=
False
,
return
pypocketfft
.
r2r_fftpack
(
a
,
axes
=
(
axis
,),
r
eal2hermitian
=
False
,
forward
=
False
,
inorm
=
inorm
,
out
=
out
,
nthreads
=
nthreads
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment