diff --git a/loopy/auto_test.py b/loopy/auto_test.py index 92c01addb27dd232fd41f40048cb15d5510d765a..66b3cb0bde00dee3ae46fcf63052219cc3664360 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 89b4f5e639a031d3f2d4d89b470d2ccf5fb4b848..231b70bf71d865e5b9832332c90f3228a0a26b82 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