Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright © 2017 ARM Ltd. All rights reserved. |
| 3 | # SPDX-License-Identifier: MIT |
| 4 | # |
| 5 | |
| 6 | LOCAL_PATH := $(call my-dir) |
| 7 | |
| 8 | # Configure these paths if you move the source or Khronos headers |
| 9 | # |
| 10 | OPENCL_HEADER_PATH := $(LOCAL_PATH)/../../mali/product/khronos/original |
| 11 | NN_HEADER_PATH := $(LOCAL_PATH)/../../../../frameworks/ml/nn/runtime/include |
| 12 | ARMNN_HEADER_PATH := $(LOCAL_PATH)/../armnn/include |
| 13 | ARMNN_DRIVER_HEADER_PATH := $(LOCAL_PATH)/.. |
| 14 | |
| 15 | ########################## |
| 16 | # armnn-driver-tests@1.0 # |
| 17 | ########################## |
| 18 | include $(CLEAR_VARS) |
| 19 | |
| 20 | LOCAL_MODULE := armnn-driver-tests@1.0 |
| 21 | ifeq ($(Q_OR_LATER),1) |
| 22 | # "eng" is deprecated in Android Q |
| 23 | LOCAL_MODULE_TAGS := optional |
| 24 | else |
| 25 | LOCAL_MODULE_TAGS := eng optional |
| 26 | endif |
| 27 | LOCAL_ARM_MODE := arm |
| 28 | LOCAL_PROPRIETARY_MODULE := true |
| 29 | # Mark source files as dependent on Android.mk |
| 30 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 31 | |
| 32 | LOCAL_C_INCLUDES := \ |
| 33 | $(OPENCL_HEADER_PATH) \ |
| 34 | $(NN_HEADER_PATH) \ |
| 35 | $(ARMNN_HEADER_PATH) \ |
| 36 | $(ARMNN_DRIVER_HEADER_PATH) |
| 37 | |
| 38 | LOCAL_CFLAGS := \ |
| 39 | -std=$(CPP_VERSION) \ |
| 40 | -fexceptions \ |
| 41 | -Werror \ |
| 42 | -O0 \ |
| 43 | -UNDEBUG |
| 44 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame^] | 45 | # Required to build with the changes made to the Android ML framework specific to Android R |
| 46 | ifeq ($(R_OR_LATER),1) |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 47 | LOCAL_CFLAGS+= \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame^] | 48 | -DARMNN_ANDROID_R |
| 49 | endif # R or later |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 50 | |
| 51 | ifeq ($(Q_OR_LATER),1) |
| 52 | LOCAL_CFLAGS += \ |
| 53 | -DBOOST_NO_AUTO_PTR |
| 54 | endif # PLATFORM_VERSION == Q or later |
| 55 | |
| 56 | LOCAL_SRC_FILES := \ |
| 57 | 1.0/Convolution2D.cpp \ |
| 58 | 1.0/FullyConnectedReshape.cpp \ |
| 59 | 1.0/Lstm.cpp \ |
| 60 | Tests.cpp \ |
| 61 | UtilsTests.cpp \ |
| 62 | Concurrent.cpp \ |
| 63 | FullyConnected.cpp \ |
| 64 | GenericLayerTests.cpp \ |
| 65 | DriverTestHelpers.cpp \ |
| 66 | SystemProperties.cpp \ |
| 67 | Concat.cpp \ |
| 68 | TestTensor.cpp |
| 69 | |
| 70 | LOCAL_STATIC_LIBRARIES := \ |
| 71 | libneuralnetworks_common \ |
| 72 | libboost_log \ |
| 73 | libboost_system \ |
| 74 | libboost_unit_test_framework \ |
| 75 | libboost_thread \ |
| 76 | libboost_filesystem \ |
| 77 | arm_compute_library |
| 78 | |
| 79 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 80 | libarmnn-driver@1.0 |
| 81 | |
| 82 | LOCAL_SHARED_LIBRARIES := \ |
| 83 | libbase \ |
| 84 | libhidlbase \ |
| 85 | libhidltransport \ |
| 86 | libhidlmemory \ |
| 87 | liblog \ |
| 88 | libtextclassifier_hash \ |
| 89 | libutils \ |
| 90 | android.hardware.neuralnetworks@1.0 \ |
| 91 | android.hidl.allocator@1.0 \ |
| 92 | android.hidl.memory@1.0 |
| 93 | |
| 94 | ifeq ($(P_OR_LATER),1) |
| 95 | # Required to build the 1.0 version of the NN Driver on Android P and later versions, |
| 96 | # as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless. |
| 97 | LOCAL_SHARED_LIBRARIES+= \ |
| 98 | android.hardware.neuralnetworks@1.1 |
| 99 | endif # PLATFORM_VERSION == 9 |
| 100 | |
| 101 | ifeq ($(Q_OR_LATER),1) |
| 102 | LOCAL_SHARED_LIBRARIES+= \ |
| 103 | libnativewindow \ |
| 104 | libui \ |
| 105 | libfmq \ |
| 106 | libcutils \ |
| 107 | android.hardware.neuralnetworks@1.2 |
| 108 | endif # PLATFORM_VERSION == Q |
| 109 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame^] | 110 | ifeq ($(R_OR_LATER),1) |
| 111 | LOCAL_SHARED_LIBRARIES+= \ |
| 112 | android.hardware.neuralnetworks@1.3 |
| 113 | endif # R or later |
| 114 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 115 | ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1) |
| 116 | LOCAL_SHARED_LIBRARIES+= \ |
| 117 | libOpenCL |
| 118 | endif |
| 119 | |
| 120 | include $(BUILD_EXECUTABLE) |
| 121 | |
| 122 | ifeq ($(P_OR_LATER),1) |
| 123 | # The following target is available starting from Android P |
| 124 | |
| 125 | ########################## |
| 126 | # armnn-driver-tests@1.1 # |
| 127 | ########################## |
| 128 | include $(CLEAR_VARS) |
| 129 | |
| 130 | LOCAL_MODULE := armnn-driver-tests@1.1 |
| 131 | ifeq ($(Q_OR_LATER),1) |
| 132 | # "eng" is deprecated in Android Q |
| 133 | LOCAL_MODULE_TAGS := optional |
| 134 | else |
| 135 | LOCAL_MODULE_TAGS := eng optional |
| 136 | endif |
| 137 | #PRODUCT_PACKAGES_ENG := libarmnn |
| 138 | LOCAL_ARM_MODE := arm |
| 139 | LOCAL_PROPRIETARY_MODULE := true |
| 140 | # Mark source files as dependent on Android.mk |
| 141 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 142 | |
| 143 | LOCAL_C_INCLUDES := \ |
| 144 | $(OPENCL_HEADER_PATH) \ |
| 145 | $(NN_HEADER_PATH) \ |
| 146 | $(ARMNN_HEADER_PATH) \ |
| 147 | $(ARMNN_DRIVER_HEADER_PATH) |
| 148 | |
| 149 | LOCAL_CFLAGS := \ |
| 150 | -std=$(CPP_VERSION) \ |
| 151 | -fexceptions \ |
| 152 | -Werror \ |
| 153 | -O0 \ |
| 154 | -UNDEBUG \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 155 | -DARMNN_ANDROID_NN_V1_1 |
| 156 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame^] | 157 | # Required to build with the changes made to the Android ML framework specific to Android R |
| 158 | ifeq ($(R_OR_LATER),1) |
| 159 | LOCAL_CFLAGS+= \ |
| 160 | -DARMNN_ANDROID_R |
| 161 | endif # R or later |
| 162 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 163 | ifeq ($(Q_OR_LATER),1) |
| 164 | LOCAL_CFLAGS += \ |
| 165 | -DBOOST_NO_AUTO_PTR |
| 166 | endif # PLATFORM_VERSION == Q or later |
| 167 | |
| 168 | LOCAL_SRC_FILES := \ |
| 169 | 1.0/Convolution2D.cpp \ |
| 170 | 1.1/Convolution2D.cpp \ |
| 171 | 1.1/Mean.cpp \ |
| 172 | 1.1/Transpose.cpp \ |
| 173 | 1.0/Lstm.cpp \ |
| 174 | 1.1/Lstm.cpp \ |
| 175 | Tests.cpp \ |
| 176 | UtilsTests.cpp \ |
| 177 | Concurrent.cpp \ |
| 178 | FullyConnected.cpp \ |
| 179 | GenericLayerTests.cpp \ |
| 180 | DriverTestHelpers.cpp \ |
| 181 | SystemProperties.cpp \ |
| 182 | Concat.cpp \ |
| 183 | TestTensor.cpp |
| 184 | |
| 185 | LOCAL_STATIC_LIBRARIES := \ |
| 186 | libneuralnetworks_common \ |
| 187 | libboost_log \ |
| 188 | libboost_system \ |
| 189 | libboost_unit_test_framework \ |
| 190 | libboost_thread \ |
| 191 | libboost_filesystem \ |
| 192 | arm_compute_library |
| 193 | |
| 194 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 195 | libarmnn-driver@1.1 |
| 196 | |
| 197 | LOCAL_SHARED_LIBRARIES := \ |
| 198 | libbase \ |
| 199 | libhidlbase \ |
| 200 | libhidltransport \ |
| 201 | libhidlmemory \ |
| 202 | liblog \ |
| 203 | libtextclassifier_hash \ |
| 204 | libutils \ |
| 205 | android.hardware.neuralnetworks@1.0 \ |
| 206 | android.hardware.neuralnetworks@1.1 \ |
| 207 | android.hidl.allocator@1.0 \ |
| 208 | android.hidl.memory@1.0 |
| 209 | |
| 210 | ifeq ($(Q_OR_LATER),1) |
| 211 | LOCAL_SHARED_LIBRARIES+= \ |
| 212 | libnativewindow \ |
| 213 | libui \ |
| 214 | libfmq \ |
| 215 | libcutils \ |
| 216 | android.hardware.neuralnetworks@1.2 |
| 217 | endif # PLATFORM_VERSION == Q |
| 218 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame^] | 219 | ifeq ($(R_OR_LATER),1) |
| 220 | LOCAL_SHARED_LIBRARIES+= \ |
| 221 | android.hardware.neuralnetworks@1.3 |
| 222 | endif # R or later |
| 223 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 224 | ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1) |
| 225 | LOCAL_SHARED_LIBRARIES+= \ |
| 226 | libOpenCL |
| 227 | endif |
| 228 | |
| 229 | include $(BUILD_EXECUTABLE) |
| 230 | |
| 231 | endif # PLATFORM_VERSION == 9 |
| 232 | |
| 233 | ifeq ($(Q_OR_LATER),1) |
| 234 | # The following target is available starting from Android Q |
| 235 | |
| 236 | ########################## |
| 237 | # armnn-driver-tests@1.2 # |
| 238 | ########################## |
| 239 | include $(CLEAR_VARS) |
| 240 | |
| 241 | LOCAL_MODULE := armnn-driver-tests@1.2 |
| 242 | LOCAL_MODULE_TAGS := optional |
| 243 | |
| 244 | LOCAL_ARM_MODE := arm |
| 245 | LOCAL_PROPRIETARY_MODULE := true |
| 246 | |
| 247 | # Mark source files as dependent on Android.mk |
| 248 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 249 | |
| 250 | LOCAL_C_INCLUDES := \ |
| 251 | $(OPENCL_HEADER_PATH) \ |
| 252 | $(NN_HEADER_PATH) \ |
| 253 | $(ARMNN_HEADER_PATH) \ |
| 254 | $(ARMNN_DRIVER_HEADER_PATH) |
| 255 | |
| 256 | LOCAL_CFLAGS := \ |
| 257 | -std=$(CPP_VERSION) \ |
| 258 | -fexceptions \ |
| 259 | -Werror \ |
| 260 | -O0 \ |
| 261 | -UNDEBUG \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame^] | 262 | -DBOOST_NO_AUTO_PTR \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 263 | -DARMNN_ANDROID_NN_V1_2 |
| 264 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame^] | 265 | # Required to build with the changes made to the Android ML framework specific to Android R |
| 266 | ifeq ($(R_OR_LATER),1) |
| 267 | LOCAL_CFLAGS+= \ |
| 268 | -DARMNN_ANDROID_R |
| 269 | endif # R or later |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 270 | |
| 271 | LOCAL_SRC_FILES := \ |
| 272 | 1.0/Convolution2D.cpp \ |
| 273 | 1.1/Convolution2D.cpp \ |
| 274 | 1.1/Mean.cpp \ |
| 275 | 1.1/Transpose.cpp \ |
| 276 | 1.2/Dilation.cpp \ |
| 277 | 1.2/Capabilities.cpp \ |
| 278 | 1.0/Lstm.cpp \ |
| 279 | 1.1/Lstm.cpp \ |
| 280 | 1.2/Lstm.cpp \ |
| 281 | Tests.cpp \ |
| 282 | UtilsTests.cpp \ |
| 283 | Concurrent.cpp \ |
| 284 | FullyConnected.cpp \ |
| 285 | GenericLayerTests.cpp \ |
| 286 | DriverTestHelpers.cpp \ |
| 287 | SystemProperties.cpp \ |
| 288 | Concat.cpp \ |
| 289 | TestTensor.cpp |
| 290 | |
| 291 | LOCAL_STATIC_LIBRARIES := \ |
| 292 | libneuralnetworks_common \ |
| 293 | libboost_log \ |
| 294 | libboost_system \ |
| 295 | libboost_unit_test_framework \ |
| 296 | libboost_thread \ |
| 297 | libboost_filesystem \ |
| 298 | arm_compute_library |
| 299 | |
| 300 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 301 | libarmnn-driver@1.2 |
| 302 | |
| 303 | LOCAL_SHARED_LIBRARIES := \ |
| 304 | libbase \ |
| 305 | libcutils \ |
| 306 | libfmq \ |
| 307 | libhidlbase \ |
| 308 | libhidltransport \ |
| 309 | libhidlmemory \ |
| 310 | liblog \ |
| 311 | libnativewindow \ |
| 312 | libtextclassifier_hash \ |
| 313 | libui \ |
| 314 | libutils \ |
| 315 | android.hardware.neuralnetworks@1.0 \ |
| 316 | android.hardware.neuralnetworks@1.1 \ |
| 317 | android.hardware.neuralnetworks@1.2 \ |
| 318 | android.hidl.allocator@1.0 \ |
| 319 | android.hidl.memory@1.0 |
| 320 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame^] | 321 | ifeq ($(R_OR_LATER),1) |
| 322 | LOCAL_SHARED_LIBRARIES+= \ |
| 323 | android.hardware.neuralnetworks@1.3 |
| 324 | endif # R or later |
| 325 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 326 | ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1) |
| 327 | LOCAL_SHARED_LIBRARIES+= \ |
| 328 | libOpenCL |
| 329 | endif |
| 330 | |
| 331 | include $(BUILD_EXECUTABLE) |
| 332 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame^] | 333 | endif # PLATFORM_VERSION == Q |