From bf3b66a83691a27b4ad1f2a6b2040b3a8c564061 Mon Sep 17 00:00:00 2001 From: Liangliang He Date: Tue, 3 Apr 2018 09:36:20 +0800 Subject: [PATCH] Sort benchmark tests --- mace/core/testing/test_benchmark.cc | 5 +++++ tools/sh_commands.py | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/mace/core/testing/test_benchmark.cc b/mace/core/testing/test_benchmark.cc index 5110bed7..0d1b68fe 100644 --- a/mace/core/testing/test_benchmark.cc +++ b/mace/core/testing/test_benchmark.cc @@ -33,6 +33,11 @@ void Benchmark::Run() { Run("all"); } void Benchmark::Run(const char *pattern) { if (!all_benchmarks) return; + std::sort(all_benchmarks->begin(), all_benchmarks->end(), + [](const Benchmark *lhs, const Benchmark *rhs) { + return lhs->name_ < rhs->name_; + }); + if (std::string(pattern) == "all") { pattern = ".*"; } diff --git a/tools/sh_commands.py b/tools/sh_commands.py index fe5bc1ca..0317d191 100644 --- a/tools/sh_commands.py +++ b/tools/sh_commands.py @@ -65,18 +65,21 @@ def adb_run(serialno, host_bin_path, bin_name, device_bin_full_path = "%s/%s" % (device_bin_path, bin_name) device_cl_path = "%s/cl" % device_bin_path props = adb_getprop_by_serialno(serialno) - print("Run on device: %s, %s, %s" % (serialno, props["ro.board.platform"], props["ro.product.model"])) + print("=====================================================================") + print("Run on device: %s, %s, %s" % (serialno, props["ro.board.platform"], + props["ro.product.model"])) sh.adb("-s", serialno, "shell", "rm -rf %s" % device_bin_path) sh.adb("-s", serialno, "shell", "mkdir -p %s" % device_bin_path) sh.adb("-s", serialno, "shell", "mkdir -p %s" % device_cl_path) - print("Push %s to device" % device_bin_full_path) + print("Push %s to %s" % (host_bin_full_path, device_bin_full_path)) sh.adb("-s", serialno, "push", host_bin_full_path, device_bin_path) - print("Run %s on device" % device_bin_full_path) + print("Run %s" % device_bin_full_path) stdout_buff=[] process_output = make_output_processor(stdout_buff) p = sh.adb("-s", serialno, "shell", - "MACE_OPENCL_PROFILING=%d MACE_KERNEL_PATH=%s MACE_CPP_MIN_VLOG_LEVEL=%d %s %s" % (opencl_profiling, device_cl_path, vlog_level, device_bin_full_path, args), - _out=process_output, _bg=True) + "MACE_OPENCL_PROFILING=%d MACE_KERNEL_PATH=%s MACE_CPP_MIN_VLOG_LEVEL=%d %s %s" % + (opencl_profiling, device_cl_path, vlog_level, device_bin_full_path, args), + _out=process_output, _bg=True, _err_to_out=True) p.wait() return "".join(stdout_buff) @@ -102,7 +105,7 @@ def bazel_build(target, strip="always", abi="armeabi-v7a"): "--copt=-O3", "--define", "neon=true", "--define", "openmp=true", - _out=process_output, _bg=True) + _out=process_output, _bg=True, _err_to_out=True) p.wait() return "".join(stdout_buff) @@ -138,7 +141,7 @@ def falcon_tags(platform, model, abi): def falcon_push_metrics(metrics, device_properties, abi): cli = falcon_cli.FalconCli.connect(server="transfer.falcon.miliao.srv", port=8433, - debug=False) + debug=True) platform = device_properties["ro.board.platform"].replace(" ", "-") model = device_properties["ro.product.model"].replace(" ", "-") tags = falcon_tags(platform, model, abi) -- GitLab