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