blob: d6a3a89391c283a3a31ac6b19dfb44273e01bfde [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"
9
David Beck6b779f02018-10-09 17:20:21 +010010#include <backends/BackendRegistry.hpp>
arovir01a0944792018-10-11 15:00:58 +010011
David Beck6b779f02018-10-09 17:20:21 +010012#include <boost/cast.hpp>
arovir014424b0a2018-10-04 10:46:04 +010013
14namespace 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 ClBackend::GetIdStatic(),
David Beck6b779f02018-10-09 17:20:21 +010024 []()
25 {
David Beck29c75de2018-10-23 13:35:58 +010026 return IBackendInternalUniquePtr(new ClBackend);
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& ClBackend::GetIdStatic()
arovir014424b0a2018-10-04 10:46:04 +010033{
David Beck3e9e1152018-10-17 14:17:50 +010034 static const BackendId s_Id{ClBackendId()};
arovir014424b0a2018-10-04 10:46:04 +010035 return s_Id;
36}
37
David Beck29c75de2018-10-23 13:35:58 +010038IBackendInternal::IWorkloadFactoryPtr ClBackend::CreateWorkloadFactory() const
arovir014424b0a2018-10-04 10:46:04 +010039{
arovir01a0944792018-10-11 15:00:58 +010040 return std::make_unique<ClWorkloadFactory>();
arovir014424b0a2018-10-04 10:46:04 +010041}
42
arovir014424b0a2018-10-04 10:46:04 +010043} // namespace armnn