IVGCVSW-2603 The macros ARMCOMPUTECL_ENABLED and ARMCOMPUTENEON_ENABLED
no longer work
* Added two master variables ARMNN_COMPUTE_CL_ENABLED and ARMNN_COMPUTE_NEON_ENABLED
to android-nn-driver/Android.mk to easily control backend support
* Setting either of those two new variables then properly sets the
corresponding build macro
* If a specific backend gets disabled, the corresponding source files
will be excluded from the build
* Unified the usage of the pre-compile macros
!android-nn-driver:613
Change-Id: I582ff73493b70ba9e22ca2e38d875a0f19566c8a
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
diff --git a/src/backends/aclCommon/BaseMemoryManager.hpp b/src/backends/aclCommon/BaseMemoryManager.hpp
index a880b9a..b8d1922 100644
--- a/src/backends/aclCommon/BaseMemoryManager.hpp
+++ b/src/backends/aclCommon/BaseMemoryManager.hpp
@@ -7,11 +7,11 @@
#include <backendsCommon/IMemoryManager.hpp>
#include <backendsCommon/WorkloadFactory.hpp>
-#ifdef ARMCOMPUTENEON_ENABLED
+#if defined(ARMCOMPUTENEON_ENABLED)
#include <arm_compute/runtime/MemoryGroup.h>
#endif
-#ifdef ARMCOMPUTECL_ENABLED
+#if defined(ARMCOMPUTECL_ENABLED)
#include <arm_compute/runtime/CL/CLMemoryGroup.h>
#endif
@@ -40,7 +40,6 @@
void Release() override;
#if defined(ARMCOMPUTENEON_ENABLED) || defined(ARMCOMPUTECL_ENABLED)
-
BaseMemoryManager(std::unique_ptr<arm_compute::IAllocator> alloc, MemoryAffinity memoryAffinity);
std::shared_ptr<arm_compute::MemoryManagerOnDemand>& GetIntraLayerManager() { return m_IntraLayerMemoryMgr; }
@@ -57,17 +56,16 @@
virtual std::shared_ptr<arm_compute::IMemoryGroup>
CreateMemoryGroup(const std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager) = 0;
-
#endif
};
+#if defined(ARMCOMPUTENEON_ENABLED)
class NeonMemoryManager : public BaseMemoryManager
{
public:
NeonMemoryManager() {}
virtual ~NeonMemoryManager() {}
-#ifdef ARMCOMPUTENEON_ENABLED
NeonMemoryManager(std::unique_ptr<arm_compute::IAllocator> alloc, MemoryAffinity memoryAffinity)
: BaseMemoryManager(std::move(alloc), memoryAffinity)
{
@@ -75,18 +73,18 @@
}
protected:
- virtual std::shared_ptr<arm_compute::IMemoryGroup>
+ std::shared_ptr<arm_compute::IMemoryGroup>
CreateMemoryGroup(const std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager) override;
-#endif
};
+#endif
+#if defined(ARMCOMPUTECL_ENABLED)
class ClMemoryManager : public BaseMemoryManager
{
public:
ClMemoryManager() {}
virtual ~ClMemoryManager() {}
-#ifdef ARMCOMPUTECL_ENABLED
ClMemoryManager(std::unique_ptr<arm_compute::IAllocator> alloc)
: BaseMemoryManager(std::move(alloc), MemoryAffinity::Buffer)
{
@@ -94,9 +92,9 @@
}
protected:
- virtual std::shared_ptr<arm_compute::IMemoryGroup>
+ std::shared_ptr<arm_compute::IMemoryGroup>
CreateMemoryGroup(const std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager) override;
-#endif
};
+#endif
} //namespace armnn