diff --git a/python/dune/perftool/pdelab/localoperator.py b/python/dune/perftool/pdelab/localoperator.py index 271432b5ffcc6ed63136ef2d2b1d258ab3b397bc..74d6b336ac604135eb414b3de968d6b6d9ab2070 100644 --- a/python/dune/perftool/pdelab/localoperator.py +++ b/python/dune/perftool/pdelab/localoperator.py @@ -498,27 +498,24 @@ def extract_kernel_from_cache(tag, wrap_in_cgen=True): name=name, ) + from loopy import make_reduction_inames_unique + kernel = make_reduction_inames_unique(kernel) + # Apply the transformations that were gathered during tree traversals for trafo in transformations: kernel = trafo[0](kernel, *trafo[1]) # Precompute all the substrules - for sr in substrules: - try: - tmpname = "precompute_{}".format(sr.name) - kernel = lp.precompute(kernel, - sr.name, - temporary_name=tmpname, - ) - # Vectorization strategies are actually very likely to eliminate the - # precomputation temporary. To avoid the temporary elimination warning - # we need to explicitly disable it. - kernel = kernel.copy(silenced_warnings=kernel.silenced_warnings + ["temp_to_write({})".format(tmpname)]) - except RunTimeError: - pass - - from loopy import make_reduction_inames_unique - kernel = make_reduction_inames_unique(kernel) + for sr in kernel.substitutions: + tmpname = "precompute_{}".format(sr) + kernel = lp.precompute(kernel, + sr, + temporary_name=tmpname, + ) + # Vectorization strategies are actually very likely to eliminate the + # precomputation temporary. To avoid the temporary elimination warning + # we need to explicitly disable it. + kernel = kernel.copy(silenced_warnings=kernel.silenced_warnings + ["temp_to_write({})".format(tmpname)]) from dune.perftool.loopy import heuristic_duplication kernel = heuristic_duplication(kernel)