From 90240d419bc86c0a0e90e375abcc7981a3aee620 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Wed, 26 Jul 2023 19:48:35 -0500
Subject: [PATCH] Use loopy executor in eager call_loopy

---
 arraycontext/impl/pyopencl/__init__.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arraycontext/impl/pyopencl/__init__.py b/arraycontext/impl/pyopencl/__init__.py
index 4064689..982fd43 100644
--- a/arraycontext/impl/pyopencl/__init__.py
+++ b/arraycontext/impl/pyopencl/__init__.py
@@ -268,17 +268,17 @@ class PyOpenCLArrayContext(ArrayContext):
 
     def call_loopy(self, t_unit, **kwargs):
         try:
-            t_unit = self._loopy_transform_cache[t_unit]
+            executor = self._loopy_transform_cache[t_unit]
         except KeyError:
             orig_t_unit = t_unit
-            t_unit = self.transform_loopy_program(t_unit)
-            self._loopy_transform_cache[orig_t_unit] = t_unit
+            executor = self.transform_loopy_program(t_unit).executor(self.context)
+            self._loopy_transform_cache[orig_t_unit] = executor
             del orig_t_unit
 
-        evt, result = t_unit(self.queue, **kwargs, allocator=self.allocator)
+        evt, result = executor(self.queue, **kwargs, allocator=self.allocator)
 
         if self._wait_event_queue_length is not False:
-            prg_name = t_unit.default_entrypoint.name
+            prg_name = executor.t_unit.default_entrypoint.name
             wait_event_queue = self._kernel_name_to_wait_event_queue.setdefault(
                     prg_name, [])
 
-- 
GitLab