From a8a1c4872ff7e127190a6508f3151f6996e35bc3 Mon Sep 17 00:00:00 2001 From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de> Date: Fri, 21 Oct 2016 18:37:14 +0200 Subject: [PATCH] Silence warning about temporary not being written It is a memory reinterpretation --- python/dune/perftool/generation/__init__.py | 1 + python/dune/perftool/generation/loopy.py | 1 + python/dune/perftool/pdelab/localoperator.py | 2 ++ python/dune/perftool/sumfact/sumfact.py | 5 +++++ 4 files changed, 9 insertions(+) diff --git a/python/dune/perftool/generation/__init__.py b/python/dune/perftool/generation/__init__.py index 758602a9..40d92670 100644 --- a/python/dune/perftool/generation/__init__.py +++ b/python/dune/perftool/generation/__init__.py @@ -33,6 +33,7 @@ from dune.perftool.generation.loopy import (constantarg, iname, instruction, pymbolic_expr, + silenced_warning, temporary_variable, valuearg, ) diff --git a/python/dune/perftool/generation/loopy.py b/python/dune/perftool/generation/loopy.py index 2e0cd5fb..0fbbfbfc 100644 --- a/python/dune/perftool/generation/loopy.py +++ b/python/dune/perftool/generation/loopy.py @@ -13,6 +13,7 @@ import numpy iname = generator_factory(item_tags=("iname",)) pymbolic_expr = generator_factory(item_tags=("kernel", "pymbolic")) function_mangler = generator_factory(item_tags=("mangler",)) +silenced_warning = generator_factory(item_tags=("silenced_warning",), no_deco=True) @generator_factory(item_tags=("argument", "globalarg"), diff --git a/python/dune/perftool/pdelab/localoperator.py b/python/dune/perftool/pdelab/localoperator.py index 702e8ff9..3fbb2595 100644 --- a/python/dune/perftool/pdelab/localoperator.py +++ b/python/dune/perftool/pdelab/localoperator.py @@ -470,6 +470,7 @@ def generate_kernel(integrals): temporaries = {i.name: i for i in retrieve_cache_items("temporary")} arguments = [i for i in retrieve_cache_items("argument")] manglers = retrieve_cache_functions("mangler") + silenced = [l for l in retrieve_cache_items("silenced_warning")] # Construct an options object from loopy import Options @@ -484,6 +485,7 @@ def generate_kernel(integrals): function_manglers=manglers, target=DuneTarget(), options=opt, + silenced_warnings=silenced, ) from loopy import make_reduction_inames_unique diff --git a/python/dune/perftool/sumfact/sumfact.py b/python/dune/perftool/sumfact/sumfact.py index 6345a029..8585f153 100644 --- a/python/dune/perftool/sumfact/sumfact.py +++ b/python/dune/perftool/sumfact/sumfact.py @@ -2,6 +2,7 @@ from dune.perftool.generation import (domain, get_counter, iname, instruction, + silenced_warning, ) from dune.perftool.loopy.buffer import (get_buffer_temporary, initialize_buffer, @@ -53,6 +54,7 @@ def start_sumfactorization(): inp = get_buffer_temporary("buffer", shape=shape, dim_tags="f,f") + silenced_warning('read_no_write({})'.format(inp)) return sum_factorization_kernel(a_matrices, inp, "buffer") @@ -83,6 +85,9 @@ def sum_factorization_kernel(a_matrices, inp, buffer): shape=inp_shape, dim_tags="f,f") + # The input temporary will only be read from, so we need to silence the loopy warning + silenced_warning('read_no_write({})'.format(inp)) + switch_base_storage(buffer) # Get a temporary that interprets the base storage of the output -- GitLab