22.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
#include <arm_compute/runtime/CL/CLGEMMHeuristicsHandle.h>
11
12
namespace
armnn
13
{
14
15
// ARM Compute OpenCL context control.
16
class
ClContextControl
17
{
18
public
:
19
20
ClContextControl
(arm_compute::CLTuner* =
nullptr
,
21
arm_compute::CLGEMMHeuristicsHandle* =
nullptr
,
22
bool
profilingEnabled =
false
);
23
24
virtual
~ClContextControl
();
25
26
void
LoadOpenClRuntime
();
27
28
// Users should call this (after freeing all of the cl::Context objects they use)
29
// to release the cached memory used by the compute library.
30
void
UnloadOpenClRuntime
();
31
32
// Clear the CL cache, without losing the tuned parameter settings.
33
void
ClearClCache
();
34
35
private
:
36
37
void
DoLoadOpenClRuntime(
bool
updateTunedParameters);
38
39
arm_compute::CLTuner* m_Tuner;
40
arm_compute::CLGEMMHeuristicsHandle* m_HeuristicsHandle;
41
42
bool
m_ProfilingEnabled;
43
};
44
45
class
ClTunedParameters
:
public
IGpuAccTunedParameters
46
{
47
public
:
48
ClTunedParameters
(
armnn::IGpuAccTunedParameters::Mode
mode,
armnn::IGpuAccTunedParameters::TuningLevel
tuningLevel);
49
50
virtual
void
Load(
const
char
* filename);
51
virtual
void
Save(
const
char
* filename)
const
;
52
53
Mode
m_Mode
;
54
TuningLevel
m_TuningLevel
;
55
56
arm_compute::CLTuner
m_Tuner
;
57
arm_compute::CLGEMMHeuristicsHandle
m_HeuristicsHandle
;
58
};
59
60
}
// namespace armnn
armnn::ClContextControl
Definition:
ClContextControl.hpp:16
armnn::ClContextControl::ClContextControl
ClContextControl(arm_compute::CLTuner *=nullptr, arm_compute::CLGEMMHeuristicsHandle *=nullptr, bool profilingEnabled=false)
Definition:
ClContextControl.cpp:30
IRuntime.hpp
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition:
01_00_quick_start.dox:6
armnn::IGpuAccTunedParameters::Mode
Mode
Definition:
IRuntime.hpp:323
armnn::ClContextControl::ClearClCache
void ClearClCache()
Definition:
ClContextControl.cpp:164
armnn::TuningLevel
TuningLevel
Definition:
ClBackendContext.cpp:70
armnn::IGpuAccTunedParameters::TuningLevel
TuningLevel
Definition:
IRuntime.hpp:329
armnn::ClContextControl::~ClContextControl
virtual ~ClContextControl()
Definition:
ClContextControl.cpp:73
armnn::ClTunedParameters
Definition:
ClContextControl.hpp:45
armnn::ClTunedParameters::m_Tuner
arm_compute::CLTuner m_Tuner
Definition:
ClContextControl.hpp:56
armnn::IGpuAccTunedParameters
Manages a set of GpuAcc parameters which have been tuned for maximum performance. ...
Definition:
IRuntime.hpp:320
armnn::ClContextControl::LoadOpenClRuntime
void LoadOpenClRuntime()
Definition:
ClContextControl.cpp:92
armnn::ClTunedParameters::m_HeuristicsHandle
arm_compute::CLGEMMHeuristicsHandle m_HeuristicsHandle
Definition:
ClContextControl.hpp:57
armnn::ClTunedParameters::m_TuningLevel
TuningLevel m_TuningLevel
Definition:
ClContextControl.hpp:54
armnn::ClContextControl::UnloadOpenClRuntime
void UnloadOpenClRuntime()
Definition:
ClContextControl.cpp:97
armnn::ClTunedParameters::m_Mode
Mode m_Mode
Definition:
ClContextControl.hpp:53
src
backends
cl
ClContextControl.hpp
Generated on Wed Nov 23 2022 10:57:38 for ArmNN by
1.8.13