IVGCVSW-2125 : Consolidate backend registries into one

Change-Id: I56da4780f8f5fcef7ff01d232d5d61bf299364bf
diff --git a/src/armnn/LayerSupport.cpp b/src/armnn/LayerSupport.cpp
index 5d2d205..78a184a 100644
--- a/src/armnn/LayerSupport.cpp
+++ b/src/armnn/LayerSupport.cpp
@@ -4,8 +4,10 @@
 //
 #include <armnn/LayerSupport.hpp>
 #include <armnn/Optional.hpp>
+#include <armnn/ILayerSupport.hpp>
 
-#include <backendsCommon/LayerSupportRegistry.hpp>
+#include <backendsCommon/BackendRegistry.hpp>
+#include <backendsCommon/IBackendInternal.hpp>
 
 #include <boost/assert.hpp>
 
@@ -39,10 +41,22 @@
     std::string reasonIfUnsupportedFull; \
     bool isSupported; \
     try { \
-        auto factoryFunc = LayerSupportRegistryInstance().GetFactory(backendId); \
-        auto layerSupportObject = factoryFunc(); \
-        isSupported = layerSupportObject->func(__VA_ARGS__, Optional<std::string&>(reasonIfUnsupportedFull)); \
-        CopyErrorMessage(reasonIfUnsupported, reasonIfUnsupportedFull.c_str(), reasonIfUnsupportedMaxLength); \
+        auto const& backendRegistry = BackendRegistryInstance(); \
+        if (!backendRegistry.IsBackendRegistered(backendId)) \
+        { \
+            std::stringstream ss; \
+            ss << __func__ << " is not supported on " << backendId << " because this backend is not registered."; \
+            reasonIfUnsupportedFull = ss.str(); \
+            isSupported = false; \
+        } \
+        else \
+        { \
+            auto factoryFunc = backendRegistry.GetFactory(backendId); \
+            auto backendObject = factoryFunc(); \
+            auto layerSupportObject = backendObject->GetLayerSupport(); \
+            isSupported = layerSupportObject->func(__VA_ARGS__, Optional<std::string&>(reasonIfUnsupportedFull)); \
+            CopyErrorMessage(reasonIfUnsupported, reasonIfUnsupportedFull.c_str(), reasonIfUnsupportedMaxLength); \
+        } \
     } catch (InvalidArgumentException e) { \
         /* re-throwing with more context information */ \
         throw InvalidArgumentException(e, "Failed to check layer support", CHECK_LOCATION()); \
diff --git a/src/backends/backendsCommon/BackendRegistry.cpp b/src/backends/backendsCommon/BackendRegistry.cpp
index e936121..80ab01c 100644
--- a/src/backends/backendsCommon/BackendRegistry.cpp
+++ b/src/backends/backendsCommon/BackendRegistry.cpp
@@ -4,6 +4,7 @@
 //
 
 #include "BackendRegistry.hpp"
+#include <armnn/Exceptions.hpp>
 
 namespace armnn
 {
@@ -14,4 +15,72 @@
     return instance;
 }
 
+void BackendRegistry::Register(const BackendId& id, BackendRegistry::FactoryFunction factory)
+{
+    if (m_Factories.count(id) > 0)
+    {
+        throw InvalidArgumentException(
+            std::string(id) + " already registered as IBackend factory",
+            CHECK_LOCATION());
+    }
+
+    m_Factories[id] = factory;
+}
+
+bool BackendRegistry::IsBackendRegistered(const BackendId& id) const
+{
+    return (m_Factories.find(id) != m_Factories.end());
+}
+
+BackendRegistry::FactoryFunction BackendRegistry::GetFactory(const BackendId& id) const
+{
+    auto it = m_Factories.find(id);
+    if (it == m_Factories.end())
+    {
+        throw InvalidArgumentException(
+            std::string(id) + " has no IBackend factory registered",
+            CHECK_LOCATION());
+    }
+
+    return it->second;
+}
+
+size_t BackendRegistry::Size() const
+{
+    return m_Factories.size();
+}
+
+BackendIdSet BackendRegistry::GetBackendIds() const
+{
+    BackendIdSet result;
+    for (const auto& it : m_Factories)
+    {
+        result.insert(it.first);
+    }
+    return result;
+}
+
+std::string BackendRegistry::GetBackendIdsAsString() const
+{
+    static const std::string delimitator = ", ";
+
+    std::stringstream output;
+    for (auto& backendId : GetBackendIds())
+    {
+        if (output.tellp() != std::streampos(0))
+        {
+            output << delimitator;
+        }
+        output << backendId;
+    }
+
+    return output.str();
+}
+
+void BackendRegistry::Swap(BackendRegistry& instance, BackendRegistry::FactoryStorage& other)
+{
+    std::swap(instance.m_Factories, other);
+}
+
+
 } // namespace armnn
