LOCAL_PATH := $(call my-dir)
# Configure these paths if you move the source or Khronos headers
-#
OPENCL_HEADER_PATH := $(LOCAL_PATH)/../clframework/include
NN_HEADER_PATH := $(LOCAL_PATH)/../../../../frameworks/ml/nn/runtime/include
ARMNN_HEADER_PATH := $(LOCAL_PATH)/include
+ARMNN_PROFILING_INCLUDE_PATH := $(LOCAL_PATH)/profiling
+ARMNN_PROFILING_COMMON_INCLUDE_PATH := $(LOCAL_PATH)/profiling/common/include
+ARMNN_TIMELINE_DECODER_INCLUDE_PATH := $(LOCAL_PATH)/src/timelineDecoder
+ARMNN_THIRD_PARTY_INCLUDE_PATH := $(LOCAL_PATH)/third-party
ARMNN_MAIN_HEADER_PATH := $(LOCAL_PATH)/src
ARMNN_SOURCE_HEADER_PATH := $(LOCAL_PATH)/src/armnn
ARMNN_SOURCE_UTILS_HEADER_PATH := $(LOCAL_PATH)/src/armnnUtils
ARMNN_BACKENDS_HEADER_PATH := $(LOCAL_PATH)/src/backends
+ARMNN_PROFILING_HEADER_PATH := $(LOCAL_PATH)/src/profiling
# find the common.mk and backend.mk files in the backend source folders
ARMNN_BACKEND_COMMON_MAKEFILE_LOCAL_PATHS := $(wildcard $(LOCAL_PATH)/src/backends/*/common.mk)
#
$(foreach mkPath,$(ARMNN_BACKEND_COMMON_MAKEFILE_DIRS),\
$(eval include $(LOCAL_PATH)/$(mkPath)/common.mk)\
- $(eval ARMNN_BACKEND_SOURCES := $(ARMNN_BACKEND_SOURCES) $(patsubst %,$(mkPath)/%,$(COMMON_SOURCES))))
+ $(eval ARMNN_BACKEND_SOURCES := $(ARMNN_BACKEND_SOURCES)\
+ $(patsubst %,$(mkPath)/%,$(COMMON_SOURCES))))
$(foreach mkPath,$(ARMNN_BACKEND_MAKEFILE_DIRS),\
$(eval include $(LOCAL_PATH)/$(mkPath)/backend.mk)\
- $(eval ARMNN_BACKEND_SOURCES := $(ARMNN_BACKEND_SOURCES) $(patsubst %,$(mkPath)/%,$(BACKEND_SOURCES))))
+ $(eval ARMNN_BACKEND_SOURCES := $(ARMNN_BACKEND_SOURCES)\
+ $(patsubst %,$(mkPath)/%,$(BACKEND_SOURCES))))
# Mark source files as dependent on Android.mk and backend makefiles
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk \
LOCAL_EXPORT_C_INCLUDES := \
$(ARMNN_MAIN_HEADER_PATH) \
$(ARMNN_SOURCE_HEADER_PATH) \
+ $(ARMNN_PROFILING_INCLUDE_PATH) \
+ $(ARMNN_PROFILING_COMMON_INCLUDE_PATH) \
+ $(ARMNN_TIMELINE_DECODER_INCLUDE_PATH) \
+ $(ARMNN_THIRD_PARTY_INCLUDE_PATH) \
$(ARMNN_SOURCE_UTILS_HEADER_PATH) \
+ $(ARMNN_PROFILING_HEADER_PATH) \
$(ARMNN_BACKENDS_HEADER_PATH)
LOCAL_C_INCLUDES := \
$(OPENCL_HEADER_PATH) \
$(NN_HEADER_PATH) \
$(ARMNN_HEADER_PATH) \
+ $(ARMNN_PROFILING_INCLUDE_PATH) \
+ $(ARMNN_PROFILING_COMMON_INCLUDE_PATH) \
+ $(ARMNN_TIMELINE_DECODER_INCLUDE_PATH) \
+ $(ARMNN_THIRD_PARTY_INCLUDE_PATH) \
$(ARMNN_MAIN_HEADER_PATH) \
$(ARMNN_SOURCE_HEADER_PATH) \
$(ARMNN_SOURCE_UTILS_HEADER_PATH) \
+ $(ARMNN_PROFILING_HEADER_PATH) \
$(ARMNN_BACKENDS_HEADER_PATH)
LOCAL_SRC_FILES := \
$(ARMNN_BACKEND_SOURCES) \
+ profiling/common/src/CommandHandlerFunctor.cpp \
+ profiling/common/src/CommandHandlerKey.cpp \
+ profiling/common/src/CommandHandlerRegistry.cpp \
+ profiling/common/src/CommonProfilingUtils.cpp \
+ profiling/common/src/NetworkSockets.cpp \
+ profiling/common/src/PacketVersionResolver.cpp \
+ profiling/common/src/SwTrace.cpp \
+ profiling/server/src/timelineDecoder/TimelineCaptureCommandHandler.cpp \
+ profiling/server/src/timelineDecoder/TimelineDecoder.cpp \
+ profiling/server/src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp \
+ src/armnn/BackendHelper.cpp \
+ src/armnn/BackendRegistry.cpp \
+ src/armnn/Descriptors.cpp \
+ src/armnn/Exceptions.cpp \
+ src/armnn/Graph.cpp \
+ src/armnn/InternalTypes.cpp \
+ src/armnn/JsonPrinter.cpp \
+ src/armnn/Layer.cpp \
+ src/armnn/LayerSupport.cpp \
+ src/armnn/LoadedNetwork.cpp \
+ src/armnn/Logging.cpp \
+ src/armnn/Network.cpp \
+ src/armnn/NetworkUtils.cpp \
+ src/armnn/Observable.cpp \
+ src/armnn/Optimizer.cpp \
+ src/armnn/OutputHandler.cpp \
+ src/armnn/ProfilingEvent.cpp \
+ src/armnn/Profiling.cpp \
+ src/armnn/Runtime.cpp \
+ src/armnn/SerializeLayerParameters.cpp \
+ src/armnn/SubgraphView.cpp \
+ src/armnn/SubgraphViewSelector.cpp \
+ src/armnn/Tensor.cpp \
+ src/armnn/TypesUtils.cpp \
+ src/armnn/Utils.cpp \
+ src/armnn/WallClockTimer.cpp \
src/armnnUtils/CsvReader.cpp \
src/armnnUtils/DataLayoutIndexed.cpp \
src/armnnUtils/DotSerializer.cpp \
src/armnnUtils/FloatingPointConverter.cpp \
src/armnnUtils/HeapProfiling.cpp \
src/armnnUtils/LeakChecking.cpp \
- src/armnnUtils/Logging.cpp \
src/armnnUtils/ParserHelper.cpp \
src/armnnUtils/Permute.cpp \
src/armnnUtils/TensorUtils.cpp \
src/armnnUtils/VerificationHelpers.cpp \
+ src/armnnUtils/Filesystem.cpp \
+ src/armnnUtils/Processes.cpp \
+ src/armnnUtils/Threads.cpp \
+ src/armnnUtils/Transpose.cpp \
src/armnn/layers/ActivationLayer.cpp \
src/armnn/layers/AdditionLayer.cpp \
+ src/armnn/layers/ArgMinMaxLayer.cpp \
src/armnn/layers/BatchNormalizationLayer.cpp \
src/armnn/layers/BatchToSpaceNdLayer.cpp \
+ src/armnn/layers/ComparisonLayer.cpp \
src/armnn/layers/ConcatLayer.cpp \
src/armnn/layers/ConstantLayer.cpp \
src/armnn/layers/Convolution2dLayer.cpp \
+ src/armnn/layers/ConvertBf16ToFp32Layer.cpp \
src/armnn/layers/ConvertFp16ToFp32Layer.cpp \
+ src/armnn/layers/ConvertFp32ToBf16Layer.cpp \
src/armnn/layers/ConvertFp32ToFp16Layer.cpp \
src/armnn/layers/DebugLayer.cpp \
+ src/armnn/layers/DepthToSpaceLayer.cpp \
src/armnn/layers/DepthwiseConvolution2dLayer.cpp \
src/armnn/layers/DequantizeLayer.cpp \
src/armnn/layers/DetectionPostProcessLayer.cpp \
src/armnn/layers/DivisionLayer.cpp \
src/armnn/layers/ElementwiseBaseLayer.cpp \
- src/armnn/layers/EqualLayer.cpp \
+ src/armnn/layers/ElementwiseUnaryLayer.cpp \
src/armnn/layers/FakeQuantizationLayer.cpp \
+ src/armnn/layers/FillLayer.cpp \
src/armnn/layers/FloorLayer.cpp \
src/armnn/layers/FullyConnectedLayer.cpp \
src/armnn/layers/GatherLayer.cpp \
- src/armnn/layers/GreaterLayer.cpp \
src/armnn/layers/InputLayer.cpp \
+ src/armnn/layers/InstanceNormalizationLayer.cpp \
src/armnn/layers/L2NormalizationLayer.cpp \
+ src/armnn/layers/LogSoftmaxLayer.cpp \
src/armnn/layers/LstmLayer.cpp \
src/armnn/layers/MaximumLayer.cpp \
src/armnn/layers/MeanLayer.cpp \
src/armnn/layers/MemCopyLayer.cpp \
+ src/armnn/layers/MemImportLayer.cpp \
src/armnn/layers/MergeLayer.cpp \
src/armnn/layers/MinimumLayer.cpp \
src/armnn/layers/MultiplicationLayer.cpp \
src/armnn/layers/Pooling2dLayer.cpp \
src/armnn/layers/PreCompiledLayer.cpp \
src/armnn/layers/PreluLayer.cpp \
+ src/armnn/layers/QLstmLayer.cpp \
src/armnn/layers/QuantizeLayer.cpp \
src/armnn/layers/QuantizedLstmLayer.cpp \
+ src/armnn/layers/RankLayer.cpp \
src/armnn/layers/ReshapeLayer.cpp \
src/armnn/layers/ResizeLayer.cpp \
- src/armnn/layers/RsqrtLayer.cpp \
+ src/armnn/layers/SliceLayer.cpp \
+ src/armnn/layers/SoftmaxLayer.cpp \
src/armnn/layers/SpaceToBatchNdLayer.cpp \
src/armnn/layers/SpaceToDepthLayer.cpp \
- src/armnn/layers/SoftmaxLayer.cpp \
src/armnn/layers/SplitterLayer.cpp \
src/armnn/layers/StackLayer.cpp \
+ src/armnn/layers/StandInLayer.cpp \
src/armnn/layers/StridedSliceLayer.cpp \
src/armnn/layers/SubtractionLayer.cpp \
src/armnn/layers/SwitchLayer.cpp \
src/armnn/layers/TransposeConvolution2dLayer.cpp \
- src/armnn/BackendHelper.cpp \
- src/armnn/Descriptors.cpp \
- src/armnn/Exceptions.cpp \
- src/armnn/Graph.cpp \
- src/armnn/Optimizer.cpp \
- src/armnn/Runtime.cpp \
- src/armnn/SerializeLayerParameters.cpp \
- src/armnn/SubgraphView.cpp \
- src/armnn/SubgraphViewSelector.cpp \
- src/armnn/InternalTypes.cpp \
- src/armnn/Layer.cpp \
- src/armnn/LoadedNetwork.cpp \
- src/armnn/Network.cpp \
- src/armnn/NetworkUtils.cpp \
- src/armnn/WallClockTimer.cpp \
- src/armnn/ProfilingEvent.cpp \
- src/armnn/Profiling.cpp \
- src/armnn/JsonPrinter.cpp \
- src/armnn/Tensor.cpp \
- src/armnn/TypesUtils.cpp \
- src/armnn/Utils.cpp \
- src/armnn/LayerSupport.cpp \
- src/armnn/Observable.cpp
+ src/armnn/layers/TransposeLayer.cpp \
+ src/profiling/ActivateTimelineReportingCommandHandler.cpp \
+ src/profiling/BufferManager.cpp \
+ src/profiling/CommandHandler.cpp \
+ src/profiling/ConnectionAcknowledgedCommandHandler.cpp \
+ src/profiling/CounterDirectory.cpp \
+ src/profiling/CounterIdMap.cpp \
+ src/profiling/DeactivateTimelineReportingCommandHandler.cpp \
+ src/profiling/DirectoryCaptureCommandHandler.cpp \
+ src/profiling/FileOnlyProfilingConnection.cpp \
+ src/profiling/Holder.cpp \
+ src/profiling/LabelsAndEventClasses.cpp \
+ src/profiling/PacketBuffer.cpp \
+ src/profiling/PeriodicCounterCapture.cpp \
+ src/profiling/PeriodicCounterSelectionCommandHandler.cpp \
+ src/profiling/PerJobCounterSelectionCommandHandler.cpp \
+ src/profiling/ProfilingConnectionDumpToFileDecorator.cpp \
+ src/profiling/ProfilingConnectionFactory.cpp \
+ src/profiling/ProfilingService.cpp \
+ src/profiling/ProfilingStateMachine.cpp \
+ src/profiling/ProfilingUtils.cpp \
+ src/profiling/RegisterBackendCounters.cpp \
+ src/profiling/RequestCounterDirectoryCommandHandler.cpp \
+ src/profiling/SendCounterPacket.cpp \
+ src/profiling/SendThread.cpp \
+ src/profiling/SendTimelinePacket.cpp \
+ src/profiling/SocketProfilingConnection.cpp \
+ src/profiling/TimelinePacketWriterFactory.cpp \
+ src/profiling/TimelineUtilityMethods.cpp \
+ src/profiling/backends/BackendProfiling.cpp
LOCAL_STATIC_LIBRARIES := \
- armnn-arm_compute \
+ arm_compute_library \
libboost_log \
libboost_system \
- libboost_thread
+ libboost_thread \
+ libboost_filesystem
LOCAL_SHARED_LIBRARIES := \
liblog
-std=$(CPP_VERSION) \
-fexceptions \
-Wno-unused-parameter \
- -frtti
+ -frtti \
+ -DFMT_HEADER_ONLY
+
# The variable to enable/disable the CL backend (ARMNN_COMPUTE_CL_ENABLED) is declared in android-nn-driver/Android.mk
ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
LOCAL_CFLAGS += \
LOCAL_CFLAGS += \
-DARMCOMPUTENEON_ENABLED
endif # ARMNN_COMPUTE_NEON_ENABLED == 1
+# The variable to enable/disable the REFERENCE backend (ARMNN_REF_ENABLED) is declared in android-nn-driver/Android.mk
+ifeq ($(ARMNN_REF_ENABLED),1)
+LOCAL_CFLAGS += \
+ -DARMNNREF_ENABLED
+endif # ARMNN_REF_ENABLED == 1
ifeq ($(Q_OR_LATER),1)
LOCAL_CFLAGS += \
+ -DARMNN_MIXED_PRECISION_FP16_POOLING \
-DBOOST_NO_AUTO_PTR
endif # PLATFORM_VERSION == Q or later
$(OPENCL_HEADER_PATH) \
$(NN_HEADER_PATH) \
$(ARMNN_HEADER_PATH) \
+ $(ARMNN_PROFILING_INCLUDE_PATH) \
+ $(ARMNN_PROFILING_COMMON_INCLUDE_PATH) \
+ $(ARMNN_TIMELINE_DECODER_INCLUDE_PATH) \
+ $(ARMNN_THIRD_PARTY_INCLUDE_PATH) \
$(ARMNN_MAIN_HEADER_PATH) \
$(ARMNN_SOURCE_HEADER_PATH) \
$(ARMNN_SOURCE_UTILS_HEADER_PATH) \
+ $(ARMNN_PROFILING_HEADER_PATH) \
$(ARMNN_BACKENDS_HEADER_PATH)
LOCAL_CFLAGS := \
-fexceptions \
-frtti \
-isystem vendor/arm/android-nn-driver/boost_1_64_0
+
# The variable to enable/disable the CL backend (ARMNN_COMPUTE_CL_ENABLED) is declared in android-nn-driver/Android.mk
ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
LOCAL_CFLAGS += \
LOCAL_CFLAGS += \
-DARMCOMPUTENEON_ENABLED
endif # ARMNN_COMPUTE_NEON_ENABLED == 1
+# The variable to enable/disable the REFERENCE backend (ARMNN_REF_ENABLED) is declared in android-nn-driver/Android.mk
+ifeq ($(ARMNN_REF_ENABLED),1)
+LOCAL_CFLAGS += \
+ -DARMNNREF_ENABLED
+endif # ARMNN_REF_ENABLED == 1
ifeq ($(Q_OR_LATER),1)
LOCAL_CFLAGS += \
LOCAL_SRC_FILES := \
$(ARMNN_BACKEND_TEST_SOURCES) \
- src/armnn/test/UnitTests.cpp \
+ src/armnn/test/ConstTensorLayerVisitor.cpp \
+ src/armnn/test/CsvReaderTest.cpp \
src/armnn/test/EndToEndTest.cpp \
- src/armnn/test/UtilsTests.cpp \
+ src/armnn/ExecutionFrame.cpp \
+ src/armnn/test/ExecutionFrameTest.cpp \
+ src/armnn/test/FloatingPointConverterTest.cpp \
+ src/armnn/test/FlowControl.cpp \
src/armnn/test/GraphTests.cpp \
src/armnn/test/GraphUtils.cpp \
src/armnn/test/InferOutputTests.cpp \
- src/armnn/test/RuntimeTests.cpp \
- src/armnn/test/SubgraphViewTests.cpp \
- src/armnn/test/TensorTest.cpp \
- src/armnn/test/NetworkTests.cpp \
src/armnn/test/InstrumentTests.cpp \
- src/armnn/test/ProfilingEventTest.cpp \
+ src/armnnUtils/ModelAccuracyChecker.cpp \
+ src/armnn/test/ModelAccuracyCheckerTest.cpp \
+ src/armnn/test/NetworkTests.cpp \
src/armnn/test/ObservableTest.cpp \
+ src/armnn/test/optimizations/ConvertConstantsBFloatTests.cpp \
+ src/armnn/test/optimizations/ConvertConstantsFloatToHalfTests.cpp \
+ src/armnn/test/optimizations/ConvertConstantsHalfToFloatTests.cpp \
+ src/armnn/test/optimizations/Fp32NetworkToBf16ConverterTests.cpp \
+ src/armnn/test/optimizations/Fp32NetworkToFp16ConverterTests.cpp \
+ src/armnn/test/optimizations/InsertDebugLayerTests.cpp \
+ src/armnn/test/optimizations/MovePermuteUpTests.cpp \
+ src/armnn/test/optimizations/OptimizeConsecutiveReshapesTests.cpp \
+ src/armnn/test/optimizations/OptimizeInverseConversionsTests.cpp \
+ src/armnn/test/optimizations/OptimizeInversePermutesTests.cpp \
+ src/armnn/test/optimizations/PermuteAndBatchToSpaceAsDepthToSpaceTests.cpp \
+ src/armnn/test/optimizations/PermuteAsReshapeTests.cpp \
+ src/armnn/test/optimizations/SquashEqualSiblingsTests.cpp \
+ src/armnn/test/optimizations/TransposeAsReshapeTests.cpp \
+ src/armnn/test/OptimizerTests.cpp \
src/armnn/test/OptionalTest.cpp \
+ src/armnn/test/ProfilerTests.cpp \
+ src/armnn/test/ProfilingEventTest.cpp \
+ src/armnnUtils/PrototxtConversions.cpp \
+ src/armnnUtils/test/PrototxtConversionsTest.cpp \
+ src/armnn/test/SubgraphViewTests.cpp \
+ src/armnn/test/TensorHandleStrategyTest.cpp \
+ src/armnn/test/TensorTest.cpp \
+ src/armnn/test/TestInputOutputLayerVisitor.cpp \
+ src/armnn/test/TestLayerVisitor.cpp \
+ src/armnn/test/TestNameAndDescriptorLayerVisitor.cpp \
+ src/armnn/test/TestNameOnlyLayerVisitor.cpp \
src/armnn/test/TestUtils.cpp \
- src/armnn/test/TensorHandleStrategyTest.cpp
+ src/armnn/test/UnitTests.cpp \
+ src/armnn/test/UtilsTests.cpp \
+ src/armnnUtils/test/ParserHelperTest.cpp \
+ src/armnnUtils/test/QuantizeHelperTest.cpp \
+ src/armnnUtils/test/TensorUtilsTest.cpp \
+ src/profiling/test/BufferTests.cpp \
+ src/profiling/test/FileOnlyProfilingDecoratorTests.cpp \
+ src/profiling/test/PrintPacketHeaderHandler.cpp \
+ src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp \
+ src/profiling/test/ProfilingGuidTest.cpp \
+ src/profiling/test/ProfilingTests.cpp \
+ src/profiling/test/ProfilingTestUtils.cpp \
+ src/profiling/test/SendCounterPacketTests.cpp \
+ src/profiling/test/SendTimelinePacketTests.cpp \
+ src/profiling/test/TestTimelinePacketHandler.cpp \
+ src/profiling/test/TimelineModel.cpp \
+ src/profiling/test/TimelinePacketTests.cpp \
+ src/profiling/test/TimelineUtilityMethodsTests.cpp
+
+ifeq ($(ARMNN_REF_ENABLED),1)
+LOCAL_SRC_FILES += \
+ src/armnn/test/DebugCallbackTest.cpp \
+ src/armnn/test/RuntimeTests.cpp
+endif
LOCAL_STATIC_LIBRARIES := \
libneuralnetworks_common \
libboost_system \
libboost_unit_test_framework \
libboost_thread \
- armnn-arm_compute
+ libboost_filesystem \
+ arm_compute_library
LOCAL_WHOLE_STATIC_LIBRARIES := libarmnn
android.hidl.allocator@1.0 \
android.hidl.memory@1.0
-ifeq ($(ARMNN_COMPUTE_CL_ENABLED),1)
+ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1)
LOCAL_SHARED_LIBRARIES += \
libOpenCL
endif