ArmNN
 20.11
ClContextControl.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include "armnn/IRuntime.hpp"
8 
9 #include <arm_compute/runtime/CL/CLTuner.h>
10 
11 namespace armnn
12 {
13 
14 // ARM Compute OpenCL context control.
16 {
17 public:
18 
19  ClContextControl(arm_compute::CLTuner* = nullptr,
20  bool profilingEnabled = false);
21 
22  virtual ~ClContextControl();
23 
24  void LoadOpenClRuntime();
25 
26  // Users should call this (after freeing all of the cl::Context objects they use)
27  // to release the cached memory used by the compute library.
28  void UnloadOpenClRuntime();
29 
30  // Clear the CL cache, without losing the tuned parameter settings.
31  void ClearClCache();
32 
33 private:
34 
35  void DoLoadOpenClRuntime(bool updateTunedParameters);
36 
37  arm_compute::CLTuner* m_Tuner;
38 
39  bool m_ProfilingEnabled;
40 };
41 
43 {
44 public:
46 
47  virtual void Load(const char* filename);
48  virtual void Save(const char* filename) const;
49 
52 
53  arm_compute::CLTuner m_Tuner;
54 };
55 
56 } // namespace armnn
ClContextControl(arm_compute::CLTuner *=nullptr, bool profilingEnabled=false)
Copyright (c) 2020 ARM Limited.
arm_compute::CLTuner m_Tuner
Manages a set of GpuAcc parameters which have been tuned for maximum performance. ...
Definition: IRuntime.hpp:190