From 74ba3dc7113e51cf11ab772ee1eb030c07a7dda5 Mon Sep 17 00:00:00 2001 From: Aron Virginas-Tar Date: Thu, 15 Nov 2018 17:44:36 +0000 Subject: IVGCVSW-2156: Remove conditional compilation directives from ClContextControl Change-Id: I812d09a869fe7c45ce71108fb675f3e2d974e2d9 --- src/backends/cl/CMakeLists.txt | 2 -- src/backends/cl/ClContextControl.cpp | 20 +++----------------- src/backends/cl/ClContextControl.hpp | 4 ---- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/backends/cl/CMakeLists.txt b/src/backends/cl/CMakeLists.txt index 7593f098da..4d08deddef 100644 --- a/src/backends/cl/CMakeLists.txt +++ b/src/backends/cl/CMakeLists.txt @@ -30,8 +30,6 @@ if(ARMCOMPUTECL) else() list(APPEND armnnClBackend_sources ClBackendId.hpp - ClContextControl.cpp - ClContextControl.hpp ClLayerSupport.cpp ClLayerSupport.hpp ) diff --git a/src/backends/cl/ClContextControl.cpp b/src/backends/cl/ClContextControl.cpp index e8b21c942d..ac0b8c8572 100644 --- a/src/backends/cl/ClContextControl.cpp +++ b/src/backends/cl/ClContextControl.cpp @@ -5,12 +5,12 @@ #include "ClContextControl.hpp" -#include "armnn/Exceptions.hpp" +#include + +#include -#ifdef ARMCOMPUTECL_ENABLED #include #include -#endif #include #include @@ -18,8 +18,6 @@ #include #include -#include "LeakChecking.hpp" - namespace cl { class Context; @@ -38,7 +36,6 @@ ClContextControl::ClContextControl(IGpuAccTunedParameters* clTunedParameters, // Ignore m_ProfilingEnabled if unused to avoid compiling problems when ArmCompute is disabled. boost::ignore_unused(m_ProfilingEnabled); -#ifdef ARMCOMPUTECL_ENABLED try { std::vector platforms; @@ -70,12 +67,10 @@ ClContextControl::ClContextControl(IGpuAccTunedParameters* clTunedParameters, // Always load the OpenCL runtime. LoadOpenClRuntime(); -#endif } ClContextControl::~ClContextControl() { -#ifdef ARMCOMPUTECL_ENABLED // Load the OpencCL runtime without the tuned parameters to free the memory for them. try { @@ -91,7 +86,6 @@ ClContextControl::~ClContextControl() std::cerr << "A CL error occurred unloading the runtime tuner parameters: " << clError.what() << ". CL error code is: " << clError.err() << std::endl; } -#endif } void ClContextControl::LoadOpenClRuntime() @@ -106,7 +100,6 @@ void ClContextControl::UnloadOpenClRuntime() void ClContextControl::DoLoadOpenClRuntime(bool useTunedParameters) { -#ifdef ARMCOMPUTECL_ENABLED cl::Device device = cl::Device::getDefault(); cl::Context context; cl::CommandQueue commandQueue; @@ -171,7 +164,6 @@ void ClContextControl::DoLoadOpenClRuntime(bool useTunedParameters) tuner = &m_clTunedParameters->m_Tuner; } arm_compute::CLScheduler::get().init(context, commandQueue, device, tuner); -#endif } void ClContextControl::ClearClCache() @@ -196,15 +188,12 @@ void IGpuAccTunedParameters::Destroy(IGpuAccTunedParameters* params) ClTunedParameters::ClTunedParameters(armnn::IGpuAccTunedParameters::Mode mode) : m_Mode(mode) -#ifdef ARMCOMPUTECL_ENABLED , m_Tuner(mode == ClTunedParameters::Mode::UpdateTunedParameters) -#endif { } void ClTunedParameters::Load(const char* filename) { -#ifdef ARMCOMPUTECL_ENABLED try { m_Tuner.load_from_file(filename); @@ -214,12 +203,10 @@ void ClTunedParameters::Load(const char* filename) throw armnn::Exception(std::string("Failed to load tuned parameters file '") + filename + "': " + e.what()); } -#endif } void ClTunedParameters::Save(const char* filename) const { -#ifdef ARMCOMPUTECL_ENABLED try { m_Tuner.save_to_file(filename); @@ -229,7 +216,6 @@ void ClTunedParameters::Save(const char* filename) const throw armnn::Exception(std::string("Failed to save tuned parameters file to '") + filename + "': " + e.what()); } -#endif } } // namespace armnn diff --git a/src/backends/cl/ClContextControl.hpp b/src/backends/cl/ClContextControl.hpp index 5ac56423bd..8575329023 100644 --- a/src/backends/cl/ClContextControl.hpp +++ b/src/backends/cl/ClContextControl.hpp @@ -6,9 +6,7 @@ #include "armnn/IRuntime.hpp" -#ifdef ARMCOMPUTECL_ENABLED #include -#endif namespace armnn { @@ -54,9 +52,7 @@ public: Mode m_Mode; -#ifdef ARMCOMPUTECL_ENABLED arm_compute::CLTuner m_Tuner; -#endif }; } // namespace armnn -- cgit v1.2.1