From 050471e40fc58cb5ea745701a43ec5b2b9586b81 Mon Sep 17 00:00:00 2001 From: Vidhya Sudhan Loganathan Date: Thu, 25 Apr 2019 09:27:24 +0100 Subject: COMPMID-1974 : Extend CLTuner to support different of level of tuning Change-Id: I52e4a00a25e7f7a17050038cee7c30e508553722 Signed-off-by: Vidhya Sudhan Loganathan Reviewed-on: https://review.mlplatform.org/c/977 Comments-Addressed: Pablo Marquez Reviewed-by: Gian Marco Iodice Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins --- arm_compute/runtime/CL/CLTuner.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'arm_compute/runtime/CL/CLTuner.h') diff --git a/arm_compute/runtime/CL/CLTuner.h b/arm_compute/runtime/CL/CLTuner.h index ee83f6933c..3f3df5f236 100644 --- a/arm_compute/runtime/CL/CLTuner.h +++ b/arm_compute/runtime/CL/CLTuner.h @@ -25,6 +25,7 @@ #define __ARM_COMPUTE_CLTUNER_H__ #include "arm_compute/core/CL/OpenCL.h" +#include "arm_compute/runtime/CL/CLTunerTypes.h" #include "arm_compute/runtime/CL/ICLTuner.h" #include @@ -57,12 +58,26 @@ public: * @return True if tuning of new kernels is enabled. */ bool tune_new_kernels() const; + + /** Set OpenCL tuner mode + * + * @param[in] mode Indicates how exhaustive the search for the optimal LWS should be while tuning. Default is Exhaustive mode + */ + void set_tuner_mode(CLTunerMode mode); + + /** Get the current OpenCL tuner mode + * + * @return tuner_mode Indicates how exhaustive the search for the optimal LWS should be while tuning + */ + CLTunerMode get_tuner_mode() const; + /** Manually add a LWS for a kernel * * @param[in] kernel_id Unique identifiant of the kernel * @param[in] optimal_lws Optimal local workgroup size to use for the given kernel */ void add_lws_to_table(const std::string &kernel_id, cl::NDRange optimal_lws); + /** Import LWS table * * @param[in] lws_table The unordered_map container to import @@ -118,8 +133,9 @@ private: cl::NDRange find_optimal_lws(ICLKernel &kernel); std::unordered_map _lws_table; - cl::Event _kernel_event; - bool _tune_new_kernels; + cl::Event _kernel_event; + bool _tune_new_kernels; + CLTunerMode _tuner_mode; }; } // namespace arm_compute #endif /*__ARM_COMPUTE_CLTUNER_H__ */ -- cgit v1.2.1