From 689c6ee3604ab34197812b13ad3ccefa4ca60418 Mon Sep 17 00:00:00 2001 From: Ruomei Yan Date: Thu, 25 Apr 2019 17:48:41 +0100 Subject: IVGCVSW-2773 Integrate new CL tuner into ArmNN !armnn:1037 Change-Id: Ice9c0fba405859d97aa848daa67c609166f2a8dc Signed-off-by: Ruomei Yan --- DriverOptions.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'DriverOptions.cpp') diff --git a/DriverOptions.cpp b/DriverOptions.cpp index cd4b6bfc..6615e519 100644 --- a/DriverOptions.cpp +++ b/DriverOptions.cpp @@ -32,6 +32,7 @@ DriverOptions::DriverOptions(armnn::Compute computeDevice, bool fp16Enabled) : m_Backends({computeDevice}) , m_VerboseLogging(false) , m_ClTunedParametersMode(armnn::IGpuAccTunedParameters::Mode::UseTunedParameters) + , m_ClTuningLevel(armnn::IGpuAccTunedParameters::TuningLevel::Rapid) , m_EnableGpuProfiling(false) , m_fp16Enabled(fp16Enabled) { @@ -41,6 +42,7 @@ DriverOptions::DriverOptions(const std::vector& backends, bool : m_Backends(backends) , m_VerboseLogging(false) , m_ClTunedParametersMode(armnn::IGpuAccTunedParameters::Mode::UseTunedParameters) + , m_ClTuningLevel(armnn::IGpuAccTunedParameters::TuningLevel::Rapid) , m_EnableGpuProfiling(false) , m_fp16Enabled(fp16Enabled) { @@ -49,6 +51,7 @@ DriverOptions::DriverOptions(const std::vector& backends, bool DriverOptions::DriverOptions(int argc, char** argv) : m_VerboseLogging(false) , m_ClTunedParametersMode(armnn::IGpuAccTunedParameters::Mode::UseTunedParameters) + , m_ClTuningLevel(armnn::IGpuAccTunedParameters::TuningLevel::Rapid) , m_EnableGpuProfiling(false) , m_fp16Enabled(false) { @@ -56,6 +59,7 @@ DriverOptions::DriverOptions(int argc, char** argv) std::string unsupportedOperationsAsString; std::string clTunedParametersModeAsString; + std::string clTuningLevelAsString; po::options_description optionsDesc("Options"); optionsDesc.add_options() @@ -89,6 +93,13 @@ DriverOptions::DriverOptions(int argc, char** argv) "If 'UpdateTunedParameters', will also find the optimum parameters when preparing new networks and update " "the file accordingly.") + ("cl-tuning-level,o", + po::value(&clTuningLevelAsString)->default_value("rapid"), + "exhaustive: all lws values are tested " + "normal: reduced number of lws values but enough to still have the performance really close to the " + "exhaustive approach " + "rapid: only 3 lws values should be tested for each kernel ") + ("gpu-profiling,p", po::bool_switch(&m_EnableGpuProfiling), "Turns GPU profiling on") @@ -166,6 +177,24 @@ DriverOptions::DriverOptions(int argc, char** argv) ALOGW("Requested unknown cl-tuned-parameters-mode '%s'. Defaulting to UseTunedParameters", clTunedParametersModeAsString.c_str()); } + + if (clTuningLevelAsString == "exhaustive") + { + m_ClTuningLevel = armnn::IGpuAccTunedParameters::TuningLevel::Exhaustive; + } + else if (clTuningLevelAsString == "normal") + { + m_ClTuningLevel = armnn::IGpuAccTunedParameters::TuningLevel::Normal; + } + else if (clTuningLevelAsString == "rapid") + { + m_ClTuningLevel = armnn::IGpuAccTunedParameters::TuningLevel::Rapid; + } + else + { + ALOGW("Requested unknown cl-tuner-mode '%s'. Defaulting to rapid", + clTuningLevelAsString.c_str()); + } } } -- cgit v1.2.1