diff options
Diffstat (limited to 'src/backends/cl')
-rw-r--r-- | src/backends/cl/ClLayerSupport.cpp | 8 | ||||
-rw-r--r-- | src/backends/cl/backend.mk | 28 |
2 files changed, 32 insertions, 4 deletions
diff --git a/src/backends/cl/ClLayerSupport.cpp b/src/backends/cl/ClLayerSupport.cpp index a7c1358ae7..cfc0f11d25 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 IsMatchingStride(uint32_t actualStride) bool IsClBackendSupported(Optional<std::string&> reasonIfUnsupported) { -#if ARMCOMPUTECL_ENABLED +#if defined(ARMCOMPUTECL_ENABLED) return true; #else if (reasonIfUnsupported) @@ -83,13 +83,13 @@ bool IsClBackendSupported(Optional<std::string&> reasonIfUnsupported) #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) { diff --git a/src/backends/cl/backend.mk b/src/backends/cl/backend.mk index a6d6e002c4..283ebcad89 100644 --- a/src/backends/cl/backend.mk +++ b/src/backends/cl/backend.mk @@ -7,6 +7,12 @@ # in the Android build and it is picked up by the Android.mk # file in the root of ArmNN +# The variable to enable/disable the CL backend (ARMNN_COMPUTE_CL_ENABLED) is declared in android-nn-driver/Android.mk +ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1) + +# ARMNN_COMPUTE_CL_ENABLED == 1 +# Include the source files for the CL backend + BACKEND_SOURCES := \ ClBackend.cpp \ ClBackendContext.cpp \ @@ -46,11 +52,25 @@ BACKEND_SOURCES := \ workloads/ClSpaceToBatchNdWorkload.cpp \ workloads/ClStridedSliceWorkload.cpp \ workloads/ClSubtractionWorkload.cpp +else + +# ARMNN_COMPUTE_CL_ENABLED == 0 +# No source file will be compiled for the CL backend + +BACKEND_SOURCES := + +endif # BACKEND_TEST_SOURCES contains the list of files to be included # in the Android unit test build (armnn-tests) and it is picked # up by the Android.mk file in the root of ArmNN +# The variable to enable/disable the CL backend (ARMNN_COMPUTE_CL_ENABLED) is declared in android-nn-driver/Android.mk +ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1) + +# ARMNN_COMPUTE_CL_ENABLED == 1 +# Include the source files for the CL backend tests + BACKEND_TEST_SOURCES := \ test/ClCreateWorkloadTests.cpp \ test/ClEndToEndTests.cpp \ @@ -62,3 +82,11 @@ BACKEND_TEST_SOURCES := \ test/ClRuntimeTests.cpp \ test/Fp16SupportTest.cpp \ test/OpenClTimerTest.cpp +else + +# ARMNN_COMPUTE_CL_ENABLED == 0 +# No source file will be compiled for the CL backend tests + +BACKEND_TEST_SOURCES := + +endif |