From e67edb238a3304dd767a34eca484d84bfebf76f5 Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Wed, 14 Aug 2019 14:05:46 +0100 Subject: IVGCVSW-3656 Make the reference backend optional * Made the build of the reference backend depend on a new ARMCOMPUTEREF macro * Made the relevant targets dependent on the ref backend * Moved Cl and Neon static registry initializers to separate files * Wrapped some of the unit tests into proper ifdefs where necessary Change-Id: I7f2c42699682630233a4c4b6aed2f005083de189 Signed-off-by: Matteo Martincigh --- src/backends/reference/backend.mk | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/backends/reference/backend.mk') diff --git a/src/backends/reference/backend.mk b/src/backends/reference/backend.mk index a8df565947..13251b779a 100644 --- a/src/backends/reference/backend.mk +++ b/src/backends/reference/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 reference backend (ARMNN_COMPUTE_REF_ENABLED is declared in android-nn-driver/Android.mk) +ifeq ($(ARMNN_COMPUTE_REF_ENABLED),1) + +# ARMNN_COMPUTE_REF_ENABLED == 1 +# Include the source files for the reference backend + BACKEND_SOURCES := \ RefBackend.cpp \ RefLayerSupport.cpp \ @@ -78,11 +84,25 @@ BACKEND_SOURCES := \ workloads/Softmax.cpp \ workloads/Splitter.cpp \ workloads/TransposeConvolution2d.cpp +else + +# ARMNN_COMPUTE_REF_ENABLED == 0 +# No source file will be compiled for the reference 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_REF_ENABLED is declared in android-nn-driver/Android.mk) +ifeq ($(ARMNN_COMPUTE_REF_ENABLED),1) + +# ARMNN_COMPUTE_REF_ENABLED == 1 +# Include the source files for the CL backend tests + BACKEND_TEST_SOURCES := \ test/RefCreateWorkloadTests.cpp \ test/RefDetectionPostProcessTests.cpp \ @@ -93,3 +113,11 @@ BACKEND_TEST_SOURCES := \ test/RefMemoryManagerTests.cpp \ test/RefOptimizedNetworkTests.cpp \ test/RefRuntimeTests.cpp +else + +# ARMNN_COMPUTE_REF_ENABLED == 0 +# No source file will be compiled for the reference backend tests + +BACKEND_TEST_SOURCES := + +endif -- cgit v1.2.1