aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFinn Williams <Finn.Williams@arm.com>2021-05-26 18:38:12 +0100
committerFinn Williams <Finn.Williams@arm.com>2021-06-09 17:18:10 +0100
commitb9af86ea42568ade799ee5529137e4756977b6c6 (patch)
tree261003078fd2191b22ee7465e07668cbed666553
parent5b1bcc93820b442bc4035c1e030a8d4a0983df91 (diff)
downloadarmnn-b9af86ea42568ade799ee5529137e4756977b6c6.tar.gz
IVGCVSW-5855 Refactor the reporting of capabilities from backends
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I05fc331a8e91bdcb6b8a2f32cfb555060fc5d797
-rw-r--r--include/armnn/BackendHelper.hpp26
-rw-r--r--include/armnn/BackendOptions.hpp1
-rw-r--r--include/armnn/backends/IBackendInternal.hpp9
-rw-r--r--src/armnn/BackendHelper.cpp93
-rw-r--r--src/armnn/test/OptimizerTests.cpp8
-rw-r--r--src/armnn/test/UtilsTests.cpp12
-rw-r--r--src/backends/backendsCommon/test/CMakeLists.txt6
-rw-r--r--src/backends/backendsCommon/test/CompatibilityTests.cpp61
-rw-r--r--src/backends/cl/ClBackend.cpp10
-rw-r--r--src/backends/cl/ClBackend.hpp14
-rw-r--r--src/backends/neon/NeonBackend.cpp10
-rw-r--r--src/backends/neon/NeonBackend.hpp15
-rw-r--r--src/backends/reference/RefBackend.cpp4
-rw-r--r--src/backends/reference/RefBackend.hpp18
14 files changed, 225 insertions, 62 deletions
diff --git a/include/armnn/BackendHelper.hpp b/include/armnn/BackendHelper.hpp
index 5eadab5e20..527d865694 100644
--- a/include/armnn/BackendHelper.hpp
+++ b/include/armnn/BackendHelper.hpp
@@ -6,6 +6,7 @@
#pragma once
#include <armnn/BackendId.hpp>
+#include <armnn/BackendOptions.hpp>
#include <armnn/backends/ILayerSupport.hpp>
#include <armnn/Types.hpp>
@@ -436,7 +437,32 @@ private:
/// Convenience function to retrieve the ILayerSupportHandle for a backend
LayerSupportHandle GetILayerSupportByBackendId(const armnn::BackendId& backend);
+/// Convenience function to check if a capability exists in a BackendCapabilites struct
+bool HasCapability(const std::string& name,const BackendCapabilities& capabilities);
+
+/// Convenience function to check if a capability exists in a backend
+bool HasCapability(const std::string& name, const armnn::BackendId& backend);
+
+/// Convenience function to check if a given capability matches a capability in a BackendCapabilities struct
+bool HasCapability(const BackendOptions::BackendOption& capability, const BackendCapabilities& capabilities);
+
+/// Convenience function to check if a given capability matches a capability in a backend
+bool HasCapability(const BackendOptions::BackendOption& backendOption, const armnn::BackendId& backend);
+
+/// Returns a BackendCapability if the backend lists the capability
+/// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
+/// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
+Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
+ const BackendCapabilities& capabilities);
+
+/// Returns a BackendCapability if the backend lists the capability
+/// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
+/// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
+Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
+ const armnn::BackendId& backend);
+
/// Convenience function to check a capability on a backend
+ARMNN_DEPRECATED_MSG("This function has been deprecated in favour of GetBackendCapability")
bool IsCapabilitySupported(const armnn::BackendId& backend, armnn::BackendCapability capability);
}
diff --git a/include/armnn/BackendOptions.hpp b/include/armnn/BackendOptions.hpp
index b705f41505..b8bf8f51f2 100644
--- a/include/armnn/BackendOptions.hpp
+++ b/include/armnn/BackendOptions.hpp
@@ -15,6 +15,7 @@ struct BackendOptions;
using NetworkOptions = std::vector<BackendOptions>;
using ModelOptions = std::vector<BackendOptions>;
+using BackendCapabilities = BackendOptions;
/// Struct for the users to pass backend specific options
struct BackendOptions
diff --git a/include/armnn/backends/IBackendInternal.hpp b/include/armnn/backends/IBackendInternal.hpp
index 135d279c21..b8edfe1f71 100644
--- a/include/armnn/backends/IBackendInternal.hpp
+++ b/include/armnn/backends/IBackendInternal.hpp
@@ -178,7 +178,16 @@ public:
/// Returns the version of the Backend API
static constexpr BackendVersion GetApiVersion() { return BackendVersion(1, 0); }
+ /// Returns a BackendCapability if the backend lists the capability
+ /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
+ /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
+ virtual BackendCapabilities GetCapabilities() const
+ {
+ return BackendCapabilities("IBackendInternal NullCapabilities");
+ };
+
/// Returns true if backend support the capability false otherwise
+ ARMNN_DEPRECATED_MSG("This function has been deprecated in favour of GetCapability")
virtual bool HasCapability(BackendCapability /*capabilityClass*/) const { return false; }
};
diff --git a/src/armnn/BackendHelper.cpp b/src/armnn/BackendHelper.cpp
index 31dfaa53a3..be21412e97 100644
--- a/src/armnn/BackendHelper.cpp
+++ b/src/armnn/BackendHelper.cpp
@@ -26,6 +26,89 @@ LayerSupportHandle GetILayerSupportByBackendId(const armnn::BackendId& backend)
return LayerSupportHandle(backendObject->GetLayerSupport(), backend);
}
+Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
+ const BackendCapabilities& capabilities)
+{
+ for (size_t i=0; i < capabilities.GetOptionCount(); i++)
+ {
+ const auto& capability = capabilities.GetOption(i);
+ if (backendCapabilityName == capability.GetName())
+ {
+ return capability;
+ }
+ }
+ return EmptyOptional();
+}
+
+Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
+ const armnn::BackendId& backend)
+{
+ auto const& backendRegistry = armnn::BackendRegistryInstance();
+ if (backendRegistry.IsBackendRegistered(backend))
+ {
+ auto factoryFunc = backendRegistry.GetFactory(backend);
+ auto backendObject = factoryFunc();
+ auto capabilities = backendObject->GetCapabilities();
+ return GetCapability(backendCapabilityName, capabilities);
+ }
+ return EmptyOptional();
+}
+
+bool HasCapability(const std::string& name, const BackendCapabilities& capabilities)
+{
+ return GetCapability(name, capabilities).has_value();
+}
+
+bool HasCapability(const std::string& name, const armnn::BackendId& backend)
+{
+ return GetCapability(name, backend).has_value();
+}
+
+bool HasCapability(const BackendOptions::BackendOption& capability, const BackendCapabilities& capabilities)
+{
+ for (size_t i=0; i < capabilities.GetOptionCount(); i++)
+ {
+ const auto& backendCapability = capabilities.GetOption(i);
+ if (capability.GetName() == backendCapability.GetName())
+ {
+ if (capability.GetValue().IsBool() && backendCapability.GetValue().IsBool())
+ {
+ return capability.GetValue().AsBool() == backendCapability.GetValue().AsBool();
+ }
+ else if(capability.GetValue().IsFloat() && backendCapability.GetValue().IsFloat())
+ {
+ return capability.GetValue().AsFloat() == backendCapability.GetValue().AsFloat();
+ }
+ else if(capability.GetValue().IsInt() && backendCapability.GetValue().IsInt())
+ {
+ return capability.GetValue().AsInt() == backendCapability.GetValue().AsInt();
+ }
+ else if(capability.GetValue().IsString() && backendCapability.GetValue().IsString())
+ {
+ return capability.GetValue().AsString() == backendCapability.GetValue().AsString();
+ }
+ else if(capability.GetValue().IsUnsignedInt() && backendCapability.GetValue().IsUnsignedInt())
+ {
+ return capability.GetValue().AsUnsignedInt() == backendCapability.GetValue().AsUnsignedInt();
+ }
+ }
+ }
+ return false;
+}
+
+bool HasCapability(const BackendOptions::BackendOption& backendOption, const armnn::BackendId& backend)
+{
+ auto const& backendRegistry = armnn::BackendRegistryInstance();
+ if (backendRegistry.IsBackendRegistered(backend))
+ {
+ auto factoryFunc = backendRegistry.GetFactory(backend);
+ auto backendObject = factoryFunc();
+ auto capabilities = backendObject->GetCapabilities();
+ return HasCapability(backendOption, capabilities);
+ }
+ return false;
+}
+
/// Convenience function to check a capability on a backend
bool IsCapabilitySupported(const armnn::BackendId& backend, armnn::BackendCapability capability)
{
@@ -35,7 +118,9 @@ bool IsCapabilitySupported(const armnn::BackendId& backend, armnn::BackendCapabi
{
auto factoryFunc = backendRegistry.GetFactory(backend);
auto backendObject = factoryFunc();
+ ARMNN_NO_DEPRECATE_WARN_BEGIN
hasCapability = backendObject->HasCapability(capability);
+ ARMNN_NO_DEPRECATE_WARN_END
}
return hasCapability;
}
@@ -316,12 +401,12 @@ bool LayerSupportHandle::IsFullyConnectedSupported(const TensorInfo& input,
{
if(!descriptor.m_ConstantWeights && !m_BackendId.IsUndefined())
{
- bool result = false;
- result = IsCapabilitySupported(m_BackendId, BackendCapability::NonConstWeights);
- if (!result)
+ auto capability = GetCapability("NonConstWeights", m_BackendId);
+ if (capability.has_value() && capability.value().GetValue().AsBool() == true)
{
- return result;
+ return true;
}
+ return false;
}
return m_LayerSupport->IsFullyConnectedSupported(input,
diff --git a/src/armnn/test/OptimizerTests.cpp b/src/armnn/test/OptimizerTests.cpp
index fcfff1a807..7fe69a9380 100644
--- a/src/armnn/test/OptimizerTests.cpp
+++ b/src/armnn/test/OptimizerTests.cpp
@@ -615,11 +615,15 @@ public:
BOOST_AUTO_TEST_CASE(BackendCapabilityTest)
{
BackendId backendId = "MockBackend";
+
+ armnn::BackendOptions::BackendOption nonConstWeights{"NonConstWeights", true};
+
// MockBackend does not support the NonConstWeights capability
- BOOST_CHECK(!armnn::IsCapabilitySupported(backendId, armnn::BackendCapability::NonConstWeights));
+ BOOST_CHECK(!armnn::HasCapability(nonConstWeights, backendId));
+ BOOST_CHECK(!armnn::HasCapability("NonConstWeights", backendId));
// MockBackend does not support the AsyncExecution capability
- BOOST_CHECK(!armnn::IsCapabilitySupported(backendId, armnn::BackendCapability::AsyncExecution));
+ BOOST_CHECK(!armnn::GetCapability("AsyncExecution", backendId).has_value());
}
BOOST_AUTO_TEST_CASE(BackendHintTest)
diff --git a/src/armnn/test/UtilsTests.cpp b/src/armnn/test/UtilsTests.cpp
index 77883ba4fb..f2ca95d7bd 100644
--- a/src/armnn/test/UtilsTests.cpp
+++ b/src/armnn/test/UtilsTests.cpp
@@ -321,18 +321,6 @@ BOOST_AUTO_TEST_CASE(LayerSupportHandle)
BOOST_CHECK(layerSupportObject.IsBackendRegistered());
}
-
-BOOST_AUTO_TEST_CASE(IsCapabilitySupported_CpuRef)
-{
- BOOST_CHECK(armnn::IsCapabilitySupported(armnn::Compute::CpuRef, armnn::BackendCapability::NonConstWeights));
-}
-#endif
-
-#if defined(ARMCOMPUTENEON_ENABLED)
-BOOST_AUTO_TEST_CASE(IsCapabilitySupported_CpuAcc)
-{
- BOOST_CHECK(!armnn::IsCapabilitySupported(armnn::Compute::CpuAcc, armnn::BackendCapability::NonConstWeights));
-}
#endif
BOOST_AUTO_TEST_SUITE_END()
diff --git a/src/backends/backendsCommon/test/CMakeLists.txt b/src/backends/backendsCommon/test/CMakeLists.txt
index 98b800bda2..6313bd5cc9 100644
--- a/src/backends/backendsCommon/test/CMakeLists.txt
+++ b/src/backends/backendsCommon/test/CMakeLists.txt
@@ -13,6 +13,7 @@ list(APPEND armnnBackendsCommonUnitTests_sources
CommonTestUtils.cpp
CommonTestUtils.hpp
ComparisonEndToEndTestImpl.hpp
+ CompatibilityTests.cpp
DataLayoutUtils.hpp
DataTypeUtils.hpp
DefaultAsyncExecuteTest.cpp
@@ -182,11 +183,6 @@ if (ARMNNREF)
)
endif()
-if(ARMCOMPUTENEON AND ARMCOMPUTECL)
- list(APPEND armnnBackendsCommonUnitTests_sources
- CompatibilityTests.cpp)
-endif()
-
add_library(armnnBackendsCommonUnitTests OBJECT ${armnnBackendsCommonUnitTests_sources})
target_include_directories(armnnBackendsCommonUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src/armnn)
target_include_directories(armnnBackendsCommonUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src/armnnUtils)
diff --git a/src/backends/backendsCommon/test/CompatibilityTests.cpp b/src/backends/backendsCommon/test/CompatibilityTests.cpp
index 0f889f416c..ed00088549 100644
--- a/src/backends/backendsCommon/test/CompatibilityTests.cpp
+++ b/src/backends/backendsCommon/test/CompatibilityTests.cpp
@@ -8,6 +8,7 @@
#include <cl/ClBackend.hpp>
#include <neon/NeonBackend.hpp>
#include <reference/RefBackend.hpp>
+#include <armnn/BackendHelper.hpp>
#include <Network.hpp>
@@ -18,6 +19,7 @@ using namespace armnn;
BOOST_AUTO_TEST_SUITE(BackendsCompatibility, * boost::unit_test::disabled())
+#if defined(ARMCOMPUTENEON_ENABLED)
BOOST_AUTO_TEST_CASE(Neon_Cl_DirectCompatibility_Test)
{
auto neonBackend = std::make_unique<NeonBackend>();
@@ -114,7 +116,7 @@ BOOST_AUTO_TEST_CASE(Neon_Cl_DirectCompatibility_Test)
});
BOOST_TEST(importCount == 0);
}
-
+#endif
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE(BackendCapability)
@@ -124,9 +126,38 @@ BOOST_AUTO_TEST_SUITE(BackendCapability)
BOOST_AUTO_TEST_CASE(Ref_Backends_Capability_Test)
{
auto refBackend = std::make_unique<RefBackend>();
- BOOST_CHECK(refBackend->HasCapability(armnn::BackendCapability::NonConstWeights));
+ auto refCapabilities = refBackend->GetCapabilities();
- BOOST_CHECK(!refBackend->HasCapability(armnn::BackendCapability::AsyncExecution));
+ BOOST_CHECK(armnn::HasCapability("NonConstWeights", refCapabilities));
+ BOOST_CHECK(armnn::HasCapability("AsyncExecution", refCapabilities));
+
+ armnn::BackendOptions::BackendOption nonConstWeights{"NonConstWeights", true};
+ armnn::BackendOptions::BackendOption AsyncExecution{"AsyncExecution", true};
+
+ BOOST_CHECK(armnn::HasCapability(nonConstWeights, refCapabilities));
+ BOOST_CHECK(armnn::HasCapability(AsyncExecution, refCapabilities));
+}
+
+BOOST_AUTO_TEST_CASE(Ref_Backends_Unkown_Capability_Test)
+{
+ auto refBackend = std::make_unique<RefBackend>();
+ auto refCapabilities = refBackend->GetCapabilities();
+
+ armnn::BackendOptions::BackendOption AsyncExecutionFalse{"AsyncExecution", false};
+ BOOST_CHECK(!armnn::HasCapability(AsyncExecutionFalse, refCapabilities));
+
+ armnn::BackendOptions::BackendOption AsyncExecutionInt{"AsyncExecution", 50};
+ BOOST_CHECK(!armnn::HasCapability(AsyncExecutionFalse, refCapabilities));
+
+ armnn::BackendOptions::BackendOption AsyncExecutionFloat{"AsyncExecution", 0.0f};
+ BOOST_CHECK(!armnn::HasCapability(AsyncExecutionFloat, refCapabilities));
+
+ armnn::BackendOptions::BackendOption AsyncExecutionString{"AsyncExecution", "true"};
+ BOOST_CHECK(!armnn::HasCapability(AsyncExecutionString, refCapabilities));
+
+ BOOST_CHECK(!armnn::HasCapability("Telekinesis", refCapabilities));
+ armnn::BackendOptions::BackendOption unkownCapability{"Telekinesis", true};
+ BOOST_CHECK(!armnn::HasCapability(unkownCapability, refCapabilities));
}
#endif
@@ -136,7 +167,16 @@ BOOST_AUTO_TEST_CASE(Ref_Backends_Capability_Test)
BOOST_AUTO_TEST_CASE(Neon_Backends_Capability_Test)
{
auto neonBackend = std::make_unique<NeonBackend>();
- BOOST_CHECK(!neonBackend->HasCapability(armnn::BackendCapability::NonConstWeights));
+ auto neonCapabilities = neonBackend->GetCapabilities();
+
+ BOOST_CHECK(armnn::HasCapability("NonConstWeights", neonCapabilities));
+ BOOST_CHECK(armnn::HasCapability("AsyncExecution", neonCapabilities));
+
+ armnn::BackendOptions::BackendOption nonConstWeights{"NonConstWeights", false};
+ armnn::BackendOptions::BackendOption AsyncExecution{"AsyncExecution", false};
+
+ BOOST_CHECK(armnn::HasCapability(nonConstWeights, neonCapabilities));
+ BOOST_CHECK(armnn::HasCapability(AsyncExecution, neonCapabilities));
}
#endif
@@ -145,8 +185,17 @@ BOOST_AUTO_TEST_CASE(Neon_Backends_Capability_Test)
BOOST_AUTO_TEST_CASE(Cl_Backends_Capability_Test)
{
- auto clBackend = std::make_unique<ClBackend>();
- BOOST_CHECK(!clBackend->HasCapability(armnn::BackendCapability::NonConstWeights));
+ auto clBackend = std::make_unique<ClBackend>();
+ auto clCapabilities = clBackend->GetCapabilities();
+
+ BOOST_CHECK(armnn::HasCapability("NonConstWeights", clCapabilities));
+ BOOST_CHECK(armnn::HasCapability("AsyncExecution", clCapabilities));
+
+ armnn::BackendOptions::BackendOption nonConstWeights{"NonConstWeights", false};
+ armnn::BackendOptions::BackendOption AsyncExecution{"AsyncExecution", false};
+
+ BOOST_CHECK(armnn::HasCapability(nonConstWeights, clCapabilities));
+ BOOST_CHECK(armnn::HasCapability(AsyncExecution, clCapabilities));
}
#endif
diff --git a/src/backends/cl/ClBackend.cpp b/src/backends/cl/ClBackend.cpp
index a9ab237325..f1e52c1998 100644
--- a/src/backends/cl/ClBackend.cpp
+++ b/src/backends/cl/ClBackend.cpp
@@ -177,16 +177,6 @@ IBackendInternal::ILayerSupportSharedPtr ClBackend::GetLayerSupport(const ModelO
return layerSupport;
}
-bool ClBackend::HasCapability(BackendCapability capabilityClass) const
-{
- auto search = gpuAccCapabilities.find(capabilityClass);
- if (search != gpuAccCapabilities.end())
- {
- return true;
- }
- return false;
-}
-
OptimizationViews ClBackend::OptimizeSubgraphView(const SubgraphView& subgraph,
const ModelOptions& modelOptions) const
{
diff --git a/src/backends/cl/ClBackend.hpp b/src/backends/cl/ClBackend.hpp
index 252d87edea..db03cfeff0 100644
--- a/src/backends/cl/ClBackend.hpp
+++ b/src/backends/cl/ClBackend.hpp
@@ -9,9 +9,12 @@
namespace armnn
{
-const std::set<armnn::BackendCapability> gpuAccCapabilities {
- // add new capabilities here..
-};
+// add new capabilities here..
+const BackendCapabilities gpuAccCapabilities("GpuAcc",
+ {
+ {"NonConstWeights", false},
+ {"AsyncExecution", false}
+ });
class ClBackend : public IBackendInternal
{
@@ -63,7 +66,10 @@ public:
IBackendInternal::IBackendSpecificModelContextPtr CreateBackendSpecificModelContext(
const ModelOptions& modelOptions) const override;
- bool HasCapability(BackendCapability capabilityClass) const override;
+ BackendCapabilities GetCapabilities() const override
+ {
+ return gpuAccCapabilities;
+ };
};
} // namespace armnn
diff --git a/src/backends/neon/NeonBackend.cpp b/src/backends/neon/NeonBackend.cpp
index b496238cf3..17876753fb 100644
--- a/src/backends/neon/NeonBackend.cpp
+++ b/src/backends/neon/NeonBackend.cpp
@@ -132,16 +132,6 @@ IBackendInternal::ILayerSupportSharedPtr NeonBackend::GetLayerSupport(const Mode
return layerSupport;
}
-bool NeonBackend::HasCapability(BackendCapability capabilityClass) const
-{
- auto search = cpuAccCapabilities.find(capabilityClass);
- if (search != cpuAccCapabilities.end())
- {
- return true;
- }
- return false;
-}
-
OptimizationViews NeonBackend::OptimizeSubgraphView(const SubgraphView& subgraph) const
{
OptimizationViews optimizationViews;
diff --git a/src/backends/neon/NeonBackend.hpp b/src/backends/neon/NeonBackend.hpp
index 34606f992c..eae57320cc 100644
--- a/src/backends/neon/NeonBackend.hpp
+++ b/src/backends/neon/NeonBackend.hpp
@@ -9,9 +9,13 @@
namespace armnn
{
-const std::set<armnn::BackendCapability> cpuAccCapabilities {
- // add new capabilities here..
-};
+// add new capabilities here..
+const BackendCapabilities cpuAccCapabilities("GpuAcc",
+ {
+ {"NonConstWeights", false},
+ {"AsyncExecution", false}
+ });
+
class NeonBackend : public IBackendInternal
{
@@ -52,7 +56,10 @@ public:
IBackendInternal::IBackendSpecificModelContextPtr CreateBackendSpecificModelContext(
const ModelOptions& modelOptions) const override;
- bool HasCapability(BackendCapability capabilityClass) const override;
+ BackendCapabilities GetCapabilities() const override
+ {
+ return cpuAccCapabilities;
+ };
};
} // namespace armnn
diff --git a/src/backends/reference/RefBackend.cpp b/src/backends/reference/RefBackend.cpp
index 85c6a2e1e4..c9f164e0c9 100644
--- a/src/backends/reference/RefBackend.cpp
+++ b/src/backends/reference/RefBackend.cpp
@@ -71,8 +71,8 @@ IBackendInternal::ILayerSupportSharedPtr RefBackend::GetLayerSupport() const
bool RefBackend::HasCapability(BackendCapability capabilityClass) const
{
- auto search = cpuRefCapabilities.find(capabilityClass);
- if (search != cpuRefCapabilities.end())
+ auto search = oldCpuRefCapabilities.find(capabilityClass);
+ if (search != oldCpuRefCapabilities.end())
{
return true;
}
diff --git a/src/backends/reference/RefBackend.hpp b/src/backends/reference/RefBackend.hpp
index 3143173061..441f4ebdf4 100644
--- a/src/backends/reference/RefBackend.hpp
+++ b/src/backends/reference/RefBackend.hpp
@@ -8,11 +8,18 @@
namespace armnn
{
-
-const std::set<armnn::BackendCapability> cpuRefCapabilities {
- armnn::BackendCapability::NonConstWeights,
+// add new capabilities here..
+const BackendCapabilities cpuRefCapabilities("CpuRef",
+ {
+ {"NonConstWeights", true},
+ {"AsyncExecution", true}
+ });
+
+const std::set<armnn::BackendCapability> oldCpuRefCapabilities {
+ armnn::BackendCapability::NonConstWeights,
};
+
class RefBackend : public IBackendInternal
{
public:
@@ -44,6 +51,11 @@ public:
void RegisterTensorHandleFactories(class TensorHandleFactoryRegistry& registry) override;
+ BackendCapabilities GetCapabilities() const override
+ {
+ return cpuRefCapabilities;
+ };
+
bool HasCapability(BackendCapability capabilityClass) const override;
};