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