From 06d17e9051668e3376938cf34c908bcb29a6c1a3 Mon Sep 17 00:00:00 2001
From: Christoph Alt <christoph.alt@fau.de>
Date: Tue, 1 Aug 2023 09:20:41 +0200
Subject: [PATCH] make timing an argument for generate benchmark to also allow
 the disabling of the timer from outside

---
 pystencils_benchmark/benchmark.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pystencils_benchmark/benchmark.py b/pystencils_benchmark/benchmark.py
index 0ee2218..df6bd9b 100644
--- a/pystencils_benchmark/benchmark.py
+++ b/pystencils_benchmark/benchmark.py
@@ -23,7 +23,9 @@ def generate_benchmark(kernel_asts: Union[KernelFunction, List[KernelFunction]],
                        path: Path = None,
                        *,
                        compiler: Compiler = Compiler.GCC,
-                       likwid: bool = False) -> None:
+                       timing: bool = True,
+                       likwid: bool = False
+                       ) -> None:
     if path is None:
         path = Path('.')
     else:
@@ -48,7 +50,7 @@ def generate_benchmark(kernel_asts: Union[KernelFunction, List[KernelFunction]],
             f.write(source)
 
     with open(src_path / 'main.c', 'w+') as f:
-        f.write(kernel_main(kernel_asts, likwid=likwid))
+        f.write(kernel_main(kernel_asts, timing=timing, likwid=likwid))
 
     copy_static_files(path)
     compiler_toolchain(path, compiler, likwid)
-- 
GitLab