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