ArmNN
NotReleased
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.
15
class
ClContextControl
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
42
class
ClTunedParameters
:
public
IGpuAccTunedParameters
43
{
44
public
:
45
ClTunedParameters
(
armnn::IGpuAccTunedParameters::Mode
mode,
armnn::IGpuAccTunedParameters::TuningLevel
tuningLevel);
46
47
virtual
void
Load(
const
char
* filename);
48
virtual
void
Save(
const
char
* filename)
const
;
49
50
Mode
m_Mode
;
51
TuningLevel
m_TuningLevel
;
52
53
arm_compute::CLTuner
m_Tuner
;
54
};
55
56
}
// namespace armnn
armnn::ClTunedParameters::m_Mode
Mode m_Mode
Definition:
ClContextControl.hpp:50
armnn::ClContextControl::UnloadOpenClRuntime
void UnloadOpenClRuntime()
Definition:
ClContextControl.cpp:95
armnn::ClContextControl::LoadOpenClRuntime
void LoadOpenClRuntime()
Definition:
ClContextControl.cpp:90
IRuntime.hpp
armnn::ClContextControl::ClearClCache
void ClearClCache()
Definition:
ClContextControl.cpp:162
armnn::ClContextControl::~ClContextControl
virtual ~ClContextControl()
Definition:
ClContextControl.cpp:71
armnn::ClContextControl
Definition:
ClContextControl.hpp:15
armnn::IGpuAccTunedParameters
Definition:
IRuntime.hpp:179
armnn::ClTunedParameters::m_Tuner
arm_compute::CLTuner m_Tuner
Definition:
ClContextControl.hpp:53
armnn::IGpuAccTunedParameters::TuningLevel
TuningLevel
Definition:
IRuntime.hpp:188
armnn
Definition:
BackendHelper.hpp:11
armnn::IGpuAccTunedParameters::Mode
Mode
Definition:
IRuntime.hpp:182
armnn::TuningLevel
TuningLevel
Definition:
ClBackendContext.cpp:69
armnn::ClContextControl::ClContextControl
ClContextControl(arm_compute::CLTuner *=nullptr, bool profilingEnabled=false)
Definition:
ClContextControl.cpp:30
armnn::ClTunedParameters::m_TuningLevel
TuningLevel m_TuningLevel
Definition:
ClContextControl.hpp:51
armnn::ClTunedParameters
Definition:
ClContextControl.hpp:42
src
backends
cl
ClContextControl.hpp
Generated on Fri Mar 13 2020 16:06:57 for ArmNN by
1.8.13