From 9452233e0322c4d2801dfedb5194acf7ff6d6af2 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Fri, 13 Jul 2018 09:26:51 +0100 Subject: COMPMID-1398: Removed --threads from CommonOptions Otherwise --threads appear twice for benchmark_graph_* tests Change-Id: I4f5454f6a2fda2558386290583a0ab84cd4666bb Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/139827 Tested-by: Jenkins Reviewed-by: Pablo Tello --- tests/benchmark_examples/RunExample.cpp | 4 ---- tests/framework/command_line/CommonOptions.cpp | 2 -- tests/framework/command_line/CommonOptions.h | 1 - tests/main.cpp | 6 ++++-- tests/validate_examples/RunExample.cpp | 3 --- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/benchmark_examples/RunExample.cpp b/tests/benchmark_examples/RunExample.cpp index 81c879ff2d..de3e796d59 100644 --- a/tests/benchmark_examples/RunExample.cpp +++ b/tests/benchmark_examples/RunExample.cpp @@ -106,9 +106,6 @@ int run_example(int argc, char **argv, std::unique_ptr example) g_example_argv.emplace_back(const_cast(arg.c_str())); // NOLINT } - // Set number of threads in Scheduler - Scheduler::get().set_num_threads(options.threads->value()); - if(options.log_level->value() > framework::LogLevel::NONE) { for(auto &p : printers) @@ -137,7 +134,6 @@ int run_example(int argc, char **argv, std::unique_ptr example) } #endif /* ARM_COMPUTE_CL */ p->print_entry("Iterations", support::cpp11::to_string(options.iterations->value())); - p->print_entry("Threads", support::cpp11::to_string(options.threads->value())); } } diff --git a/tests/framework/command_line/CommonOptions.cpp b/tests/framework/command_line/CommonOptions.cpp index f1c140e6fe..fee18f6386 100644 --- a/tests/framework/command_line/CommonOptions.cpp +++ b/tests/framework/command_line/CommonOptions.cpp @@ -39,7 +39,6 @@ CommonOptions::CommonOptions(CommandLineParser &parser) : help(parser.add_option("help")), instruments(), iterations(parser.add_option>("iterations", 1)), - threads(parser.add_option>("threads", 1)), log_format(), log_file(parser.add_option>("log-file")), log_level(), @@ -87,7 +86,6 @@ CommonOptions::CommonOptions(CommandLineParser &parser) help->set_help("Show this help message"); instruments->set_help("Set the profiling instruments to use"); iterations->set_help("Number of iterations per test case"); - threads->set_help("Number of threads to use"); log_format->set_help("Output format for measurements and failures (affects only log-file)"); log_file->set_help("Write output to file instead of to the console (affected by log-format)"); log_level->set_help("Verbosity of the output"); diff --git a/tests/framework/command_line/CommonOptions.h b/tests/framework/command_line/CommonOptions.h index b29c1d8dd5..f4646a0299 100644 --- a/tests/framework/command_line/CommonOptions.h +++ b/tests/framework/command_line/CommonOptions.h @@ -74,7 +74,6 @@ public: arm_compute::utils::ToggleOption *help; /**< Show help option */ arm_compute::utils::EnumListOption *instruments; /**< Instruments option */ arm_compute::utils::SimpleOption *iterations; /**< Number of iterations option */ - arm_compute::utils::SimpleOption *threads; /**< Number of threads option */ arm_compute::utils::EnumOption *log_format; /**< Log format option */ arm_compute::utils::SimpleOption *log_file; /**< Log file option */ arm_compute::utils::EnumOption *log_level; /**< Logging level option */ diff --git a/tests/main.cpp b/tests/main.cpp index 596838927a..2da6804c60 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -107,6 +107,8 @@ int main(int argc, char **argv) auto enable_tuner = parser.add_option("enable-tuner"); enable_tuner->set_help("Enable OpenCL dynamic tuner"); #endif /* ARM_COMPUTE_CL */ + auto threads = parser.add_option>("threads", 1); + threads->set_help("Number of threads to use"); try { @@ -120,7 +122,7 @@ int main(int argc, char **argv) std::vector> printers = options.create_printers(); - Scheduler::get().set_num_threads(options.threads->value()); + Scheduler::get().set_num_threads(threads->value()); #ifdef ARM_COMPUTE_CL if(enable_tuner->is_set()) { @@ -152,7 +154,7 @@ int main(int argc, char **argv) } #endif /* ARM_COMPUTE_CL */ p->print_entry("Iterations", support::cpp11::to_string(options.iterations->value())); - p->print_entry("Threads", support::cpp11::to_string(options.threads->value())); + p->print_entry("Threads", support::cpp11::to_string(threads->value())); { using support::cpp11::to_string; p->print_entry("Dataset mode", to_string(dataset_mode->value())); diff --git a/tests/validate_examples/RunExample.cpp b/tests/validate_examples/RunExample.cpp index d842c5bd6f..9ce41c2768 100644 --- a/tests/validate_examples/RunExample.cpp +++ b/tests/validate_examples/RunExample.cpp @@ -124,8 +124,6 @@ int run_example(int argc, char **argv, std::unique_ptr example) g_example_argv.emplace_back(const_cast(arg.c_str())); // NOLINT } - // Set number of threads in Scheduler - Scheduler::get().set_num_threads(options.threads->value()); library = support::cpp14::make_unique("." /* Only using random values */, seed->value()); if(options.log_level->value() > framework::LogLevel::NONE) @@ -157,7 +155,6 @@ int run_example(int argc, char **argv, std::unique_ptr example) } #endif /* ARM_COMPUTE_CL */ p->print_entry("Iterations", support::cpp11::to_string(options.iterations->value())); - p->print_entry("Threads", support::cpp11::to_string(options.threads->value())); g_example->print_parameters(*p); } } -- cgit v1.2.1