ArmNN
 24.02
ClBackendContext.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 
8 #include <unordered_set>
9 #include <mutex>
10 
11 #include <arm_compute/runtime/CL/CLTuner.h>
12 #include <arm_compute/runtime/CL/CLGEMMHeuristicsHandle.h>
13 
14 namespace armnn
15 {
16 
18 {
19 public:
21 
22  bool BeforeLoadNetwork(NetworkId networkId) override;
23  bool AfterLoadNetwork(NetworkId networkId) override;
24 
25  bool BeforeUnloadNetwork(NetworkId networkId) override;
26  bool AfterUnloadNetwork(NetworkId networkId) override;
27 
28  bool AfterEnqueueWorkload(NetworkId networkId) override;
29 
30  ~ClBackendContext() override;
31 
32 private:
33  std::mutex m_Mutex;
34  struct ClContextControlWrapper;
35  std::unique_ptr<ClContextControlWrapper> m_ClContextControlWrapper;
36 
37  std::unordered_set<NetworkId> m_NetworkIds;
38 
39  std::unique_ptr<arm_compute::CLTuner> m_Tuner;
40  std::string m_TuningFile;
41 
42 protected:
43  arm_compute::CLGEMMHeuristicsHandle m_MLGOTuner;
44  std::string m_MLGOTuningFile;
45 };
46 
47 } // namespace armnn
armnn::ClBackendContext::AfterUnloadNetwork
bool AfterUnloadNetwork(NetworkId networkId) override
Definition: ClBackendContext.cpp:197
armnn::ClBackendContext::AfterEnqueueWorkload
bool AfterEnqueueWorkload(NetworkId networkId) override
Definition: ClBackendContext.cpp:214
armnn::ClBackendContext::~ClBackendContext
~ClBackendContext() override
Definition: ClBackendContext.cpp:219
armnn::ClBackendContext::m_MLGOTuningFile
std::string m_MLGOTuningFile
Definition: ClBackendContext.hpp:44
armnn::NetworkId
int NetworkId
Definition: IRuntime.hpp:35
IBackendContext.hpp
armnn::IBackendContext
Definition: IBackendContext.hpp:14
armnn::ClBackendContext::BeforeUnloadNetwork
bool BeforeUnloadNetwork(NetworkId networkId) override
Before and after Unload network events.
Definition: ClBackendContext.cpp:192
armnn::ClBackendContext::m_MLGOTuner
arm_compute::CLGEMMHeuristicsHandle m_MLGOTuner
Definition: ClBackendContext.hpp:43
armnn::IRuntime::CreationOptions
Definition: IRuntime.hpp:78
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::ClBackendContext::ClBackendContext
ClBackendContext(const IRuntime::CreationOptions &options)
Definition: ClBackendContext.cpp:62
armnn::ClBackendContext::AfterLoadNetwork
bool AfterLoadNetwork(NetworkId networkId) override
Definition: ClBackendContext.cpp:183
armnn::ClBackendContext
Definition: ClBackendContext.hpp:17
armnn::ClBackendContext::BeforeLoadNetwork
bool BeforeLoadNetwork(NetworkId networkId) override
Before and after Load network events.
Definition: ClBackendContext.cpp:178