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+= \ |
Sadik Armagan | d7be72e | 2020-04-23 12:56:05 +0100 | [diff] [blame] | 112 | libsync \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 113 | android.hardware.neuralnetworks@1.3 |
| 114 | endif # R or later |
| 115 | |
alered01 | 7c395b2 | 2020-04-03 15:37:24 +0100 | [diff] [blame] | 116 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 117 | LOCAL_SHARED_LIBRARIES+= \ |
| 118 | libOpenCL |
| 119 | endif |
| 120 | |
| 121 | include $(BUILD_EXECUTABLE) |
| 122 | |
| 123 | ifeq ($(P_OR_LATER),1) |
| 124 | # The following target is available starting from Android P |
| 125 | |
| 126 | ########################## |
| 127 | # armnn-driver-tests@1.1 # |
| 128 | ########################## |
| 129 | include $(CLEAR_VARS) |
| 130 | |
| 131 | LOCAL_MODULE := armnn-driver-tests@1.1 |
| 132 | ifeq ($(Q_OR_LATER),1) |
| 133 | # "eng" is deprecated in Android Q |
| 134 | LOCAL_MODULE_TAGS := optional |
| 135 | else |
| 136 | LOCAL_MODULE_TAGS := eng optional |
| 137 | endif |
| 138 | #PRODUCT_PACKAGES_ENG := libarmnn |
| 139 | LOCAL_ARM_MODE := arm |
| 140 | LOCAL_PROPRIETARY_MODULE := true |
| 141 | # Mark source files as dependent on Android.mk |
| 142 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 143 | |
| 144 | LOCAL_C_INCLUDES := \ |
| 145 | $(OPENCL_HEADER_PATH) \ |
| 146 | $(NN_HEADER_PATH) \ |
| 147 | $(ARMNN_HEADER_PATH) \ |
| 148 | $(ARMNN_DRIVER_HEADER_PATH) |
| 149 | |
| 150 | LOCAL_CFLAGS := \ |
| 151 | -std=$(CPP_VERSION) \ |
| 152 | -fexceptions \ |
| 153 | -Werror \ |
| 154 | -O0 \ |
| 155 | -UNDEBUG \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 156 | -DARMNN_ANDROID_NN_V1_1 |
| 157 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 158 | # Required to build with the changes made to the Android ML framework specific to Android R |
| 159 | ifeq ($(R_OR_LATER),1) |
| 160 | LOCAL_CFLAGS+= \ |
| 161 | -DARMNN_ANDROID_R |
| 162 | endif # R or later |
| 163 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 164 | ifeq ($(Q_OR_LATER),1) |
| 165 | LOCAL_CFLAGS += \ |
| 166 | -DBOOST_NO_AUTO_PTR |
| 167 | endif # PLATFORM_VERSION == Q or later |
| 168 | |
| 169 | LOCAL_SRC_FILES := \ |
| 170 | 1.0/Convolution2D.cpp \ |
| 171 | 1.1/Convolution2D.cpp \ |
| 172 | 1.1/Mean.cpp \ |
| 173 | 1.1/Transpose.cpp \ |
| 174 | 1.0/Lstm.cpp \ |
| 175 | 1.1/Lstm.cpp \ |
| 176 | Tests.cpp \ |
| 177 | UtilsTests.cpp \ |
| 178 | Concurrent.cpp \ |
| 179 | FullyConnected.cpp \ |
| 180 | GenericLayerTests.cpp \ |
| 181 | DriverTestHelpers.cpp \ |
| 182 | SystemProperties.cpp \ |
| 183 | Concat.cpp \ |
| 184 | TestTensor.cpp |
| 185 | |
| 186 | LOCAL_STATIC_LIBRARIES := \ |
| 187 | libneuralnetworks_common \ |
| 188 | libboost_log \ |
| 189 | libboost_system \ |
| 190 | libboost_unit_test_framework \ |
| 191 | libboost_thread \ |
| 192 | libboost_filesystem \ |
| 193 | arm_compute_library |
| 194 | |
| 195 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 196 | libarmnn-driver@1.1 |
| 197 | |
| 198 | LOCAL_SHARED_LIBRARIES := \ |
| 199 | libbase \ |
| 200 | libhidlbase \ |
| 201 | libhidltransport \ |
| 202 | libhidlmemory \ |
| 203 | liblog \ |
| 204 | libtextclassifier_hash \ |
| 205 | libutils \ |
| 206 | android.hardware.neuralnetworks@1.0 \ |
| 207 | android.hardware.neuralnetworks@1.1 \ |
| 208 | android.hidl.allocator@1.0 \ |
| 209 | android.hidl.memory@1.0 |
| 210 | |
| 211 | ifeq ($(Q_OR_LATER),1) |
| 212 | LOCAL_SHARED_LIBRARIES+= \ |
| 213 | libnativewindow \ |
| 214 | libui \ |
| 215 | libfmq \ |
| 216 | libcutils \ |
| 217 | android.hardware.neuralnetworks@1.2 |
| 218 | endif # PLATFORM_VERSION == Q |
| 219 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 220 | ifeq ($(R_OR_LATER),1) |
| 221 | LOCAL_SHARED_LIBRARIES+= \ |
Sadik Armagan | d7be72e | 2020-04-23 12:56:05 +0100 | [diff] [blame] | 222 | libsync \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 223 | android.hardware.neuralnetworks@1.3 |
| 224 | endif # R or later |
| 225 | |
alered01 | 7c395b2 | 2020-04-03 15:37:24 +0100 | [diff] [blame] | 226 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 227 | LOCAL_SHARED_LIBRARIES+= \ |
| 228 | libOpenCL |
| 229 | endif |
| 230 | |
| 231 | include $(BUILD_EXECUTABLE) |
| 232 | |
| 233 | endif # PLATFORM_VERSION == 9 |
| 234 | |
| 235 | ifeq ($(Q_OR_LATER),1) |
| 236 | # The following target is available starting from Android Q |
| 237 | |
| 238 | ########################## |
| 239 | # armnn-driver-tests@1.2 # |
| 240 | ########################## |
| 241 | include $(CLEAR_VARS) |
| 242 | |
| 243 | LOCAL_MODULE := armnn-driver-tests@1.2 |
| 244 | LOCAL_MODULE_TAGS := optional |
| 245 | |
| 246 | LOCAL_ARM_MODE := arm |
| 247 | LOCAL_PROPRIETARY_MODULE := true |
| 248 | |
| 249 | # Mark source files as dependent on Android.mk |
| 250 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 251 | |
| 252 | LOCAL_C_INCLUDES := \ |
| 253 | $(OPENCL_HEADER_PATH) \ |
| 254 | $(NN_HEADER_PATH) \ |
| 255 | $(ARMNN_HEADER_PATH) \ |
| 256 | $(ARMNN_DRIVER_HEADER_PATH) |
| 257 | |
| 258 | LOCAL_CFLAGS := \ |
| 259 | -std=$(CPP_VERSION) \ |
| 260 | -fexceptions \ |
| 261 | -Werror \ |
| 262 | -O0 \ |
| 263 | -UNDEBUG \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 264 | -DBOOST_NO_AUTO_PTR \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 265 | -DARMNN_ANDROID_NN_V1_2 |
| 266 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 267 | # Required to build with the changes made to the Android ML framework specific to Android R |
| 268 | ifeq ($(R_OR_LATER),1) |
| 269 | LOCAL_CFLAGS+= \ |
| 270 | -DARMNN_ANDROID_R |
| 271 | endif # R or later |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 272 | |
| 273 | LOCAL_SRC_FILES := \ |
| 274 | 1.0/Convolution2D.cpp \ |
| 275 | 1.1/Convolution2D.cpp \ |
| 276 | 1.1/Mean.cpp \ |
| 277 | 1.1/Transpose.cpp \ |
| 278 | 1.2/Dilation.cpp \ |
| 279 | 1.2/Capabilities.cpp \ |
| 280 | 1.0/Lstm.cpp \ |
| 281 | 1.1/Lstm.cpp \ |
| 282 | 1.2/Lstm.cpp \ |
| 283 | Tests.cpp \ |
| 284 | UtilsTests.cpp \ |
| 285 | Concurrent.cpp \ |
| 286 | FullyConnected.cpp \ |
| 287 | GenericLayerTests.cpp \ |
| 288 | DriverTestHelpers.cpp \ |
| 289 | SystemProperties.cpp \ |
| 290 | Concat.cpp \ |
| 291 | TestTensor.cpp |
| 292 | |
| 293 | LOCAL_STATIC_LIBRARIES := \ |
| 294 | libneuralnetworks_common \ |
| 295 | libboost_log \ |
| 296 | libboost_system \ |
| 297 | libboost_unit_test_framework \ |
| 298 | libboost_thread \ |
| 299 | libboost_filesystem \ |
| 300 | arm_compute_library |
| 301 | |
| 302 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 303 | libarmnn-driver@1.2 |
| 304 | |
| 305 | LOCAL_SHARED_LIBRARIES := \ |
| 306 | libbase \ |
| 307 | libcutils \ |
| 308 | libfmq \ |
| 309 | libhidlbase \ |
| 310 | libhidltransport \ |
| 311 | libhidlmemory \ |
| 312 | liblog \ |
| 313 | libnativewindow \ |
| 314 | libtextclassifier_hash \ |
| 315 | libui \ |
| 316 | libutils \ |
| 317 | android.hardware.neuralnetworks@1.0 \ |
| 318 | android.hardware.neuralnetworks@1.1 \ |
| 319 | android.hardware.neuralnetworks@1.2 \ |
| 320 | android.hidl.allocator@1.0 \ |
| 321 | android.hidl.memory@1.0 |
| 322 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 323 | ifeq ($(R_OR_LATER),1) |
| 324 | LOCAL_SHARED_LIBRARIES+= \ |
Sadik Armagan | d7be72e | 2020-04-23 12:56:05 +0100 | [diff] [blame] | 325 | libsync \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 326 | android.hardware.neuralnetworks@1.3 |
| 327 | endif # R or later |
| 328 | |
alered01 | 7c395b2 | 2020-04-03 15:37:24 +0100 | [diff] [blame] | 329 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 330 | LOCAL_SHARED_LIBRARIES+= \ |
| 331 | libOpenCL |
| 332 | endif |
| 333 | |
| 334 | include $(BUILD_EXECUTABLE) |
| 335 | |
Sadik Armagan | 6a903a7 | 2020-05-26 10:41:54 +0100 | [diff] [blame] | 336 | endif # PLATFORM_VERSION == Q |
| 337 | |
| 338 | ifeq ($(R_OR_LATER),1) |
| 339 | # The following target is available starting from Android R |
| 340 | |
| 341 | ########################## |
| 342 | # armnn-driver-tests@1.3 # |
| 343 | ########################## |
| 344 | include $(CLEAR_VARS) |
| 345 | |
| 346 | LOCAL_MODULE := armnn-driver-tests@1.3 |
| 347 | LOCAL_MODULE_TAGS := optional |
| 348 | |
| 349 | LOCAL_ARM_MODE := arm |
| 350 | LOCAL_PROPRIETARY_MODULE := true |
| 351 | |
| 352 | # Mark source files as dependent on Android.mk |
| 353 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 354 | |
| 355 | LOCAL_C_INCLUDES := \ |
| 356 | $(OPENCL_HEADER_PATH) \ |
| 357 | $(NN_HEADER_PATH) \ |
| 358 | $(ARMNN_HEADER_PATH) \ |
| 359 | $(ARMNN_DRIVER_HEADER_PATH) |
| 360 | |
| 361 | LOCAL_CFLAGS := \ |
| 362 | -std=$(CPP_VERSION) \ |
| 363 | -fexceptions \ |
| 364 | -Werror \ |
| 365 | -O0 \ |
| 366 | -UNDEBUG \ |
| 367 | -DBOOST_NO_AUTO_PTR \ |
| 368 | -DARMNN_ANDROID_R \ |
| 369 | -DARMNN_ANDROID_NN_V1_3 |
| 370 | |
| 371 | LOCAL_SRC_FILES := \ |
| 372 | 1.0/Convolution2D.cpp \ |
| 373 | 1.1/Convolution2D.cpp \ |
| 374 | 1.1/Mean.cpp \ |
| 375 | 1.1/Transpose.cpp \ |
| 376 | 1.2/Dilation.cpp \ |
| 377 | 1.2/Capabilities.cpp \ |
| 378 | 1.0/Lstm.cpp \ |
| 379 | 1.1/Lstm.cpp \ |
| 380 | 1.2/Lstm.cpp \ |
| 381 | 1.3/QLstm.cpp \ |
| 382 | Tests.cpp \ |
| 383 | UtilsTests.cpp \ |
| 384 | Concurrent.cpp \ |
| 385 | FullyConnected.cpp \ |
| 386 | GenericLayerTests.cpp \ |
| 387 | DriverTestHelpers.cpp \ |
| 388 | SystemProperties.cpp \ |
| 389 | Concat.cpp \ |
| 390 | TestTensor.cpp |
| 391 | |
| 392 | LOCAL_STATIC_LIBRARIES := \ |
| 393 | libneuralnetworks_common \ |
| 394 | libboost_log \ |
| 395 | libboost_system \ |
| 396 | libboost_unit_test_framework \ |
| 397 | libboost_thread \ |
| 398 | libboost_filesystem \ |
| 399 | arm_compute_library |
| 400 | |
| 401 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 402 | libarmnn-driver@1.3 |
| 403 | |
| 404 | LOCAL_SHARED_LIBRARIES := \ |
| 405 | libbase \ |
| 406 | libcutils \ |
| 407 | libfmq \ |
| 408 | libhidlbase \ |
| 409 | libhidltransport \ |
| 410 | libhidlmemory \ |
| 411 | liblog \ |
| 412 | libnativewindow \ |
| 413 | libtextclassifier_hash \ |
| 414 | libui \ |
| 415 | libutils \ |
| 416 | libsync \ |
| 417 | android.hardware.neuralnetworks@1.0 \ |
| 418 | android.hardware.neuralnetworks@1.1 \ |
| 419 | android.hardware.neuralnetworks@1.2 \ |
| 420 | android.hardware.neuralnetworks@1.3 \ |
| 421 | android.hidl.allocator@1.0 \ |
| 422 | android.hidl.memory@1.0 |
| 423 | |
| 424 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
| 425 | LOCAL_SHARED_LIBRARIES+= \ |
| 426 | libOpenCL |
| 427 | endif |
| 428 | |
| 429 | include $(BUILD_EXECUTABLE) |
| 430 | |
| 431 | endif # PLATFORM_VERSION == R |