diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-08-14 14:13:47 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-08-20 16:09:45 +0100 |
commit | 5eb5f1f8e6ae4d8efbd2c57572f2aa5c4e8805f4 (patch) | |
tree | ad147413b5bf30893ca96ed73cc6c6137f8c90a8 | |
parent | 64b19b548bd23f25c81006f378b7631d0288e26e (diff) | |
download | android-nn-driver-5eb5f1f8e6ae4d8efbd2c57572f2aa5c4e8805f4.tar.gz |
IVGCVSW-3656 Make the reference backend optional
* Added ARMNN_COMPUTE_REF_ENABLED to programmatically
build the reference backend
* Adjusted the makefiles to allow any backend combination to build
* Refactoring where necessary
Change-Id: I04cf23245971fcd460b776dd60e01cacb0458dab
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
-rw-r--r-- | Android.mk | 39 |
1 files changed, 31 insertions, 8 deletions
@@ -37,17 +37,25 @@ ARMNN_UTILS_HEADER_PATH := $(LOCAL_PATH)/armnn/src/armnnUtils OPENCL_HEADER_PATH := $(LOCAL_PATH)/clframework/include NN_HEADER_PATH := $(LOCAL_PATH)/../../../frameworks/ml/nn/runtime/include -# Variables to control CL/NEON backend support -# Set them to '0' to disable support for a specific backend +# Variables to control CL/NEON/reference backend support +# +# They can be optionally passed from the command line to build the backends programmatically +# For example, to disable CL support, do from the top of the Android source tree: +# ARMNN_COMPUTE_CL_ENABLED=0 make +# Or export it as an environment variable, export ARMNN_COMPUTE_CL_ENABLED=0, and then run the make command +# +# Set the following default values to '0' to disable support for a specific backend +ifndef ARMNN_COMPUTE_CL_ENABLED +# ARMNN_COMPUTE_CL_ENABLED is undefined, use the following default value ARMNN_COMPUTE_CL_ENABLED := 1 +endif +ifndef ARMNN_COMPUTE_NEON_ENABLED +# ARMNN_COMPUTE_NEON_ENABLED is undefined, use the following default value ARMNN_COMPUTE_NEON_ENABLED := 1 - -ifeq ($(ARMNN_COMPUTE_CL_ENABLE),0) -ARMNN_COMPUTE_CL_ENABLED := 0 endif - -ifeq ($(ARMNN_COMPUTE_NEON_ENABLE),0) -ARMNN_COMPUTE_NEON_ENABLED := 0 +ifndef ARMNN_COMPUTE_REF_ENABLED +# ARMNN_COMPUTE_REF_ENABLED is undefined, use the following default value +ARMNN_COMPUTE_REF_ENABLED := 1 endif ####################### @@ -106,6 +114,11 @@ LOCAL_CFLAGS += \ -DARMCOMPUTENEON_ENABLED endif # ARMNN_COMPUTE_NEON_ENABLED == 1 +ifeq ($(ARMNN_COMPUTE_REF_ENABLED),1) +LOCAL_CFLAGS += \ + -DARMCOMPUTEREF_ENABLED +endif # ARMNN_COMPUTE_REF_ENABLED == 1 + LOCAL_SRC_FILES := \ 1.0/ArmnnDriverImpl.cpp \ 1.0/HalPolicy.cpp \ @@ -218,6 +231,11 @@ LOCAL_CFLAGS += \ -DARMCOMPUTENEON_ENABLED endif # ARMNN_COMPUTE_NEON_ENABLED == 1 +ifeq ($(ARMNN_COMPUTE_REF_ENABLED),1) +LOCAL_CFLAGS += \ + -DARMCOMPUTEREF_ENABLED +endif # ARMNN_COMPUTE_REF_ENABLED == 1 + LOCAL_SRC_FILES := \ 1.0/ArmnnDriverImpl.cpp \ 1.0/HalPolicy.cpp \ @@ -322,6 +340,11 @@ LOCAL_CFLAGS += \ -DARMCOMPUTENEON_ENABLED endif # ARMNN_COMPUTE_NEON_ENABLED == 1 +ifeq ($(ARMNN_COMPUTE_REF_ENABLED),1) +LOCAL_CFLAGS += \ + -DARMCOMPUTEREF_ENABLED +endif # ARMNN_COMPUTE_REF_ENABLED == 1 + LOCAL_SRC_FILES := \ 1.0/ArmnnDriverImpl.cpp \ 1.0/HalPolicy.cpp \ |