Skip to content

Commit 11339a4

Browse files
committed
freeze constant arrays
1 parent f09fdd4 commit 11339a4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

meshmode/discretization/connection/direct.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ class _FromGroupPickData(Generic[ArrayT]):
232232
from_element_indices: ArrayT
233233
is_surjective: bool
234234

235+
@memoize_method
236+
def indexed_dof_pick_lists(self, actx):
237+
return actx.freeze(
238+
actx.thaw(self.dof_pick_lists)[actx.thaw(self.dof_pick_list_indices)])
239+
235240
# }}}
236241

237242

@@ -736,8 +741,7 @@ def group_pick_knl(is_surjective: bool):
736741
grp_ary_contrib = ary[fgpd.from_group_index][
737742
_reshape_and_preserve_tags(
738743
actx, from_element_indices, (-1, 1)),
739-
actx.thaw(fgpd.dof_pick_lists)[
740-
actx.thaw(fgpd.dof_pick_list_indices)]
744+
actx.thaw(fgpd.indexed_dof_pick_lists(actx))
741745
]
742746

743747
if not fgpd.is_surjective:

0 commit comments

Comments
 (0)