arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 1 | // |
2 | // Copyright © 2017 Arm Ltd. All rights reserved. | ||||
3 | // SPDX-License-Identifier: MIT | ||||
4 | // | ||||
5 | |||||
6 | #include "RefBackend.hpp" | ||||
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 7 | #include "RefBackendId.hpp" |
arovir01 | a094479 | 2018-10-11 15:00:58 +0100 | [diff] [blame] | 8 | #include "RefWorkloadFactory.hpp" |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame^] | 9 | #include "RefLayerSupport.hpp" |
arovir01 | a094479 | 2018-10-11 15:00:58 +0100 | [diff] [blame] | 10 | |
David Beck | 263e349 | 2018-11-09 14:46:40 +0000 | [diff] [blame] | 11 | #include <backendsCommon/IBackendContext.hpp> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 12 | #include <backendsCommon/BackendRegistry.hpp> |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame^] | 13 | |
David Beck | 263e349 | 2018-11-09 14:46:40 +0000 | [diff] [blame] | 14 | #include <Optimizer.hpp> |
arovir01 | a094479 | 2018-10-11 15:00:58 +0100 | [diff] [blame] | 15 | |
David Beck | 9efb57d | 2018-11-05 13:40:33 +0000 | [diff] [blame] | 16 | #include <boost/cast.hpp> |
17 | |||||
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 18 | namespace armnn |
19 | { | ||||
20 | |||||
David Beck | 6b779f0 | 2018-10-09 17:20:21 +0100 | [diff] [blame] | 21 | namespace |
22 | { | ||||
David Beck | 6b779f0 | 2018-10-09 17:20:21 +0100 | [diff] [blame] | 23 | |
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame^] | 24 | static BackendRegistry::StaticRegistryInitializer g_RegisterHelper |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 25 | { |
26 | BackendRegistryInstance(), | ||||
David Beck | 3cc9a62 | 2018-10-12 10:38:31 +0100 | [diff] [blame] | 27 | RefBackend::GetIdStatic(), |
David Beck | 9efb57d | 2018-11-05 13:40:33 +0000 | [diff] [blame] | 28 | []() |
David Beck | 6b779f0 | 2018-10-09 17:20:21 +0100 | [diff] [blame] | 29 | { |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 30 | return IBackendInternalUniquePtr(new RefBackend); |
David Beck | 6b779f0 | 2018-10-09 17:20:21 +0100 | [diff] [blame] | 31 | } |
32 | }; | ||||
33 | |||||
34 | } | ||||
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 35 | |
David Beck | 3cc9a62 | 2018-10-12 10:38:31 +0100 | [diff] [blame] | 36 | const BackendId& RefBackend::GetIdStatic() |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 37 | { |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 38 | static const BackendId s_Id{RefBackendId()}; |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 39 | return s_Id; |
40 | } | ||||
41 | |||||
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 42 | IBackendInternal::IWorkloadFactoryPtr RefBackend::CreateWorkloadFactory() const |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 43 | { |
arovir01 | a094479 | 2018-10-11 15:00:58 +0100 | [diff] [blame] | 44 | return std::make_unique<RefWorkloadFactory>(); |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 45 | } |
46 | |||||
David Beck | 263e349 | 2018-11-09 14:46:40 +0000 | [diff] [blame] | 47 | IBackendInternal::IBackendContextPtr RefBackend::CreateBackendContext(const IRuntime::CreationOptions&) const |
48 | { | ||||
49 | return IBackendContextPtr{}; | ||||
50 | } | ||||
51 | |||||
52 | IBackendInternal::Optimizations RefBackend::GetOptimizations() const | ||||
53 | { | ||||
54 | return Optimizations{}; | ||||
55 | } | ||||
56 | |||||
David Beck | 111b5d9 | 2018-11-12 14:59:37 +0000 | [diff] [blame^] | 57 | IBackendInternal::ILayerSupportSharedPtr RefBackend::GetLayerSupport() const |
58 | { | ||||
59 | static ILayerSupportSharedPtr layerSupport{new RefLayerSupport}; | ||||
60 | return layerSupport; | ||||
61 | } | ||||
62 | |||||
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 63 | } // namespace armnn |