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