diff options
author | Francis Murtagh <francis.murtagh@arm.com> | 2021-08-16 11:59:53 +0100 |
---|---|---|
committer | Matthew Sloyan <matthew.sloyan@arm.com> | 2021-08-16 18:23:31 +0100 |
commit | b80eaff042d928690eedda6652be5c66e2a81e53 (patch) | |
tree | 0050744d6c30dd9cf96925bb2c075cf6ca4cd7ae /src | |
parent | 57d2c7ebc214c22098172fdd8b77940956bcbaf8 (diff) | |
download | armnn-b80eaff042d928690eedda6652be5c66e2a81e53.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
Diffstat (limited to 'src')
-rw-r--r-- | src/backends/cl/test/ClCustomAllocatorTests.cpp | 31 |
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 |