ArmNN
 24.02
GpuFsaBackendContext.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2023 Arm Ltd and Contributors. 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  ~GpuFsaBackendContext() override;
31 
32 private:
33  std::mutex m_Mutex;
34  struct GpuFsaContextControlWrapper;
35  std::unique_ptr<GpuFsaContextControlWrapper> m_GpuFsaContextControlWrapper;
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::GpuFsaBackendContext::GpuFsaBackendContext
GpuFsaBackendContext(const IRuntime::CreationOptions &options)
Definition: GpuFsaBackendContext.cpp:61
armnn::GpuFsaBackendContext::BeforeLoadNetwork
bool BeforeLoadNetwork(NetworkId networkId) override
Before and after Load network events.
Definition: GpuFsaBackendContext.cpp:177
armnn::NetworkId
int NetworkId
Definition: IRuntime.hpp:35
armnn::GpuFsaBackendContext::BeforeUnloadNetwork
bool BeforeUnloadNetwork(NetworkId networkId) override
Before and after Unload network events.
Definition: GpuFsaBackendContext.cpp:191
armnn::GpuFsaBackendContext::AfterLoadNetwork
bool AfterLoadNetwork(NetworkId networkId) override
Definition: GpuFsaBackendContext.cpp:182
IBackendContext.hpp
armnn::GpuFsaBackendContext::AfterUnloadNetwork
bool AfterUnloadNetwork(NetworkId networkId) override
Definition: GpuFsaBackendContext.cpp:196
armnn::GpuFsaBackendContext::~GpuFsaBackendContext
~GpuFsaBackendContext() override
Definition: GpuFsaBackendContext.cpp:218
armnn::IBackendContext
Definition: IBackendContext.hpp:14
armnn::IRuntime::CreationOptions
Definition: IRuntime.hpp:78
armnn::GpuFsaBackendContext::AfterEnqueueWorkload
bool AfterEnqueueWorkload(NetworkId networkId) override
Definition: GpuFsaBackendContext.cpp:213
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::GpuFsaBackendContext::m_MLGOTuner
arm_compute::CLGEMMHeuristicsHandle m_MLGOTuner
Definition: GpuFsaBackendContext.hpp:43
armnn::GpuFsaBackendContext
Definition: GpuFsaBackendContext.hpp:17
armnn::GpuFsaBackendContext::m_MLGOTuningFile
std::string m_MLGOTuningFile
Definition: GpuFsaBackendContext.hpp:44