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