aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2018-11-15 17:44:36 +0000
committerAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2018-11-15 17:44:36 +0000
commit74ba3dc7113e51cf11ab772ee1eb030c07a7dda5 (patch)
tree15c82dc2866e26b47e829f0cdd7447d296210373
parent310c2091f72e2c43e9f71845867b7550ea1373dc (diff)
downloadarmnn-74ba3dc7113e51cf11ab772ee1eb030c07a7dda5.tar.gz
IVGCVSW-2156: Remove conditional compilation directives from ClContextControl
Change-Id: I812d09a869fe7c45ce71108fb675f3e2d974e2d9
-rw-r--r--src/backends/cl/CMakeLists.txt2
-rw-r--r--src/backends/cl/ClContextControl.cpp20
-rw-r--r--src/backends/cl/ClContextControl.hpp4
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 <armnn/Exceptions.hpp>
+
+#include <LeakChecking.hpp>
-#ifdef ARMCOMPUTECL_ENABLED
#include <arm_compute/core/CL/CLKernelLibrary.h>
#include <arm_compute/runtime/CL/CLScheduler.h>
-#endif
#include <boost/assert.hpp>
#include <boost/format.hpp>
@@ -18,8 +18,6 @@
#include <boost/polymorphic_cast.hpp>
#include <boost/core/ignore_unused.hpp>
-#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<cl::Platform> 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 <arm_compute/runtime/CL/CLTuner.h>
-#endif
namespace armnn
{
@@ -54,9 +52,7 @@ public:
Mode m_Mode;
-#ifdef ARMCOMPUTECL_ENABLED
arm_compute::CLTuner m_Tuner;
-#endif
};
} // namespace armnn