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/cl/ClLayerSupport.cpp b/src/backends/cl/ClLayerSupport.cpp
index a7c1358..cfc0f11 100644
--- a/src/backends/cl/ClLayerSupport.cpp
+++ b/src/backends/cl/ClLayerSupport.cpp
@@ -14,7 +14,7 @@
#include <boost/core/ignore_unused.hpp>
-#ifdef ARMCOMPUTECL_ENABLED
+#if defined(ARMCOMPUTECL_ENABLED)
#include "workloads/ClAdditionWorkload.hpp"
#include "workloads/ClActivationWorkload.hpp"
#include "workloads/ClBatchNormalizationFloatWorkload.hpp"
@@ -72,7 +72,7 @@
bool IsClBackendSupported(Optional<std::string&> reasonIfUnsupported)
{
-#if ARMCOMPUTECL_ENABLED
+#if defined(ARMCOMPUTECL_ENABLED)
return true;
#else
if (reasonIfUnsupported)
@@ -83,13 +83,13 @@
#endif
}
-#if ARMCOMPUTECL_ENABLED
+#if defined(ARMCOMPUTECL_ENABLED)
#define FORWARD_CL_LAYER_SUPPORT_FUNC(expr) (expr)
#else
#define FORWARD_CL_LAYER_SUPPORT_FUNC(expr) IsClBackendSupported(reasonIfUnsupported)
#endif
-#if ARMCOMPUTECL_ENABLED
+#if defined(ARMCOMPUTECL_ENABLED)
template<class FuncType, class... Args>
inline bool IsWorkloadSupported(FuncType&& func, Optional<std::string&> reasonIfUnsupported, Args&&... args)
{