From 25d7ae6bd00c14d485beeb5b4fd26c671c47be9e Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Thu, 18 Aug 2022 10:06:18 +0300 Subject: [PATCH] longer lived memoize for opencl_fft_app --- sumpy/fmm.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sumpy/fmm.py b/sumpy/fmm.py index 30ca38384..0d411da25 100644 --- a/sumpy/fmm.py +++ b/sumpy/fmm.py @@ -179,10 +179,17 @@ def p2p(self): exclude_self=self.exclude_self, strength_usage=self.strength_usage) - @memoize_method def opencl_fft_app(self, shape, dtype, inverse): - with cl.CommandQueue(self.cl_context) as queue: - return get_opencl_fft_app(queue, shape, dtype, inverse) + from pytools import memoize_in + + @memoize_in(self.cl_context, ( + SumpyTreeIndependentDataForWrangler.opencl_fft_app, + shape, dtype, inverse)) + def app(): + with cl.CommandQueue(self.cl_context) as queue: + return get_opencl_fft_app(queue, shape, dtype, inverse) + + return app() # }}}