Skip to content

Commit 9c52e77

Browse files
committed
longer lived memoize for opencl_fft_app
1 parent 7c277e6 commit 9c52e77

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

sumpy/fmm.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,17 @@ def p2p(self):
179179
exclude_self=self.exclude_self,
180180
strength_usage=self.strength_usage)
181181

182-
@memoize_method
183182
def opencl_fft_app(self, shape, dtype, inverse):
184-
with cl.CommandQueue(self.cl_context) as queue:
185-
return get_opencl_fft_app(queue, shape, dtype, inverse)
183+
from pytools import memoize_in
184+
185+
@memoize_in(self.cl_context, (
186+
SumpyTreeIndependentDataForWrangler.opencl_fft_app,
187+
shape, dtype, inverse))
188+
def app():
189+
with cl.CommandQueue(self.cl_context) as queue:
190+
return get_opencl_fft_app(queue, shape, dtype, inverse)
191+
192+
return app()
186193

187194
# }}}
188195

0 commit comments

Comments
 (0)