diff --git a/firedrake/slate/slac/utils.py b/firedrake/slate/slac/utils.py index cb38dd3a16..bd5c81e23b 100644 --- a/firedrake/slate/slac/utils.py +++ b/firedrake/slate/slac/utils.py @@ -247,13 +247,17 @@ def merge_loopy(slate_loopy, output_arg, builder, var2terminal, name): for tsfc_loopy in tsfc_kernels: slate_wrapper = merge([slate_wrapper, tsfc_loopy]) - names = tsfc_loopy.callables_table - for name in names: + slate_wrapper = merge([slate_wrapper, slate_loopy]) + + # At this point the individual subkernels are no longer callable, we + # only want to access the generated code via the wrapper. + slate_wrapper = slate_wrapper.with_entrypoints({name}) + + for tsfc_loopy in tsfc_kernels: + for name in tsfc_loopy.callables_table: if isinstance(slate_wrapper.callables_table[name], CallableKernel): slate_wrapper = _match_caller_callee_argument_dimension_(slate_wrapper, name) - slate_wrapper = merge([slate_wrapper, slate_loopy]) - names = slate_loopy.callables_table - for name in names: + for name in slate_loopy.callables_table: if isinstance(slate_wrapper.callables_table[name], CallableKernel): slate_wrapper = _match_caller_callee_argument_dimension_(slate_wrapper, name)