Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
38aa1c4b
Commit
38aa1c4b
authored
Oct 25, 2016
by
Jait Dixit
Browse files
WIP: Fix FFTW caching
- Refactor RGRGTransformation - Add is_local to dictionary key hash
parent
370fdd22
Changes
3
Hide whitespace changes
Inline
Side-by-side
nifty/operators/fft_operator/transformations/rg_transforms.py
View file @
38aa1c4b
...
...
@@ -170,7 +170,9 @@ class FFTW(Transform):
# generate a id-tuple which identifies the domain-codomain setting
temp_id
=
(
domain
.
__hash__
()
^
(
101
*
codomain
.
__hash__
())
^
(
211
*
transform_shape
.
__hash__
()))
(
211
*
transform_shape
.
__hash__
())
^
(
131
*
is_local
.
__hash__
())
)
# generate the plan_and_info object if not already there
if
temp_id
not
in
self
.
info_dict
:
...
...
nifty/operators/fft_operator/transformations/rgrgtransformation.py
View file @
38aa1c4b
...
...
@@ -7,29 +7,29 @@ from nifty import RGSpace, nifty_configuration
class
RGRGTransformation
(
Transformation
):
def
__init__
(
self
,
domain
,
codomain
=
None
,
module
=
None
):
super
(
RGRGTransformation
,
self
).
__init__
(
domain
,
codomain
,
module
)
super
(
RGRGTransformation
,
self
).
__init__
(
domain
,
codomain
)
if
module
is
None
:
if
nifty_configuration
[
'fft_module'
]
==
'pyfftw'
:
self
.
_transform
=
FFTW
(
domain
,
codomain
)
self
.
_transform
=
FFTW
(
self
.
domain
,
self
.
codomain
)
elif
(
nifty_configuration
[
'fft_module'
]
==
'gfft'
or
nifty_configuration
[
'fft_module'
]
==
'gfft_dummy'
):
self
.
_transform
=
\
GFFT
(
domain
,
codomain
,
GFFT
(
self
.
domain
,
self
.
codomain
,
gdi
.
get
(
nifty_configuration
[
'fft_module'
]))
else
:
raise
ValueError
(
'ERROR: unknow default FFT module:'
+
nifty_configuration
[
'fft_module'
])
else
:
if
module
==
'pyfftw'
:
self
.
_transform
=
FFTW
(
domain
,
codomain
)
self
.
_transform
=
FFTW
(
self
.
domain
,
self
.
codomain
)
elif
module
==
'gfft'
:
self
.
_transform
=
\
GFFT
(
domain
,
codomain
,
gdi
.
get
(
'gfft'
))
GFFT
(
self
.
domain
,
self
.
codomain
,
gdi
.
get
(
'gfft'
))
elif
module
==
'gfft_dummy'
:
self
.
_transform
=
\
GFFT
(
domain
,
codomain
,
gdi
.
get
(
'gfft_dummy'
))
GFFT
(
self
.
domain
,
self
.
codomain
,
gdi
.
get
(
'gfft_dummy'
))
else
:
raise
ValueError
(
'ERROR: unknow FFT module:'
+
module
)
...
...
nifty/operators/fft_operator/transformations/transformation.py
View file @
38aa1c4b
...
...
@@ -11,7 +11,7 @@ class Transformation(object, Loggable):
"""
__metaclass__
=
abc
.
ABCMeta
def
__init__
(
self
,
domain
,
codomain
=
None
,
module
=
None
):
def
__init__
(
self
,
domain
,
codomain
):
if
codomain
is
None
:
self
.
domain
=
domain
self
.
codomain
=
self
.
get_codomain
(
domain
)
...
...
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