aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Monahan <david.monahan@arm.com>2021-08-11 10:22:35 +0100
committerMatthew Sloyan <matthew.sloyan@arm.com>2021-08-11 13:12:36 +0100
commit26f203c6b2e59a3cf5eb8b6e7740261555bf508c (patch)
treee1e4a319c22d0caea5c7641a126e1eac7a0c7dfd
parente5339e7013cf24e5a34509fb0a60377e5f8a244e (diff)
downloadarmnn-26f203c6b2e59a3cf5eb8b6e7740261555bf508c.tar.gz
IVGCVSW-6087 Add an Assertion check to make sure we aren't given null allocators
Add conditional compilation check to Cl specific header Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: Ib196b8ef4dc5fcfd1d1ccd3f29abf8e0ecd020cb
-rw-r--r--src/armnn/Runtime.cpp2
-rw-r--r--src/backends/aclCommon/BaseMemoryManager.hpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/armnn/Runtime.cpp b/src/armnn/Runtime.cpp
index 9fe58287c3..5a52888639 100644
--- a/src/armnn/Runtime.cpp
+++ b/src/armnn/Runtime.cpp
@@ -307,6 +307,8 @@ RuntimeImpl::RuntimeImpl(const IRuntime::CreationOptions& options)
if (customAllocatorMapIterator != options.m_CustomAllocatorMap.end())
{
std::string err;
+ // Check we have actually been given an allocator.
+ ARMNN_ASSERT(customAllocatorMapIterator->second != nullptr);
if (customAllocatorMapIterator->second->GetMemorySourceType()
== armnn::MemorySource::DmaBufProtected)
{
diff --git a/src/backends/aclCommon/BaseMemoryManager.hpp b/src/backends/aclCommon/BaseMemoryManager.hpp
index e3ffd188a1..732db61c52 100644
--- a/src/backends/aclCommon/BaseMemoryManager.hpp
+++ b/src/backends/aclCommon/BaseMemoryManager.hpp
@@ -15,6 +15,9 @@
#include <arm_compute/runtime/IAllocator.h>
#include <arm_compute/runtime/IMemoryGroup.h>
#include <arm_compute/runtime/MemoryManagerOnDemand.h>
+#endif
+
+#if defined(ARMCOMPUTECL_ENABLED)
#include <arm_compute/runtime/CL/CLTensorAllocator.h>
#endif