ArmNN
 25.11
Loading...
Searching...
No Matches
DeviceSpec.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/Types.hpp>
8#include <set>
9#include <vector>
10
11namespace armnn
12{
13
14class DeviceSpec : public IDeviceSpec
15{
16public:
18 {}
19
20 DeviceSpec(const BackendIdSet& supportedBackends)
21 : m_SupportedBackends{supportedBackends} {}
22
23 virtual ~DeviceSpec() {}
24
25 virtual const BackendIdSet& GetSupportedBackends() const override
26 {
27 return m_SupportedBackends;
28 }
29
30 void AddSupportedBackends(const BackendIdSet& backendIds, bool isDynamic = false)
31 {
32 m_SupportedBackends.insert(backendIds.begin(), backendIds.end());
33 if (isDynamic)
34 {
35 m_DynamicBackends.insert(backendIds.begin(), backendIds.end());
36 }
37 }
38
40 {
41 for (const auto& id : m_DynamicBackends)
42 {
43 m_SupportedBackends.erase(id);
44 }
45 m_DynamicBackends.clear();
46 }
47
49 {
50 return m_DynamicBackends;
51 }
52
53private:
54 BackendIdSet m_SupportedBackends;
55 BackendIdSet m_DynamicBackends;
56};
57
58} // namespace armnn
void AddSupportedBackends(const BackendIdSet &backendIds, bool isDynamic=false)
virtual ~DeviceSpec()
void ClearDynamicBackends()
DeviceSpec(const BackendIdSet &supportedBackends)
virtual const BackendIdSet & GetSupportedBackends() const override
const BackendIdSet & GetDynamicBackends() const
Copyright (c) 2021 ARM Limited and Contributors.
std::unordered_set< BackendId > BackendIdSet