diff options
author | David Monahan <david.monahan@arm.com> | 2021-08-11 10:22:35 +0100 |
---|---|---|
committer | David Monahan <david.monahan@arm.com> | 2021-08-11 10:22:35 +0100 |
commit | 75b981dba849db74b1cb74438348cbcad54bf45d (patch) | |
tree | e1e4a319c22d0caea5c7641a126e1eac7a0c7dfd | |
parent | e5339e7013cf24e5a34509fb0a60377e5f8a244e (diff) | |
download | armnn-75b981dba849db74b1cb74438348cbcad54bf45d.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.cpp | 2 | ||||
-rw-r--r-- | src/backends/aclCommon/BaseMemoryManager.hpp | 3 |
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 |