2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
7 #include "armnn/IRuntime.hpp"
9 #ifdef ARMCOMPUTECL_ENABLED
10 #include <arm_compute/runtime/CL/CLTuner.h>
16 class IGpuAccTunedParameters;
17 class ClTunedParameters;
19 // ARM Compute OpenCL context control.
20 class ClContextControl
24 ClContextControl(IGpuAccTunedParameters* clTunedParameters = nullptr,
25 bool profilingEnabled = false);
27 virtual ~ClContextControl();
29 void LoadOpenClRuntime();
31 // Users should call this (after freeing all of the cl::Context objects they use)
32 // to release the cached memory used by the compute library.
33 void UnloadOpenClRuntime();
35 // Clear the CL cache, without losing the tuned parameter settings.
40 void DoLoadOpenClRuntime(bool useTunedParameters);
42 ClTunedParameters* m_clTunedParameters;
44 bool m_ProfilingEnabled;
47 class ClTunedParameters : public IGpuAccTunedParameters
50 ClTunedParameters(armnn::IGpuAccTunedParameters::Mode mode);
52 virtual void Load(const char* filename);
53 virtual void Save(const char* filename) const;
57 #ifdef ARMCOMPUTECL_ENABLED
58 arm_compute::CLTuner m_Tuner;