diff --git a/src/backends/backendsCommon/BackendRegistry.hpp b/src/backends/backendsCommon/BackendRegistry.hpp
index 4b20cac..2a52e24 100644
--- a/src/backends/backendsCommon/BackendRegistry.hpp
+++ b/src/backends/backendsCommon/BackendRegistry.hpp
@@ -4,21 +4,57 @@
 //
 #pragma once
 
-#include "RegistryCommon.hpp"
 #include <armnn/Types.hpp>
+#include <armnn/BackendId.hpp>
+
+#include <memory>
+#include <unordered_map>
 
 namespace armnn
 {
+
 class IBackendInternal;
 using IBackendInternalUniquePtr = std::unique_ptr<IBackendInternal>;
-using BackendRegistry = RegistryCommon<IBackendInternal, IBackendInternalUniquePtr>;
+
+class BackendRegistry
+{
+public:
+    using PointerType = IBackendInternalUniquePtr;
+    using FactoryFunction = std::function<PointerType()>;
+
+    void Register(const BackendId& id, FactoryFunction factory);
+    bool IsBackendRegistered(const BackendId& id) const;
+    FactoryFunction GetFactory(const BackendId& id) const;
+    size_t Size() const;
+    BackendIdSet GetBackendIds() const;
+    std::string GetBackendIdsAsString() const;
+
+    BackendRegistry() {}
+    virtual ~BackendRegistry() {}
+
+    struct StaticRegistryInitializer
+    {
+        StaticRegistryInitializer(BackendRegistry& instance,
+                                  const BackendId& id,
+                                  FactoryFunction factory)
+        {
+            instance.Register(id, factory);
+        }
+    };
+
+protected:
+    using FactoryStorage = std::unordered_map<BackendId, FactoryFunction>;
+
+    // For testing only
+    static void Swap(BackendRegistry& instance, FactoryStorage& other);
+
+private:
+    BackendRegistry(const BackendRegistry&) = delete;
+    BackendRegistry& operator=(const BackendRegistry&) = delete;
+
+    FactoryStorage m_Factories;
+};
 
 BackendRegistry& BackendRegistryInstance();
 
-template <>
-struct RegisteredTypeName<IBackend>
-{
-    static const char * Name() { return "IBackend"; }
-};
-
 } // namespace armnn
\ No newline at end of file
diff --git a/src/backends/backendsCommon/CMakeLists.txt b/src/backends/backendsCommon/CMakeLists.txt
index f4ab45f..e6ac01c 100644
--- a/src/backends/backendsCommon/CMakeLists.txt
+++ b/src/backends/backendsCommon/CMakeLists.txt
@@ -13,14 +13,11 @@
     IBackendContext.hpp
     ILayerSupport.cpp
     ITensorHandle.hpp
-    LayerSupportRegistry.cpp
-    LayerSupportRegistry.hpp
     MakeWorkloadHelper.hpp
     MemCopyWorkload.cpp
     MemCopyWorkload.hpp
     OutputHandler.cpp
     OutputHandler.hpp
-    RegistryCommon.hpp
     StringMapping.cpp
     StringMapping.hpp
     WorkloadDataCollector.hpp
diff --git a/src/backends/backendsCommon/IBackendInternal.hpp b/src/backends/backendsCommon/IBackendInternal.hpp
index 9c54b82..9d649fc 100644
--- a/src/backends/backendsCommon/IBackendInternal.hpp
+++ b/src/backends/backendsCommon/IBackendInternal.hpp
@@ -13,6 +13,7 @@
 class IWorkloadFactory;
 class IBackendContext;
 class Optimization;
