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 "ClBackend.hpp" | ||||
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 7 | #include "ClBackendId.hpp" |
arovir01 | a094479 | 2018-10-11 15:00:58 +0100 | [diff] [blame] | 8 | #include "ClWorkloadFactory.hpp" |
David Beck | 1b61be5 | 2018-11-08 09:19:14 +0000 | [diff] [blame] | 9 | #include "ClBackendContext.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 | 263e349 | 2018-11-09 14:46:40 +0000 | [diff] [blame] | 13 | #include <Optimizer.hpp> |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 14 | |
15 | namespace armnn | ||||
16 | { | ||||
17 | |||||
David Beck | 6b779f0 | 2018-10-09 17:20:21 +0100 | [diff] [blame] | 18 | namespace |
19 | { | ||||
David Beck | 6b779f0 | 2018-10-09 17:20:21 +0100 | [diff] [blame] | 20 | |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 21 | static StaticRegistryInitializer<BackendRegistry> g_RegisterHelper |
22 | { | ||||
23 | BackendRegistryInstance(), | ||||
David Beck | 3cc9a62 | 2018-10-12 10:38:31 +0100 | [diff] [blame] | 24 | ClBackend::GetIdStatic(), |
David Beck | 9efb57d | 2018-11-05 13:40:33 +0000 | [diff] [blame] | 25 | []() |
David Beck | 6b779f0 | 2018-10-09 17:20:21 +0100 | [diff] [blame] | 26 | { |
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 27 | return IBackendInternalUniquePtr(new ClBackend); |
David Beck | 6b779f0 | 2018-10-09 17:20:21 +0100 | [diff] [blame] | 28 | } |
29 | }; | ||||
30 | |||||
David Beck | 9efb57d | 2018-11-05 13:40:33 +0000 | [diff] [blame] | 31 | } |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 32 | |
David Beck | 3cc9a62 | 2018-10-12 10:38:31 +0100 | [diff] [blame] | 33 | const BackendId& ClBackend::GetIdStatic() |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 34 | { |
David Beck | 3e9e115 | 2018-10-17 14:17:50 +0100 | [diff] [blame] | 35 | static const BackendId s_Id{ClBackendId()}; |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 36 | return s_Id; |
37 | } | ||||
38 | |||||
David Beck | 29c75de | 2018-10-23 13:35:58 +0100 | [diff] [blame] | 39 | IBackendInternal::IWorkloadFactoryPtr ClBackend::CreateWorkloadFactory() const |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 40 | { |
arovir01 | a094479 | 2018-10-11 15:00:58 +0100 | [diff] [blame] | 41 | return std::make_unique<ClWorkloadFactory>(); |
arovir01 | 4424b0a | 2018-10-04 10:46:04 +0100 | [diff] [blame] | 42 | } |
43 | |||||
David Beck | 1b61be5 | 2018-11-08 09:19:14 +0000 | [diff] [blame] | 44 | IBackendInternal::IBackendContextPtr |
45 | ClBackend::CreateBackendContext(const IRuntime::CreationOptions& options) const | ||||
46 | { | ||||
47 | return IBackendContextPtr{new ClBackendContext{options}}; | ||||
48 | } | ||||
49 | |||||
David Beck | 263e349 | 2018-11-09 14:46:40 +0000 | [diff] [blame] | 50 | IBackendInternal::Optimizations ClBackend::GetOptimizations() const |
51 | { | ||||
52 | return Optimizations{}; | ||||
53 | } | ||||
David Beck | 1b61be5 | 2018-11-08 09:19:14 +0000 | [diff] [blame] | 54 | |
David Beck | 9efb57d | 2018-11-05 13:40:33 +0000 | [diff] [blame] | 55 | } // namespace armnn |