From df9fe2a48ab9a9099b6e3f5c1e727999c20fcaa1 Mon Sep 17 00:00:00 2001 From: Dominic Kempf <dominic.r.kempf@gmail.com> Date: Wed, 2 Sep 2015 11:48:49 +0200 Subject: [PATCH] Add an additional cache item type: Includes --- python/dune/perftool/generation.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/dune/perftool/generation.py b/python/dune/perftool/generation.py index ad902b90..6a419da4 100644 --- a/python/dune/perftool/generation.py +++ b/python/dune/perftool/generation.py @@ -63,6 +63,11 @@ class LoopDomainCacheItem(UFL2LoopyCacheItem): self.content = "{{ [{0}] : 0<={0}<{0}_n }}".format(content) self.returnValue = content +class IncludeCacheItem(NoReturnCacheItem): + def __init__(self, content): + NoReturnCacheItem.__init__(self, content) + self.content = "#include<{}>".format(content) + # have one cache the module level. It is easier than handing around an instance of it. _cache = {} @@ -190,3 +195,7 @@ dune_symbol = _dune_decorator_factory(cache_item_type=SymbolCacheItem) temporary_variable = _dune_decorator_factory(cache_item_type=TemporaryVariableCacheItem) loopy_c_instruction = _dune_decorator_factory(cache_item_type=CInstructionCacheItem) loopy_expr_instruction = _dune_decorator_factory(cache_item_type=ExpressionInstructionCacheItem) + +@_dune_decorator_factory(cache_item_type=IncludeCacheItem) +def dune_include(incfile): + return incfile \ No newline at end of file -- GitLab