blob: 8209a109a45d462eb325da326c3128af12b935cd [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 "ClBackend.hpp"
David Beck3e9e1152018-10-17 14:17:50 +01007#include "ClBackendId.hpp"
arovir01a0944792018-10-11 15:00:58 +01008#include "ClWorkloadFactory.hpp"
David Beck1b61be52018-11-08 09:19:14 +00009#include "ClBackendContext.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 Beck263e3492018-11-09 14:46:40 +000013#include <Optimizer.hpp>
arovir014424b0a2018-10-04 10:46:04 +010014
15namespace armnn
16{
17
David Beck6b779f02018-10-09 17:20:21 +010018namespace
19{
David Beck6b779f02018-10-09 17:20:21 +010020
David Beck3e9e1152018-10-17 14:17:50 +010021static StaticRegistryInitializer<BackendRegistry> g_RegisterHelper
22{
23 BackendRegistryInstance(),
David Beck3cc9a622018-10-12 10:38:31 +010024 ClBackend::GetIdStatic(),
David Beck9efb57d2018-11-05 13:40:33 +000025 []()
David Beck6b779f02018-10-09 17:20:21 +010026 {
David Beck29c75de2018-10-23 13:35:58 +010027 return IBackendInternalUniquePtr(new ClBackend);
David Beck6b779f02018-10-09 17:20:21 +010028 }
29};
30
David Beck9efb57d2018-11-05 13:40:33 +000031}
arovir014424b0a2018-10-04 10:46:04 +010032
David Beck3cc9a622018-10-12 10:38:31 +010033const BackendId& ClBackend::GetIdStatic()
arovir014424b0a2018-10-04 10:46:04 +010034{
David Beck3e9e1152018-10-17 14:17:50 +010035 static const BackendId s_Id{ClBackendId()};
arovir014424b0a2018-10-04 10:46:04 +010036 return s_Id;
37}
38
David Beck29c75de2018-10-23 13:35:58 +010039IBackendInternal::IWorkloadFactoryPtr ClBackend::CreateWorkloadFactory() const
arovir014424b0a2018-10-04 10:46:04 +010040{
arovir01a0944792018-10-11 15:00:58 +010041 return std::make_unique<ClWorkloadFactory>();
arovir014424b0a2018-10-04 10:46:04 +010042}
43
David Beck1b61be52018-11-08 09:19:14 +000044IBackendInternal::IBackendContextPtr
45ClBackend::CreateBackendContext(const IRuntime::CreationOptions& options) const
46{
47 return IBackendContextPtr{new ClBackendContext{options}};
48}
49
David Beck263e3492018-11-09 14:46:40 +000050IBackendInternal::Optimizations ClBackend::GetOptimizations() const
51{
52 return Optimizations{};
53}
David Beck1b61be52018-11-08 09:19:14 +000054
David Beck9efb57d2018-11-05 13:40:33 +000055} // namespace armnn