Skip to content

Commit d27c898

Browse files
committed
freeze constant arrays
1 parent 31d849e commit d27c898

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

meshmode/discretization/connection/direct.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ class _FromGroupPickData(Generic[ArrayT]):
232232
from_element_indices: ArrayT
233233
is_surjective: bool
234234

235+
@keyed_memoize_method(key=lambda actx: type(actx).__name__)
236+
def indexed_dof_pick_lists(self, actx):
237+
assert actx.permits_advanced_indexing
238+
return actx.freeze(
239+
actx.thaw(self.dof_pick_lists)[actx.thaw(self.dof_pick_list_indices)])
240+
235241
# }}}
236242

237243

@@ -737,8 +743,7 @@ def group_pick_knl(is_surjective: bool):
737743
grp_ary_contrib = ary[fgpd.from_group_index][
738744
_reshape_and_preserve_tags(
739745
actx, from_element_indices, (-1, 1)),
740-
actx.thaw(fgpd.dof_pick_lists)[
741-
actx.thaw(fgpd.dof_pick_list_indices)]
746+
actx.thaw(fgpd.indexed_dof_pick_lists(actx))
742747
]
743748

744749
if not fgpd.is_surjective:

0 commit comments

Comments
 (0)