From 95b290f32802f50a8b190cb445baade2853187c9 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Sun, 17 Jan 2021 23:48:06 -0600 Subject: [PATCH] kernel_get_work_group_info: Use Device.int_ptr in cache key --- pyopencl/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 7cc3f3af..c3c9cf3f 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -865,13 +865,14 @@ def _add_functionality(): KernelWithCustomEnqueue.set_args = set_args def kernel_get_work_group_info(self, param, device): + cache_key = (param, device.int_ptr) try: - return self._wg_info_cache[param, device] + return self._wg_info_cache[cache_key] except KeyError: pass result = kernel_old_get_work_group_info(self, param, device) - self._wg_info_cache[param, device] = result + self._wg_info_cache[cache_key] = result return result def kernel_set_args(self, *args, **kwargs): -- GitLab