From 943a40ba3d91da0165fa35bfc8dee4b070f7940a Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Thu, 12 Jul 2018 18:03:54 +0100 Subject: COMPMID-1397: Add option to enable CLTuner in arm_compute_benchmark Change-Id: Iee062e674e7a20b4786d738d4535e4c89fbbf42e Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/139800 Reviewed-by: Georgios Pinitas Tested-by: Jenkins --- tests/main.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'tests/main.cpp') diff --git a/tests/main.cpp b/tests/main.cpp index ae9a47e1d4..596838927a 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -36,6 +36,7 @@ #ifdef ARM_COMPUTE_CL #include "arm_compute/runtime/CL/CLScheduler.h" +#include "arm_compute/runtime/CL/CLTuner.h" #endif /* ARM_COMPUTE_CL */ #ifdef ARM_COMPUTE_GC #include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" @@ -63,7 +64,8 @@ std::unique_ptr library; int main(int argc, char **argv) { #ifdef ARM_COMPUTE_CL - CLScheduler::get().default_init(); + CLTuner cl_tuner(false); + CLScheduler::get().default_init(&cl_tuner); #endif /* ARM_COMPUTE_CL */ #ifdef ARM_COMPUTE_GC @@ -101,6 +103,10 @@ int main(int argc, char **argv) error_on_missing_assets->set_help("Mark a test as failed instead of skipping it when assets are missing"); auto assets = parser.add_positional_option>("assets"); assets->set_help("Path to the assets directory"); +#ifdef ARM_COMPUTE_CL + auto enable_tuner = parser.add_option("enable-tuner"); + enable_tuner->set_help("Enable OpenCL dynamic tuner"); +#endif /* ARM_COMPUTE_CL */ try { @@ -115,7 +121,12 @@ int main(int argc, char **argv) std::vector> printers = options.create_printers(); Scheduler::get().set_num_threads(options.threads->value()); - +#ifdef ARM_COMPUTE_CL + if(enable_tuner->is_set()) + { + cl_tuner.set_tune_new_kernels(enable_tuner->value()); + } +#endif /* ARM_COMPUTE_CL */ if(options.log_level->value() > framework::LogLevel::NONE) { for(auto &p : printers) -- cgit v1.2.1