+class ILayerSupport;
 
 class IBackendInternal : public IBackend
 {
@@ -30,10 +31,12 @@
     using IBackendContextPtr = std::unique_ptr<IBackendContext>;
     using OptimizationPtr = std::unique_ptr<Optimization>;
     using Optimizations = std::vector<OptimizationPtr>;
+    using ILayerSupportSharedPtr = std::shared_ptr<ILayerSupport>;
 
     virtual IWorkloadFactoryPtr CreateWorkloadFactory() const = 0;
     virtual IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const = 0;
     virtual Optimizations GetOptimizations() const = 0;
+    virtual ILayerSupportSharedPtr GetLayerSupport() const = 0;
 };
 
 using IBackendInternalUniquePtr = std::unique_ptr<IBackendInternal>;
diff --git a/src/backends/backendsCommon/LayerSupportRegistry.cpp b/src/backends/backendsCommon/LayerSupportRegistry.cpp
deleted file mode 100644
index 63b4da7..0000000
--- a/src/backends/backendsCommon/LayerSupportRegistry.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// Copyright © 2017 Arm Ltd. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-
-#include "LayerSupportRegistry.hpp"
-
-namespace armnn
-{
-
-LayerSupportRegistry& LayerSupportRegistryInstance()
-{
-    static LayerSupportRegistry instance;
-    return instance;
-}
-
-} // namespace armnn
diff --git a/src/backends/backendsCommon/LayerSupportRegistry.hpp b/src/backends/backendsCommon/LayerSupportRegistry.hpp
deleted file mode 100644
index a5efad0..0000000
--- a/src/backends/backendsCommon/LayerSupportRegistry.hpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// Copyright © 2017 Arm Ltd. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-#pragma once
-
-#include "RegistryCommon.hpp"
-#include <armnn/ILayerSupport.hpp>
-
-namespace armnn
-{
-
-using LayerSupportRegistry = RegistryCommon<ILayerSupport, ILayerSupportSharedPtr>;
-
-LayerSupportRegistry& LayerSupportRegistryInstance();
-
-template <>
-struct RegisteredTypeName<ILayerSupport>
-{
-    static const char * Name() { return "ILayerSupport"; }
-};
-
-} // namespace armnn
diff --git a/src/backends/backendsCommon/RegistryCommon.hpp b/src/backends/backendsCommon/RegistryCommon.hpp
deleted file mode 100644
index 03bd338..0000000
--- a/src/backends/backendsCommon/RegistryCommon.hpp
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// Copyright © 2017 Arm Ltd. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-#pragma once
-
-#include <armnn/BackendId.hpp>
-#include <armnn/Exceptions.hpp>
-
-#include <functional>
-#include <memory>
-#include <sstream>
-#include <string>
-#include <unordered_map>
-
-namespace armnn
-{
-
-template <typename RegisteredType>
-struct RegisteredTypeName
-{
-    static const char * Name() { return "UNKNOWN"; }
-};
-
-template <typename RegisteredType, typename PointerType>
-class RegistryCommon
-{
-public:
-    using FactoryFunction = std::function<PointerType()>;
-
-    void Register(const BackendId& id, FactoryFunction factory)
-    {
-        if (m_Factories.count(id) > 0)
-        {
-            throw InvalidArgumentException(
-                std::string(id) + " already registered as " + RegisteredTypeName<RegisteredType>::Name() + " factory",
-                CHECK_LOCATION());
-        }
-
-        m_Factories[id] = factory;
-    }
-
-    FactoryFunction GetFactory(const BackendId& id) const
-    {
-        auto it = m_Factories.find(id);
-        if (it == m_Factories.end())
-        {
-            throw InvalidArgumentException(
-                std::string(id) + " has no " + RegisteredTypeName<RegisteredType>::Name() + " factory registered",
-                CHECK_LOCATION());
-        }
-
-        return it->second;
-    }
-
-    size_t Size() const
-    {
-        return m_Factories.size();
-    }
-
-    BackendIdSet GetBackendIds() const
-    {
-        BackendIdSet result;
-        for (const auto& it : m_Factories)
-        {
-            result.insert(it.first);
-        }
-        return result;
-    }
-
-    std::string GetBackendIdsAsString() const
-    {
-        static const std::string delimitator = ", ";
-
-        std::stringstream output;
-        for (auto& backendId : GetBackendIds())
-        {
-            if (output.tellp() != std::streampos(0))
-            {
-                output << delimitator;
-            }
-            output << backendId;
-        }
-
-        return output.str();
-    }
-
-    RegistryCommon() {}
-    virtual ~RegistryCommon() {}
-
-protected:
-    using FactoryStorage = std::unordered_map<BackendId, FactoryFunction>;
-
-    // For testing only
-    static void Swap(RegistryCommon& instance, FactoryStorage& other)
-    {
-        std::swap(instance.m_Factories, other);
-    }
-
-private:
-    RegistryCommon(const RegistryCommon&) = delete;
-    RegistryCommon& operator=(const RegistryCommon&) = delete;
-
-    FactoryStorage m_Factories;
-};
-
-template <typename RegistryType>
-struct StaticRegistryInitializer
-{
-    using FactoryFunction = typename RegistryType::FactoryFunction;
-
-    StaticRegistryInitializer(RegistryType& instance,
-                              const BackendId& id,
-                              FactoryFunction factory)
-    {
-        instance.Register(id, factory);
-    }
-};
-
-} // namespace armnn
diff --git a/src/backends/backendsCommon/WorkloadFactory.cpp b/src/backends/backendsCommon/WorkloadFactory.cpp
index ec30f34..bb63b33 100644
--- a/src/backends/backendsCommon/WorkloadFactory.cpp
+++ b/src/backends/backendsCommon/WorkloadFactory.cpp
@@ -10,14 +10,17 @@
 
 #include <armnn/Types.hpp>
 #include <armnn/LayerSupport.hpp>
