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 | ANDROID_NN_DRIVER_LOCAL_PATH := $(call my-dir) |
| 7 | LOCAL_PATH := $(ANDROID_NN_DRIVER_LOCAL_PATH) |
| 8 | |
| 9 | P_OR_LATER := 0 |
| 10 | Q_OR_LATER := 0 |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 11 | R_OR_LATER := 0 |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 12 | ANDROID_R := 0 |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 13 | |
| 14 | ifeq ($(PLATFORM_VERSION),9) |
| 15 | P_OR_LATER := 1 |
| 16 | endif # PLATFORM_VERSION == 9 |
| 17 | ifeq ($(PLATFORM_VERSION),P) |
| 18 | P_OR_LATER := 1 |
| 19 | endif # PLATFORM_VERSION == P |
| 20 | |
| 21 | ifeq ($(PLATFORM_VERSION),10) |
| 22 | P_OR_LATER := 1 |
| 23 | Q_OR_LATER := 1 |
| 24 | endif # PLATFORM_VERSION == 10 |
| 25 | ifeq ($(PLATFORM_VERSION),Q) |
| 26 | P_OR_LATER := 1 |
| 27 | Q_OR_LATER := 1 |
| 28 | endif # PLATFORM_VERSION == Q |
| 29 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 30 | ifeq ($(PLATFORM_VERSION),R) |
| 31 | P_OR_LATER := 1 |
| 32 | Q_OR_LATER := 1 |
| 33 | R_OR_LATER := 1 |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 34 | ANDROID_R := 1 |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 35 | endif # PLATFORM_VERSION == R |
| 36 | |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 37 | ifeq ($(PLATFORM_VERSION),11) |
| 38 | P_OR_LATER := 1 |
| 39 | Q_OR_LATER := 1 |
| 40 | R_OR_LATER := 1 |
| 41 | ANDROID_R := 1 |
| 42 | endif # PLATFORM_VERSION == 11 |
| 43 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 44 | CPP_VERSION := c++14 |
| 45 | |
| 46 | ifeq ($(Q_OR_LATER),1) |
| 47 | CPP_VERSION := c++17 |
| 48 | endif |
| 49 | |
| 50 | # Configure these paths if you move the source or Khronos headers |
| 51 | ARMNN_HEADER_PATH := $(LOCAL_PATH)/armnn/include |
Colm Donelan | 08d9a1c | 2020-09-09 17:56:55 +0100 | [diff] [blame] | 52 | ARMNN_THIRD_PARTY_PATH := $(LOCAL_PATH)/armnn/third-party |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 53 | ARMNN_UTILS_HEADER_PATH := $(LOCAL_PATH)/armnn/src/armnnUtils |
Colm Donelan | 0cc6178 | 2020-10-06 21:02:21 +0100 | [diff] [blame^] | 54 | ARMNN_THIRD_PARTY_PATH := $(LOCAL_PATH)/armnn/third-party |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 55 | OPENCL_HEADER_PATH := $(LOCAL_PATH)/clframework/include |
| 56 | NN_HEADER_PATH := $(LOCAL_PATH)/../../../frameworks/ml/nn/runtime/include |
| 57 | |
| 58 | # Variables to control CL/NEON/reference backend support |
| 59 | # Set them to '0' to disable support for a specific backend |
| 60 | ARMNN_COMPUTE_CL_ENABLED := 1 |
| 61 | ARMNN_COMPUTE_NEON_ENABLED := 1 |
| 62 | ARMNN_REF_ENABLED := 1 |
FrancisMurtagh | 594b283 | 2020-06-15 17:17:56 +0100 | [diff] [blame] | 63 | ARMNN_ETHOSN_ENABLED := 1 |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 64 | |
| 65 | ifeq ($(ARMNN_COMPUTE_CL_ENABLE),0) |
| 66 | ARMNN_COMPUTE_CL_ENABLED := 0 |
| 67 | endif |
| 68 | |
| 69 | ifeq ($(ARMNN_COMPUTE_NEON_ENABLE),0) |
| 70 | ARMNN_COMPUTE_NEON_ENABLED := 0 |
| 71 | endif |
| 72 | |
| 73 | ifeq ($(ARMNN_REF_ENABLE),0) |
| 74 | ARMNN_REF_ENABLED := 0 |
| 75 | endif |
| 76 | |
FrancisMurtagh | 594b283 | 2020-06-15 17:17:56 +0100 | [diff] [blame] | 77 | ifeq ($(ARMNN_ETHOSN_ENABLE),0) |
| 78 | ARMNN_ETHOSN_ENABLED := 0 |
| 79 | endif |
| 80 | |
alered01 | 7c395b2 | 2020-04-03 15:37:24 +0100 | [diff] [blame] | 81 | # Variable to control inclusion of libOpenCL shared library |
| 82 | ARMNN_INCLUDE_LIBOPENCL := $(ARMNN_COMPUTE_CL_ENABLED) |
| 83 | ifeq ($(ARMNN_LIBOPENCL),0) |
| 84 | ARMNN_INCLUDE_LIBOPENCL := 0 |
| 85 | endif |
| 86 | |
Narumol Prangnawarat | cad4e91 | 2020-06-02 12:07:43 +0100 | [diff] [blame] | 87 | # Variable to control retire rate of priority queue |
| 88 | RETIRE_RATE := 3 |
| 89 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 90 | ####################### |
| 91 | # libarmnn-driver@1.0 # |
| 92 | ####################### |
| 93 | include $(CLEAR_VARS) |
| 94 | |
| 95 | LOCAL_MODULE := libarmnn-driver@1.0 |
| 96 | ifeq ($(Q_OR_LATER),1) |
| 97 | # "eng" is deprecated in Android Q |
| 98 | LOCAL_MODULE_TAGS := optional |
| 99 | else |
| 100 | LOCAL_MODULE_TAGS := eng optional |
| 101 | endif |
| 102 | LOCAL_ARM_MODE := arm |
| 103 | LOCAL_PROPRIETARY_MODULE := true |
| 104 | # Mark source files as dependent on Android.mk |
| 105 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 106 | |
| 107 | LOCAL_C_INCLUDES := \ |
| 108 | $(ARMNN_HEADER_PATH) \ |
Colm Donelan | 08d9a1c | 2020-09-09 17:56:55 +0100 | [diff] [blame] | 109 | $(ARMNN_THIRD_PARTY_PATH) \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 110 | $(ARMNN_UTILS_HEADER_PATH) \ |
Colm Donelan | 0cc6178 | 2020-10-06 21:02:21 +0100 | [diff] [blame^] | 111 | $(ARMNN_THIRD_PARTY_PATH) \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 112 | $(OPENCL_HEADER_PATH) \ |
| 113 | $(NN_HEADER_PATH) |
| 114 | |
| 115 | LOCAL_CFLAGS := \ |
| 116 | -std=$(CPP_VERSION) \ |
| 117 | -fexceptions \ |
| 118 | -Werror \ |
| 119 | -Wno-format-security |
| 120 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 121 | # Required to build with the changes made to the Android ML framework specific to Android R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 122 | ifeq ($(ANDROID_R),1) |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 123 | LOCAL_CFLAGS+= \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 124 | -DARMNN_ANDROID_R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 125 | endif |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 126 | |
| 127 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
| 128 | LOCAL_CFLAGS+= \ |
| 129 | -UNDEBUG |
| 130 | endif # ARMNN_DRIVER_DEBUG == 1 |
| 131 | |
| 132 | ifeq ($(Q_OR_LATER),1) |
| 133 | LOCAL_CFLAGS += \ |
| 134 | -DBOOST_NO_AUTO_PTR |
| 135 | endif # PLATFORM_VERSION == Q or later |
| 136 | |
| 137 | ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1) |
| 138 | LOCAL_CFLAGS += \ |
| 139 | -DARMCOMPUTECL_ENABLED |
| 140 | endif # ARMNN_COMPUTE_CL_ENABLED == 1 |
| 141 | |
| 142 | ifeq ($(ARMNN_COMPUTE_NEON_ENABLED),1) |
| 143 | LOCAL_CFLAGS += \ |
| 144 | -DARMCOMPUTENEON_ENABLED |
| 145 | endif # ARMNN_COMPUTE_NEON_ENABLED == 1 |
| 146 | |
| 147 | ifeq ($(ARMNN_REF_ENABLED),1) |
| 148 | LOCAL_CFLAGS += \ |
| 149 | -DARMNNREF_ENABLED |
| 150 | endif # ARMNN_REF_ENABLED == 1 |
| 151 | |
FrancisMurtagh | 594b283 | 2020-06-15 17:17:56 +0100 | [diff] [blame] | 152 | ifeq ($(ARMNN_ETHOSN_ENABLED),1) |
| 153 | LOCAL_CFLAGS += \ |
| 154 | -DARMNNETHOSN_ENABLED |
| 155 | endif # ARMNN_ETHOSN_ENABLED == 1 |
| 156 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 157 | LOCAL_SRC_FILES := \ |
| 158 | 1.0/ArmnnDriverImpl.cpp \ |
| 159 | 1.0/HalPolicy.cpp \ |
| 160 | ArmnnDriverImpl.cpp \ |
| 161 | DriverOptions.cpp \ |
| 162 | ArmnnDevice.cpp \ |
| 163 | ArmnnPreparedModel.cpp \ |
| 164 | ModelToINetworkConverter.cpp \ |
| 165 | RequestThread.cpp \ |
| 166 | Utils.cpp \ |
| 167 | ConversionUtils.cpp |
| 168 | |
| 169 | LOCAL_STATIC_LIBRARIES := \ |
| 170 | libneuralnetworks_common \ |
| 171 | libboost_log \ |
| 172 | libboost_program_options \ |
| 173 | libboost_system \ |
| 174 | libboost_thread \ |
| 175 | libboost_filesystem \ |
| 176 | arm_compute_library |
| 177 | |
| 178 | LOCAL_WHOLE_STATIC_LIBRARIES := libarmnn |
| 179 | |
| 180 | LOCAL_SHARED_LIBRARIES := \ |
| 181 | libbase \ |
| 182 | libhidlbase \ |
| 183 | libhidltransport \ |
| 184 | libhidlmemory \ |
| 185 | liblog \ |
| 186 | libutils \ |
| 187 | android.hardware.neuralnetworks@1.0 \ |
| 188 | android.hidl.allocator@1.0 \ |
| 189 | android.hidl.memory@1.0 |
| 190 | |
| 191 | ifeq ($(P_OR_LATER),1) |
| 192 | # Required to build the 1.0 version of the NN Driver on Android P and later versions, |
| 193 | # as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless. |
| 194 | LOCAL_SHARED_LIBRARIES+= \ |
| 195 | android.hardware.neuralnetworks@1.1 |
| 196 | endif # PLATFORM_VERSION == 9 |
| 197 | |
| 198 | ifeq ($(Q_OR_LATER),1) |
| 199 | LOCAL_SHARED_LIBRARIES+= \ |
| 200 | libnativewindow \ |
| 201 | libui \ |
| 202 | libfmq \ |
| 203 | libcutils \ |
| 204 | android.hardware.neuralnetworks@1.2 |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 205 | endif # Q or later |
| 206 | |
| 207 | ifeq ($(R_OR_LATER),1) |
| 208 | LOCAL_SHARED_LIBRARIES+= \ |
Sadik Armagan | d7be72e | 2020-04-23 12:56:05 +0100 | [diff] [blame] | 209 | libsync \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 210 | android.hardware.neuralnetworks@1.3 |
| 211 | endif # R or later |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 212 | |
alered01 | dbae247 | 2020-04-07 12:31:10 +0100 | [diff] [blame] | 213 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 214 | LOCAL_SHARED_LIBRARIES+= \ |
| 215 | libOpenCL |
| 216 | endif |
| 217 | |
| 218 | include $(BUILD_STATIC_LIBRARY) |
| 219 | |
| 220 | ifeq ($(P_OR_LATER),1) |
| 221 | # The following target is available starting from Android P |
| 222 | |
| 223 | ####################### |
| 224 | # libarmnn-driver@1.1 # |
| 225 | ####################### |
| 226 | include $(CLEAR_VARS) |
| 227 | |
| 228 | LOCAL_MODULE := libarmnn-driver@1.1 |
| 229 | ifeq ($(Q_OR_LATER),1) |
| 230 | # "eng" is deprecated in Android Q |
| 231 | LOCAL_MODULE_TAGS := optional |
| 232 | else |
| 233 | LOCAL_MODULE_TAGS := eng optional |
| 234 | endif |
| 235 | #PRODUCT_PACKAGES_ENG := libarmnn-driver@1.1 |
| 236 | LOCAL_ARM_MODE := arm |
| 237 | LOCAL_PROPRIETARY_MODULE := true |
| 238 | # Mark source files as dependent on Android.mk |
| 239 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 240 | |
| 241 | LOCAL_C_INCLUDES := \ |
| 242 | $(ARMNN_HEADER_PATH) \ |
Colm Donelan | 08d9a1c | 2020-09-09 17:56:55 +0100 | [diff] [blame] | 243 | $(ARMNN_THIRD_PARTY_PATH) \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 244 | $(ARMNN_UTILS_HEADER_PATH) \ |
Colm Donelan | 0cc6178 | 2020-10-06 21:02:21 +0100 | [diff] [blame^] | 245 | $(ARMNN_THIRD_PARTY_PATH) \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 246 | $(OPENCL_HEADER_PATH) \ |
| 247 | $(NN_HEADER_PATH) |
| 248 | |
| 249 | LOCAL_CFLAGS := \ |
| 250 | -std=$(CPP_VERSION) \ |
| 251 | -fexceptions \ |
| 252 | -Werror \ |
| 253 | -Wno-format-security \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 254 | -DARMNN_ANDROID_NN_V1_1 |
| 255 | |
| 256 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
| 257 | LOCAL_CFLAGS+= \ |
| 258 | -UNDEBUG |
| 259 | endif # ARMNN_DRIVER_DEBUG == 1 |
| 260 | |
| 261 | ifeq ($(Q_OR_LATER),1) |
| 262 | LOCAL_CFLAGS += \ |
| 263 | -DBOOST_NO_AUTO_PTR |
| 264 | endif # PLATFORM_VERSION == Q or later |
| 265 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 266 | # Required to build with the changes made to the Android ML framework specific to Android R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 267 | ifeq ($(ANDROID_R),1) |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 268 | LOCAL_CFLAGS+= \ |
| 269 | -DARMNN_ANDROID_R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 270 | endif |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 271 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 272 | ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1) |
| 273 | LOCAL_CFLAGS += \ |
| 274 | -DARMCOMPUTECL_ENABLED |
| 275 | endif # ARMNN_COMPUTE_CL_ENABLED == 1 |
| 276 | |
| 277 | ifeq ($(ARMNN_COMPUTE_NEON_ENABLED),1) |
| 278 | LOCAL_CFLAGS += \ |
| 279 | -DARMCOMPUTENEON_ENABLED |
| 280 | endif # ARMNN_COMPUTE_NEON_ENABLED == 1 |
| 281 | |
| 282 | ifeq ($(ARMNN_REF_ENABLED),1) |
| 283 | LOCAL_CFLAGS += \ |
| 284 | -DARMNNREF_ENABLED |
| 285 | endif # ARMNN_REF_ENABLED == 1 |
| 286 | |
FrancisMurtagh | 594b283 | 2020-06-15 17:17:56 +0100 | [diff] [blame] | 287 | ifeq ($(ARMNN_ETHOSN_ENABLED),1) |
| 288 | LOCAL_CFLAGS += \ |
| 289 | -DARMNNETHOSN_ENABLED |
| 290 | endif # ARMNN_ETHOSN_ENABLED == 1 |
| 291 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 292 | LOCAL_SRC_FILES := \ |
| 293 | 1.0/ArmnnDriverImpl.cpp \ |
| 294 | 1.0/HalPolicy.cpp \ |
| 295 | 1.1/ArmnnDriverImpl.cpp \ |
| 296 | 1.1/HalPolicy.cpp \ |
| 297 | ArmnnDriverImpl.cpp \ |
| 298 | DriverOptions.cpp \ |
| 299 | ArmnnDevice.cpp \ |
| 300 | ArmnnPreparedModel.cpp \ |
| 301 | ModelToINetworkConverter.cpp \ |
| 302 | RequestThread.cpp \ |
| 303 | Utils.cpp \ |
| 304 | ConversionUtils.cpp |
| 305 | |
| 306 | LOCAL_STATIC_LIBRARIES := \ |
| 307 | libneuralnetworks_common \ |
| 308 | libboost_log \ |
| 309 | libboost_program_options \ |
| 310 | libboost_system \ |
| 311 | libboost_thread \ |
| 312 | libboost_filesystem \ |
| 313 | arm_compute_library |
| 314 | |
| 315 | LOCAL_WHOLE_STATIC_LIBRARIES := libarmnn |
| 316 | |
| 317 | LOCAL_SHARED_LIBRARIES := \ |
| 318 | libbase \ |
| 319 | libhidlbase \ |
| 320 | libhidltransport \ |
| 321 | libhidlmemory \ |
| 322 | liblog \ |
| 323 | libutils \ |
| 324 | android.hardware.neuralnetworks@1.0 \ |
| 325 | android.hardware.neuralnetworks@1.1 \ |
| 326 | android.hidl.allocator@1.0 \ |
| 327 | android.hidl.memory@1.0 |
| 328 | |
| 329 | ifeq ($(Q_OR_LATER),1) |
| 330 | LOCAL_SHARED_LIBRARIES+= \ |
| 331 | libnativewindow \ |
| 332 | libui \ |
| 333 | libfmq \ |
| 334 | libcutils \ |
| 335 | android.hardware.neuralnetworks@1.2 |
| 336 | endif # PLATFORM_VERSION == Q |
| 337 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 338 | ifeq ($(R_OR_LATER),1) |
| 339 | LOCAL_SHARED_LIBRARIES+= \ |
Sadik Armagan | d7be72e | 2020-04-23 12:56:05 +0100 | [diff] [blame] | 340 | libsync \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 341 | android.hardware.neuralnetworks@1.3 |
| 342 | endif # R or later |
| 343 | |
alered01 | 7c395b2 | 2020-04-03 15:37:24 +0100 | [diff] [blame] | 344 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 345 | LOCAL_SHARED_LIBRARIES+= \ |
| 346 | libOpenCL |
| 347 | endif |
| 348 | |
| 349 | include $(BUILD_STATIC_LIBRARY) |
| 350 | |
| 351 | endif # PLATFORM_VERSION == 9 |
| 352 | |
| 353 | ifeq ($(Q_OR_LATER),1) |
| 354 | # The following target is available starting from Android Q |
| 355 | |
| 356 | ####################### |
| 357 | # libarmnn-driver@1.2 # |
| 358 | ####################### |
| 359 | include $(CLEAR_VARS) |
| 360 | |
| 361 | LOCAL_MODULE := libarmnn-driver@1.2 |
| 362 | LOCAL_MODULE_TAGS := optional |
| 363 | LOCAL_ARM_MODE := arm |
| 364 | LOCAL_PROPRIETARY_MODULE := true |
| 365 | # Mark source files as dependent on Android.mk |
| 366 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 367 | |
| 368 | LOCAL_C_INCLUDES := \ |
| 369 | $(ARMNN_HEADER_PATH) \ |
Colm Donelan | 08d9a1c | 2020-09-09 17:56:55 +0100 | [diff] [blame] | 370 | $(ARMNN_THIRD_PARTY_PATH) \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 371 | $(ARMNN_UTILS_HEADER_PATH) \ |
Colm Donelan | 0cc6178 | 2020-10-06 21:02:21 +0100 | [diff] [blame^] | 372 | $(ARMNN_THIRD_PARTY_PATH) \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 373 | $(OPENCL_HEADER_PATH) \ |
| 374 | $(NN_HEADER_PATH) |
| 375 | |
| 376 | LOCAL_CFLAGS := \ |
| 377 | -std=$(CPP_VERSION) \ |
| 378 | -fexceptions \ |
| 379 | -Werror \ |
| 380 | -Wno-format-security \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 381 | -DBOOST_NO_AUTO_PTR \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 382 | -DARMNN_ANDROID_NN_V1_2 |
| 383 | |
| 384 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
| 385 | LOCAL_CFLAGS+= \ |
| 386 | -UNDEBUG |
| 387 | endif # ARMNN_DRIVER_DEBUG == 1 |
| 388 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 389 | # Required to build with the changes made to the Android ML framework specific to Android R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 390 | ifeq ($(ANDROID_R),1) |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 391 | LOCAL_CFLAGS+= \ |
| 392 | -DARMNN_ANDROID_R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 393 | endif |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 394 | |
| 395 | ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1) |
| 396 | LOCAL_CFLAGS += \ |
| 397 | -DARMCOMPUTECL_ENABLED |
| 398 | endif # ARMNN_COMPUTE_CL_ENABLED == 1 |
| 399 | |
| 400 | ifeq ($(ARMNN_COMPUTE_NEON_ENABLED),1) |
| 401 | LOCAL_CFLAGS += \ |
| 402 | -DARMCOMPUTENEON_ENABLED |
| 403 | endif # ARMNN_COMPUTE_NEON_ENABLED == 1 |
| 404 | |
| 405 | ifeq ($(ARMNN_REF_ENABLED),1) |
| 406 | LOCAL_CFLAGS += \ |
| 407 | -DARMNNREF_ENABLED |
| 408 | endif # ARMNN_REF_ENABLED == 1 |
| 409 | |
FrancisMurtagh | 594b283 | 2020-06-15 17:17:56 +0100 | [diff] [blame] | 410 | ifeq ($(ARMNN_ETHOSN_ENABLED),1) |
| 411 | LOCAL_CFLAGS += \ |
| 412 | -DARMNNETHOSN_ENABLED |
| 413 | endif # ARMNN_ETHOSN_ENABLED == 1 |
| 414 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 415 | LOCAL_SRC_FILES := \ |
| 416 | 1.0/ArmnnDriverImpl.cpp \ |
| 417 | 1.0/HalPolicy.cpp \ |
| 418 | 1.1/ArmnnDriverImpl.cpp \ |
| 419 | 1.1/HalPolicy.cpp \ |
| 420 | 1.2/ArmnnDriverImpl.cpp \ |
| 421 | 1.2/HalPolicy.cpp \ |
| 422 | ArmnnDevice.cpp \ |
| 423 | ArmnnDriverImpl.cpp \ |
| 424 | ArmnnPreparedModel.cpp \ |
| 425 | ArmnnPreparedModel_1_2.cpp \ |
| 426 | ConversionUtils.cpp \ |
| 427 | DriverOptions.cpp \ |
| 428 | ModelToINetworkConverter.cpp \ |
| 429 | RequestThread.cpp \ |
| 430 | Utils.cpp |
| 431 | |
| 432 | LOCAL_STATIC_LIBRARIES := \ |
| 433 | libneuralnetworks_common \ |
| 434 | libboost_log \ |
| 435 | libboost_program_options \ |
| 436 | libboost_system \ |
| 437 | libboost_thread \ |
| 438 | libboost_filesystem \ |
| 439 | arm_compute_library |
| 440 | |
| 441 | LOCAL_WHOLE_STATIC_LIBRARIES := libarmnn |
| 442 | |
| 443 | LOCAL_SHARED_LIBRARIES := \ |
| 444 | libbase \ |
| 445 | libhidlbase \ |
| 446 | libhidltransport \ |
| 447 | libhidlmemory \ |
| 448 | liblog \ |
| 449 | libutils \ |
| 450 | libnativewindow \ |
| 451 | libui \ |
| 452 | libfmq \ |
| 453 | libcutils \ |
| 454 | android.hidl.allocator@1.0 \ |
| 455 | android.hidl.memory@1.0 \ |
| 456 | android.hardware.neuralnetworks@1.0 \ |
| 457 | android.hardware.neuralnetworks@1.1 \ |
| 458 | android.hardware.neuralnetworks@1.2 |
| 459 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 460 | ifeq ($(R_OR_LATER),1) |
| 461 | LOCAL_SHARED_LIBRARIES+= \ |
Sadik Armagan | d7be72e | 2020-04-23 12:56:05 +0100 | [diff] [blame] | 462 | libsync \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 463 | android.hardware.neuralnetworks@1.3 |
| 464 | endif # R or later |
| 465 | |
alered01 | 7c395b2 | 2020-04-03 15:37:24 +0100 | [diff] [blame] | 466 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 467 | LOCAL_SHARED_LIBRARIES+= \ |
| 468 | libOpenCL |
| 469 | endif |
| 470 | |
| 471 | include $(BUILD_STATIC_LIBRARY) |
| 472 | |
| 473 | endif # PLATFORM_VERSION == Q |
| 474 | |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 475 | ifeq ($(R_OR_LATER),1) |
| 476 | # The following target is available starting from Android R |
| 477 | |
| 478 | ####################### |
| 479 | # libarmnn-driver@1.3 # |
| 480 | ####################### |
| 481 | include $(CLEAR_VARS) |
| 482 | |
| 483 | LOCAL_MODULE := libarmnn-driver@1.3 |
| 484 | LOCAL_MODULE_TAGS := optional |
| 485 | LOCAL_ARM_MODE := arm |
| 486 | LOCAL_PROPRIETARY_MODULE := true |
| 487 | # Mark source files as dependent on Android.mk |
| 488 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 489 | |
| 490 | LOCAL_C_INCLUDES := \ |
| 491 | $(ARMNN_HEADER_PATH) \ |
Colm Donelan | 08d9a1c | 2020-09-09 17:56:55 +0100 | [diff] [blame] | 492 | $(ARMNN_THIRD_PARTY_PATH) \ |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 493 | $(ARMNN_UTILS_HEADER_PATH) \ |
Colm Donelan | 0cc6178 | 2020-10-06 21:02:21 +0100 | [diff] [blame^] | 494 | $(ARMNN_THIRD_PARTY_PATH) \ |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 495 | $(OPENCL_HEADER_PATH) \ |
| 496 | $(NN_HEADER_PATH) |
| 497 | |
| 498 | LOCAL_CFLAGS := \ |
| 499 | -std=$(CPP_VERSION) \ |
| 500 | -fexceptions \ |
| 501 | -Werror \ |
| 502 | -Wno-format-security \ |
| 503 | -DBOOST_NO_AUTO_PTR \ |
| 504 | -DARMNN_ANDROID_NN_V1_3 \ |
| 505 | -DARMNN_ANDROID_R |
| 506 | |
| 507 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
| 508 | LOCAL_CFLAGS+= \ |
| 509 | -UNDEBUG |
| 510 | endif # ARMNN_DRIVER_DEBUG == 1 |
| 511 | |
| 512 | ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1) |
| 513 | LOCAL_CFLAGS += \ |
| 514 | -DARMCOMPUTECL_ENABLED |
| 515 | endif # ARMNN_COMPUTE_CL_ENABLED == 1 |
| 516 | |
| 517 | ifeq ($(ARMNN_COMPUTE_NEON_ENABLED),1) |
| 518 | LOCAL_CFLAGS += \ |
| 519 | -DARMCOMPUTENEON_ENABLED |
| 520 | endif # ARMNN_COMPUTE_NEON_ENABLED == 1 |
| 521 | |
| 522 | ifeq ($(ARMNN_REF_ENABLED),1) |
| 523 | LOCAL_CFLAGS += \ |
| 524 | -DARMNNREF_ENABLED |
| 525 | endif # ARMNN_REF_ENABLED == 1 |
| 526 | |
FrancisMurtagh | 594b283 | 2020-06-15 17:17:56 +0100 | [diff] [blame] | 527 | ifeq ($(ARMNN_ETHOSN_ENABLED),1) |
| 528 | LOCAL_CFLAGS += \ |
| 529 | -DARMNNETHOSN_ENABLED |
| 530 | endif # ARMNN_ETHOSN_ENABLED == 1 |
| 531 | |
Narumol Prangnawarat | cad4e91 | 2020-06-02 12:07:43 +0100 | [diff] [blame] | 532 | LOCAL_CFLAGS += \ |
| 533 | -DRETIRE_RATE=$(RETIRE_RATE) |
| 534 | |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 535 | LOCAL_SRC_FILES := \ |
| 536 | 1.0/ArmnnDriverImpl.cpp \ |
| 537 | 1.0/HalPolicy.cpp \ |
| 538 | 1.1/ArmnnDriverImpl.cpp \ |
| 539 | 1.1/HalPolicy.cpp \ |
| 540 | 1.2/ArmnnDriverImpl.cpp \ |
| 541 | 1.2/HalPolicy.cpp \ |
| 542 | 1.3/ArmnnDriverImpl.cpp \ |
| 543 | 1.3/HalPolicy.cpp \ |
| 544 | ArmnnDevice.cpp \ |
| 545 | ArmnnDriverImpl.cpp \ |
| 546 | ArmnnPreparedModel.cpp \ |
| 547 | ArmnnPreparedModel_1_2.cpp \ |
| 548 | ArmnnPreparedModel_1_3.cpp \ |
| 549 | ConversionUtils.cpp \ |
| 550 | DriverOptions.cpp \ |
| 551 | ModelToINetworkConverter.cpp \ |
| 552 | RequestThread.cpp \ |
Narumol Prangnawarat | cad4e91 | 2020-06-02 12:07:43 +0100 | [diff] [blame] | 553 | RequestThread_1_3.cpp \ |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 554 | Utils.cpp |
| 555 | |
| 556 | LOCAL_STATIC_LIBRARIES := \ |
| 557 | libneuralnetworks_common \ |
| 558 | libboost_log \ |
| 559 | libboost_program_options \ |
| 560 | libboost_system \ |
| 561 | libboost_thread \ |
| 562 | libboost_filesystem \ |
| 563 | arm_compute_library |
| 564 | |
| 565 | LOCAL_WHOLE_STATIC_LIBRARIES := libarmnn |
| 566 | |
| 567 | LOCAL_SHARED_LIBRARIES := \ |
| 568 | libbase \ |
| 569 | libhidlbase \ |
| 570 | libhidltransport \ |
| 571 | libhidlmemory \ |
| 572 | liblog \ |
| 573 | libutils \ |
| 574 | libnativewindow \ |
| 575 | libui \ |
| 576 | libfmq \ |
| 577 | libcutils \ |
| 578 | android.hidl.allocator@1.0 \ |
| 579 | android.hidl.memory@1.0 \ |
Sadik Armagan | d7be72e | 2020-04-23 12:56:05 +0100 | [diff] [blame] | 580 | libsync \ |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 581 | android.hardware.neuralnetworks@1.0 \ |
| 582 | android.hardware.neuralnetworks@1.1 \ |
| 583 | android.hardware.neuralnetworks@1.2 \ |
| 584 | android.hardware.neuralnetworks@1.3 |
| 585 | |
alered01 | 7c395b2 | 2020-04-03 15:37:24 +0100 | [diff] [blame] | 586 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 587 | LOCAL_SHARED_LIBRARIES+= \ |
| 588 | libOpenCL |
| 589 | endif |
| 590 | |
| 591 | include $(BUILD_STATIC_LIBRARY) |
| 592 | |
| 593 | endif # PLATFORM_VERSION == R |
| 594 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 595 | ##################################################### |
Kevin May | abc95d0 | 2020-05-15 15:34:03 +0100 | [diff] [blame] | 596 | # android.hardware.neuralnetworks@1.0-service-armnn # |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 597 | ##################################################### |
| 598 | include $(CLEAR_VARS) |
| 599 | |
Kevin May | abc95d0 | 2020-05-15 15:34:03 +0100 | [diff] [blame] | 600 | LOCAL_MODULE := android.hardware.neuralnetworks@1.0-service-armnn |
| 601 | LOCAL_INIT_RC := android.hardware.neuralnetworks@1.0-service-armnn.rc |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 602 | ifeq ($(Q_OR_LATER),1) |
| 603 | # "eng" is deprecated in Android Q |
| 604 | LOCAL_MODULE_TAGS := optional |
| 605 | else |
| 606 | LOCAL_MODULE_TAGS := eng optional |
| 607 | endif |
| 608 | LOCAL_ARM_MODE := arm |
| 609 | LOCAL_MODULE_RELATIVE_PATH := hw |
| 610 | LOCAL_PROPRIETARY_MODULE := true |
| 611 | # Mark source files as dependent on Android.mk |
| 612 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 613 | |
| 614 | LOCAL_C_INCLUDES := \ |
| 615 | $(ARMNN_HEADER_PATH) \ |
Colm Donelan | 08d9a1c | 2020-09-09 17:56:55 +0100 | [diff] [blame] | 616 | $(ARMNN_THIRD_PARTY_PATH) \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 617 | $(NN_HEADER_PATH) |
| 618 | |
| 619 | LOCAL_CFLAGS := \ |
| 620 | -std=$(CPP_VERSION) \ |
| 621 | -fexceptions |
| 622 | |
| 623 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
| 624 | LOCAL_CFLAGS += \ |
| 625 | -UNDEBUG |
| 626 | endif # ARMNN_DRIVER_DEBUG == 1 |
| 627 | |
| 628 | ifeq ($(Q_OR_LATER),1) |
| 629 | LOCAL_CFLAGS += \ |
| 630 | -DBOOST_NO_AUTO_PTR |
| 631 | endif # PLATFORM_VERSION == Q or later |
| 632 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 633 | # Required to build with the changes made to the Android ML framework specific to Android R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 634 | ifeq ($(ANDROID_R),1) |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 635 | LOCAL_CFLAGS+= \ |
| 636 | -DARMNN_ANDROID_R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 637 | endif |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 638 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 639 | LOCAL_SRC_FILES := \ |
| 640 | service.cpp |
| 641 | |
| 642 | LOCAL_STATIC_LIBRARIES := \ |
| 643 | libneuralnetworks_common \ |
| 644 | libboost_log \ |
| 645 | libboost_program_options \ |
| 646 | libboost_system \ |
| 647 | libboost_thread \ |
| 648 | libboost_filesystem \ |
| 649 | arm_compute_library |
| 650 | |
| 651 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 652 | libarmnn-driver@1.0 |
| 653 | |
| 654 | LOCAL_SHARED_LIBRARIES := \ |
| 655 | libbase \ |
| 656 | libhidlbase \ |
| 657 | libhidltransport \ |
| 658 | libhidlmemory \ |
| 659 | libdl \ |
| 660 | libhardware \ |
| 661 | liblog \ |
| 662 | libtextclassifier_hash \ |
| 663 | libutils \ |
| 664 | android.hardware.neuralnetworks@1.0 \ |
| 665 | android.hidl.allocator@1.0 \ |
| 666 | android.hidl.memory@1.0 |
| 667 | |
| 668 | ifeq ($(P_OR_LATER),1) |
| 669 | # Required to build the 1.0 version of the NN Driver on Android P and later versions, |
| 670 | # as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless. |
| 671 | LOCAL_SHARED_LIBRARIES+= \ |
| 672 | android.hardware.neuralnetworks@1.1 |
| 673 | endif # PLATFORM_VERSION == 9 |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 674 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 675 | ifeq ($(Q_OR_LATER),1) |
| 676 | LOCAL_SHARED_LIBRARIES+= \ |
| 677 | libnativewindow \ |
| 678 | libui \ |
| 679 | libfmq \ |
| 680 | libcutils \ |
| 681 | android.hardware.neuralnetworks@1.2 |
| 682 | endif # PLATFORM_VERSION == Q |
| 683 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 684 | ifeq ($(R_OR_LATER),1) |
| 685 | LOCAL_SHARED_LIBRARIES+= \ |
Sadik Armagan | d7be72e | 2020-04-23 12:56:05 +0100 | [diff] [blame] | 686 | libsync \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 687 | android.hardware.neuralnetworks@1.3 |
| 688 | endif # R or later |
| 689 | |
alered01 | 7c395b2 | 2020-04-03 15:37:24 +0100 | [diff] [blame] | 690 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 691 | LOCAL_SHARED_LIBRARIES+= \ |
| 692 | libOpenCL |
| 693 | endif |
| 694 | |
| 695 | include $(BUILD_EXECUTABLE) |
| 696 | |
| 697 | ifeq ($(P_OR_LATER),1) |
| 698 | # The following target is available starting from Android P |
| 699 | |
| 700 | ##################################################### |
Kevin May | abc95d0 | 2020-05-15 15:34:03 +0100 | [diff] [blame] | 701 | # android.hardware.neuralnetworks@1.1-service-armnn # |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 702 | ##################################################### |
| 703 | include $(CLEAR_VARS) |
| 704 | |
Kevin May | abc95d0 | 2020-05-15 15:34:03 +0100 | [diff] [blame] | 705 | LOCAL_MODULE := android.hardware.neuralnetworks@1.1-service-armnn |
| 706 | LOCAL_INIT_RC := android.hardware.neuralnetworks@1.1-service-armnn.rc |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 707 | ifeq ($(Q_OR_LATER),1) |
| 708 | # "eng" is deprecated in Android Q |
| 709 | LOCAL_MODULE_TAGS := optional |
| 710 | else |
| 711 | LOCAL_MODULE_TAGS := eng optional |
| 712 | endif |
| 713 | LOCAL_ARM_MODE := arm |
| 714 | LOCAL_MODULE_RELATIVE_PATH := hw |
| 715 | LOCAL_PROPRIETARY_MODULE := true |
| 716 | # Mark source files as dependent on Android.mk |
| 717 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 718 | |
| 719 | LOCAL_C_INCLUDES := \ |
| 720 | $(ARMNN_HEADER_PATH) \ |
Colm Donelan | 08d9a1c | 2020-09-09 17:56:55 +0100 | [diff] [blame] | 721 | $(ARMNN_THIRD_PARTY_PATH) \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 722 | $(NN_HEADER_PATH) |
| 723 | |
| 724 | LOCAL_CFLAGS := \ |
| 725 | -std=$(CPP_VERSION) \ |
| 726 | -fexceptions \ |
| 727 | -DARMNN_ANDROID_NN_V1_1 |
| 728 | |
| 729 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
| 730 | LOCAL_CFLAGS += \ |
| 731 | -UNDEBUG |
| 732 | endif # ARMNN_DRIVER_DEBUG == 1 |
| 733 | |
| 734 | ifeq ($(Q_OR_LATER),1) |
| 735 | LOCAL_CFLAGS += \ |
| 736 | -DBOOST_NO_AUTO_PTR |
| 737 | endif # PLATFORM_VERSION == Q or later |
| 738 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 739 | # Required to build with the changes made to the Android ML framework specific to Android R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 740 | ifeq ($(ANDROID_R),1) |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 741 | LOCAL_CFLAGS+= \ |
| 742 | -DARMNN_ANDROID_R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 743 | endif |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 744 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 745 | LOCAL_SRC_FILES := \ |
| 746 | service.cpp |
| 747 | |
| 748 | LOCAL_STATIC_LIBRARIES := \ |
| 749 | libneuralnetworks_common \ |
| 750 | libboost_log \ |
| 751 | libboost_program_options \ |
| 752 | libboost_system \ |
| 753 | libboost_thread \ |
| 754 | libboost_filesystem \ |
| 755 | arm_compute_library |
| 756 | |
| 757 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 758 | libarmnn-driver@1.1 |
| 759 | |
| 760 | LOCAL_SHARED_LIBRARIES := \ |
| 761 | libbase \ |
| 762 | libhidlbase \ |
| 763 | libhidltransport \ |
| 764 | libhidlmemory \ |
| 765 | libdl \ |
| 766 | libhardware \ |
| 767 | liblog \ |
| 768 | libtextclassifier_hash \ |
| 769 | libutils \ |
| 770 | android.hardware.neuralnetworks@1.0 \ |
| 771 | android.hardware.neuralnetworks@1.1 \ |
| 772 | android.hidl.allocator@1.0 \ |
| 773 | android.hidl.memory@1.0 |
| 774 | |
| 775 | ifeq ($(Q_OR_LATER),1) |
| 776 | LOCAL_SHARED_LIBRARIES+= \ |
| 777 | libnativewindow \ |
| 778 | libui \ |
| 779 | libfmq \ |
| 780 | libcutils \ |
| 781 | android.hardware.neuralnetworks@1.2 |
| 782 | endif # PLATFORM_VERSION == Q |
| 783 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 784 | ifeq ($(R_OR_LATER),1) |
| 785 | LOCAL_SHARED_LIBRARIES+= \ |
Sadik Armagan | d7be72e | 2020-04-23 12:56:05 +0100 | [diff] [blame] | 786 | libsync \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 787 | android.hardware.neuralnetworks@1.3 |
| 788 | endif # PLATFORM_VERSION == R |
| 789 | |
alered01 | 7c395b2 | 2020-04-03 15:37:24 +0100 | [diff] [blame] | 790 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 791 | LOCAL_SHARED_LIBRARIES+= \ |
| 792 | libOpenCL |
| 793 | endif |
| 794 | |
| 795 | include $(BUILD_EXECUTABLE) |
| 796 | |
| 797 | endif # PLATFORM_VERSION == 9 |
| 798 | |
| 799 | ifeq ($(Q_OR_LATER),1) |
| 800 | # The following target is available starting from Android Q |
| 801 | |
| 802 | ##################################################### |
Kevin May | abc95d0 | 2020-05-15 15:34:03 +0100 | [diff] [blame] | 803 | # android.hardware.neuralnetworks@1.2-service-armnn # |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 804 | ##################################################### |
| 805 | include $(CLEAR_VARS) |
| 806 | |
Kevin May | abc95d0 | 2020-05-15 15:34:03 +0100 | [diff] [blame] | 807 | LOCAL_MODULE := android.hardware.neuralnetworks@1.2-service-armnn |
| 808 | LOCAL_INIT_RC := android.hardware.neuralnetworks@1.2-service-armnn.rc |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 809 | LOCAL_MODULE_TAGS := optional |
| 810 | LOCAL_ARM_MODE := arm |
| 811 | LOCAL_MODULE_RELATIVE_PATH := hw |
| 812 | LOCAL_PROPRIETARY_MODULE := true |
| 813 | # Mark source files as dependent on Android.mk |
| 814 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 815 | |
| 816 | LOCAL_C_INCLUDES := \ |
| 817 | $(ARMNN_HEADER_PATH) \ |
Colm Donelan | 08d9a1c | 2020-09-09 17:56:55 +0100 | [diff] [blame] | 818 | $(ARMNN_THIRD_PARTY_PATH) \ |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 819 | $(NN_HEADER_PATH) |
| 820 | |
| 821 | LOCAL_CFLAGS := \ |
| 822 | -std=$(CPP_VERSION) \ |
| 823 | -fexceptions \ |
| 824 | -DARMNN_ANDROID_NN_V1_2 \ |
| 825 | -DBOOST_NO_AUTO_PTR |
| 826 | |
| 827 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
| 828 | LOCAL_CFLAGS += \ |
| 829 | -UNDEBUG |
| 830 | endif # ARMNN_DRIVER_DEBUG == 1 |
| 831 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 832 | # Required to build with the changes made to the Android ML framework specific to Android R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 833 | ifeq ($(ANDROID_R),1) |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 834 | LOCAL_CFLAGS+= \ |
| 835 | -DARMNN_ANDROID_R |
Kevin May | 157f8f4 | 2020-06-02 14:50:01 +0100 | [diff] [blame] | 836 | endif |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 837 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 838 | LOCAL_SRC_FILES := \ |
| 839 | service.cpp |
| 840 | |
| 841 | LOCAL_STATIC_LIBRARIES := \ |
| 842 | libneuralnetworks_common \ |
| 843 | libboost_log \ |
| 844 | libboost_program_options \ |
| 845 | libboost_system \ |
| 846 | libboost_thread \ |
| 847 | libboost_filesystem \ |
| 848 | arm_compute_library |
| 849 | |
| 850 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 851 | libarmnn-driver@1.2 |
| 852 | |
| 853 | LOCAL_SHARED_LIBRARIES := \ |
| 854 | libbase \ |
| 855 | libhidlbase \ |
| 856 | libhidltransport \ |
| 857 | libhidlmemory \ |
| 858 | libdl \ |
| 859 | libhardware \ |
| 860 | liblog \ |
| 861 | libtextclassifier_hash \ |
| 862 | libutils \ |
| 863 | libnativewindow \ |
| 864 | libui \ |
| 865 | libfmq \ |
| 866 | libcutils \ |
| 867 | android.hidl.allocator@1.0 \ |
| 868 | android.hidl.memory@1.0 \ |
| 869 | android.hardware.neuralnetworks@1.0 \ |
| 870 | android.hardware.neuralnetworks@1.1 \ |
| 871 | android.hardware.neuralnetworks@1.2 |
| 872 | |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 873 | ifeq ($(R_OR_LATER),1) |
| 874 | LOCAL_SHARED_LIBRARIES+= \ |
Sadik Armagan | d7be72e | 2020-04-23 12:56:05 +0100 | [diff] [blame] | 875 | libsync \ |
Kevin May | ec1e5b8 | 2020-02-26 17:00:39 +0000 | [diff] [blame] | 876 | android.hardware.neuralnetworks@1.3 |
| 877 | endif # R or later |
| 878 | |
alered01 | 7c395b2 | 2020-04-03 15:37:24 +0100 | [diff] [blame] | 879 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 880 | LOCAL_SHARED_LIBRARIES+= \ |
| 881 | libOpenCL |
| 882 | endif |
| 883 | |
| 884 | include $(BUILD_EXECUTABLE) |
| 885 | |
| 886 | endif # PLATFORM_VERSION == Q |
| 887 | |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 888 | ifeq ($(R_OR_LATER),1) |
| 889 | # The following target is available starting from Android R |
| 890 | |
| 891 | ##################################################### |
Kevin May | abc95d0 | 2020-05-15 15:34:03 +0100 | [diff] [blame] | 892 | # android.hardware.neuralnetworks@1.3-service-armnn # |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 893 | ##################################################### |
| 894 | include $(CLEAR_VARS) |
| 895 | |
Kevin May | abc95d0 | 2020-05-15 15:34:03 +0100 | [diff] [blame] | 896 | LOCAL_MODULE := android.hardware.neuralnetworks@1.3-service-armnn |
| 897 | LOCAL_INIT_RC := android.hardware.neuralnetworks@1.3-service-armnn.rc |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 898 | LOCAL_MODULE_TAGS := optional |
| 899 | LOCAL_ARM_MODE := arm |
| 900 | LOCAL_MODULE_RELATIVE_PATH := hw |
| 901 | LOCAL_PROPRIETARY_MODULE := true |
| 902 | # Mark source files as dependent on Android.mk |
| 903 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 904 | |
| 905 | LOCAL_C_INCLUDES := \ |
| 906 | $(ARMNN_HEADER_PATH) \ |
Colm Donelan | 08d9a1c | 2020-09-09 17:56:55 +0100 | [diff] [blame] | 907 | $(ARMNN_THIRD_PARTY_PATH) \ |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 908 | $(NN_HEADER_PATH) |
| 909 | |
| 910 | LOCAL_CFLAGS := \ |
| 911 | -std=$(CPP_VERSION) \ |
| 912 | -fexceptions \ |
| 913 | -DARMNN_ANDROID_NN_V1_3 \ |
| 914 | -DBOOST_NO_AUTO_PTR \ |
| 915 | -DARMNN_ANDROID_R |
| 916 | |
| 917 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
| 918 | LOCAL_CFLAGS += \ |
| 919 | -UNDEBUG |
| 920 | endif # ARMNN_DRIVER_DEBUG == 1 |
| 921 | |
| 922 | LOCAL_SRC_FILES := \ |
| 923 | service.cpp |
| 924 | |
| 925 | LOCAL_STATIC_LIBRARIES := \ |
| 926 | libneuralnetworks_common \ |
| 927 | libboost_log \ |
| 928 | libboost_program_options \ |
| 929 | libboost_system \ |
| 930 | libboost_thread \ |
| 931 | libboost_filesystem \ |
| 932 | arm_compute_library |
| 933 | |
| 934 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 935 | libarmnn-driver@1.3 |
| 936 | |
| 937 | LOCAL_SHARED_LIBRARIES := \ |
| 938 | libbase \ |
| 939 | libhidlbase \ |
| 940 | libhidltransport \ |
| 941 | libhidlmemory \ |
| 942 | libdl \ |
| 943 | libhardware \ |
| 944 | liblog \ |
| 945 | libtextclassifier_hash \ |
| 946 | libutils \ |
| 947 | libnativewindow \ |
| 948 | libui \ |
| 949 | libfmq \ |
| 950 | libcutils \ |
Sadik Armagan | d7be72e | 2020-04-23 12:56:05 +0100 | [diff] [blame] | 951 | libsync \ |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 952 | android.hidl.allocator@1.0 \ |
| 953 | android.hidl.memory@1.0 \ |
| 954 | android.hardware.neuralnetworks@1.0 \ |
| 955 | android.hardware.neuralnetworks@1.1 \ |
| 956 | android.hardware.neuralnetworks@1.2 \ |
| 957 | android.hardware.neuralnetworks@1.3 |
| 958 | |
alered01 | 7c395b2 | 2020-04-03 15:37:24 +0100 | [diff] [blame] | 959 | ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1) |
Kevin May | 42477c1 | 2020-03-26 13:34:14 +0000 | [diff] [blame] | 960 | LOCAL_SHARED_LIBRARIES+= \ |
| 961 | libOpenCL |
| 962 | endif |
| 963 | |
| 964 | include $(BUILD_EXECUTABLE) |
| 965 | |
| 966 | endif # PLATFORM_VERSION == R |
| 967 | |
Mike Kelly | 0e41513 | 2020-02-11 11:21:25 +0000 | [diff] [blame] | 968 | ########################## |
| 969 | # armnn module and tests # |
| 970 | ########################## |
| 971 | # Note we use ANDROID_NN_DRIVER_LOCAL_PATH rather than LOCAL_PATH because LOCAL_PATH will be overwritten |
| 972 | # when including other .mk files that set it. |
| 973 | include $(ANDROID_NN_DRIVER_LOCAL_PATH)/armnn/Android.mk |
| 974 | include $(ANDROID_NN_DRIVER_LOCAL_PATH)/test/Android.mk |