From 0cd9ff2c8fc53b1edb6c6f5cb19efb37d718501d Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 1 Jul 2019 20:42:19 +0200 Subject: [PATCH] Support zero warm-up rounds in auto_test (Closes #179) --- loopy/auto_test.py | 2 +- test/test_loopy.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/loopy/auto_test.py b/loopy/auto_test.py index 92c01addb..66b3cb0bd 100644 --- a/loopy/auto_test.py +++ b/loopy/auto_test.py @@ -615,7 +615,7 @@ def auto_test_vs_ref( logger.info("%s: timing run" % (knl.name)) - timing_rounds = warmup_rounds + timing_rounds = max(warmup_rounds, 1) while True: from time import time diff --git a/test/test_loopy.py b/test/test_loopy.py index 89b4f5e63..231b70bf7 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -953,6 +953,23 @@ def test_auto_test_can_detect_problems(ctx_factory): parameters=dict(n=123)) +def test_auto_test_zero_warmup_rounds(ctx_factory): + ctx = ctx_factory() + + ref_knl = lp.make_kernel( + "{[i,j]: 0<=i,j