ArmNN
 24.08
ClContextControl.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017, 2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
8 
9 namespace armnn
10 {
11 
12 // ARM Compute OpenCL context control.
14 {
15 public:
16 
17  ClContextControl(arm_compute::CLTuner* = nullptr,
18  arm_compute::CLGEMMHeuristicsHandle* = nullptr,
19  bool profilingEnabled = false);
20 
21  virtual ~ClContextControl();
22 
23  void LoadOpenClRuntime();
24 
25  // Users should call this (after freeing all of the cl::Context objects they use)
26  // to release the cached memory used by the compute library.
27  void UnloadOpenClRuntime();
28 
29  // Clear the CL cache, without losing the tuned parameter settings.
30  void ClearClCache();
31 
32 private:
33 
34  void DoLoadOpenClRuntime(bool updateTunedParameters);
35 
36  arm_compute::CLTuner* m_Tuner;
37  arm_compute::CLGEMMHeuristicsHandle* m_HeuristicsHandle;
38 
39  bool m_ProfilingEnabled;
40 };
41 
42 } // namespace armnn
armnn::ClContextControl::ClContextControl
ClContextControl(arm_compute::CLTuner *=nullptr, arm_compute::CLGEMMHeuristicsHandle *=nullptr, bool profilingEnabled=false)
Definition: ClContextControl.cpp:27
armnn::ClContextControl::UnloadOpenClRuntime
void UnloadOpenClRuntime()
Definition: ClContextControl.cpp:89
armnn::ClContextControl
Definition: ClContextControl.hpp:13
armnn::ClContextControl::LoadOpenClRuntime
void LoadOpenClRuntime()
Definition: ClContextControl.cpp:84
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::ClContextControl::ClearClCache
void ClearClCache()
Definition: ClContextControl.cpp:156
armnn::ClContextControl::~ClContextControl
virtual ~ClContextControl()
Definition: ClContextControl.cpp:65
ArmComputeTuningUtils.hpp