blob: 3680831fb3c62e404dda4638416404cc894f2600 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#include "RefBackend.hpp"
#include "RefBackendId.hpp"
#include "RefWorkloadFactory.hpp"
#include "RefLayerSupport.hpp"
#include <backendsCommon/IBackendContext.hpp>
#include <backendsCommon/IMemoryManager.hpp>
#include <backendsCommon/BackendRegistry.hpp>
#include <Optimizer.hpp>
#include <boost/cast.hpp>
#include <boost/polymorphic_pointer_cast.hpp>
namespace armnn
{
namespace
{
static BackendRegistry::StaticRegistryInitializer g_RegisterHelper
{
BackendRegistryInstance(),
RefBackend::GetIdStatic(),
[]()
{
return IBackendInternalUniquePtr(new RefBackend);
}
};
}
const BackendId& RefBackend::GetIdStatic()
{
static const BackendId s_Id{RefBackendId()};
return s_Id;
}
IBackendInternal::IWorkloadFactoryPtr RefBackend::CreateWorkloadFactory(
const IBackendInternal::IMemoryManagerSharedPtr& memoryManager) const
{
return std::make_unique<RefWorkloadFactory>(boost::polymorphic_pointer_downcast<RefMemoryManager>(memoryManager));
}
IBackendInternal::IBackendContextPtr RefBackend::CreateBackendContext(const IRuntime::CreationOptions&) const
{
return IBackendContextPtr{};
}
IBackendInternal::IMemoryManagerUniquePtr RefBackend::CreateMemoryManager() const
{
return std::make_unique<RefMemoryManager>();
}
IBackendInternal::Optimizations RefBackend::GetOptimizations() const
{
return Optimizations{};
}
IBackendInternal::ILayerSupportSharedPtr RefBackend::GetLayerSupport() const
{
static ILayerSupportSharedPtr layerSupport{new RefLayerSupport};
return layerSupport;
}
OptimizationViews RefBackend::OptimizeSubgraphView(const SubgraphView& subgraph) const
{
OptimizationViews optimizationViews;
optimizationViews.AddUntouchedSubgraph(SubgraphView(subgraph));
return optimizationViews;
}
} // namespace armnn
|