blob: 271688fd99e27d67ac6b982c7d85d547b5aa492a [file] [log] [blame]
David Monahan8a570462023-11-22 13:24:25 +00001//
2// Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6
7#include <armnn/backends/IBackendContext.hpp>
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
14namespace armnn
15{
16
17class GpuFsaBackendContext : public IBackendContext
18{
19public:
20 GpuFsaBackendContext(const IRuntime::CreationOptions& options);
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
32private:
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
42protected:
43 arm_compute::CLGEMMHeuristicsHandle m_MLGOTuner;
44 std::string m_MLGOTuningFile;
45};
46
47} // namespace armnn