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