aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2020-02-11 11:21:25 +0000
committermike.kelly <mike.kelly@arm.com>2020-02-11 11:56:03 +0000
commit0e41513c801582269e173735322bb4a5941d6480 (patch)
treecda8204757a16c67df5ab342bbea8ef0b5c9b9c0
parent7bdaac5383dae5794897da9a006dac372519d1e5 (diff)
downloadandroid-nn-driver-0e41513c801582269e173735322bb4a5941d6480.tar.gz
Partial Revert "IVGCVSW-4130 Remove clframework from android-nn-driver build."
* Partial reversion to restore Android.mk files. * Changed armnn-arm_compute library name to arm_compute_library. !armnn:2714 This reverts commit 826dd41dc4de616059a61fb0aaec432311372c6c. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: Idb4a2eeb6cbb19a249c1a85eec2cf597d6b6d970
-rw-r--r--Android.mk658
-rw-r--r--test/Android.mk313
2 files changed, 971 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..73ae8ca
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,658 @@
+#
+# Copyright © 2017 ARM Ltd. All rights reserved.
+# SPDX-License-Identifier: MIT
+#
+
+ANDROID_NN_DRIVER_LOCAL_PATH := $(call my-dir)
+LOCAL_PATH := $(ANDROID_NN_DRIVER_LOCAL_PATH)
+
+P_OR_LATER := 0
+Q_OR_LATER := 0
+
+ifeq ($(PLATFORM_VERSION),9)
+P_OR_LATER := 1
+endif # PLATFORM_VERSION == 9
+ifeq ($(PLATFORM_VERSION),P)
+P_OR_LATER := 1
+endif # PLATFORM_VERSION == P
+
+ifeq ($(PLATFORM_VERSION),10)
+P_OR_LATER := 1
+Q_OR_LATER := 1
+endif # PLATFORM_VERSION == 10
+ifeq ($(PLATFORM_VERSION),Q)
+P_OR_LATER := 1
+Q_OR_LATER := 1
+endif # PLATFORM_VERSION == Q
+
+CPP_VERSION := c++14
+
+ifeq ($(Q_OR_LATER),1)
+CPP_VERSION := c++17
+endif
+
+# Configure these paths if you move the source or Khronos headers
+ARMNN_HEADER_PATH := $(LOCAL_PATH)/armnn/include
+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/reference backend support
+# Set them to '0' to disable support for a specific backend
+ARMNN_COMPUTE_CL_ENABLED := 1
+ARMNN_COMPUTE_NEON_ENABLED := 1
+ARMNN_REF_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
+endif
+
+ifeq ($(ARMNN_REF_ENABLE),0)
+ARMNN_REF_ENABLED := 0
+endif
+
+#######################
+# libarmnn-driver@1.0 #
+#######################
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libarmnn-driver@1.0
+ifeq ($(Q_OR_LATER),1)
+# "eng" is deprecated in Android Q
+LOCAL_MODULE_TAGS := optional
+else
+LOCAL_MODULE_TAGS := eng optional
+endif
+LOCAL_ARM_MODE := arm
+LOCAL_PROPRIETARY_MODULE := true
+# Mark source files as dependent on Android.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_C_INCLUDES := \
+ $(ARMNN_HEADER_PATH) \
+ $(ARMNN_UTILS_HEADER_PATH) \
+ $(OPENCL_HEADER_PATH) \
+ $(NN_HEADER_PATH)
+
+LOCAL_CFLAGS := \
+ -std=$(CPP_VERSION) \
+ -fexceptions \
+ -Werror \
+ -Wno-format-security
+
+ifeq ($(P_OR_LATER),1)
+# Required to build with the changes made to the Android ML framework starting from Android P,
+# regardless of the HAL version used for the build.
+LOCAL_CFLAGS+= \
+ -DARMNN_ANDROID_P
+endif # PLATFORM_VERSION == 9
+
+ifeq ($(ARMNN_DRIVER_DEBUG),1)
+LOCAL_CFLAGS+= \
+ -UNDEBUG
+endif # ARMNN_DRIVER_DEBUG == 1
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_CFLAGS += \
+ -DBOOST_NO_AUTO_PTR
+endif # PLATFORM_VERSION == Q or later
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_CFLAGS += \
+ -DARMCOMPUTECL_ENABLED
+endif # ARMNN_COMPUTE_CL_ENABLED == 1
+
+ifeq ($(ARMNN_COMPUTE_NEON_ENABLED),1)
+LOCAL_CFLAGS += \
+ -DARMCOMPUTENEON_ENABLED
+endif # ARMNN_COMPUTE_NEON_ENABLED == 1
+
+ifeq ($(ARMNN_REF_ENABLED),1)
+LOCAL_CFLAGS += \
+ -DARMNNREF_ENABLED
+endif # ARMNN_REF_ENABLED == 1
+
+LOCAL_SRC_FILES := \
+ 1.0/ArmnnDriverImpl.cpp \
+ 1.0/HalPolicy.cpp \
+ ArmnnDriverImpl.cpp \
+ DriverOptions.cpp \
+ ArmnnDevice.cpp \
+ ArmnnPreparedModel.cpp \
+ ModelToINetworkConverter.cpp \
+ RequestThread.cpp \
+ Utils.cpp \
+ ConversionUtils.cpp
+
+LOCAL_STATIC_LIBRARIES := \
+ libneuralnetworks_common \
+ libboost_log \
+ libboost_program_options \
+ libboost_system \
+ libboost_thread \
+ libboost_filesystem \
+ arm_compute_library
+
+LOCAL_WHOLE_STATIC_LIBRARIES := libarmnn
+
+LOCAL_SHARED_LIBRARIES := \
+ libbase \
+ libhidlbase \
+ libhidltransport \
+ libhidlmemory \
+ liblog \
+ libutils \
+ android.hardware.neuralnetworks@1.0 \
+ android.hidl.allocator@1.0 \
+ android.hidl.memory@1.0
+
+ifeq ($(P_OR_LATER),1)
+# Required to build the 1.0 version of the NN Driver on Android P and later versions,
+# as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless.
+LOCAL_SHARED_LIBRARIES+= \
+ android.hardware.neuralnetworks@1.1
+endif # PLATFORM_VERSION == 9
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libnativewindow \
+ libui \
+ libfmq \
+ libcutils \
+ android.hardware.neuralnetworks@1.2
+endif # PLATFORM_VERSION == Q
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libOpenCL
+endif
+
+include $(BUILD_STATIC_LIBRARY)
+
+ifeq ($(P_OR_LATER),1)
+# The following target is available starting from Android P
+
+#######################
+# libarmnn-driver@1.1 #
+#######################
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libarmnn-driver@1.1
+ifeq ($(Q_OR_LATER),1)
+# "eng" is deprecated in Android Q
+LOCAL_MODULE_TAGS := optional
+else
+LOCAL_MODULE_TAGS := eng optional
+endif
+#PRODUCT_PACKAGES_ENG := libarmnn-driver@1.1
+LOCAL_ARM_MODE := arm
+LOCAL_PROPRIETARY_MODULE := true
+# Mark source files as dependent on Android.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_C_INCLUDES := \
+ $(ARMNN_HEADER_PATH) \
+ $(ARMNN_UTILS_HEADER_PATH) \
+ $(OPENCL_HEADER_PATH) \
+ $(NN_HEADER_PATH)
+
+LOCAL_CFLAGS := \
+ -std=$(CPP_VERSION) \
+ -fexceptions \
+ -Werror \
+ -Wno-format-security \
+ -DARMNN_ANDROID_P \
+ -DARMNN_ANDROID_NN_V1_1
+
+ifeq ($(ARMNN_DRIVER_DEBUG),1)
+LOCAL_CFLAGS+= \
+ -UNDEBUG
+endif # ARMNN_DRIVER_DEBUG == 1
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_CFLAGS += \
+ -DBOOST_NO_AUTO_PTR
+endif # PLATFORM_VERSION == Q or later
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_CFLAGS += \
+ -DARMCOMPUTECL_ENABLED
+endif # ARMNN_COMPUTE_CL_ENABLED == 1
+
+ifeq ($(ARMNN_COMPUTE_NEON_ENABLED),1)
+LOCAL_CFLAGS += \
+ -DARMCOMPUTENEON_ENABLED
+endif # ARMNN_COMPUTE_NEON_ENABLED == 1
+
+ifeq ($(ARMNN_REF_ENABLED),1)
+LOCAL_CFLAGS += \
+ -DARMNNREF_ENABLED
+endif # ARMNN_REF_ENABLED == 1
+
+LOCAL_SRC_FILES := \
+ 1.0/ArmnnDriverImpl.cpp \
+ 1.0/HalPolicy.cpp \
+ 1.1/ArmnnDriverImpl.cpp \
+ 1.1/HalPolicy.cpp \
+ ArmnnDriverImpl.cpp \
+ DriverOptions.cpp \
+ ArmnnDevice.cpp \
+ ArmnnPreparedModel.cpp \
+ ModelToINetworkConverter.cpp \
+ RequestThread.cpp \
+ Utils.cpp \
+ ConversionUtils.cpp
+
+LOCAL_STATIC_LIBRARIES := \
+ libneuralnetworks_common \
+ libboost_log \
+ libboost_program_options \
+ libboost_system \
+ libboost_thread \
+ libboost_filesystem \
+ arm_compute_library
+
+LOCAL_WHOLE_STATIC_LIBRARIES := libarmnn
+
+LOCAL_SHARED_LIBRARIES := \
+ libbase \
+ libhidlbase \
+ libhidltransport \
+ libhidlmemory \
+ liblog \
+ libutils \
+ android.hardware.neuralnetworks@1.0 \
+ android.hardware.neuralnetworks@1.1 \
+ android.hidl.allocator@1.0 \
+ android.hidl.memory@1.0
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libnativewindow \
+ libui \
+ libfmq \
+ libcutils \
+ android.hardware.neuralnetworks@1.2
+endif # PLATFORM_VERSION == Q
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libOpenCL
+endif
+
+include $(BUILD_STATIC_LIBRARY)
+
+endif # PLATFORM_VERSION == 9
+
+ifeq ($(Q_OR_LATER),1)
+# The following target is available starting from Android Q
+
+#######################
+# libarmnn-driver@1.2 #
+#######################
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libarmnn-driver@1.2
+LOCAL_MODULE_TAGS := optional
+LOCAL_ARM_MODE := arm
+LOCAL_PROPRIETARY_MODULE := true
+# Mark source files as dependent on Android.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_C_INCLUDES := \
+ $(ARMNN_HEADER_PATH) \
+ $(ARMNN_UTILS_HEADER_PATH) \
+ $(OPENCL_HEADER_PATH) \
+ $(NN_HEADER_PATH)
+
+LOCAL_CFLAGS := \
+ -std=$(CPP_VERSION) \
+ -fexceptions \
+ -Werror \
+ -Wno-format-security \
+ -DARMNN_ANDROID_Q \
+ -DARMNN_ANDROID_NN_V1_2
+
+ifeq ($(ARMNN_DRIVER_DEBUG),1)
+LOCAL_CFLAGS+= \
+ -UNDEBUG
+endif # ARMNN_DRIVER_DEBUG == 1
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_CFLAGS += \
+ -DBOOST_NO_AUTO_PTR
+endif # PLATFORM_VERSION == Q or later
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_CFLAGS += \
+ -DARMCOMPUTECL_ENABLED
+endif # ARMNN_COMPUTE_CL_ENABLED == 1
+
+ifeq ($(ARMNN_COMPUTE_NEON_ENABLED),1)
+LOCAL_CFLAGS += \
+ -DARMCOMPUTENEON_ENABLED
+endif # ARMNN_COMPUTE_NEON_ENABLED == 1
+
+ifeq ($(ARMNN_REF_ENABLED),1)
+LOCAL_CFLAGS += \
+ -DARMNNREF_ENABLED
+endif # ARMNN_REF_ENABLED == 1
+
+LOCAL_SRC_FILES := \
+ 1.0/ArmnnDriverImpl.cpp \
+ 1.0/HalPolicy.cpp \
+ 1.1/ArmnnDriverImpl.cpp \
+ 1.1/HalPolicy.cpp \
+ 1.2/ArmnnDriverImpl.cpp \
+ 1.2/HalPolicy.cpp \
+ ArmnnDevice.cpp \
+ ArmnnDriverImpl.cpp \
+ ArmnnPreparedModel.cpp \
+ ArmnnPreparedModel_1_2.cpp \
+ ConversionUtils.cpp \
+ DriverOptions.cpp \
+ ModelToINetworkConverter.cpp \
+ RequestThread.cpp \
+ Utils.cpp
+
+LOCAL_STATIC_LIBRARIES := \
+ libneuralnetworks_common \
+ libboost_log \
+ libboost_program_options \
+ libboost_system \
+ libboost_thread \
+ libboost_filesystem \
+ arm_compute_library
+
+LOCAL_WHOLE_STATIC_LIBRARIES := libarmnn
+
+LOCAL_SHARED_LIBRARIES := \
+ libbase \
+ libhidlbase \
+ libhidltransport \
+ libhidlmemory \
+ liblog \
+ libutils \
+ libnativewindow \
+ libui \
+ libfmq \
+ libcutils \
+ android.hidl.allocator@1.0 \
+ android.hidl.memory@1.0 \
+ android.hardware.neuralnetworks@1.0 \
+ android.hardware.neuralnetworks@1.1 \
+ android.hardware.neuralnetworks@1.2
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libOpenCL
+endif
+
+include $(BUILD_STATIC_LIBRARY)
+
+endif # PLATFORM_VERSION == Q
+
+#####################################################
+# android.hardware.neuralnetworks@1.0-service-armnn #
+#####################################################
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := android.hardware.neuralnetworks@1.0-service-armnn
+LOCAL_INIT_RC := android.hardware.neuralnetworks@1.0-service-armnn.rc
+ifeq ($(Q_OR_LATER),1)
+# "eng" is deprecated in Android Q
+LOCAL_MODULE_TAGS := optional
+else
+LOCAL_MODULE_TAGS := eng optional
+endif
+LOCAL_ARM_MODE := arm
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_PROPRIETARY_MODULE := true
+# Mark source files as dependent on Android.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_C_INCLUDES := \
+ $(ARMNN_HEADER_PATH) \
+ $(NN_HEADER_PATH)
+
+LOCAL_CFLAGS := \
+ -std=$(CPP_VERSION) \
+ -fexceptions
+
+ifeq ($(ARMNN_DRIVER_DEBUG),1)
+LOCAL_CFLAGS += \
+ -UNDEBUG
+endif # ARMNN_DRIVER_DEBUG == 1
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_CFLAGS += \
+ -DBOOST_NO_AUTO_PTR
+endif # PLATFORM_VERSION == Q or later
+
+LOCAL_SRC_FILES := \
+ service.cpp
+
+LOCAL_STATIC_LIBRARIES := \
+ libneuralnetworks_common \
+ libboost_log \
+ libboost_program_options \
+ libboost_system \
+ libboost_thread \
+ libboost_filesystem \
+ arm_compute_library
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ libarmnn-driver@1.0
+
+LOCAL_SHARED_LIBRARIES := \
+ libbase \
+ libhidlbase \
+ libhidltransport \
+ libhidlmemory \
+ libdl \
+ libhardware \
+ liblog \
+ libtextclassifier_hash \
+ libutils \
+ android.hardware.neuralnetworks@1.0 \
+ android.hidl.allocator@1.0 \
+ android.hidl.memory@1.0
+
+ifeq ($(P_OR_LATER),1)
+# Required to build the 1.0 version of the NN Driver on Android P and later versions,
+# as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless.
+LOCAL_SHARED_LIBRARIES+= \
+ android.hardware.neuralnetworks@1.1
+endif # PLATFORM_VERSION == 9
+ifeq ($(Q_OR_LATER),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libnativewindow \
+ libui \
+ libfmq \
+ libcutils \
+ android.hardware.neuralnetworks@1.2
+endif # PLATFORM_VERSION == Q
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libOpenCL
+endif
+
+include $(BUILD_EXECUTABLE)
+
+ifeq ($(P_OR_LATER),1)
+# The following target is available starting from Android P
+
+#####################################################
+# android.hardware.neuralnetworks@1.1-service-armnn #
+#####################################################
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := android.hardware.neuralnetworks@1.1-service-armnn
+LOCAL_INIT_RC := android.hardware.neuralnetworks@1.1-service-armnn.rc
+ifeq ($(Q_OR_LATER),1)
+# "eng" is deprecated in Android Q
+LOCAL_MODULE_TAGS := optional
+else
+LOCAL_MODULE_TAGS := eng optional
+endif
+LOCAL_ARM_MODE := arm
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_PROPRIETARY_MODULE := true
+# Mark source files as dependent on Android.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_C_INCLUDES := \
+ $(ARMNN_HEADER_PATH) \
+ $(NN_HEADER_PATH)
+
+LOCAL_CFLAGS := \
+ -std=$(CPP_VERSION) \
+ -fexceptions \
+ -DARMNN_ANDROID_NN_V1_1
+
+ifeq ($(ARMNN_DRIVER_DEBUG),1)
+LOCAL_CFLAGS += \
+ -UNDEBUG
+endif # ARMNN_DRIVER_DEBUG == 1
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_CFLAGS += \
+ -DBOOST_NO_AUTO_PTR
+endif # PLATFORM_VERSION == Q or later
+
+LOCAL_SRC_FILES := \
+ service.cpp
+
+LOCAL_STATIC_LIBRARIES := \
+ libneuralnetworks_common \
+ libboost_log \
+ libboost_program_options \
+ libboost_system \
+ libboost_thread \
+ libboost_filesystem \
+ arm_compute_library
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ libarmnn-driver@1.1
+
+LOCAL_SHARED_LIBRARIES := \
+ libbase \
+ libhidlbase \
+ libhidltransport \
+ libhidlmemory \
+ libdl \
+ libhardware \
+ liblog \
+ libtextclassifier_hash \
+ libutils \
+ android.hardware.neuralnetworks@1.0 \
+ android.hardware.neuralnetworks@1.1 \
+ android.hidl.allocator@1.0 \
+ android.hidl.memory@1.0
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libnativewindow \
+ libui \
+ libfmq \
+ libcutils \
+ android.hardware.neuralnetworks@1.2
+endif # PLATFORM_VERSION == Q
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libOpenCL
+endif
+
+include $(BUILD_EXECUTABLE)
+
+endif # PLATFORM_VERSION == 9
+
+ifeq ($(Q_OR_LATER),1)
+# The following target is available starting from Android Q
+
+#####################################################
+# android.hardware.neuralnetworks@1.2-service-armnn #
+#####################################################
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := android.hardware.neuralnetworks@1.2-service-armnn
+LOCAL_INIT_RC := android.hardware.neuralnetworks@1.2-service-armnn.rc
+LOCAL_MODULE_TAGS := optional
+LOCAL_ARM_MODE := arm
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_PROPRIETARY_MODULE := true
+# Mark source files as dependent on Android.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_C_INCLUDES := \
+ $(ARMNN_HEADER_PATH) \
+ $(NN_HEADER_PATH)
+
+LOCAL_CFLAGS := \
+ -std=$(CPP_VERSION) \
+ -fexceptions \
+ -DARMNN_ANDROID_NN_V1_2 \
+ -DBOOST_NO_AUTO_PTR
+
+ifeq ($(ARMNN_DRIVER_DEBUG),1)
+LOCAL_CFLAGS += \
+ -UNDEBUG
+endif # ARMNN_DRIVER_DEBUG == 1
+
+LOCAL_SRC_FILES := \
+ service.cpp
+
+LOCAL_STATIC_LIBRARIES := \
+ libneuralnetworks_common \
+ libboost_log \
+ libboost_program_options \
+ libboost_system \
+ libboost_thread \
+ libboost_filesystem \
+ arm_compute_library
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ libarmnn-driver@1.2
+
+LOCAL_SHARED_LIBRARIES := \
+ libbase \
+ libhidlbase \
+ libhidltransport \
+ libhidlmemory \
+ libdl \
+ libhardware \
+ liblog \
+ libtextclassifier_hash \
+ libutils \
+ libnativewindow \
+ libui \
+ libfmq \
+ libcutils \
+ android.hidl.allocator@1.0 \
+ android.hidl.memory@1.0 \
+ android.hardware.neuralnetworks@1.0 \
+ android.hardware.neuralnetworks@1.1 \
+ android.hardware.neuralnetworks@1.2
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libOpenCL
+endif
+
+include $(BUILD_EXECUTABLE)
+
+endif # PLATFORM_VERSION == Q
+
+##########################
+# armnn module and tests #
+##########################
+# Note we use ANDROID_NN_DRIVER_LOCAL_PATH rather than LOCAL_PATH because LOCAL_PATH will be overwritten
+# when including other .mk files that set it.
+include $(ANDROID_NN_DRIVER_LOCAL_PATH)/armnn/Android.mk
+include $(ANDROID_NN_DRIVER_LOCAL_PATH)/test/Android.mk
diff --git a/test/Android.mk b/test/Android.mk
new file mode 100644
index 0000000..13a36b5
--- /dev/null
+++ b/test/Android.mk
@@ -0,0 +1,313 @@
+#
+# Copyright © 2017 ARM Ltd. All rights reserved.
+# SPDX-License-Identifier: MIT
+#
+
+LOCAL_PATH := $(call my-dir)
+
+# Configure these paths if you move the source or Khronos headers
+#
+OPENCL_HEADER_PATH := $(LOCAL_PATH)/../../mali/product/khronos/original
+NN_HEADER_PATH := $(LOCAL_PATH)/../../../../frameworks/ml/nn/runtime/include
+ARMNN_HEADER_PATH := $(LOCAL_PATH)/../armnn/include
+ARMNN_DRIVER_HEADER_PATH := $(LOCAL_PATH)/..
+
+##########################
+# armnn-driver-tests@1.0 #
+##########################
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := armnn-driver-tests@1.0
+ifeq ($(Q_OR_LATER),1)
+# "eng" is deprecated in Android Q
+LOCAL_MODULE_TAGS := optional
+else
+LOCAL_MODULE_TAGS := eng optional
+endif
+LOCAL_ARM_MODE := arm
+LOCAL_PROPRIETARY_MODULE := true
+# Mark source files as dependent on Android.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_C_INCLUDES := \
+ $(OPENCL_HEADER_PATH) \
+ $(NN_HEADER_PATH) \
+ $(ARMNN_HEADER_PATH) \
+ $(ARMNN_DRIVER_HEADER_PATH)
+
+LOCAL_CFLAGS := \
+ -std=$(CPP_VERSION) \
+ -fexceptions \
+ -Werror \
+ -O0 \
+ -UNDEBUG
+
+ifeq ($(P_OR_LATER),1)
+# Required to build with the changes made to the Android ML framework starting from Android P,
+# regardless of the HAL version used for the build.
+LOCAL_CFLAGS+= \
+ -DARMNN_ANDROID_P
+endif # PLATFORM_VERSION == 9
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_CFLAGS += \
+ -DBOOST_NO_AUTO_PTR
+endif # PLATFORM_VERSION == Q or later
+
+LOCAL_SRC_FILES := \
+ 1.0/Convolution2D.cpp \
+ 1.0/FullyConnectedReshape.cpp \
+ 1.0/Lstm.cpp \
+ Tests.cpp \
+ UtilsTests.cpp \
+ Concurrent.cpp \
+ FullyConnected.cpp \
+ GenericLayerTests.cpp \
+ DriverTestHelpers.cpp \
+ SystemProperties.cpp \
+ Concat.cpp \
+ TestTensor.cpp
+
+LOCAL_STATIC_LIBRARIES := \
+ libneuralnetworks_common \
+ libboost_log \
+ libboost_system \
+ libboost_unit_test_framework \
+ libboost_thread \
+ libboost_filesystem \
+ arm_compute_library
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ libarmnn-driver@1.0
+
+LOCAL_SHARED_LIBRARIES := \
+ libbase \
+ libhidlbase \
+ libhidltransport \
+ libhidlmemory \
+ liblog \
+ libtextclassifier_hash \
+ libutils \
+ android.hardware.neuralnetworks@1.0 \
+ android.hidl.allocator@1.0 \
+ android.hidl.memory@1.0
+
+ifeq ($(P_OR_LATER),1)
+# Required to build the 1.0 version of the NN Driver on Android P and later versions,
+# as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless.
+LOCAL_SHARED_LIBRARIES+= \
+ android.hardware.neuralnetworks@1.1
+endif # PLATFORM_VERSION == 9
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libnativewindow \
+ libui \
+ libfmq \
+ libcutils \
+ android.hardware.neuralnetworks@1.2
+endif # PLATFORM_VERSION == Q
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libOpenCL
+endif
+
+include $(BUILD_EXECUTABLE)
+
+ifeq ($(P_OR_LATER),1)
+# The following target is available starting from Android P
+
+##########################
+# armnn-driver-tests@1.1 #
+##########################
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := armnn-driver-tests@1.1
+ifeq ($(Q_OR_LATER),1)
+# "eng" is deprecated in Android Q
+LOCAL_MODULE_TAGS := optional
+else
+LOCAL_MODULE_TAGS := eng optional
+endif
+#PRODUCT_PACKAGES_ENG := libarmnn
+LOCAL_ARM_MODE := arm
+LOCAL_PROPRIETARY_MODULE := true
+# Mark source files as dependent on Android.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_C_INCLUDES := \
+ $(OPENCL_HEADER_PATH) \
+ $(NN_HEADER_PATH) \
+ $(ARMNN_HEADER_PATH) \
+ $(ARMNN_DRIVER_HEADER_PATH)
+
+LOCAL_CFLAGS := \
+ -std=$(CPP_VERSION) \
+ -fexceptions \
+ -Werror \
+ -O0 \
+ -UNDEBUG \
+ -DARMNN_ANDROID_P \
+ -DARMNN_ANDROID_NN_V1_1
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_CFLAGS += \
+ -DBOOST_NO_AUTO_PTR
+endif # PLATFORM_VERSION == Q or later
+
+LOCAL_SRC_FILES := \
+ 1.0/Convolution2D.cpp \
+ 1.1/Convolution2D.cpp \
+ 1.1/Mean.cpp \
+ 1.1/Transpose.cpp \
+ 1.0/Lstm.cpp \
+ 1.1/Lstm.cpp \
+ Tests.cpp \
+ UtilsTests.cpp \
+ Concurrent.cpp \
+ FullyConnected.cpp \
+ GenericLayerTests.cpp \
+ DriverTestHelpers.cpp \
+ SystemProperties.cpp \
+ Concat.cpp \
+ TestTensor.cpp
+
+LOCAL_STATIC_LIBRARIES := \
+ libneuralnetworks_common \
+ libboost_log \
+ libboost_system \
+ libboost_unit_test_framework \
+ libboost_thread \
+ libboost_filesystem \
+ arm_compute_library
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ libarmnn-driver@1.1
+
+LOCAL_SHARED_LIBRARIES := \
+ libbase \
+ libhidlbase \
+ libhidltransport \
+ libhidlmemory \
+ liblog \
+ libtextclassifier_hash \
+ libutils \
+ android.hardware.neuralnetworks@1.0 \
+ android.hardware.neuralnetworks@1.1 \
+ android.hidl.allocator@1.0 \
+ android.hidl.memory@1.0
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libnativewindow \
+ libui \
+ libfmq \
+ libcutils \
+ android.hardware.neuralnetworks@1.2
+endif # PLATFORM_VERSION == Q
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libOpenCL
+endif
+
+include $(BUILD_EXECUTABLE)
+
+endif # PLATFORM_VERSION == 9
+
+ifeq ($(Q_OR_LATER),1)
+# The following target is available starting from Android Q
+
+##########################
+# armnn-driver-tests@1.2 #
+##########################
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := armnn-driver-tests@1.2
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_ARM_MODE := arm
+LOCAL_PROPRIETARY_MODULE := true
+
+# Mark source files as dependent on Android.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_C_INCLUDES := \
+ $(OPENCL_HEADER_PATH) \
+ $(NN_HEADER_PATH) \
+ $(ARMNN_HEADER_PATH) \
+ $(ARMNN_DRIVER_HEADER_PATH)
+
+LOCAL_CFLAGS := \
+ -std=$(CPP_VERSION) \
+ -fexceptions \
+ -Werror \
+ -O0 \
+ -UNDEBUG \
+ -DARMNN_ANDROID_Q \
+ -DARMNN_ANDROID_NN_V1_2
+
+ifeq ($(Q_OR_LATER),1)
+LOCAL_CFLAGS += \
+ -DBOOST_NO_AUTO_PTR
+endif # PLATFORM_VERSION == Q or later
+
+LOCAL_SRC_FILES := \
+ 1.0/Convolution2D.cpp \
+ 1.1/Convolution2D.cpp \
+ 1.1/Mean.cpp \
+ 1.1/Transpose.cpp \
+ 1.2/Dilation.cpp \
+ 1.2/Capabilities.cpp \
+ 1.0/Lstm.cpp \
+ 1.1/Lstm.cpp \
+ 1.2/Lstm.cpp \
+ Tests.cpp \
+ UtilsTests.cpp \
+ Concurrent.cpp \
+ FullyConnected.cpp \
+ GenericLayerTests.cpp \
+ DriverTestHelpers.cpp \
+ SystemProperties.cpp \
+ Concat.cpp \
+ TestTensor.cpp
+
+LOCAL_STATIC_LIBRARIES := \
+ libneuralnetworks_common \
+ libboost_log \
+ libboost_system \
+ libboost_unit_test_framework \
+ libboost_thread \
+ libboost_filesystem \
+ arm_compute_library
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ libarmnn-driver@1.2
+
+LOCAL_SHARED_LIBRARIES := \
+ libbase \
+ libcutils \
+ libfmq \
+ libhidlbase \
+ libhidltransport \
+ libhidlmemory \
+ liblog \
+ libnativewindow \
+ libtextclassifier_hash \
+ libui \
+ libutils \
+ android.hardware.neuralnetworks@1.0 \
+ android.hardware.neuralnetworks@1.1 \
+ android.hardware.neuralnetworks@1.2 \
+ android.hidl.allocator@1.0 \
+ android.hidl.memory@1.0
+
+ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+LOCAL_SHARED_LIBRARIES+= \
+ libOpenCL
+endif
+
+include $(BUILD_EXECUTABLE)
+
+endif # PLATFORM_VERSION == Q