Skip to content

Commit

Permalink
simplify with_kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener committed Jan 29, 2025
1 parent ba93a2f commit e06e31a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions loopy/translation_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e06e31a

Please sign in to comment.