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
diff --git a/src/armnn/Runtime.cpp b/src/armnn/Runtime.cpp
index 9fe5828..5a52888 100644
--- a/src/armnn/Runtime.cpp
+++ b/src/armnn/Runtime.cpp
@@ -307,6 +307,8 @@
                 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 e3ffd18..732db61 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