From 99691a29357d11dc115e2b152e315b2d193bd122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20He=C3=9F?= <rene.hess@iwr.uni-heidelberg.de> Date: Tue, 16 Apr 2019 15:16:46 +0200 Subject: [PATCH] [skip ci] Remove Opcounter from signature for autotuning --- python/dune/codegen/sumfact/autotune.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/dune/codegen/sumfact/autotune.py b/python/dune/codegen/sumfact/autotune.py index c77d8f0e..addeabcc 100644 --- a/python/dune/codegen/sumfact/autotune.py +++ b/python/dune/codegen/sumfact/autotune.py @@ -311,6 +311,13 @@ def generate_standalone_kernel_code(kernel, signature, filename, transformations opcounting = get_option("opcounter") set_option("opcounter", False) + # Remove opcounter from signature + p = re.compile('OpCounter::OpCounter<([^>]*)>') + assert len(signature) == 1 + sig = signature[0] + sig = p.sub(r'\1', sig) + assert 'OpCounter' not in signature + with open(filename, 'w') as f: if transformations: f.write('// Transformations:\n') @@ -330,8 +337,6 @@ def generate_standalone_kernel_code(kernel, signature, filename, transformations f.write("\n".join(headers)) # Get a list of the function argument names - assert len(signature) == 1 - sig = signature[0] arguments = sig[sig.find('(') + 1:sig.find(')')].split(',') arguments = [a.split(' ')[-1] for a in arguments] @@ -425,7 +430,6 @@ def generate_standalone_kernel_code(kernel, signature, filename, transformations set_option("opcounter", opcounting) - def autotune_realization(sf=None, kernel=None, signature=None, transformations=None): """Generate an microbenchmark, compile run and return time -- GitLab