From 430c51879669a88868c4a1e825078a6894a234ff Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Tue, 8 Sep 2015 22:46:06 -0500 Subject: [PATCH] Make auto_test more flexible regarding not running the ref check --- loopy/auto_test.py | 12 +++++++++--- loopy/diff.py | 2 -- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/loopy/auto_test.py b/loopy/auto_test.py index e5f88417d..fd4e56213 100644 --- a/loopy/auto_test.py +++ b/loopy/auto_test.py @@ -350,7 +350,7 @@ def _enumerate_cl_devices_for_ref_test(): # {{{ main automatic testing entrypoint def auto_test_vs_ref( - ref_knl, ctx, test_knl, op_count=[], op_label=[], parameters={}, + ref_knl, ctx, test_knl=None, op_count=[], op_label=[], parameters={}, print_ref_code=False, print_code=True, warmup_rounds=2, dump_binary=False, fills_entire_output=None, do_check=True, check_result=None, @@ -367,6 +367,10 @@ def auto_test_vs_ref( import pyopencl as cl + if test_knl is None: + test_knl = ref_knl + do_check = False + if len(ref_knl.args) != len(test_knl.args): raise LoopyError("ref_knl and test_knl do not have the same number " "of arguments") @@ -647,8 +651,10 @@ def auto_test_vs_ref( result_dict["elapsed_event_marker"] = elapsed_event_marker result_dict["elapsed_wall"] = elapsed_wall result_dict["timing_rounds"] = timing_rounds - result_dict["ref_elapsed_event"] = ref_elapsed_event - result_dict["ref_elapsed_wall"] = ref_elapsed_wall + + if do_check: + result_dict["ref_elapsed_event"] = ref_elapsed_event + result_dict["ref_elapsed_wall"] = ref_elapsed_wall return result_dict diff --git a/loopy/diff.py b/loopy/diff.py index d72465e6f..df03e16c7 100644 --- a/loopy/diff.py +++ b/loopy/diff.py @@ -343,8 +343,6 @@ class DifferentiationContext(object): return new_var_name - # }}} - # }}} -- GitLab