aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Murtagh <francis.murtagh@arm.com>2021-08-16 11:59:53 +0100
committerMatthew Sloyan <matthew.sloyan@arm.com>2021-08-16 20:31:25 +0100
commitcbcd2d1a11f650445177fcbc2926e7eec0d32622 (patch)
tree0050744d6c30dd9cf96925bb2c075cf6ca4cd7ae
parent98f3afb890f1bddf4798e59e4ef95098f44521f4 (diff)
downloadarmnn-cbcd2d1a11f650445177fcbc2926e7eec0d32622.tar.gz
Bugfix: Only run ClCustomAllocatorCpuAccNegativeTest if Neon Enabled
* Also call DeregisterAllocator on CpuAcc backend. * Removed problematic ClCustomAllocatorGpuAccNullptrTest unit test. Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: Ia2894c82a2b5de1c8d662551ea07b9123dd682cb
-rw-r--r--src/backends/cl/test/ClCustomAllocatorTests.cpp31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/backends/cl/test/ClCustomAllocatorTests.cpp b/src/backends/cl/test/ClCustomAllocatorTests.cpp
index 86e1182703..a9b9e41a34 100644
--- a/src/backends/cl/test/ClCustomAllocatorTests.cpp
+++ b/src/backends/cl/test/ClCustomAllocatorTests.cpp
@@ -11,6 +11,9 @@
#include <armnn/Utils.hpp>
#include <armnn/BackendRegistry.hpp>
#include <cl/ClBackend.hpp>
+#if defined(ARMCOMPUTENEON_ENABLED)
+#include <neon/NeonBackend.hpp>
+#endif
#include <doctest/doctest.h>
@@ -166,6 +169,9 @@ TEST_CASE("ClCustomAllocatorTest")
backendRegistry.DeregisterAllocator(ClBackend::GetIdStatic());
}
+// Only run this test if NEON is enabled
+#if defined(ARMCOMPUTENEON_ENABLED)
+
TEST_CASE("ClCustomAllocatorCpuAccNegativeTest")
{
using namespace armnn;
@@ -197,30 +203,9 @@ TEST_CASE("ClCustomAllocatorCpuAccNegativeTest")
CHECK(errMessages.size() > 0);
auto& backendRegistry = armnn::BackendRegistryInstance();
- backendRegistry.DeregisterAllocator(ClBackend::GetIdStatic());
+ backendRegistry.DeregisterAllocator(NeonBackend::GetIdStatic());
}
-TEST_CASE("ClCustomAllocatorGpuAccNullptrTest")
-{
- using namespace armnn;
-
- // Create ArmNN runtime
- IRuntime::CreationOptions options; // default options
- auto customAllocator = std::make_shared<SampleClBackendCustomAllocator>();
- options.m_CustomAllocatorMap = {{"GpuAcc", nullptr}};
-
- try
- {
- IRuntimePtr run = IRuntime::Create(options);
- FAIL("Should have thrown an exception in RuntimeImpl::RuntimeImpl().");
- }
- catch (const armnn::Exception& e)
- {
- // Caught successfully
- }
-
- auto& backendRegistry = armnn::BackendRegistryInstance();
- backendRegistry.DeregisterAllocator(ClBackend::GetIdStatic());
-}
+#endif
} // test suite ClCustomAllocatorTests \ No newline at end of file