blob: 7c9240479b1393072b94f2bb2dced081182a8388 [file] [log] [blame]
arovir014424b0a2018-10-04 10:46:04 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "RefBackend.hpp"
David Beck3e9e1152018-10-17 14:17:50 +01007#include "RefBackendId.hpp"
arovir01a0944792018-10-11 15:00:58 +01008#include "RefWorkloadFactory.hpp"
David Beck111b5d92018-11-12 14:59:37 +00009#include "RefLayerSupport.hpp"
arovir01a0944792018-10-11 15:00:58 +010010
David Beck263e3492018-11-09 14:46:40 +000011#include <backendsCommon/IBackendContext.hpp>
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +000012#include <backendsCommon/BackendRegistry.hpp>
David Beck111b5d92018-11-12 14:59:37 +000013
David Beck263e3492018-11-09 14:46:40 +000014#include <Optimizer.hpp>
arovir01a0944792018-10-11 15:00:58 +010015
David Beck9efb57d2018-11-05 13:40:33 +000016#include <boost/cast.hpp>
17
arovir014424b0a2018-10-04 10:46:04 +010018namespace armnn
19{
20
David Beck6b779f02018-10-09 17:20:21 +010021namespace
22{
David Beck6b779f02018-10-09 17:20:21 +010023
David Beck111b5d92018-11-12 14:59:37 +000024static BackendRegistry::StaticRegistryInitializer g_RegisterHelper
David Beck3e9e1152018-10-17 14:17:50 +010025{
26 BackendRegistryInstance(),
David Beck3cc9a622018-10-12 10:38:31 +010027 RefBackend::GetIdStatic(),
David Beck9efb57d2018-11-05 13:40:33 +000028 []()
David Beck6b779f02018-10-09 17:20:21 +010029 {
David Beck29c75de2018-10-23 13:35:58 +010030 return IBackendInternalUniquePtr(new RefBackend);
David Beck6b779f02018-10-09 17:20:21 +010031 }
32};
33
34}
arovir014424b0a2018-10-04 10:46:04 +010035
David Beck3cc9a622018-10-12 10:38:31 +010036const BackendId& RefBackend::GetIdStatic()
arovir014424b0a2018-10-04 10:46:04 +010037{
David Beck3e9e1152018-10-17 14:17:50 +010038 static const BackendId s_Id{RefBackendId()};
arovir014424b0a2018-10-04 10:46:04 +010039 return s_Id;
40}
41
David Beck29c75de2018-10-23 13:35:58 +010042IBackendInternal::IWorkloadFactoryPtr RefBackend::CreateWorkloadFactory() const
arovir014424b0a2018-10-04 10:46:04 +010043{
arovir01a0944792018-10-11 15:00:58 +010044 return std::make_unique<RefWorkloadFactory>();
arovir014424b0a2018-10-04 10:46:04 +010045}
46
David Beck263e3492018-11-09 14:46:40 +000047IBackendInternal::IBackendContextPtr RefBackend::CreateBackendContext(const IRuntime::CreationOptions&) const
48{
49 return IBackendContextPtr{};
50}
51
52IBackendInternal::Optimizations RefBackend::GetOptimizations() const
53{
54 return Optimizations{};
55}
56
David Beck111b5d92018-11-12 14:59:37 +000057IBackendInternal::ILayerSupportSharedPtr RefBackend::GetLayerSupport() const
58{
59 static ILayerSupportSharedPtr layerSupport{new RefLayerSupport};
60 return layerSupport;
61}
62
arovir014424b0a2018-10-04 10:46:04 +010063} // namespace armnn