aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnn/test')
-rw-r--r--src/armnn/test/OptimizerTests.cpp8
-rw-r--r--src/armnn/test/UtilsTests.cpp12
2 files changed, 20 insertions, 0 deletions
diff --git a/src/armnn/test/OptimizerTests.cpp b/src/armnn/test/OptimizerTests.cpp
index fa860abb64..896fdfd68c 100644
--- a/src/armnn/test/OptimizerTests.cpp
+++ b/src/armnn/test/OptimizerTests.cpp
@@ -10,6 +10,7 @@
#include <Network.hpp>
#include <Optimizer.hpp>
+#include <armnn/BackendHelper.hpp>
#include <armnn/BackendRegistry.hpp>
#include <armnn/INetwork.hpp>
#include <armnn/LayerVisitorBase.hpp>
@@ -679,6 +680,13 @@ public:
};
};
+BOOST_AUTO_TEST_CASE(BackendCapabilityTest)
+{
+ BackendId backendId ="MockBackend";
+ // MockBackend does not support the NonConstWeights capability
+ BOOST_CHECK(!armnn::IsCapabilitySupported(backendId, armnn::BackendCapability::NonConstWeights));
+}
+
BOOST_AUTO_TEST_CASE(BackendHintTest)
{
class TestBackendAssignment : public LayerVisitorBase<VisitorNoThrowPolicy>
diff --git a/src/armnn/test/UtilsTests.cpp b/src/armnn/test/UtilsTests.cpp
index 7776a2d3cf..f0198cb9d4 100644
--- a/src/armnn/test/UtilsTests.cpp
+++ b/src/armnn/test/UtilsTests.cpp
@@ -278,6 +278,18 @@ 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()