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