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/cl | |
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/cl')
-rw-r--r-- | src/backends/cl/ClBackend.cpp | 22 | ||||
-rw-r--r-- | src/backends/cl/ClBackend.hpp | 8 |
2 files changed, 23 insertions, 7 deletions
diff --git a/src/backends/cl/ClBackend.cpp b/src/backends/cl/ClBackend.cpp index 5de9d31234..d185c15b72 100644 --- a/src/backends/cl/ClBackend.cpp +++ b/src/backends/cl/ClBackend.cpp @@ -4,11 +4,25 @@ // #include "ClBackend.hpp" +#include <backends/BackendRegistry.hpp> +#include <boost/cast.hpp> namespace armnn { -const std::string ClBackend::s_Id = "arm_compute_cl"; +namespace +{ +static const std::string s_Id = "GpuAcc"; + +static BackendRegistry::Helper g_RegisterHelper{ + s_Id, + []() + { + return IBackendUniquePtr(new ClBackend, &ClBackend::Destroy); + } +}; + +} const std::string& ClBackend::GetId() const { @@ -22,8 +36,12 @@ const ILayerSupport& ClBackend::GetLayerSupport() const std::unique_ptr<IWorkloadFactory> ClBackend::CreateWorkloadFactory() const { - // TODO implement return nullptr; } +void ClBackend::Destroy(IBackend* backend) +{ + delete boost::polymorphic_downcast<ClBackend*>(backend); +} + } // namespace armnn
\ No newline at end of file diff --git a/src/backends/cl/ClBackend.hpp b/src/backends/cl/ClBackend.hpp index 7e67f5e9ad..c43b6a6ce0 100644 --- a/src/backends/cl/ClBackend.hpp +++ b/src/backends/cl/ClBackend.hpp @@ -4,8 +4,7 @@ // #pragma once -#include "backends/IBackendInternal.hpp" - +#include <backends/IBackendInternal.hpp> #include "ClLayerSupport.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: ClLayerSupport m_LayerSupport; }; |