diff options
author | David Beck <david.beck@arm.com> | 2018-10-09 17:20:21 +0100 |
---|---|---|
committer | Matthew Bentham <matthew.bentham@arm.com> | 2018-10-22 16:57:53 +0100 |
commit | 6b779f0e437127bfa71a529e9b848b5e41683ab8 (patch) | |
tree | 85be136c3e33912ab46a504a4a2a17bd81553e5d /src/backends/reference | |
parent | 32cbb0c7cd99786191c080f5a619b3dab23b4cd0 (diff) | |
download | armnn-6b779f0e437127bfa71a529e9b848b5e41683ab8.tar.gz |
IVGCVSW-1989 : implement backend creation and registry for Ref,Cl and Neon
!armnn:152557
Change-Id: Ic6b99cddee1597c85de76034d9332fe1bf3aceb1
Diffstat (limited to 'src/backends/reference')
-rw-r--r-- | src/backends/reference/RefBackend.cpp | 22 | ||||
-rw-r--r-- | src/backends/reference/RefBackend.hpp | 8 |
2 files changed, 23 insertions, 7 deletions
diff --git a/src/backends/reference/RefBackend.cpp b/src/backends/reference/RefBackend.cpp index 1799abfc33..b671e8bca8 100644 --- a/src/backends/reference/RefBackend.cpp +++ b/src/backends/reference/RefBackend.cpp @@ -4,11 +4,25 @@ // #include "RefBackend.hpp" +#include <backends/BackendRegistry.hpp> +#include <boost/cast.hpp> namespace armnn { -const std::string RefBackend::s_Id = "arm_reference"; +namespace +{ +const std::string s_Id = "CpuRef"; + +static BackendRegistry::Helper s_RegisterHelper{ + s_Id, + []() + { + return IBackendUniquePtr(new RefBackend, &RefBackend::Destroy); + } +}; + +} const std::string& RefBackend::GetId() const { @@ -22,8 +36,12 @@ const ILayerSupport& RefBackend::GetLayerSupport() const std::unique_ptr<IWorkloadFactory> RefBackend::CreateWorkloadFactory() const { - // TODO implement return nullptr; } +void RefBackend::Destroy(IBackend* backend) +{ + delete boost::polymorphic_downcast<RefBackend*>(backend); +} + } // namespace armnn
\ No newline at end of file diff --git a/src/backends/reference/RefBackend.hpp b/src/backends/reference/RefBackend.hpp index c3797158a6..e4a11f10c9 100644 --- a/src/backends/reference/RefBackend.hpp +++ b/src/backends/reference/RefBackend.hpp @@ -4,8 +4,7 @@ // #pragma once -#include "backends/IBackendInternal.hpp" - +#include <backends/IBackendInternal.hpp> #include "RefLayerSupport.hpp" namespace armnn @@ -23,10 +22,9 @@ public: std::unique_ptr<IWorkloadFactory> CreateWorkloadFactory() const override; -private: - static const std::string s_Id; + static void Destroy(IBackend* backend); - // TODO initialize +private: RefLayerSupport m_LayerSupport; }; |