+#include <armnn/ILayerSupport.hpp>
 
-#include <backendsCommon/LayerSupportRegistry.hpp>
+#include <backendsCommon/BackendRegistry.hpp>
 #include <backendsCommon/WorkloadFactory.hpp>
+#include <backendsCommon/IBackendInternal.hpp>
 
 #include <boost/cast.hpp>
 #include <boost/iterator/transform_iterator.hpp>
 
 #include <cstring>
+#include <sstream>
 
 namespace armnn
 {
@@ -66,9 +69,20 @@
     bool result;
     const Layer& layer = *(boost::polymorphic_downcast<const Layer*>(&connectableLayer));
 
-    auto const& layerSupportRegistry = LayerSupportRegistryInstance();
-    auto layerSupportFactory = layerSupportRegistry.GetFactory(backendId);
-    auto layerSupportObject = layerSupportFactory();
+    auto const& backendRegistry = BackendRegistryInstance();
+    if (!backendRegistry.IsBackendRegistered(backendId))
+    {
+        std::stringstream ss;
+        ss << connectableLayer.GetName() << " is not supported on " << backendId
+           << " because this backend is not registered.";
+
+        outReasonIfUnsupported = ss.str();
+        return false;
+    }
+
+    auto backendFactory = backendRegistry.GetFactory(backendId);
+    auto backendObject = backendFactory();
+    auto layerSupportObject = backendObject->GetLayerSupport();
 
     switch(layer.GetType())
     {
diff --git a/src/backends/backendsCommon/common.mk b/src/backends/backendsCommon/common.mk
index b1583b9..8d29316 100644
--- a/src/backends/backendsCommon/common.mk
+++ b/src/backends/backendsCommon/common.mk
@@ -12,7 +12,6 @@
     CpuTensorHandle.cpp \
     ILayerSupport.cpp \
     MemCopyWorkload.cpp \
-    LayerSupportRegistry.cpp \
     OutputHandler.cpp \
     StringMapping.cpp \
     WorkloadData.cpp \
diff --git a/src/backends/backendsCommon/test/BackendRegistryTests.cpp b/src/backends/backendsCommon/test/BackendRegistryTests.cpp
index 26175e0..283caaf 100644
--- a/src/backends/backendsCommon/test/BackendRegistryTests.cpp
+++ b/src/backends/backendsCommon/test/BackendRegistryTests.cpp
@@ -52,7 +52,7 @@
 
     bool called = false;
 
-    StaticRegistryInitializer<BackendRegistry> factoryHelper(
+    BackendRegistry::StaticRegistryInitializer factoryHelper(
         BackendRegistryInstance(),
         "HelloWorld",
         [&called]()
diff --git a/src/backends/cl/ClBackend.cpp b/src/backends/cl/ClBackend.cpp
index 8209a10..4ef8d90 100644
--- a/src/backends/cl/ClBackend.cpp
+++ b/src/backends/cl/ClBackend.cpp
@@ -7,6 +7,7 @@
 #include "ClBackendId.hpp"
 #include "ClWorkloadFactory.hpp"
 #include "ClBackendContext.hpp"
+#include "ClLayerSupport.hpp"
 
 #include <backendsCommon/IBackendContext.hpp>
 #include <backendsCommon/BackendRegistry.hpp>
@@ -18,7 +19,7 @@
 namespace
 {
 
-static StaticRegistryInitializer<BackendRegistry> g_RegisterHelper
+static BackendRegistry::StaticRegistryInitializer g_RegisterHelper
 {
     BackendRegistryInstance(),
     ClBackend::GetIdStatic(),
@@ -52,4 +53,10 @@
     return Optimizations{};
 }
 
+IBackendInternal::ILayerSupportSharedPtr ClBackend::GetLayerSupport() const
+{
+    static ILayerSupportSharedPtr layerSupport{new ClLayerSupport};
+    return layerSupport;
+}
+
 } // namespace armnn
diff --git a/src/backends/cl/ClBackend.hpp b/src/backends/cl/ClBackend.hpp
index ad84e8a..7ee8598 100644
--- a/src/backends/cl/ClBackend.hpp
+++ b/src/backends/cl/ClBackend.hpp
@@ -21,6 +21,7 @@
     IBackendInternal::IWorkloadFactoryPtr CreateWorkloadFactory() const override;
     IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const override;
     IBackendInternal::Optimizations GetOptimizations() const override;
+    IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override;
 };
 
 } // namespace armnn
\ No newline at end of file
diff --git a/src/backends/cl/ClLayerSupport.cpp b/src/backends/cl/ClLayerSupport.cpp
index f4e14c2..039f1c2 100644
--- a/src/backends/cl/ClLayerSupport.cpp
+++ b/src/backends/cl/ClLayerSupport.cpp
@@ -10,7 +10,7 @@
 #include <InternalTypes.hpp>
 #include <LayerSupportCommon.hpp>
 
-#include <backendsCommon/LayerSupportRegistry.hpp>
+#include <backendsCommon/BackendRegistry.hpp>
 
 #include <boost/core/ignore_unused.hpp>
 
@@ -44,21 +44,6 @@
 namespace
 {
 
-ILayerSupportSharedPtr GetLayerSupportPointer()
-{
-    static ILayerSupportSharedPtr instance{new ClLayerSupport};
-    return instance;
-}
-
-static StaticRegistryInitializer<LayerSupportRegistry> g_RegisterHelper{
-    LayerSupportRegistryInstance(),
-    ClBackendId(),
-    []()
-    {
-        return GetLayerSupportPointer();
-    }
-};
-
 template<unsigned int FilterSize>
 bool IsMatchingSize2d(const TensorInfo& weightInfo)
 {
diff --git a/src/backends/neon/NeonBackend.cpp b/src/backends/neon/NeonBackend.cpp
index 9e079f3..4d57eda 100644
--- a/src/backends/neon/NeonBackend.cpp
+++ b/src/backends/neon/NeonBackend.cpp
@@ -6,6 +6,7 @@
 #include "NeonBackend.hpp"
 #include "NeonBackendId.hpp"
 #include "NeonWorkloadFactory.hpp"
+#include "NeonLayerSupport.hpp"
 
 #include <backendsCommon/IBackendContext.hpp>
 #include <backendsCommon/BackendRegistry.hpp>
@@ -19,7 +20,7 @@
 namespace
 {
 
-static StaticRegistryInitializer<BackendRegistry> g_RegisterHelper
+static BackendRegistry::StaticRegistryInitializer g_RegisterHelper
 {
     BackendRegistryInstance(),
     NeonBackend::GetIdStatic(),
@@ -52,4 +53,10 @@
     return Optimizations{};
 }
 
+IBackendInternal::ILayerSupportSharedPtr NeonBackend::GetLayerSupport() const
+{
+    static ILayerSupportSharedPtr layerSupport{new NeonLayerSupport};
+    return layerSupport;
+}
+
 } // namespace armnn
\ No newline at end of file
diff --git a/src/backends/neon/NeonBackend.hpp b/src/backends/neon/NeonBackend.hpp
index e0017d9..d83710d 100644
--- a/src/backends/neon/NeonBackend.hpp
+++ b/src/backends/neon/NeonBackend.hpp
@@ -21,6 +21,7 @@
     IWorkloadFactoryPtr CreateWorkloadFactory() const override;
     IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const override;
     IBackendInternal::Optimizations GetOptimizations() const override;
+    IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override;
 };
 
 } // namespace armnn
\ No newline at end of file
diff --git a/src/backends/neon/NeonLayerSupport.cpp b/src/backends/neon/NeonLayerSupport.cpp
index a4a6b67..165e067 100644
--- a/src/backends/neon/NeonLayerSupport.cpp
+++ b/src/backends/neon/NeonLayerSupport.cpp
@@ -12,7 +12,7 @@
 #include <armnn/Tensor.hpp>
 #include <armnn/Types.hpp>
 
-#include <backendsCommon/LayerSupportRegistry.hpp>
+#include <backendsCommon/BackendRegistry.hpp>
 
 #include <boost/core/ignore_unused.hpp>
 
@@ -40,21 +40,6 @@
 namespace
 {
 
-ILayerSupportSharedPtr GetLayerSupportPointer()
-{
-    static ILayerSupportSharedPtr instance{new NeonLayerSupport};
-    return instance;
-}
-
-static StaticRegistryInitializer<LayerSupportRegistry> g_RegisterHelper{
-    LayerSupportRegistryInstance(),
-    NeonBackendId(),
-    []()
-    {
-        return GetLayerSupportPointer();
-    }
-};
-
 bool IsNeonBackendSupported(Optional<std::string&> reasonIfUnsupported)
 {
 #if ARMCOMPUTENEON_ENABLED
diff --git a/src/backends/reference/RefBackend.cpp b/src/backends/reference/RefBackend.cpp
index 2f5ec80..7c92404 100644
--- a/src/backends/reference/RefBackend.cpp
+++ b/src/backends/reference/RefBackend.cpp
@@ -6,9 +6,11 @@
 #include "RefBackend.hpp"
 #include "RefBackendId.hpp"
 #include "RefWorkloadFactory.hpp"
+#include "RefLayerSupport.hpp"
 
 #include <backendsCommon/IBackendContext.hpp>
 #include <backendsCommon/BackendRegistry.hpp>
+
 #include <Optimizer.hpp>
 
 #include <boost/cast.hpp>
@@ -19,7 +21,7 @@
 namespace
 {
 
-static StaticRegistryInitializer<BackendRegistry> g_RegisterHelper
+static BackendRegistry::StaticRegistryInitializer g_RegisterHelper
 {
     BackendRegistryInstance(),
     RefBackend::GetIdStatic(),
@@ -52,4 +54,10 @@
     return Optimizations{};
 }
 
+IBackendInternal::ILayerSupportSharedPtr RefBackend::GetLayerSupport() const
+{
+    static ILayerSupportSharedPtr layerSupport{new RefLayerSupport};
+    return layerSupport;
+}
+
 } // namespace armnn
\ No newline at end of file
diff --git a/src/backends/reference/RefBackend.hpp b/src/backends/reference/RefBackend.hpp
index be71f35..12d56ff 100644
--- a/src/backends/reference/RefBackend.hpp
+++ b/src/backends/reference/RefBackend.hpp
@@ -21,6 +21,7 @@
     IBackendInternal::IWorkloadFactoryPtr CreateWorkloadFactory() const override;
     IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const override;
     IBackendInternal::Optimizations GetOptimizations() const override;
+    IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override;
 };
 
 } // namespace armnn
\ No newline at end of file
diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp
index b057370..d6c1e66 100644
--- a/src/backends/reference/RefLayerSupport.cpp
+++ b/src/backends/reference/RefLayerSupport.cpp
@@ -10,7 +10,7 @@
 #include <LayerSupportCommon.hpp>
 #include <armnn/Types.hpp>
 
-#include <backendsCommon/LayerSupportRegistry.hpp>
+#include <backendsCommon/BackendRegistry.hpp>
 
 #include <boost/core/ignore_unused.hpp>
 
@@ -22,21 +22,6 @@
 namespace
 {
 
-ILayerSupportSharedPtr GetLayerSupportPointer()
-{
-    static ILayerSupportSharedPtr instance{new RefLayerSupport};
-    return instance;
-}
-
-static StaticRegistryInitializer<LayerSupportRegistry> g_RegisterHelper{
-    LayerSupportRegistryInstance(),
-    RefBackendId(),
-    []()
-    {
-        return GetLayerSupportPointer();
-    }
-};
-
 template<typename Float32Func, typename Uint8Func, typename ... Params>
 bool IsSupportedForDataTypeRef(Optional<std::string&> reasonIfUnsupported,
                                DataType dataType,