blob: b6fb0ff5eca1f361f25c5d6c9c555a508f16738a [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"
9
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +000010#include <backendsCommon/BackendRegistry.hpp>
arovir01a0944792018-10-11 15:00:58 +010011
David Beck9efb57d2018-11-05 13:40:33 +000012#include <boost/cast.hpp>
13
arovir014424b0a2018-10-04 10:46:04 +010014namespace armnn
15{
16
David Beck6b779f02018-10-09 17:20:21 +010017namespace
18{
David Beck6b779f02018-10-09 17:20:21 +010019
David Beck3e9e1152018-10-17 14:17:50 +010020static StaticRegistryInitializer<BackendRegistry> g_RegisterHelper
21{
22 BackendRegistryInstance(),
David Beck3cc9a622018-10-12 10:38:31 +010023 RefBackend::GetIdStatic(),
David Beck9efb57d2018-11-05 13:40:33 +000024 []()
David Beck6b779f02018-10-09 17:20:21 +010025 {
David Beck29c75de2018-10-23 13:35:58 +010026 return IBackendInternalUniquePtr(new RefBackend);
David Beck6b779f02018-10-09 17:20:21 +010027 }
28};
29
30}
arovir014424b0a2018-10-04 10:46:04 +010031
David Beck3cc9a622018-10-12 10:38:31 +010032const BackendId& RefBackend::GetIdStatic()
arovir014424b0a2018-10-04 10:46:04 +010033{
David Beck3e9e1152018-10-17 14:17:50 +010034 static const BackendId s_Id{RefBackendId()};
arovir014424b0a2018-10-04 10:46:04 +010035 return s_Id;
36}
37
David Beck29c75de2018-10-23 13:35:58 +010038IBackendInternal::IWorkloadFactoryPtr RefBackend::CreateWorkloadFactory() const
arovir014424b0a2018-10-04 10:46:04 +010039{
arovir01a0944792018-10-11 15:00:58 +010040 return std::make_unique<RefWorkloadFactory>();
arovir014424b0a2018-10-04 10:46:04 +010041}
42
arovir014424b0a2018-10-04 10:46:04 +010043} // namespace armnn