From cbcd2d1a11f650445177fcbc2926e7eec0d32622 Mon Sep 17 00:00:00 2001 From: Francis Murtagh Date: Mon, 16 Aug 2021 11:59:53 +0100 Subject: Bugfix: Only run ClCustomAllocatorCpuAccNegativeTest if Neon Enabled * Also call DeregisterAllocator on CpuAcc backend. * Removed problematic ClCustomAllocatorGpuAccNullptrTest unit test. Signed-off-by: Francis Murtagh Signed-off-by: Matthew Sloyan Change-Id: Ia2894c82a2b5de1c8d662551ea07b9123dd682cb --- src/backends/cl/test/ClCustomAllocatorTests.cpp | 31 +++++++------------------ 1 file 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 #include #include +#if defined(ARMCOMPUTENEON_ENABLED) +#include +#endif #include @@ -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(); - 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 -- cgit v1.2.1