diff --git a/loopy/translation_unit.py b/loopy/translation_unit.py index 6fe3e7171..93ecbe9ab 100644 --- a/loopy/translation_unit.py +++ b/loopy/translation_unit.py @@ -302,9 +302,9 @@ def with_kernel(self, kernel: LoopKernel) -> Self: # update the callable kernel new_in_knl_callable = self.callables_table[kernel.name].copy( subkernel=kernel) - new_callables = self.callables_table.mutate() - new_callables[kernel.name] = new_in_knl_callable - return self.copy(callables_table=new_callables.finish()) + return self.copy( + callables_table=self.callables_table.set( + kernel.name, new_in_knl_callable)) else: # add a new callable kernel clbl = CallableKernel(kernel)