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