telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright © 2017 ARM Ltd. All rights reserved. |
David Beck | 93e4898 | 2018-09-05 13:05:09 +0100 | [diff] [blame] | 3 | # SPDX-License-Identifier: MIT |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 4 | # |
| 5 | |
| 6 | ANDROID_NN_DRIVER_LOCAL_PATH := $(call my-dir) |
| 7 | LOCAL_PATH := $(ANDROID_NN_DRIVER_LOCAL_PATH) |
| 8 | |
| 9 | # Configure these paths if you move the source or Khronos headers |
surmeh01 | deb3bdb | 2018-07-05 12:06:04 +0100 | [diff] [blame] | 10 | ARMNN_HEADER_PATH := $(LOCAL_PATH)/armnn/include |
| 11 | ARMNN_UTILS_HEADER_PATH := $(LOCAL_PATH)/armnn/src/armnnUtils |
surmeh01 | 49b9e10 | 2018-05-17 14:11:25 +0100 | [diff] [blame] | 12 | OPENCL_HEADER_PATH := $(LOCAL_PATH)/clframework/include |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 13 | NN_HEADER_PATH := $(LOCAL_PATH)/../../../frameworks/ml/nn/runtime/include |
| 14 | |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 15 | ####################### |
| 16 | # libarmnn-driver@1.0 # |
| 17 | ####################### |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 18 | include $(CLEAR_VARS) |
| 19 | |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 20 | LOCAL_MODULE := libarmnn-driver@1.0 |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 21 | LOCAL_MODULE_TAGS := eng optional |
| 22 | LOCAL_ARM_MODE := arm |
surmeh01 | 49b9e10 | 2018-05-17 14:11:25 +0100 | [diff] [blame] | 23 | LOCAL_PROPRIETARY_MODULE := true |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 24 | # Mark source files as dependent on Android.mk |
| 25 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 26 | |
surmeh01 | deb3bdb | 2018-07-05 12:06:04 +0100 | [diff] [blame] | 27 | LOCAL_C_INCLUDES := \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 28 | $(ARMNN_HEADER_PATH) \ |
| 29 | $(ARMNN_UTILS_HEADER_PATH) \ |
| 30 | $(OPENCL_HEADER_PATH) \ |
| 31 | $(NN_HEADER_PATH) |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 32 | |
| 33 | LOCAL_CFLAGS := \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 34 | -std=c++14 \ |
| 35 | -fexceptions \ |
| 36 | -Werror \ |
| 37 | -Wno-format-security |
surmeh01 | deb3bdb | 2018-07-05 12:06:04 +0100 | [diff] [blame] | 38 | ifeq ($(PLATFORM_VERSION),9) |
| 39 | # Required to build with the changes made to the Android ML framework starting from Android P, |
| 40 | # regardless of the HAL version used for the build. |
| 41 | LOCAL_CFLAGS+= \ |
| 42 | -DARMNN_ANDROID_P |
Matteo Martincigh | 69558df | 2018-08-31 16:18:19 +0100 | [diff] [blame] | 43 | endif # PLATFORM_VERSION == 9 |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 44 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 45 | LOCAL_CFLAGS+= \ |
| 46 | -UNDEBUG |
Matteo Martincigh | 69558df | 2018-08-31 16:18:19 +0100 | [diff] [blame] | 47 | endif # ARMNN_DRIVER_DEBUG == 1 |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 48 | |
surmeh01 | deb3bdb | 2018-07-05 12:06:04 +0100 | [diff] [blame] | 49 | LOCAL_SRC_FILES := \ |
Matteo Martincigh | 79250ab | 2018-09-04 16:28:10 +0100 | [diff] [blame] | 50 | 1.0/ArmnnDriverImpl.cpp \ |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 51 | 1.0/HalPolicy.cpp \ |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 52 | ArmnnDriverImpl.cpp \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 53 | DriverOptions.cpp \ |
| 54 | ArmnnDevice.cpp \ |
| 55 | ArmnnPreparedModel.cpp \ |
| 56 | ModelToINetworkConverter.cpp \ |
| 57 | RequestThread.cpp \ |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 58 | Utils.cpp \ |
| 59 | ConversionUtils.cpp |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 60 | |
| 61 | LOCAL_STATIC_LIBRARIES := \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 62 | libneuralnetworks_common \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 63 | libboost_log \ |
| 64 | libboost_program_options \ |
| 65 | libboost_system \ |
| 66 | libboost_thread \ |
| 67 | armnn-arm_compute |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 68 | |
David Beck | c965f3c | 2018-10-12 17:23:16 +0100 | [diff] [blame] | 69 | LOCAL_WHOLE_STATIC_LIBRARIES := libarmnn |
| 70 | |
surmeh01 | deb3bdb | 2018-07-05 12:06:04 +0100 | [diff] [blame] | 71 | LOCAL_SHARED_LIBRARIES := \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 72 | libbase \ |
| 73 | libhidlbase \ |
| 74 | libhidltransport \ |
| 75 | libhidlmemory \ |
| 76 | liblog \ |
| 77 | libutils \ |
| 78 | android.hardware.neuralnetworks@1.0 \ |
| 79 | android.hidl.allocator@1.0 \ |
| 80 | android.hidl.memory@1.0 \ |
| 81 | libOpenCL |
surmeh01 | deb3bdb | 2018-07-05 12:06:04 +0100 | [diff] [blame] | 82 | ifeq ($(PLATFORM_VERSION),9) |
| 83 | # Required to build the 1.0 version of the NN Driver on Android P and later versions, |
| 84 | # as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless. |
| 85 | LOCAL_SHARED_LIBRARIES+= \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 86 | android.hardware.neuralnetworks@1.1 |
Matteo Martincigh | 69558df | 2018-08-31 16:18:19 +0100 | [diff] [blame] | 87 | endif # PLATFORM_VERSION == 9 |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 88 | |
| 89 | include $(BUILD_STATIC_LIBRARY) |
| 90 | |
Matteo Martincigh | 69558df | 2018-08-31 16:18:19 +0100 | [diff] [blame] | 91 | ifeq ($(PLATFORM_VERSION),9) |
| 92 | # The following target is available starting from Android P |
| 93 | |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 94 | ####################### |
| 95 | # libarmnn-driver@1.1 # |
| 96 | ####################### |
| 97 | include $(CLEAR_VARS) |
| 98 | |
| 99 | LOCAL_MODULE := libarmnn-driver@1.1 |
| 100 | LOCAL_MODULE_TAGS := eng optional |
| 101 | LOCAL_ARM_MODE := arm |
| 102 | LOCAL_PROPRIETARY_MODULE := true |
| 103 | # Mark source files as dependent on Android.mk |
| 104 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 105 | |
| 106 | LOCAL_C_INCLUDES := \ |
| 107 | $(ARMNN_HEADER_PATH) \ |
| 108 | $(ARMNN_UTILS_HEADER_PATH) \ |
| 109 | $(OPENCL_HEADER_PATH) \ |
| 110 | $(NN_HEADER_PATH) |
| 111 | |
| 112 | LOCAL_CFLAGS := \ |
| 113 | -std=c++14 \ |
| 114 | -fexceptions \ |
| 115 | -Werror \ |
| 116 | -Wno-format-security \ |
| 117 | -DARMNN_ANDROID_P \ |
| 118 | -DARMNN_ANDROID_NN_V1_1 |
| 119 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
| 120 | LOCAL_CFLAGS+= \ |
| 121 | -UNDEBUG |
Matteo Martincigh | 69558df | 2018-08-31 16:18:19 +0100 | [diff] [blame] | 122 | endif # ARMNN_DRIVER_DEBUG == 1 |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 123 | |
| 124 | LOCAL_SRC_FILES := \ |
Matteo Martincigh | 79250ab | 2018-09-04 16:28:10 +0100 | [diff] [blame] | 125 | 1.0/ArmnnDriverImpl.cpp \ |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 126 | 1.0/HalPolicy.cpp \ |
Matteo Martincigh | 79250ab | 2018-09-04 16:28:10 +0100 | [diff] [blame] | 127 | 1.1/ArmnnDriverImpl.cpp \ |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 128 | 1.1/HalPolicy.cpp \ |
Matteo Martincigh | e48bdff | 2018-09-03 13:50:50 +0100 | [diff] [blame] | 129 | ArmnnDriverImpl.cpp \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 130 | DriverOptions.cpp \ |
| 131 | ArmnnDevice.cpp \ |
| 132 | ArmnnPreparedModel.cpp \ |
| 133 | ModelToINetworkConverter.cpp \ |
| 134 | RequestThread.cpp \ |
arovir01 | b0717b5 | 2018-09-05 17:03:25 +0100 | [diff] [blame] | 135 | Utils.cpp \ |
| 136 | ConversionUtils.cpp |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 137 | |
| 138 | LOCAL_STATIC_LIBRARIES := \ |
| 139 | libneuralnetworks_common \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 140 | libboost_log \ |
| 141 | libboost_program_options \ |
| 142 | libboost_system \ |
| 143 | libboost_thread \ |
| 144 | armnn-arm_compute |
| 145 | |
David Beck | c965f3c | 2018-10-12 17:23:16 +0100 | [diff] [blame] | 146 | LOCAL_WHOLE_STATIC_LIBRARIES := libarmnn |
| 147 | |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 148 | LOCAL_SHARED_LIBRARIES := \ |
| 149 | libbase \ |
| 150 | libhidlbase \ |
| 151 | libhidltransport \ |
| 152 | libhidlmemory \ |
| 153 | liblog \ |
| 154 | libutils \ |
| 155 | android.hardware.neuralnetworks@1.0 \ |
| 156 | android.hardware.neuralnetworks@1.1 \ |
| 157 | android.hidl.allocator@1.0 \ |
| 158 | android.hidl.memory@1.0 \ |
| 159 | libOpenCL |
| 160 | |
| 161 | include $(BUILD_STATIC_LIBRARY) |
| 162 | |
Matteo Martincigh | 69558df | 2018-08-31 16:18:19 +0100 | [diff] [blame] | 163 | endif # PLATFORM_VERSION == 9 |
| 164 | |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 165 | ##################################################### |
| 166 | # android.hardware.neuralnetworks@1.0-service-armnn # |
| 167 | ##################################################### |
| 168 | include $(CLEAR_VARS) |
| 169 | |
| 170 | LOCAL_MODULE := android.hardware.neuralnetworks@1.0-service-armnn |
| 171 | LOCAL_INIT_RC := android.hardware.neuralnetworks@1.0-service-armnn.rc |
| 172 | LOCAL_MODULE_TAGS := eng optional |
| 173 | LOCAL_ARM_MODE := arm |
| 174 | LOCAL_MODULE_RELATIVE_PATH := hw |
| 175 | LOCAL_PROPRIETARY_MODULE := true |
| 176 | # Mark source files as dependent on Android.mk |
| 177 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 178 | |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 179 | LOCAL_C_INCLUDES := \ |
| 180 | $(ARMNN_HEADER_PATH) \ |
| 181 | $(NN_HEADER_PATH) |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 182 | |
| 183 | LOCAL_CFLAGS := \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 184 | -std=c++14 \ |
| 185 | -fexceptions |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 186 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 187 | LOCAL_CFLAGS += \ |
| 188 | -UNDEBUG |
Matteo Martincigh | 69558df | 2018-08-31 16:18:19 +0100 | [diff] [blame] | 189 | endif # ARMNN_DRIVER_DEBUG == 1 |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 190 | |
surmeh01 | deb3bdb | 2018-07-05 12:06:04 +0100 | [diff] [blame] | 191 | LOCAL_SRC_FILES := \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 192 | service.cpp |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 193 | |
| 194 | LOCAL_STATIC_LIBRARIES := \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 195 | libneuralnetworks_common \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 196 | libboost_log \ |
| 197 | libboost_program_options \ |
| 198 | libboost_system \ |
| 199 | libboost_thread \ |
| 200 | armnn-arm_compute |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 201 | |
David Beck | beb3e1f | 2018-10-15 14:15:42 +0100 | [diff] [blame] | 202 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 203 | libarmnn-driver@1.0 |
David Beck | c965f3c | 2018-10-12 17:23:16 +0100 | [diff] [blame] | 204 | |
surmeh01 | deb3bdb | 2018-07-05 12:06:04 +0100 | [diff] [blame] | 205 | LOCAL_SHARED_LIBRARIES := \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 206 | libbase \ |
| 207 | libhidlbase \ |
| 208 | libhidltransport \ |
| 209 | libhidlmemory \ |
| 210 | libdl \ |
| 211 | libhardware \ |
| 212 | liblog \ |
| 213 | libtextclassifier_hash \ |
| 214 | libutils \ |
| 215 | android.hardware.neuralnetworks@1.0 \ |
| 216 | android.hidl.allocator@1.0 \ |
| 217 | android.hidl.memory@1.0 \ |
| 218 | libOpenCL |
surmeh01 | deb3bdb | 2018-07-05 12:06:04 +0100 | [diff] [blame] | 219 | ifeq ($(PLATFORM_VERSION),9) |
| 220 | # Required to build the 1.0 version of the NN Driver on Android P and later versions, |
| 221 | # as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless. |
| 222 | LOCAL_SHARED_LIBRARIES+= \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 223 | android.hardware.neuralnetworks@1.1 |
Matteo Martincigh | 69558df | 2018-08-31 16:18:19 +0100 | [diff] [blame] | 224 | endif # PLATFORM_VERSION == 9 |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 225 | |
| 226 | include $(BUILD_EXECUTABLE) |
| 227 | |
Matteo Martincigh | 69558df | 2018-08-31 16:18:19 +0100 | [diff] [blame] | 228 | ifeq ($(PLATFORM_VERSION),9) |
| 229 | # The following target is available starting from Android P |
| 230 | |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 231 | ##################################################### |
| 232 | # android.hardware.neuralnetworks@1.1-service-armnn # |
| 233 | ##################################################### |
| 234 | include $(CLEAR_VARS) |
| 235 | |
| 236 | LOCAL_MODULE := android.hardware.neuralnetworks@1.1-service-armnn |
| 237 | LOCAL_INIT_RC := android.hardware.neuralnetworks@1.1-service-armnn.rc |
| 238 | LOCAL_MODULE_TAGS := eng optional |
| 239 | LOCAL_ARM_MODE := arm |
| 240 | LOCAL_MODULE_RELATIVE_PATH := hw |
| 241 | LOCAL_PROPRIETARY_MODULE := true |
| 242 | # Mark source files as dependent on Android.mk |
| 243 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 244 | |
| 245 | LOCAL_C_INCLUDES := \ |
| 246 | $(ARMNN_HEADER_PATH) \ |
| 247 | $(NN_HEADER_PATH) |
| 248 | |
| 249 | LOCAL_CFLAGS := \ |
| 250 | -std=c++14 \ |
| 251 | -fexceptions \ |
| 252 | -DARMNN_ANDROID_NN_V1_1 |
| 253 | ifeq ($(ARMNN_DRIVER_DEBUG),1) |
| 254 | LOCAL_CFLAGS += \ |
| 255 | -UNDEBUG |
Matteo Martincigh | 69558df | 2018-08-31 16:18:19 +0100 | [diff] [blame] | 256 | endif # ARMNN_DRIVER_DEBUG == 1 |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 257 | |
| 258 | LOCAL_SRC_FILES := \ |
| 259 | service.cpp |
| 260 | |
| 261 | LOCAL_STATIC_LIBRARIES := \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 262 | libneuralnetworks_common \ |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 263 | libboost_log \ |
| 264 | libboost_program_options \ |
| 265 | libboost_system \ |
| 266 | libboost_thread \ |
| 267 | armnn-arm_compute |
| 268 | |
David Beck | beb3e1f | 2018-10-15 14:15:42 +0100 | [diff] [blame] | 269 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 270 | libarmnn-driver@1.1 |
David Beck | c965f3c | 2018-10-12 17:23:16 +0100 | [diff] [blame] | 271 | |
telsoa01 | ce3e84a | 2018-08-31 09:31:35 +0100 | [diff] [blame] | 272 | LOCAL_SHARED_LIBRARIES := \ |
| 273 | libbase \ |
| 274 | libhidlbase \ |
| 275 | libhidltransport \ |
| 276 | libhidlmemory \ |
| 277 | libdl \ |
| 278 | libhardware \ |
| 279 | liblog \ |
| 280 | libtextclassifier_hash \ |
| 281 | libutils \ |
| 282 | android.hardware.neuralnetworks@1.0 \ |
| 283 | android.hardware.neuralnetworks@1.1 \ |
| 284 | android.hidl.allocator@1.0 \ |
| 285 | android.hidl.memory@1.0 \ |
| 286 | libOpenCL |
| 287 | |
| 288 | include $(BUILD_EXECUTABLE) |
| 289 | |
Matteo Martincigh | 69558df | 2018-08-31 16:18:19 +0100 | [diff] [blame] | 290 | endif # PLATFORM_VERSION == 9 |
| 291 | |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 292 | ########################## |
| 293 | # armnn module and tests # |
| 294 | ########################## |
| 295 | # Note we use ANDROID_NN_DRIVER_LOCAL_PATH rather than LOCAL_PATH because LOCAL_PATH will be overwritten |
| 296 | # when including other .mk files that set it. |
| 297 | include $(ANDROID_NN_DRIVER_LOCAL_PATH)/armnn/Android.mk |
surmeh01 | 49b9e10 | 2018-05-17 14:11:25 +0100 | [diff] [blame] | 298 | include $(ANDROID_NN_DRIVER_LOCAL_PATH)/test/Android.mk |