diff options
Diffstat (limited to 'delegate')
-rw-r--r-- | delegate/CMakeLists.txt | 356 | ||||
-rw-r--r-- | delegate/armnnDelegateJNI/CMakeLists.txt | 17 | ||||
-rw-r--r-- | delegate/classic/CMakeLists.txt | 101 | ||||
-rw-r--r-- | delegate/classic/include/Version.hpp | 29 | ||||
-rw-r--r-- | delegate/classic/include/armnn_delegate.hpp | 141 | ||||
-rw-r--r-- | delegate/classic/src/Activation.hpp (renamed from delegate/src/Activation.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/ArgMinMax.hpp (renamed from delegate/src/ArgMinMax.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/BatchMatMul.hpp (renamed from delegate/src/BatchMatMul.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/BatchSpace.hpp (renamed from delegate/src/BatchSpace.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/Comparison.hpp (renamed from delegate/src/Comparison.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/Control.hpp (renamed from delegate/src/Control.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/Convolution.hpp (renamed from delegate/src/Convolution.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/ElementwiseBinary.hpp (renamed from delegate/src/ElementwiseBinary.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/ElementwiseUnary.hpp (renamed from delegate/src/ElementwiseUnary.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/Fill.hpp (renamed from delegate/src/Fill.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/FullyConnected.hpp (renamed from delegate/src/FullyConnected.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/Gather.hpp (renamed from delegate/src/Gather.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/GatherNd.hpp (renamed from delegate/src/GatherNd.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/LogicalBinary.hpp (renamed from delegate/src/LogicalBinary.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/Lstm.hpp (renamed from delegate/src/Lstm.hpp) | 4 | ||||
-rw-r--r-- | delegate/classic/src/MultiLayerFacade.hpp (renamed from delegate/src/MultiLayerFacade.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/Normalization.hpp (renamed from delegate/src/Normalization.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/Pack.hpp (renamed from delegate/src/Pack.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/Pad.hpp (renamed from delegate/src/Pad.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/Pooling.hpp (renamed from delegate/src/Pooling.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/Prelu.hpp (renamed from delegate/src/Prelu.hpp) | 4 | ||||
-rw-r--r-- | delegate/classic/src/Quantization.hpp (renamed from delegate/src/Quantization.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/Redefine.hpp (renamed from delegate/src/Redefine.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/Reduce.hpp (renamed from delegate/src/Reduce.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/Resize.hpp (renamed from delegate/src/Resize.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/Round.hpp (renamed from delegate/src/Round.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/Shape.hpp (renamed from delegate/src/Shape.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/SharedFunctions.cpp (renamed from delegate/src/SharedFunctions.cpp) | 10 | ||||
-rw-r--r-- | delegate/classic/src/SharedFunctions.hpp (renamed from delegate/src/SharedFunctions.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/Slice.hpp (renamed from delegate/src/Slice.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/Softmax.hpp (renamed from delegate/src/Softmax.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/SpaceDepth.hpp (renamed from delegate/src/SpaceDepth.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/Split.hpp (renamed from delegate/src/Split.hpp) | 2 | ||||
-rw-r--r-- | delegate/classic/src/StridedSlice.hpp (renamed from delegate/src/StridedSlice.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/Transpose.hpp (renamed from delegate/src/Transpose.hpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/UnidirectionalSequenceLstm.hpp (renamed from delegate/src/UnidirectionalSequenceLstm.hpp) | 4 | ||||
-rw-r--r-- | delegate/classic/src/Unpack.hpp (renamed from delegate/src/Unpack.hpp) | 4 | ||||
-rw-r--r-- | delegate/classic/src/armnn_delegate.cpp (renamed from delegate/src/armnn_delegate.cpp) | 0 | ||||
-rw-r--r-- | delegate/classic/src/armnn_external_delegate.cpp (renamed from delegate/src/armnn_external_delegate.cpp) | 2 | ||||
-rw-r--r-- | delegate/common/include/DelegateOptions.hpp | 304 | ||||
-rw-r--r-- | delegate/common/src/DelegateOptions.cpp (renamed from delegate/src/DelegateOptions.cpp) | 0 | ||||
-rw-r--r-- | delegate/common/src/DelegateUtils.hpp (renamed from delegate/src/DelegateUtils.hpp) | 0 | ||||
-rw-r--r-- | delegate/include/DelegateOptions.hpp | 302 | ||||
-rw-r--r-- | delegate/include/Version.hpp | 29 | ||||
-rw-r--r-- | delegate/include/armnn_delegate.hpp | 141 | ||||
-rw-r--r-- | delegate/opaque/CMakeLists.txt | 64 | ||||
-rw-r--r-- | delegate/opaque/include/Version.hpp | 29 | ||||
-rw-r--r-- | delegate/opaque/include/armnn_delegate.hpp | 141 | ||||
-rw-r--r-- | delegate/test/ActivationTest.cpp (renamed from delegate/src/test/ActivationTest.cpp) | 7 | ||||
-rw-r--r-- | delegate/test/ActivationTestHelper.hpp (renamed from delegate/src/test/ActivationTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/ArgMinMaxTest.cpp (renamed from delegate/src/test/ArgMinMaxTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/ArgMinMaxTestHelper.hpp (renamed from delegate/src/test/ArgMinMaxTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/ArmnnDelegateTest.cpp (renamed from delegate/src/test/ArmnnDelegateTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/BatchMatMulTest.cpp (renamed from delegate/src/test/BatchMatMulTest.cpp) | 2 | ||||
-rw-r--r-- | delegate/test/BatchMatMulTestHelper.hpp (renamed from delegate/src/test/BatchMatMulTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/BatchSpaceTest.cpp (renamed from delegate/src/test/BatchSpaceTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/BatchSpaceTestHelper.hpp (renamed from delegate/src/test/BatchSpaceTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/CastTest.cpp (renamed from delegate/src/test/CastTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/CastTestHelper.hpp (renamed from delegate/src/test/CastTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/ComparisonTest.cpp (renamed from delegate/src/test/ComparisonTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/ComparisonTestHelper.hpp (renamed from delegate/src/test/ComparisonTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/ControlTest.cpp (renamed from delegate/src/test/ControlTest.cpp) | 2 | ||||
-rw-r--r-- | delegate/test/ControlTestHelper.hpp (renamed from delegate/src/test/ControlTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/Convolution2dTest.cpp (renamed from delegate/src/test/Convolution2dTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/Convolution3dTest.cpp (renamed from delegate/src/test/Convolution3dTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/ConvolutionTestHelper.hpp (renamed from delegate/src/test/ConvolutionTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/DelegateOptionsTest.cpp (renamed from delegate/src/test/DelegateOptionsTest.cpp) | 2 | ||||
-rw-r--r-- | delegate/test/DelegateOptionsTestHelper.hpp (renamed from delegate/src/test/DelegateOptionsTestHelper.hpp) | 3 | ||||
-rw-r--r-- | delegate/test/DepthwiseConvolution2dTest.cpp (renamed from delegate/src/test/DepthwiseConvolution2dTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/ElementwiseBinaryTest.cpp (renamed from delegate/src/test/ElementwiseBinaryTest.cpp) | 2 | ||||
-rw-r--r-- | delegate/test/ElementwiseBinaryTestHelper.hpp (renamed from delegate/src/test/ElementwiseBinaryTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/ElementwiseUnaryTest.cpp (renamed from delegate/src/test/ElementwiseUnaryTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/ElementwiseUnaryTestHelper.hpp (renamed from delegate/src/test/ElementwiseUnaryTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/FillTest.cpp (renamed from delegate/src/test/FillTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/FillTestHelper.hpp (renamed from delegate/src/test/FillTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/FullyConnectedTest.cpp (renamed from delegate/src/test/FullyConnectedTest.cpp) | 0 | ||||
-rw-r--r-- | delegate/test/FullyConnectedTestHelper.hpp (renamed from delegate/src/test/FullyConnectedTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/GatherNdTest.cpp (renamed from delegate/src/test/GatherNdTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/GatherNdTestHelper.hpp (renamed from delegate/src/test/GatherNdTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/GatherTest.cpp (renamed from delegate/src/test/GatherTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/GatherTestHelper.hpp (renamed from delegate/src/test/GatherTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/LogicalTest.cpp (renamed from delegate/src/test/LogicalTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/LogicalTestHelper.hpp (renamed from delegate/src/test/LogicalTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/LstmTest.cpp (renamed from delegate/src/test/LstmTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/LstmTestHelper.hpp (renamed from delegate/src/test/LstmTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/MirrorPadTest.cpp (renamed from delegate/src/test/MirrorPadTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/NeonDelegateTests_NDK_Issue.cpp (renamed from delegate/src/test/NeonDelegateTests_NDK_Issue.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/NormalizationTest.cpp (renamed from delegate/src/test/NormalizationTest.cpp) | 2 | ||||
-rw-r--r-- | delegate/test/NormalizationTestHelper.hpp (renamed from delegate/src/test/NormalizationTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/PackTest.cpp (renamed from delegate/src/test/PackTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/PackTestHelper.hpp (renamed from delegate/src/test/PackTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/PadTest.cpp (renamed from delegate/src/test/PadTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/PadTestHelper.hpp (renamed from delegate/src/test/PadTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/Pooling2dTest.cpp (renamed from delegate/src/test/Pooling2dTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/Pooling2dTestHelper.hpp (renamed from delegate/src/test/Pooling2dTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/Pooling3dTest.cpp (renamed from delegate/src/test/Pooling3dTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/Pooling3dTestHelper.hpp (renamed from delegate/src/test/Pooling3dTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/PreluTest.cpp (renamed from delegate/src/test/PreluTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/PreluTestHelper.hpp (renamed from delegate/src/test/PreluTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/QuantizationTest.cpp (renamed from delegate/src/test/QuantizationTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/QuantizationTestHelper.hpp (renamed from delegate/src/test/QuantizationTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/RedefineTestHelper.hpp (renamed from delegate/src/test/RedefineTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/ReduceTest.cpp (renamed from delegate/src/test/ReduceTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/ReduceTestHelper.hpp (renamed from delegate/src/test/ReduceTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/ReshapeTest.cpp (renamed from delegate/src/test/ReshapeTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/ResizeTest.cpp (renamed from delegate/src/test/ResizeTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/ResizeTestHelper.hpp (renamed from delegate/src/test/ResizeTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/RoundTest.cpp (renamed from delegate/src/test/RoundTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/RoundTestHelper.hpp (renamed from delegate/src/test/RoundTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/ShapeTest.cpp (renamed from delegate/src/test/ShapeTest.cpp) | 2 | ||||
-rw-r--r-- | delegate/test/ShapeTestHelper.hpp (renamed from delegate/src/test/ShapeTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/SliceTest.cpp (renamed from delegate/src/test/SliceTest.cpp) | 2 | ||||
-rw-r--r-- | delegate/test/SliceTestHelper.hpp (renamed from delegate/src/test/SliceTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/SoftmaxTest.cpp (renamed from delegate/src/test/SoftmaxTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/SoftmaxTestHelper.hpp (renamed from delegate/src/test/SoftmaxTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/SpaceDepthTest.cpp (renamed from delegate/src/test/SpaceDepthTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/SpaceDepthTestHelper.hpp (renamed from delegate/src/test/SpaceDepthTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/SplitTest.cpp (renamed from delegate/src/test/SplitTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/SplitTestHelper.hpp (renamed from delegate/src/test/SplitTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/StridedSliceTest.cpp (renamed from delegate/src/test/StridedSliceTest.cpp) | 2 | ||||
-rw-r--r-- | delegate/test/StridedSliceTestHelper.hpp (renamed from delegate/src/test/StridedSliceTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/TestUtils.cpp (renamed from delegate/src/test/TestUtils.cpp) | 2 | ||||
-rw-r--r-- | delegate/test/TestUtils.hpp (renamed from delegate/src/test/TestUtils.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/TransposeTest.cpp (renamed from delegate/src/test/TransposeTest.cpp) | 2 | ||||
-rw-r--r-- | delegate/test/TransposeTestHelper.hpp (renamed from delegate/src/test/TransposeTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/UnidirectionalSequenceLstmTest.cpp (renamed from delegate/src/test/UnidirectionalSequenceLstmTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/UnidirectionalSequenceLstmTestHelper.hpp (renamed from delegate/src/test/UnidirectionalSequenceLstmTestHelper.hpp) | 2 | ||||
-rw-r--r-- | delegate/test/UnpackTest.cpp (renamed from delegate/src/test/UnpackTest.cpp) | 4 | ||||
-rw-r--r-- | delegate/test/UnpackTestHelper.hpp (renamed from delegate/src/test/UnpackTestHelper.hpp) | 2 |
134 files changed, 1139 insertions, 809 deletions
diff --git a/delegate/CMakeLists.txt b/delegate/CMakeLists.txt index 55bdb7ca53..f6a5e512fa 100644 --- a/delegate/CMakeLists.txt +++ b/delegate/CMakeLists.txt @@ -7,112 +7,86 @@ cmake_minimum_required (VERSION 3.7.0) project(armnnDelegate) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Wextra -Werror -Wold-style-cast -Wno-missing-braces -Wconversion -Wsign-conversion -Wno-comment") - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/") +option(BUILD_UNIT_TESTS "Build unit tests" ON) +option(BUILD_CLASSIC_DELEGATE "Build classic delegate" ON) +option(BUILD_OPAQUE_DELEGATE "Build opaque delegate" OFF) +option(BUILD_SHARED_LIBS "Build share libs" ON) +option(BUILD_DELEGATE_JNI_INTERFACE "Builds a library to allow accessing the Arm NN delegate from Java code. + This is an experimental feature." ON) + set(armnnDelegate_sources) list(APPEND armnnDelegate_sources - include/armnn_delegate.hpp - include/DelegateOptions.hpp - include/Version.hpp - src/armnn_delegate.cpp - src/armnn_external_delegate.cpp - src/DelegateOptions.cpp - src/Activation.hpp - src/ArgMinMax.hpp - src/BatchMatMul.hpp - src/BatchSpace.hpp - src/Comparison.hpp - src/Convolution.hpp - src/Control.hpp - src/DelegateUtils.hpp - src/ElementwiseBinary.hpp - src/ElementwiseUnary.hpp - src/Fill.hpp - src/FullyConnected.hpp - src/Gather.hpp - src/GatherNd.hpp - src/LogicalBinary.hpp - src/Lstm.hpp - src/MultiLayerFacade.hpp - src/Normalization.hpp - src/Pack.hpp - src/Pad.hpp - src/Pooling.hpp - src/Prelu.hpp - src/Quantization.hpp - src/Redefine.hpp - src/Reduce.hpp - src/Resize.hpp - src/Round.hpp - src/Shape.hpp - src/SharedFunctions.hpp - src/SharedFunctions.cpp - src/Slice.hpp - src/Softmax.hpp - src/SpaceDepth.hpp - src/Split.hpp - src/Unpack.hpp - src/Transpose.hpp) - -add_library(armnnDelegate ${armnnDelegate_sources}) - -target_include_directories(armnnDelegate - PUBLIC - $<INSTALL_INTERFACE:include> - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/src) - -include(GNUInstallDirs) + common/include/DelegateOptions.hpp + common/src/DelegateOptions.cpp + common/src/DelegateUtils.hpp) ## Add Armnn as a Dependency if(NOT ARMNN_SUB_PROJECT) find_package(Armnn REQUIRED CONFIG HINTS ${Armnn_DIR}) endif() -target_link_libraries(armnnDelegate PUBLIC Armnn::Armnn) -## Add TfLite dependency -find_package(TfLiteSrc REQUIRED MODULE) -find_package(TfLite REQUIRED MODULE) - -target_link_libraries(armnnDelegate PUBLIC ${TfLite_LIB}) +if (BUILD_CLASSIC_DELEGATE) + add_subdirectory(classic) + add_library(armnnDelegate ${armnnDelegate_sources}) -# lpthread and ldl are not required for Android -if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Android) - target_link_libraries(armnnDelegate PUBLIC -lpthread) - target_link_libraries(armnnDelegate PUBLIC -ldl) + target_include_directories(armnnDelegate + PUBLIC + $<INSTALL_INTERFACE:include> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common/include> + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/common/src) +endif() +if (BUILD_OPAQUE_DELEGATE) + add_subdirectory(opaque) + add_library(armnnOpaqueDelegate ${armnnDelegate_sources}) + + target_include_directories(armnnOpaqueDelegate + PUBLIC + $<INSTALL_INTERFACE:include> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common/include> + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/common/src) endif() -# Various tflite header files are not warning clean -# We can't change compilation flags on header files directly, so we need to add them to an interface library first -add_library(tflite_headers INTERFACE) -target_include_directories(tflite_headers INTERFACE $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}> - $<INSTALL_INTERFACE:include/tflite_headers>) - -target_compile_options(tflite_headers INTERFACE -Wno-conversion - -Wno-sign-conversion - -Wno-unused-parameter - -Wno-unused-function) - -target_link_libraries(armnnDelegate PUBLIC tflite_headers) +include(GNUInstallDirs) -## Add Flatbuffers dependency -find_package(Flatbuffers REQUIRED MODULE) +if (BUILD_CLASSIC_DELEGATE) + target_link_libraries(armnnDelegate PUBLIC Armnn::Armnn) -target_link_libraries(armnnDelegate PRIVATE - ${Flatbuffers_LIB}) + ## Add armnnClassicDelegateObject as a Dependency + target_link_libraries(armnnDelegate PUBLIC armnnClassicDelegateObject) +endif() +if (BUILD_OPAQUE_DELEGATE) + target_link_libraries(armnnOpaqueDelegate PUBLIC Armnn::Armnn) -# include/flatbuffers/flatbuffers.h is not warning clean -# We can't change compilation flags on header files directly, so we need to add them to an interface library first -add_library(flatbuffer_headers INTERFACE) -target_include_directories(flatbuffer_headers INTERFACE $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}> - $<INSTALL_INTERFACE:include/flatbuffer_headers>) -target_compile_options(flatbuffer_headers INTERFACE -Wno-sign-conversion) + ## Add armnnOpaqueDelegateObject as a Dependency + target_link_libraries(armnnOpaqueDelegate PUBLIC armnnOpaqueDelegateObject) +endif() -target_link_libraries(armnnDelegate PUBLIC flatbuffer_headers) +## Add TfLite dependency +find_package(TfLiteSrc REQUIRED MODULE) +find_package(TfLite REQUIRED MODULE) +if (BUILD_CLASSIC_DELEGATE) + target_link_libraries(armnnDelegate PUBLIC ${TfLite_LIB}) + + # lpthread and ldl are not required for Android + if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Android) + target_link_libraries(armnnDelegate PUBLIC -lpthread) + target_link_libraries(armnnDelegate PUBLIC -ldl) + endif() +endif() +if (BUILD_OPAQUE_DELEGATE) + target_link_libraries(armnnOpaqueDelegate PUBLIC ${TfLite_LIB}) + + # lpthread and ldl are not required for Android + if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Android) + target_link_libraries(armnnOpaqueDelegate PUBLIC -lpthread) + target_link_libraries(armnnOpaqueDelegate PUBLIC -ldl) + endif() +endif() # Add libraries from armnn third-party libraries # Third-party header files are not warning clean @@ -122,100 +96,113 @@ target_include_directories(thirdparty_headers INTERFACE $<BUILD_INTERFACE:${ARMN $<INSTALL_INTERFACE:include/thirdparty_headers>) target_compile_options(thirdparty_headers INTERFACE -Wno-old-style-cast) -target_link_libraries(armnnDelegate PUBLIC thirdparty_headers) +if (BUILD_CLASSIC_DELEGATE) + target_link_libraries(armnnDelegate PUBLIC thirdparty_headers) +endif() +if (BUILD_OPAQUE_DELEGATE) + target_link_libraries(armnnOpaqueDelegate PUBLIC thirdparty_headers) +endif() add_library(profiling_library_headers INTERFACE) target_include_directories(profiling_library_headers INTERFACE $<BUILD_INTERFACE:${ARMNN_SOURCE_DIR}/profiling> $<INSTALL_INTERFACE:include/profiling_library_headers>) -target_link_libraries(armnnDelegate PUBLIC profiling_library_headers) -target_link_libraries(armnnDelegate PUBLIC Armnn::armnnUtils) -set_target_properties(armnnDelegate PROPERTIES VERSION ${DELEGATE_LIB_VERSION} SOVERSION ${DELEGATE_LIB_SOVERSION}) +if (BUILD_CLASSIC_DELEGATE) + target_link_libraries(armnnDelegate PUBLIC profiling_library_headers) + target_link_libraries(armnnDelegate PUBLIC Armnn::armnnUtils) + + set_target_properties(armnnDelegate PROPERTIES VERSION ${DELEGATE_LIB_VERSION} SOVERSION ${DELEGATE_LIB_SOVERSION}) +endif() +if (BUILD_OPAQUE_DELEGATE) + target_link_libraries(armnnOpaqueDelegate PUBLIC profiling_library_headers) + target_link_libraries(armnnOpaqueDelegate PUBLIC Armnn::armnnUtils) + + set_target_properties(armnnOpaqueDelegate PROPERTIES VERSION ${OPAQUE_DELEGATE_LIB_VERSION} SOVERSION ${OPAQUE_DELEGATE_LIB_SOVERSION}) +endif() -option(BUILD_UNIT_TESTS "Build unit tests" ON) if(BUILD_UNIT_TESTS) set(armnnDelegate_unittest_sources) list(APPEND armnnDelegate_unittest_sources - src/test/ActivationTest.cpp - src/test/ActivationTestHelper.hpp - src/test/ArgMinMaxTest.cpp - src/test/ArgMinMaxTestHelper.hpp - src/test/ArmnnDelegateTest.cpp - src/test/BatchMatMulTest.cpp - src/test/BatchMatMulTestHelper.hpp - src/test/BatchSpaceTest.cpp - src/test/BatchSpaceTestHelper.hpp - src/test/CastTest.cpp - src/test/CastTestHelper.hpp - src/test/ComparisonTest.cpp - src/test/ComparisonTestHelper.hpp - src/test/ControlTest.cpp - src/test/ControlTestHelper.hpp - src/test/Convolution2dTest.cpp - src/test/Convolution3dTest.cpp - src/test/ConvolutionTestHelper.hpp - src/test/DelegateOptionsTest.cpp - src/test/DelegateOptionsTestHelper.hpp - src/test/DepthwiseConvolution2dTest.cpp - src/test/ElementwiseBinaryTest.cpp - src/test/ElementwiseBinaryTestHelper.hpp - src/test/ElementwiseUnaryTest.cpp - src/test/ElementwiseUnaryTestHelper.hpp - src/test/FillTest.cpp - src/test/FillTestHelper.hpp - src/test/FullyConnectedTest.cpp - src/test/FullyConnectedTestHelper.hpp - src/test/GatherTest.cpp - src/test/GatherTestHelper.hpp - src/test/GatherNdTest.cpp - src/test/GatherNdTestHelper.hpp - src/test/LogicalTest.cpp - src/test/LogicalTestHelper.hpp - src/test/LstmTest.cpp - src/test/LstmTestHelper.hpp - src/test/MirrorPadTest.cpp - src/test/NormalizationTest.cpp - src/test/NormalizationTestHelper.hpp - src/test/PackTest.cpp - src/test/PackTestHelper.hpp - src/test/PadTest.cpp - src/test/PadTestHelper.hpp - src/test/Pooling2dTest.cpp - src/test/Pooling2dTestHelper.hpp - src/test/Pooling3dTest.cpp - src/test/Pooling3dTestHelper.hpp - src/test/PreluTest.cpp - src/test/PreluTestHelper.hpp - src/test/QuantizationTest.cpp - src/test/QuantizationTestHelper.hpp - src/test/RedefineTestHelper.hpp - src/test/ReduceTest.cpp - src/test/ReduceTestHelper.hpp - src/test/ReshapeTest.cpp - src/test/ResizeTest.cpp - src/test/ResizeTestHelper.hpp - src/test/RoundTest.cpp - src/test/RoundTestHelper.hpp - src/test/SoftmaxTest.cpp - src/test/SoftmaxTestHelper.hpp - src/test/SpaceDepthTest.cpp - src/test/SpaceDepthTestHelper.hpp - src/test/ShapeTest.cpp - src/test/ShapeTestHelper.hpp - src/test/SliceTest.cpp - src/test/SliceTestHelper.hpp - src/test/StridedSliceTest.cpp - src/test/StridedSliceTestHelper.hpp - src/test/SplitTest.cpp - src/test/SplitTestHelper.hpp - src/test/TestUtils.hpp - src/test/TestUtils.cpp - src/test/TransposeTest.cpp - src/test/TransposeTestHelper.hpp - src/test/UnidirectionalSequenceLstmTest.cpp - src/test/UnidirectionalSequenceLstmTestHelper.hpp - src/test/UnpackTest.cpp - src/test/UnpackTestHelper.hpp) + test/ActivationTest.cpp + test/ActivationTestHelper.hpp + test/ArgMinMaxTest.cpp + test/ArgMinMaxTestHelper.hpp + test/ArmnnDelegateTest.cpp + test/BatchMatMulTest.cpp + test/BatchMatMulTestHelper.hpp + test/BatchSpaceTest.cpp + test/BatchSpaceTestHelper.hpp + test/CastTest.cpp + test/CastTestHelper.hpp + test/ComparisonTest.cpp + test/ComparisonTestHelper.hpp + test/ControlTest.cpp + test/ControlTestHelper.hpp + test/Convolution2dTest.cpp + test/Convolution3dTest.cpp + test/ConvolutionTestHelper.hpp + test/DelegateOptionsTest.cpp + test/DelegateOptionsTestHelper.hpp + test/DepthwiseConvolution2dTest.cpp + test/ElementwiseBinaryTest.cpp + test/ElementwiseBinaryTestHelper.hpp + test/ElementwiseUnaryTest.cpp + test/ElementwiseUnaryTestHelper.hpp + test/FillTest.cpp + test/FillTestHelper.hpp + test/FullyConnectedTest.cpp + test/FullyConnectedTestHelper.hpp + test/GatherTest.cpp + test/GatherTestHelper.hpp + test/GatherNdTest.cpp + test/GatherNdTestHelper.hpp + test/LogicalTest.cpp + test/LogicalTestHelper.hpp + test/LstmTest.cpp + test/LstmTestHelper.hpp + test/MirrorPadTest.cpp + test/NormalizationTest.cpp + test/NormalizationTestHelper.hpp + test/PackTest.cpp + test/PackTestHelper.hpp + test/PadTest.cpp + test/PadTestHelper.hpp + test/Pooling2dTest.cpp + test/Pooling2dTestHelper.hpp + test/Pooling3dTest.cpp + test/Pooling3dTestHelper.hpp + test/PreluTest.cpp + test/PreluTestHelper.hpp + test/QuantizationTest.cpp + test/QuantizationTestHelper.hpp + test/RedefineTestHelper.hpp + test/ReduceTest.cpp + test/ReduceTestHelper.hpp + test/ReshapeTest.cpp + test/ResizeTest.cpp + test/ResizeTestHelper.hpp + test/RoundTest.cpp + test/RoundTestHelper.hpp + test/SoftmaxTest.cpp + test/SoftmaxTestHelper.hpp + test/SpaceDepthTest.cpp + test/SpaceDepthTestHelper.hpp + test/ShapeTest.cpp + test/ShapeTestHelper.hpp + test/SliceTest.cpp + test/SliceTestHelper.hpp + test/StridedSliceTest.cpp + test/StridedSliceTestHelper.hpp + test/SplitTest.cpp + test/SplitTestHelper.hpp + test/TestUtils.hpp + test/TestUtils.cpp + test/TransposeTest.cpp + test/TransposeTestHelper.hpp + test/UnidirectionalSequenceLstmTest.cpp + test/UnidirectionalSequenceLstmTestHelper.hpp + test/UnpackTest.cpp + test/UnpackTestHelper.hpp) # There's a known Android NDK bug which causes a subset of NeonLayerTests to # fail. We'll exclude these tests in NeonLayerTests_NDK_Bug.cpp if we're doing @@ -241,28 +228,26 @@ if(BUILD_UNIT_TESTS) if ( INCLUDE_NDK_BUG_TESTS STREQUAL "ON" ) list(APPEND armnnDelegate_unittest_sources - src/test/NeonDelegateTests_NDK_Issue.cpp + test/NeonDelegateTests_NDK_Issue.cpp ) else() endif() + if (BUILD_CLASSIC_DELEGATE) # For Opaque Delegate Unit Tests add OR BUILD_ARMNN_TFLITE_OPAQUE_DELEGATE here + add_executable(DelegateUnitTests ${armnnDelegate_unittest_sources}) - add_executable(DelegateUnitTests ${armnnDelegate_unittest_sources}) + target_include_directories(DelegateUnitTests SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}") - # Add half library from armnn third-party libraries - target_link_libraries(DelegateUnitTests PRIVATE thirdparty_headers) + # Add half library from armnn third-party libraries + target_link_libraries(DelegateUnitTests PRIVATE thirdparty_headers) - target_link_libraries(DelegateUnitTests PRIVATE armnnDelegate) - target_link_libraries(DelegateUnitTests PRIVATE Armnn::armnnUtils) - - target_link_libraries(DelegateUnitTests PRIVATE tflite_headers) - target_link_libraries(DelegateUnitTests PRIVATE flatbuffer_headers) - target_link_libraries(DelegateUnitTests PRIVATE profiling_library_headers) + target_link_libraries(DelegateUnitTests PRIVATE armnnDelegate) + target_link_libraries(DelegateUnitTests PRIVATE Armnn::armnnUtils) + target_link_libraries(DelegateUnitTests PRIVATE profiling_library_headers) + endif() endif() -option(BUILD_DELEGATE_JNI_INTERFACE "Builds a library to allow accessing the Arm NN delegate from Java code. - This is an experimental feature." Off) if(BUILD_DELEGATE_JNI_INTERFACE) add_subdirectory(armnnDelegateJNI) endif() @@ -271,6 +256,7 @@ endif() ## Export targets set(armnn_delegate_export_targets) list(APPEND armnn_delegate_export_targets + armnnClassicDelegateObject armnnDelegate tflite_headers flatbuffer_headers diff --git a/delegate/armnnDelegateJNI/CMakeLists.txt b/delegate/armnnDelegateJNI/CMakeLists.txt index 06eb3bf8e3..f16238c826 100644 --- a/delegate/armnnDelegateJNI/CMakeLists.txt +++ b/delegate/armnnDelegateJNI/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +# Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. # SPDX-License-Identifier: MIT # @@ -33,19 +33,10 @@ include_directories(${JNI_INCLUDE_DIRS}) add_library(armnn_delegate_jni SHARED ${jni_delegate_sources}) -target_include_directories( - armnn_delegate_jni - PUBLIC - ${ARMNN_INCLUDE_DIR} - ${ARMNN_DELEGATE_INCLUDE_DIR} - ${ARMCOMPUTE_INCLUDE} - ) - -target_link_libraries( - armnn_delegate_jni +target_link_libraries(armnn_delegate_jni PRIVATE - Armnn::Armnn - ArmnnDelegate::ArmnnDelegate + Armnn::Armnn + ArmnnDelegate::ArmnnDelegate ) # A version script is used to hide all symbols that are not required to use the jni interface diff --git a/delegate/classic/CMakeLists.txt b/delegate/classic/CMakeLists.txt new file mode 100644 index 0000000000..04167130d7 --- /dev/null +++ b/delegate/classic/CMakeLists.txt @@ -0,0 +1,101 @@ +# +# Copyright © 2023 Arm Ltd and Contributors. All rights reserved. +# SPDX-License-Identifier: MIT +# + +set(armnnClassicDelegateObject_sources) +list(APPEND armnnClassicDelegateObject_sources + include/armnn_delegate.hpp + include/Version.hpp + src/armnn_delegate.cpp + src/armnn_external_delegate.cpp + src/Activation.hpp + src/ArgMinMax.hpp + src/BatchMatMul.hpp + src/BatchSpace.hpp + src/Comparison.hpp + src/Convolution.hpp + src/Control.hpp + src/ElementwiseBinary.hpp + src/ElementwiseUnary.hpp + src/Fill.hpp + src/FullyConnected.hpp + src/Gather.hpp + src/GatherNd.hpp + src/LogicalBinary.hpp + src/Lstm.hpp + src/MultiLayerFacade.hpp + src/Normalization.hpp + src/Pack.hpp + src/Pad.hpp + src/Pooling.hpp + src/Prelu.hpp + src/Quantization.hpp + src/Redefine.hpp + src/Reduce.hpp + src/Resize.hpp + src/Round.hpp + src/Shape.hpp + src/SharedFunctions.hpp + src/SharedFunctions.cpp + src/Slice.hpp + src/Softmax.hpp + src/SpaceDepth.hpp + src/Split.hpp + src/Unpack.hpp + src/Transpose.hpp) + +add_library(armnnClassicDelegateObject OBJECT ${armnnClassicDelegateObject_sources}) + +target_include_directories(armnnClassicDelegateObject + PUBLIC + $<INSTALL_INTERFACE:include> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/common/include> + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${PROJECT_SOURCE_DIR}/common/src) + +## Add Tflite dependency +if(NOT TfLite_INCLUDE_DIR OR NOT TfLite_Schema_INCLUDE_PATH) + find_package(TfLiteSrc REQUIRED MODULE) +endif() + +# Various tflite header files are not warning clean +# We can't change compilation flags on header files directly, so we need to add them to an interface library first +add_library(tflite_headers INTERFACE) +target_include_directories(tflite_headers + INTERFACE + $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}> + $<INSTALL_INTERFACE:include/tflite_headers>) + +target_compile_options(tflite_headers + INTERFACE + -Wno-conversion + -Wno-sign-conversion + -Wno-unused-parameter + -Wno-unused-function) + +target_link_libraries(armnnClassicDelegateObject PUBLIC tflite_headers) + +## Add Flatbuffers dependency +find_package(Flatbuffers REQUIRED MODULE) + +target_link_libraries(armnnClassicDelegateObject PRIVATE ${Flatbuffers_LIB}) + +# include/flatbuffers/flatbuffers.h is not warning clean +# We can't change compilation flags on header files directly, so we need to add them to an interface library first +add_library(flatbuffer_headers INTERFACE) +target_include_directories(flatbuffer_headers + INTERFACE + $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}> + $<INSTALL_INTERFACE:include/flatbuffer_headers>) +target_compile_options(flatbuffer_headers INTERFACE -Wno-sign-conversion) + +target_link_libraries(armnnClassicDelegateObject PUBLIC flatbuffer_headers) + +#################################################### +## Export targets +install(TARGETS armnnClassicDelegateObject + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
\ No newline at end of file diff --git a/delegate/classic/include/Version.hpp b/delegate/classic/include/Version.hpp new file mode 100644 index 0000000000..c171d77c16 --- /dev/null +++ b/delegate/classic/include/Version.hpp @@ -0,0 +1,29 @@ +// +// Copyright © 2023 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +namespace armnnDelegate +{ + +/// Macro utils +#define STRINGIFY_VALUE(s) STRINGIFY_MACRO(s) +#define STRINGIFY_MACRO(s) #s + +// ArmNN Delegate version components +#define DELEGATE_MAJOR_VERSION 28 +#define DELEGATE_MINOR_VERSION 0 +#define DELEGATE_PATCH_VERSION 0 + +/// DELEGATE_VERSION: "X.Y.Z" +/// where: +/// X = Major version number +/// Y = Minor version number +/// Z = Patch version number +#define DELEGATE_VERSION STRINGIFY_VALUE(DELEGATE_MAJOR_VERSION) "." \ + STRINGIFY_VALUE(DELEGATE_MINOR_VERSION) "." \ + STRINGIFY_VALUE(DELEGATE_PATCH_VERSION) + +} //namespace armnnDelegate
\ No newline at end of file diff --git a/delegate/classic/include/armnn_delegate.hpp b/delegate/classic/include/armnn_delegate.hpp new file mode 100644 index 0000000000..8957dc87d6 --- /dev/null +++ b/delegate/classic/include/armnn_delegate.hpp @@ -0,0 +1,141 @@ +// +// Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include <DelegateOptions.hpp> + +#include <tensorflow/lite/builtin_ops.h> +#include <tensorflow/lite/c/builtin_op_data.h> +#include <tensorflow/lite/c/common.h> +#include <tensorflow/lite/minimal_logging.h> +#include <tensorflow/lite/version.h> + +#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 3) +#define ARMNN_POST_TFLITE_2_3 +#endif + +#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 4) +#define ARMNN_POST_TFLITE_2_4 +#endif + +#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 5) +#define ARMNN_POST_TFLITE_2_5 +#endif + +namespace armnnDelegate +{ + +struct DelegateData +{ + DelegateData(const std::vector<armnn::BackendId>& backends) + : m_Backends(backends) + , m_Network(nullptr, nullptr) + {} + + const std::vector<armnn::BackendId> m_Backends; + armnn::INetworkPtr m_Network; + std::vector<armnn::IOutputSlot*> m_OutputSlotForNode; +}; + +// Forward decleration for functions initializing the ArmNN Delegate +DelegateOptions TfLiteArmnnDelegateOptionsDefault(); + +TfLiteDelegate* TfLiteArmnnDelegateCreate(armnnDelegate::DelegateOptions options); + +void TfLiteArmnnDelegateDelete(TfLiteDelegate* tfLiteDelegate); + +TfLiteStatus DoPrepare(TfLiteContext* context, TfLiteDelegate* delegate); + +/// ArmNN Delegate +class Delegate +{ + friend class ArmnnSubgraph; +public: + explicit Delegate(armnnDelegate::DelegateOptions options); + + TfLiteIntArray* IdentifyOperatorsToDelegate(TfLiteContext* context); + + TfLiteDelegate* GetDelegate(); + + /// Retrieve version in X.Y.Z form + static const std::string GetVersion(); + +private: + /** + * Returns a pointer to the armnn::IRuntime* this will be shared by all armnn_delegates. + */ + armnn::IRuntime* GetRuntime(const armnn::IRuntime::CreationOptions& options) + { + static armnn::IRuntimePtr instance = armnn::IRuntime::Create(options); + // Instantiated on first use. + return instance.get(); + } + + TfLiteDelegate m_Delegate = { + reinterpret_cast<void*>(this), // .data_ + DoPrepare, // .Prepare + nullptr, // .CopyFromBufferHandle + nullptr, // .CopyToBufferHandle + nullptr, // .FreeBufferHandle + kTfLiteDelegateFlagsNone, // .flags + nullptr, // .opaque_delegate_builder + }; + + /// ArmNN Runtime pointer + armnn::IRuntime* m_Runtime; + /// ArmNN Delegate Options + armnnDelegate::DelegateOptions m_Options; +}; + +/// ArmnnSubgraph class where parsing the nodes to ArmNN format and creating the ArmNN Graph +class ArmnnSubgraph +{ +public: + static ArmnnSubgraph* Create(TfLiteContext* tfLiteContext, + const TfLiteDelegateParams* parameters, + const Delegate* delegate); + + TfLiteStatus Prepare(TfLiteContext* tfLiteContext); + + TfLiteStatus Invoke(TfLiteContext* tfLiteContext, TfLiteNode* tfLiteNode); + + static TfLiteStatus VisitNode(DelegateData& delegateData, + TfLiteContext* tfLiteContext, + TfLiteRegistration* tfLiteRegistration, + TfLiteNode* tfLiteNode, + int nodeIndex); + +private: + ArmnnSubgraph(armnn::NetworkId networkId, + armnn::IRuntime* runtime, + std::vector<armnn::BindingPointInfo>& inputBindings, + std::vector<armnn::BindingPointInfo>& outputBindings) + : m_NetworkId(networkId), m_Runtime(runtime), m_InputBindings(inputBindings), m_OutputBindings(outputBindings) + {} + + static TfLiteStatus AddInputLayer(DelegateData& delegateData, + TfLiteContext* tfLiteContext, + const TfLiteIntArray* inputs, + std::vector<armnn::BindingPointInfo>& inputBindings); + + static TfLiteStatus AddOutputLayer(DelegateData& delegateData, + TfLiteContext* tfLiteContext, + const TfLiteIntArray* outputs, + std::vector<armnn::BindingPointInfo>& outputBindings); + + + /// The Network Id + armnn::NetworkId m_NetworkId; + /// ArmNN Rumtime + armnn::IRuntime* m_Runtime; + + // Binding information for inputs and outputs + std::vector<armnn::BindingPointInfo> m_InputBindings; + std::vector<armnn::BindingPointInfo> m_OutputBindings; + +}; + +} // armnnDelegate namespace
\ No newline at end of file diff --git a/delegate/src/Activation.hpp b/delegate/classic/src/Activation.hpp index 59066d23e3..b86d89b4e5 100644 --- a/delegate/src/Activation.hpp +++ b/delegate/classic/src/Activation.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <tensorflow/lite/builtin_ops.h> #include <tensorflow/lite/c/builtin_op_data.h> diff --git a/delegate/src/ArgMinMax.hpp b/delegate/classic/src/ArgMinMax.hpp index 4e4a2a3f3a..4e4a2a3f3a 100644 --- a/delegate/src/ArgMinMax.hpp +++ b/delegate/classic/src/ArgMinMax.hpp diff --git a/delegate/src/BatchMatMul.hpp b/delegate/classic/src/BatchMatMul.hpp index 49fba05238..f56f728ef5 100644 --- a/delegate/src/BatchMatMul.hpp +++ b/delegate/classic/src/BatchMatMul.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <algorithm> #include <iterator> #include <string> diff --git a/delegate/src/BatchSpace.hpp b/delegate/classic/src/BatchSpace.hpp index 30c6dbfc15..30c6dbfc15 100644 --- a/delegate/src/BatchSpace.hpp +++ b/delegate/classic/src/BatchSpace.hpp diff --git a/delegate/src/Comparison.hpp b/delegate/classic/src/Comparison.hpp index 688f90c597..6d7700d191 100644 --- a/delegate/src/Comparison.hpp +++ b/delegate/classic/src/Comparison.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <armnn/utility/IgnoreUnused.hpp> #include <tensorflow/lite/builtin_ops.h> diff --git a/delegate/src/Control.hpp b/delegate/classic/src/Control.hpp index a3ea6e92a7..a3ea6e92a7 100644 --- a/delegate/src/Control.hpp +++ b/delegate/classic/src/Control.hpp diff --git a/delegate/src/Convolution.hpp b/delegate/classic/src/Convolution.hpp index 31cb2ab9ac..f6a50615fc 100644 --- a/delegate/src/Convolution.hpp +++ b/delegate/classic/src/Convolution.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include "SharedFunctions.hpp" #include <tensorflow/lite/builtin_ops.h> diff --git a/delegate/src/ElementwiseBinary.hpp b/delegate/classic/src/ElementwiseBinary.hpp index fa9021b5c1..e11327b95a 100644 --- a/delegate/src/ElementwiseBinary.hpp +++ b/delegate/classic/src/ElementwiseBinary.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include "MultiLayerFacade.hpp" #include "SharedFunctions.hpp" diff --git a/delegate/src/ElementwiseUnary.hpp b/delegate/classic/src/ElementwiseUnary.hpp index 4be6fba82e..562ce1fd9f 100644 --- a/delegate/src/ElementwiseUnary.hpp +++ b/delegate/classic/src/ElementwiseUnary.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <armnn/utility/Assert.hpp> diff --git a/delegate/src/Fill.hpp b/delegate/classic/src/Fill.hpp index e79133e15c..15dc91e481 100644 --- a/delegate/src/Fill.hpp +++ b/delegate/classic/src/Fill.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/FullyConnected.hpp b/delegate/classic/src/FullyConnected.hpp index 1129951104..28d43d06df 100644 --- a/delegate/src/FullyConnected.hpp +++ b/delegate/classic/src/FullyConnected.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include "armnnUtils/TensorUtils.hpp" #include <armnn/utility/IgnoreUnused.hpp> diff --git a/delegate/src/Gather.hpp b/delegate/classic/src/Gather.hpp index 9125997417..4c9cf82832 100644 --- a/delegate/src/Gather.hpp +++ b/delegate/classic/src/Gather.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <algorithm> #include <iterator> #include <string> diff --git a/delegate/src/GatherNd.hpp b/delegate/classic/src/GatherNd.hpp index cf526e1995..12f0af306d 100644 --- a/delegate/src/GatherNd.hpp +++ b/delegate/classic/src/GatherNd.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <algorithm> #include <iterator> #include <string> diff --git a/delegate/src/LogicalBinary.hpp b/delegate/classic/src/LogicalBinary.hpp index d71618ee9c..d71618ee9c 100644 --- a/delegate/src/LogicalBinary.hpp +++ b/delegate/classic/src/LogicalBinary.hpp diff --git a/delegate/src/Lstm.hpp b/delegate/classic/src/Lstm.hpp index 8c1f877ec9..460c61adf9 100644 --- a/delegate/src/Lstm.hpp +++ b/delegate/classic/src/Lstm.hpp @@ -1,11 +1,11 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <armnn/LstmParams.hpp> #include <armnn/Tensor.hpp> diff --git a/delegate/src/MultiLayerFacade.hpp b/delegate/classic/src/MultiLayerFacade.hpp index 31a7354382..90d0b3174d 100644 --- a/delegate/src/MultiLayerFacade.hpp +++ b/delegate/classic/src/MultiLayerFacade.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2021,2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021,2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/Normalization.hpp b/delegate/classic/src/Normalization.hpp index ef2e524369..ef2e524369 100644 --- a/delegate/src/Normalization.hpp +++ b/delegate/classic/src/Normalization.hpp diff --git a/delegate/src/Pack.hpp b/delegate/classic/src/Pack.hpp index 57d3b460f5..99c8b804ff 100644 --- a/delegate/src/Pack.hpp +++ b/delegate/classic/src/Pack.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2021,2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021,2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/Pad.hpp b/delegate/classic/src/Pad.hpp index 2ecf2a06d7..440a3d023c 100644 --- a/delegate/src/Pad.hpp +++ b/delegate/classic/src/Pad.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/Pooling.hpp b/delegate/classic/src/Pooling.hpp index 1178b6d8dc..2de40613fb 100644 --- a/delegate/src/Pooling.hpp +++ b/delegate/classic/src/Pooling.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <tensorflow/lite/builtin_ops.h> #include <tensorflow/lite/c/builtin_op_data.h> diff --git a/delegate/src/Prelu.hpp b/delegate/classic/src/Prelu.hpp index 06e74ed635..71a04a744e 100644 --- a/delegate/src/Prelu.hpp +++ b/delegate/classic/src/Prelu.hpp @@ -1,11 +1,11 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <tensorflow/lite/builtin_ops.h> #include <tensorflow/lite/c/builtin_op_data.h> diff --git a/delegate/src/Quantization.hpp b/delegate/classic/src/Quantization.hpp index f1192960e4..f1192960e4 100644 --- a/delegate/src/Quantization.hpp +++ b/delegate/classic/src/Quantization.hpp diff --git a/delegate/src/Redefine.hpp b/delegate/classic/src/Redefine.hpp index 864fb7af67..83c42d046e 100644 --- a/delegate/src/Redefine.hpp +++ b/delegate/classic/src/Redefine.hpp @@ -7,7 +7,7 @@ #include <armnn/utility/IgnoreUnused.hpp> -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <tensorflow/lite/builtin_ops.h> #include <tensorflow/lite/c/builtin_op_data.h> diff --git a/delegate/src/Reduce.hpp b/delegate/classic/src/Reduce.hpp index 2d8b462cd2..2d8b462cd2 100644 --- a/delegate/src/Reduce.hpp +++ b/delegate/classic/src/Reduce.hpp diff --git a/delegate/src/Resize.hpp b/delegate/classic/src/Resize.hpp index 370f1ab2d2..33c6c6ecd8 100644 --- a/delegate/src/Resize.hpp +++ b/delegate/classic/src/Resize.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <armnn/utility/IgnoreUnused.hpp> #include <armnn/Descriptors.hpp> diff --git a/delegate/src/Round.hpp b/delegate/classic/src/Round.hpp index 7a060b1d8f..7a060b1d8f 100644 --- a/delegate/src/Round.hpp +++ b/delegate/classic/src/Round.hpp diff --git a/delegate/src/Shape.hpp b/delegate/classic/src/Shape.hpp index d797563ab5..381a87430f 100644 --- a/delegate/src/Shape.hpp +++ b/delegate/classic/src/Shape.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <tensorflow/lite/builtin_ops.h> #include <tensorflow/lite/c/builtin_op_data.h> diff --git a/delegate/src/SharedFunctions.cpp b/delegate/classic/src/SharedFunctions.cpp index fef970173e..8de7d9c933 100644 --- a/delegate/src/SharedFunctions.cpp +++ b/delegate/classic/src/SharedFunctions.cpp @@ -6,12 +6,12 @@ #include "SharedFunctions.hpp" -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> -#include <tensorflow/lite/builtin_ops.h> -#include <tensorflow/lite/c/builtin_op_data.h> -#include <tensorflow/lite/c/common.h> -#include <tensorflow/lite/minimal_logging.h> +#include "tensorflow/lite/builtin_ops.h" +#include "tensorflow/lite/c/builtin_op_data.h" +#include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/minimal_logging.h" namespace armnnDelegate { diff --git a/delegate/src/SharedFunctions.hpp b/delegate/classic/src/SharedFunctions.hpp index b03a63ded9..b03a63ded9 100644 --- a/delegate/src/SharedFunctions.hpp +++ b/delegate/classic/src/SharedFunctions.hpp diff --git a/delegate/src/Slice.hpp b/delegate/classic/src/Slice.hpp index f19e3327e4..f19e3327e4 100644 --- a/delegate/src/Slice.hpp +++ b/delegate/classic/src/Slice.hpp diff --git a/delegate/src/Softmax.hpp b/delegate/classic/src/Softmax.hpp index 31c6ac3677..4fbd508437 100644 --- a/delegate/src/Softmax.hpp +++ b/delegate/classic/src/Softmax.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <tensorflow/lite/builtin_ops.h> #include <tensorflow/lite/c/builtin_op_data.h> diff --git a/delegate/src/SpaceDepth.hpp b/delegate/classic/src/SpaceDepth.hpp index cc7f03413d..cc7f03413d 100644 --- a/delegate/src/SpaceDepth.hpp +++ b/delegate/classic/src/SpaceDepth.hpp diff --git a/delegate/src/Split.hpp b/delegate/classic/src/Split.hpp index b183b55c54..fc193baf86 100644 --- a/delegate/src/Split.hpp +++ b/delegate/classic/src/Split.hpp @@ -5,7 +5,7 @@ #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <algorithm> #include <iterator> diff --git a/delegate/src/StridedSlice.hpp b/delegate/classic/src/StridedSlice.hpp index 998e3d3e14..998e3d3e14 100644 --- a/delegate/src/StridedSlice.hpp +++ b/delegate/classic/src/StridedSlice.hpp diff --git a/delegate/src/Transpose.hpp b/delegate/classic/src/Transpose.hpp index 41178d0b59..41178d0b59 100644 --- a/delegate/src/Transpose.hpp +++ b/delegate/classic/src/Transpose.hpp diff --git a/delegate/src/UnidirectionalSequenceLstm.hpp b/delegate/classic/src/UnidirectionalSequenceLstm.hpp index 9408397587..f8689d263f 100644 --- a/delegate/src/UnidirectionalSequenceLstm.hpp +++ b/delegate/classic/src/UnidirectionalSequenceLstm.hpp @@ -1,11 +1,11 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <armnn/LstmParams.hpp> #include <armnn/Tensor.hpp> diff --git a/delegate/src/Unpack.hpp b/delegate/classic/src/Unpack.hpp index ad541adccc..c9b737040c 100644 --- a/delegate/src/Unpack.hpp +++ b/delegate/classic/src/Unpack.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -7,7 +7,7 @@ #include <armnn/utility/IgnoreUnused.hpp> -#include "DelegateUtils.hpp" +#include <DelegateUtils.hpp> #include <tensorflow/lite/builtin_ops.h> #include <tensorflow/lite/c/builtin_op_data.h> diff --git a/delegate/src/armnn_delegate.cpp b/delegate/classic/src/armnn_delegate.cpp index 4ddfc1a35f..4ddfc1a35f 100644 --- a/delegate/src/armnn_delegate.cpp +++ b/delegate/classic/src/armnn_delegate.cpp diff --git a/delegate/src/armnn_external_delegate.cpp b/delegate/classic/src/armnn_external_delegate.cpp index c3875740e1..444015d71c 100644 --- a/delegate/src/armnn_external_delegate.cpp +++ b/delegate/classic/src/armnn_external_delegate.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #include "armnn_delegate.hpp" diff --git a/delegate/common/include/DelegateOptions.hpp b/delegate/common/include/DelegateOptions.hpp new file mode 100644 index 0000000000..3737940d17 --- /dev/null +++ b/delegate/common/include/DelegateOptions.hpp @@ -0,0 +1,304 @@ +// +// Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include <armnn/ArmNN.hpp> +#include <armnn/Optional.hpp> + +#include <string> +#include <vector> + +namespace armnnDelegate +{ + +class DelegateOptions +{ +public: + DelegateOptions(armnn::Compute computeDevice, + const std::vector<armnn::BackendOptions>& backendOptions = {}, + armnn::Optional<armnn::LogSeverity> logSeverityLevel = armnn::EmptyOptional()); + + DelegateOptions(const std::vector<armnn::BackendId>& backends, + const std::vector<armnn::BackendOptions>& backendOptions = {}, + armnn::Optional<armnn::LogSeverity> logSeverityLevel = armnn::EmptyOptional()); + + DelegateOptions(armnn::Compute computeDevice, + const armnn::OptimizerOptions& optimizerOptions, + const armnn::Optional<armnn::LogSeverity>& logSeverityLevel = armnn::EmptyOptional(), + const armnn::Optional<armnn::DebugCallbackFunction>& func = armnn::EmptyOptional()); + + DelegateOptions(const std::vector<armnn::BackendId>& backends, + const armnn::OptimizerOptions& optimizerOptions, + const armnn::Optional<armnn::LogSeverity>& logSeverityLevel = armnn::EmptyOptional(), + const armnn::Optional<armnn::DebugCallbackFunction>& func = armnn::EmptyOptional()); + + + /** + * This constructor processes delegate options in form of command line arguments. + * It works in conjunction with the TfLite external delegate plugin. + * + * Available options: + * + * Option key: "backends" \n + * Possible values: ["EthosNPU"/"GpuAcc"/"CpuAcc"/"CpuRef"] \n + * Descriptions: A comma separated list without whitespaces of + * backends which should be used for execution. Falls + * back to next backend in list if previous doesn't + * provide support for operation. e.g. "GpuAcc,CpuAcc" + * + * Option key: "dynamic-backends-path" \n + * Possible values: [filenameString] \n + * Descriptions: This is the directory that will be searched for any dynamic backends. + * + * Option key: "logging-severity" \n + * Possible values: ["trace"/"debug"/"info"/"warning"/"error"/"fatal"] \n + * Description: Sets the logging severity level for ArmNN. Logging + * is turned off if this option is not provided. + * + * Option key: "gpu-tuning-level" \n + * Possible values: ["0"/"1"/"2"/"3"] \n + * Description: 0=UseOnly(default), 1=RapidTuning, 2=NormalTuning, + * 3=ExhaustiveTuning. Requires option gpu-tuning-file. + * 1,2 and 3 will create a tuning-file, 0 will apply the + * tunings from an existing file + * + * Option key: "gpu-mlgo-tuning-file" \n + * Possible values: [filenameString] \n + * Description: File name for the MLGO tuning file + * + * Option key: "gpu-tuning-file" \n + * Possible values: [filenameString] \n + * Description: File name for the tuning file. + * + * Option key: "gpu-enable-profiling" \n + * Possible values: ["true"/"false"] \n + * Description: Enables GPU profiling + * + * Option key: "gpu-kernel-profiling-enabled" \n + * Possible values: ["true"/"false"] \n + * Description: Enables GPU kernel profiling + * + * Option key: "save-cached-network" \n + * Possible values: ["true"/"false"] \n + * Description: Enables saving of the cached network to a file, + * specified with the cached-network-filepath option + * + * Option key: "cached-network-filepath" \n + * Possible values: [filenameString] \n + * Description: If non-empty, the given file will be used to load/save the cached network. + * If save-cached-network is given then the cached network will be saved to the given file. + * To save the cached network a file must already exist. + * If save-cached-network is not given then the cached network will be loaded from the given file. + * This will remove initial compilation time of kernels and speed up the first execution. + * + * Option key: "enable-fast-math" \n + * Possible values: ["true"/"false"] \n + * Description: Enables fast_math options in backends that support it + * + * Option key: "number-of-threads" \n + * Possible values: ["1"-"64"] \n + * Description: Assign the number of threads used by the CpuAcc backend. + * Default is set to 0 (Backend will decide number of threads to use). + * + * Option key: "reduce-fp32-to-fp16" \n + * Possible values: ["true"/"false"] \n + * Description: Reduce Fp32 data to Fp16 for faster processing + * + * Option key: "reduce-fp32-to-bf16" \n + * Possible values: ["true"/"false"] \n + * Description: This option is currently ignored. Please enable Fast Math in the CpuAcc or GpuAcc backends. + * + * Option key: "debug-data" \n + * Possible values: ["true"/"false"] \n + * Description: Add debug data for easier troubleshooting + * + * Option key: "memory-import" \n + * Possible values: ["true"/"false"] \n + * Description: Enable memory import + * + * Option key: "enable-internal-profiling" \n + * Possible values: ["true"/"false"] \n + * Description: Enable the internal profiling feature. + * + * Option key: "internal-profiling-detail" \n + * Possible values: [1/2] \n + * Description: Set the detail on the internal profiling. 1 = DetailsWithEvents, 2 = DetailsOnly. + * + * Option key: "enable-external-profiling" \n + * Possible values: ["true"/"false"] \n + * Description: Enable the external profiling feature. + * + * Option key: "timeline-profiling" \n + * Possible values: ["true"/"false"] \n + * Description: Indicates whether external timeline profiling is enabled or not. + * + * Option key: "outgoing-capture-file" \n + * Possible values: [filenameString] \n + * Description: Path to a file in which outgoing timeline profiling messages will be stored. + * + * Option key: "incoming-capture-file" \n + * Possible values: [filenameString] \n + * Description: Path to a file in which incoming timeline profiling messages will be stored. + * + * Option key: "file-only-external-profiling" \n + * Possible values: ["true"/"false"] \n + * Description: Enable profiling output to file only. + * + * Option key: "counter-capture-period" \n + * Possible values: Integer, Default is 10000u + * Description: Value in microseconds of the profiling capture period. \n + * + * Option key: "profiling-file-format" \n + * Possible values: String of ["binary"] \n + * Description: The format of the file used for outputting profiling data. Currently on "binary" is supported. + * + * Option key: "serialize-to-dot" \n + * Possible values: [filenameString] \n + * Description: Serialize the optimized network to the file specified in "dot" format. + * + * Option key: "infer-output-shape" \n + * Possible values: ["true"/"false"] \n + * Description: Infers output tensor shape from input tensor shape and validate where applicable. + * + * Option key: "allow-expanded-dims" \n + * Possible values: ["true"/"false"] \n + * Description: If true will disregard dimensions with a size of 1 when validating tensor shapes but tensor + * sizes must still match. \n + * This is an Experimental parameter that is incompatible with "infer-output-shape". \n + * This parameter may be removed in a later update. + * + * Option key: "disable-tflite-runtime-fallback" \n + * Possible values: ["true"/"false"] \n + * Description: Disable TfLite Runtime fallback in the Arm NN TfLite delegate. + * An exception will be thrown if unsupported operators are encountered. + * This option is only for testing purposes. + * + * @param[in] option_keys Delegate option names + * @param[in] options_values Delegate option values + * @param[in] num_options Number of delegate options + * @param[in,out] report_error Error callback function + * + */ + DelegateOptions(char const* const* options_keys, + char const* const* options_values, + size_t num_options, + void (*report_error)(const char*)); + + const std::vector<armnn::BackendId>& GetBackends() const { return m_Backends; } + + void SetBackends(const std::vector<armnn::BackendId>& backends) { m_Backends = backends; } + + void SetDynamicBackendsPath(const std::string& dynamicBackendsPath) + { + m_RuntimeOptions.m_DynamicBackendsPath = dynamicBackendsPath; + } + const std::string& GetDynamicBackendsPath() const + { + return m_RuntimeOptions.m_DynamicBackendsPath; + } + + void SetGpuProfilingState(bool gpuProfilingState) + { + m_RuntimeOptions.m_EnableGpuProfiling = gpuProfilingState; + } + bool GetGpuProfilingState() + { + return m_RuntimeOptions.m_EnableGpuProfiling; + } + + const std::vector<armnn::BackendOptions>& GetBackendOptions() const + { + return m_RuntimeOptions.m_BackendOptions; + } + + /// Appends a backend option to the list of backend options + void AddBackendOption(const armnn::BackendOptions& option) + { + m_RuntimeOptions.m_BackendOptions.push_back(option); + } + + /// Sets the severity level for logging within ArmNN that will be used on creation of the delegate + void SetLoggingSeverity(const armnn::LogSeverity& level) { m_LoggingSeverity = level; } + void SetLoggingSeverity(const std::string& level) { m_LoggingSeverity = armnn::StringToLogLevel(level); } + + /// Returns the severity level for logging within ArmNN + armnn::LogSeverity GetLoggingSeverity() { return m_LoggingSeverity.value(); } + + bool IsLoggingEnabled() { return m_LoggingSeverity.has_value(); } + + const armnn::OptimizerOptions& GetOptimizerOptions() const { return m_OptimizerOptions; } + + void SetOptimizerOptions(const armnn::OptimizerOptions& optimizerOptions) { m_OptimizerOptions = optimizerOptions; } + + const armnn::Optional<armnn::DebugCallbackFunction>& GetDebugCallbackFunction() const + { return m_DebugCallbackFunc; } + + void SetInternalProfilingParams(bool internalProfilingState, + const armnn::ProfilingDetailsMethod& internalProfilingDetail) + { m_InternalProfilingEnabled = internalProfilingState; m_InternalProfilingDetail = internalProfilingDetail; } + + bool GetInternalProfilingState() const { return m_InternalProfilingEnabled; } + const armnn::ProfilingDetailsMethod& GetInternalProfilingDetail() const { return m_InternalProfilingDetail; } + + void SetSerializeToDot(const std::string& serializeToDotFile) { m_SerializeToDot = serializeToDotFile; } + const std::string& GetSerializeToDot() const { return m_SerializeToDot; } + + /// @Note: This might overwrite options that were set with other setter functions of DelegateOptions + void SetRuntimeOptions(const armnn::IRuntime::CreationOptions& runtimeOptions) + { + m_RuntimeOptions = runtimeOptions; + } + + const armnn::IRuntime::CreationOptions& GetRuntimeOptions() + { + return m_RuntimeOptions; + } + + void DisableTfLiteRuntimeFallback(bool fallbackState) + { + m_DisableTfLiteRuntimeFallback = fallbackState; + } + bool TfLiteRuntimeFallbackDisabled() + { + return m_DisableTfLiteRuntimeFallback; + } + +private: + /// Which backend to run Delegate on. + /// Examples of possible values are: CpuRef, CpuAcc, GpuAcc. + /// CpuRef as default. + std::vector<armnn::BackendId> m_Backends = { armnn::Compute::CpuRef }; + + /// Creation options for the ArmNN runtime + /// Contains options for global settings that are valid for the whole lifetime of ArmNN + /// i.e. BackendOptions, DynamicBackendPath, ExternalProfilingOptions and more + armnn::IRuntime::CreationOptions m_RuntimeOptions; + + /// Options for the optimization step for the network + armnn::OptimizerOptions m_OptimizerOptions; + + /// Internal profiling options. Written to INetworkProperties during model load. + /// Indicates whether internal profiling is enabled or not. + bool m_InternalProfilingEnabled = false; + /// Sets the level of detail output by the profiling. Options are DetailsWithEvents = 1 and DetailsOnly = 2 + armnn::ProfilingDetailsMethod m_InternalProfilingDetail = armnn::ProfilingDetailsMethod::DetailsWithEvents; + + /// Severity level for logging within ArmNN that will be used on creation of the delegate + armnn::Optional<armnn::LogSeverity> m_LoggingSeverity; + + /// A callback function to debug layers performing custom computations on intermediate tensors. + /// If a function is not registered, and debug is enabled in OptimizerOptions, + /// debug will print information of the intermediate tensors. + armnn::Optional<armnn::DebugCallbackFunction> m_DebugCallbackFunc; + + /// If not empty then the optimized model will be serialized to a file with this file name in "dot" format. + std::string m_SerializeToDot = ""; + + /// Option to disable TfLite Runtime fallback for unsupported operators. + bool m_DisableTfLiteRuntimeFallback = false; +}; + +} // namespace armnnDelegate diff --git a/delegate/src/DelegateOptions.cpp b/delegate/common/src/DelegateOptions.cpp index fc4858fa29..fc4858fa29 100644 --- a/delegate/src/DelegateOptions.cpp +++ b/delegate/common/src/DelegateOptions.cpp diff --git a/delegate/src/DelegateUtils.hpp b/delegate/common/src/DelegateUtils.hpp index 1aa9029271..1aa9029271 100644 --- a/delegate/src/DelegateUtils.hpp +++ b/delegate/common/src/DelegateUtils.hpp diff --git a/delegate/include/DelegateOptions.hpp b/delegate/include/DelegateOptions.hpp index a3c1edf82f..1c3ffb62ea 100644 --- a/delegate/include/DelegateOptions.hpp +++ b/delegate/include/DelegateOptions.hpp @@ -3,302 +3,6 @@ // SPDX-License-Identifier: MIT // -#pragma once - -#include <armnn/ArmNN.hpp> -#include <armnn/Optional.hpp> - -#include <string> -#include <vector> - -namespace armnnDelegate -{ - -class DelegateOptions -{ -public: - DelegateOptions(armnn::Compute computeDevice, - const std::vector<armnn::BackendOptions>& backendOptions = {}, - armnn::Optional<armnn::LogSeverity> logSeverityLevel = armnn::EmptyOptional()); - - DelegateOptions(const std::vector<armnn::BackendId>& backends, - const std::vector<armnn::BackendOptions>& backendOptions = {}, - armnn::Optional<armnn::LogSeverity> logSeverityLevel = armnn::EmptyOptional()); - - DelegateOptions(armnn::Compute computeDevice, - const armnn::OptimizerOptions& optimizerOptions, - const armnn::Optional<armnn::LogSeverity>& logSeverityLevel = armnn::EmptyOptional(), - const armnn::Optional<armnn::DebugCallbackFunction>& func = armnn::EmptyOptional()); - - DelegateOptions(const std::vector<armnn::BackendId>& backends, - const armnn::OptimizerOptions& optimizerOptions, - const armnn::Optional<armnn::LogSeverity>& logSeverityLevel = armnn::EmptyOptional(), - const armnn::Optional<armnn::DebugCallbackFunction>& func = armnn::EmptyOptional()); - - - /** - * This constructor processes delegate options in form of command line arguments. - * It works in conjunction with the TfLite external delegate plugin. - * - * Available options: - * - * Option key: "backends" \n - * Possible values: ["EthosNPU"/"GpuAcc"/"CpuAcc"/"CpuRef"] \n - * Descriptions: A comma separated list without whitespaces of - * backends which should be used for execution. Falls - * back to next backend in list if previous doesn't - * provide support for operation. e.g. "GpuAcc,CpuAcc" - * - * Option key: "dynamic-backends-path" \n - * Possible values: [filenameString] \n - * Descriptions: This is the directory that will be searched for any dynamic backends. - * - * Option key: "logging-severity" \n - * Possible values: ["trace"/"debug"/"info"/"warning"/"error"/"fatal"] \n - * Description: Sets the logging severity level for ArmNN. Logging - * is turned off if this option is not provided. - * - * Option key: "gpu-tuning-level" \n - * Possible values: ["0"/"1"/"2"/"3"] \n - * Description: 0=UseOnly(default), 1=RapidTuning, 2=NormalTuning, - * 3=ExhaustiveTuning. Requires option gpu-tuning-file. - * 1,2 and 3 will create a tuning-file, 0 will apply the - * tunings from an existing file - * - * Option key: "gpu-mlgo-tuning-file" \n - * Possible values: [filenameString] \n - * Description: File name for the MLGO tuning file - * - * Option key: "gpu-tuning-file" \n - * Possible values: [filenameString] \n - * Description: File name for the tuning file. - * - * Option key: "gpu-enable-profiling" \n - * Possible values: ["true"/"false"] \n - * Description: Enables GPU profiling - * - * Option key: "gpu-kernel-profiling-enabled" \n - * Possible values: ["true"/"false"] \n - * Description: Enables GPU kernel profiling - * - * Option key: "save-cached-network" \n - * Possible values: ["true"/"false"] \n - * Description: Enables saving of the cached network to a file, - * specified with the cached-network-filepath option - * - * Option key: "cached-network-filepath" \n - * Possible values: [filenameString] \n - * Description: If non-empty, the given file will be used to load/save the cached network. - * If save-cached-network is given then the cached network will be saved to the given file. - * To save the cached network a file must already exist. - * If save-cached-network is not given then the cached network will be loaded from the given file. - * This will remove initial compilation time of kernels and speed up the first execution. - * - * Option key: "enable-fast-math" \n - * Possible values: ["true"/"false"] \n - * Description: Enables fast_math options in backends that support it - * - * Option key: "number-of-threads" \n - * Possible values: ["1"-"64"] \n - * Description: Assign the number of threads used by the CpuAcc backend. - * Default is set to 0 (Backend will decide number of threads to use). - * - * Option key: "reduce-fp32-to-fp16" \n - * Possible values: ["true"/"false"] \n - * Description: Reduce Fp32 data to Fp16 for faster processing - * - * Option key: "reduce-fp32-to-bf16" \n - * Possible values: ["true"/"false"] \n - * Description: This option is currently ignored. Please enable Fast Math in the CpuAcc or GpuAcc backends. - * - * Option key: "debug-data" \n - * Possible values: ["true"/"false"] \n - * Description: Add debug data for easier troubleshooting - * - * Option key: "memory-import" \n - * Possible values: ["true"/"false"] \n - * Description: Enable memory import - * - * Option key: "enable-internal-profiling" \n - * Possible values: ["true"/"false"] \n - * Description: Enable the internal profiling feature. - * - * Option key: "internal-profiling-detail" \n - * Possible values: [1/2] \n - * Description: Set the detail on the internal profiling. 1 = DetailsWithEvents, 2 = DetailsOnly. - * - * Option key: "enable-external-profiling" \n - * Possible values: ["true"/"false"] \n - * Description: Enable the external profiling feature. - * - * Option key: "timeline-profiling" \n - * Possible values: ["true"/"false"] \n - * Description: Indicates whether external timeline profiling is enabled or not. - * - * Option key: "outgoing-capture-file" \n - * Possible values: [filenameString] \n - * Description: Path to a file in which outgoing timeline profiling messages will be stored. - * - * Option key: "incoming-capture-file" \n - * Possible values: [filenameString] \n - * Description: Path to a file in which incoming timeline profiling messages will be stored. - * - * Option key: "file-only-external-profiling" \n - * Possible values: ["true"/"false"] \n - * Description: Enable profiling output to file only. - * - * Option key: "counter-capture-period" \n - * Possible values: Integer, Default is 10000u - * Description: Value in microseconds of the profiling capture period. \n - * - * Option key: "profiling-file-format" \n - * Possible values: String of ["binary"] \n - * Description: The format of the file used for outputting profiling data. Currently on "binary" is supported. - * - * Option key: "serialize-to-dot" \n - * Possible values: [filenameString] \n - * Description: Serialize the optimized network to the file specified in "dot" format. - * - * Option key: "infer-output-shape" \n - * Possible values: ["true"/"false"] \n - * Description: Infers output tensor shape from input tensor shape and validate where applicable. - * - * Option key: "allow-expanded-dims" \n - * Possible values: ["true"/"false"] \n - * Description: If true will disregard dimensions with a size of 1 when validating tensor shapes but tensor - * sizes must still match. \n - * This is an Experimental parameter that is incompatible with "infer-output-shape". \n - * This parameter may be removed in a later update. - * - * Option key: "disable-tflite-runtime-fallback" \n - * Possible values: ["true"/"false"] \n - * Description: Disable TfLite Runtime fallback in the Arm NN TfLite delegate. - * An exception will be thrown if unsupported operators are encountered. - * This option is only for testing purposes. - * - * @param[in] option_keys Delegate option names - * @param[in] options_values Delegate option values - * @param[in] num_options Number of delegate options - * @param[in,out] report_error Error callback function - * - */ - DelegateOptions(char const* const* options_keys, - char const* const* options_values, - size_t num_options, - void (*report_error)(const char*)); - - const std::vector<armnn::BackendId>& GetBackends() const { return m_Backends; } - - void SetBackends(const std::vector<armnn::BackendId>& backends) { m_Backends = backends; } - - void SetDynamicBackendsPath(const std::string& dynamicBackendsPath) - { - m_RuntimeOptions.m_DynamicBackendsPath = dynamicBackendsPath; - } - const std::string& GetDynamicBackendsPath() const - { - return m_RuntimeOptions.m_DynamicBackendsPath; - } - - void SetGpuProfilingState(bool gpuProfilingState) - { - m_RuntimeOptions.m_EnableGpuProfiling = gpuProfilingState; - } - bool GetGpuProfilingState() - { - return m_RuntimeOptions.m_EnableGpuProfiling; - } - - const std::vector<armnn::BackendOptions>& GetBackendOptions() const - { - return m_RuntimeOptions.m_BackendOptions; - } - - /// Appends a backend option to the list of backend options - void AddBackendOption(const armnn::BackendOptions& option) - { - m_RuntimeOptions.m_BackendOptions.push_back(option); - } - - /// Sets the severity level for logging within ArmNN that will be used on creation of the delegate - void SetLoggingSeverity(const armnn::LogSeverity& level) { m_LoggingSeverity = level; } - void SetLoggingSeverity(const std::string& level) { m_LoggingSeverity = armnn::StringToLogLevel(level); } - - /// Returns the severity level for logging within ArmNN - armnn::LogSeverity GetLoggingSeverity() { return m_LoggingSeverity.value(); } - - bool IsLoggingEnabled() { return m_LoggingSeverity.has_value(); } - - const armnn::OptimizerOptions& GetOptimizerOptions() const { return m_OptimizerOptions; } - - void SetOptimizerOptions(const armnn::OptimizerOptions& optimizerOptions) { m_OptimizerOptions = optimizerOptions; } - - const armnn::Optional<armnn::DebugCallbackFunction>& GetDebugCallbackFunction() const - { return m_DebugCallbackFunc; } - - void SetInternalProfilingParams(bool internalProfilingState, - const armnn::ProfilingDetailsMethod& internalProfilingDetail) - { m_InternalProfilingEnabled = internalProfilingState; m_InternalProfilingDetail = internalProfilingDetail; } - - bool GetInternalProfilingState() const { return m_InternalProfilingEnabled; } - const armnn::ProfilingDetailsMethod& GetInternalProfilingDetail() const { return m_InternalProfilingDetail; } - - void SetSerializeToDot(const std::string& serializeToDotFile) { m_SerializeToDot = serializeToDotFile; } - const std::string& GetSerializeToDot() const { return m_SerializeToDot; } - - /// @Note: This might overwrite options that were set with other setter functions of DelegateOptions - void SetRuntimeOptions(const armnn::IRuntime::CreationOptions& runtimeOptions) - { - m_RuntimeOptions = runtimeOptions; - } - - const armnn::IRuntime::CreationOptions& GetRuntimeOptions() - { - return m_RuntimeOptions; - } - - void DisableTfLiteRuntimeFallback(bool fallbackState) - { - m_DisableTfLiteRuntimeFallback = fallbackState; - } - bool TfLiteRuntimeFallbackDisabled() - { - return m_DisableTfLiteRuntimeFallback; - } - -private: - /// Which backend to run Delegate on. - /// Examples of possible values are: CpuRef, CpuAcc, GpuAcc. - /// CpuRef as default. - std::vector<armnn::BackendId> m_Backends = { armnn::Compute::CpuRef }; - - /// Creation options for the ArmNN runtime - /// Contains options for global settings that are valid for the whole lifetime of ArmNN - /// i.e. BackendOptions, DynamicBackendPath, ExternalProfilingOptions and more - armnn::IRuntime::CreationOptions m_RuntimeOptions; - - /// Options for the optimization step for the network - armnn::OptimizerOptions m_OptimizerOptions; - - /// Internal profiling options. Written to INetworkProperties during model load. - /// Indicates whether internal profiling is enabled or not. - bool m_InternalProfilingEnabled = false; - /// Sets the level of detail output by the profiling. Options are DetailsWithEvents = 1 and DetailsOnly = 2 - armnn::ProfilingDetailsMethod m_InternalProfilingDetail = armnn::ProfilingDetailsMethod::DetailsWithEvents; - - /// Severity level for logging within ArmNN that will be used on creation of the delegate - armnn::Optional<armnn::LogSeverity> m_LoggingSeverity; - - /// A callback function to debug layers performing custom computations on intermediate tensors. - /// If a function is not registered, and debug is enabled in OptimizerOptions, - /// debug will print information of the intermediate tensors. - armnn::Optional<armnn::DebugCallbackFunction> m_DebugCallbackFunc; - - /// If not empty then the optimized model will be serialized to a file with this file name in "dot" format. - std::string m_SerializeToDot = ""; - - /// Option to disable TfLite Runtime fallback for unsupported operators. - bool m_DisableTfLiteRuntimeFallback = false; -}; - -} // namespace armnnDelegate +#include <armnn/delegate/common/include/DelegateOptions.hpp> +#pragma message("armnn/delegate/include/DelegateOptions.hpp has been deprecated, it is due for removal in"\ + " 24.02 release. Please use public interface ")
\ No newline at end of file diff --git a/delegate/include/Version.hpp b/delegate/include/Version.hpp index 5550278414..687471c8ba 100644 --- a/delegate/include/Version.hpp +++ b/delegate/include/Version.hpp @@ -1,29 +1,8 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // -#pragma once - -namespace armnnDelegate -{ - -/// Macro utils -#define STRINGIFY_VALUE(s) STRINGIFY_MACRO(s) -#define STRINGIFY_MACRO(s) #s - -// ArmNN Delegate version components -#define DELEGATE_MAJOR_VERSION 28 -#define DELEGATE_MINOR_VERSION 0 -#define DELEGATE_PATCH_VERSION 0 - -/// DELEGATE_VERSION: "X.Y.Z" -/// where: -/// X = Major version number -/// Y = Minor version number -/// Z = Patch version number -#define DELEGATE_VERSION STRINGIFY_VALUE(DELEGATE_MAJOR_VERSION) "." \ - STRINGIFY_VALUE(DELEGATE_MINOR_VERSION) "." \ - STRINGIFY_VALUE(DELEGATE_PATCH_VERSION) - -} //namespace armnnDelegate
\ No newline at end of file +#include <armnn/delegate/classic/include/Version.hpp> +#pragma message("armnn/delegate/include/Version.hpp has been deprecated, it is due for removal in"\ + " 24.02 release. Please use public interface ")
\ No newline at end of file diff --git a/delegate/include/armnn_delegate.hpp b/delegate/include/armnn_delegate.hpp index 9cfc397550..fd071eb24a 100644 --- a/delegate/include/armnn_delegate.hpp +++ b/delegate/include/armnn_delegate.hpp @@ -3,141 +3,6 @@ // SPDX-License-Identifier: MIT // -#pragma once - -#include "DelegateOptions.hpp" - -#include <tensorflow/lite/builtin_ops.h> -#include <tensorflow/lite/c/builtin_op_data.h> -#include <tensorflow/lite/c/common.h> -#include <tensorflow/lite/minimal_logging.h> -#include <tensorflow/lite/version.h> - -#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 3) -#define ARMNN_POST_TFLITE_2_3 -#endif - -#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 4) -#define ARMNN_POST_TFLITE_2_4 -#endif - -#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 5) -#define ARMNN_POST_TFLITE_2_5 -#endif - -namespace armnnDelegate -{ - -struct DelegateData -{ - DelegateData(const std::vector<armnn::BackendId>& backends) - : m_Backends(backends) - , m_Network(nullptr, nullptr) - {} - - const std::vector<armnn::BackendId> m_Backends; - armnn::INetworkPtr m_Network; - std::vector<armnn::IOutputSlot*> m_OutputSlotForNode; -}; - -// Forward decleration for functions initializing the ArmNN Delegate -DelegateOptions TfLiteArmnnDelegateOptionsDefault(); - -TfLiteDelegate* TfLiteArmnnDelegateCreate(armnnDelegate::DelegateOptions options); - -void TfLiteArmnnDelegateDelete(TfLiteDelegate* tfLiteDelegate); - -TfLiteStatus DoPrepare(TfLiteContext* context, TfLiteDelegate* delegate); - -/// ArmNN Delegate -class Delegate -{ - friend class ArmnnSubgraph; -public: - explicit Delegate(armnnDelegate::DelegateOptions options); - - TfLiteIntArray* IdentifyOperatorsToDelegate(TfLiteContext* context); - - TfLiteDelegate* GetDelegate(); - - /// Retrieve version in X.Y.Z form - static const std::string GetVersion(); - -private: - /** - * Returns a pointer to the armnn::IRuntime* this will be shared by all armnn_delegates. - */ - armnn::IRuntime* GetRuntime(const armnn::IRuntime::CreationOptions& options) - { - static armnn::IRuntimePtr instance = armnn::IRuntime::Create(options); - // Instantiated on first use. - return instance.get(); - } - - TfLiteDelegate m_Delegate = { - reinterpret_cast<void*>(this), // .data_ - DoPrepare, // .Prepare - nullptr, // .CopyFromBufferHandle - nullptr, // .CopyToBufferHandle - nullptr, // .FreeBufferHandle - kTfLiteDelegateFlagsNone, // .flags - nullptr, // .opaque_delegate_builder - }; - - /// ArmNN Runtime pointer - armnn::IRuntime* m_Runtime; - /// ArmNN Delegate Options - armnnDelegate::DelegateOptions m_Options; -}; - -/// ArmnnSubgraph class where parsing the nodes to ArmNN format and creating the ArmNN Graph -class ArmnnSubgraph -{ -public: - static ArmnnSubgraph* Create(TfLiteContext* tfLiteContext, - const TfLiteDelegateParams* parameters, - const Delegate* delegate); - - TfLiteStatus Prepare(TfLiteContext* tfLiteContext); - - TfLiteStatus Invoke(TfLiteContext* tfLiteContext, TfLiteNode* tfLiteNode); - - static TfLiteStatus VisitNode(DelegateData& delegateData, - TfLiteContext* tfLiteContext, - TfLiteRegistration* tfLiteRegistration, - TfLiteNode* tfLiteNode, - int nodeIndex); - -private: - ArmnnSubgraph(armnn::NetworkId networkId, - armnn::IRuntime* runtime, - std::vector<armnn::BindingPointInfo>& inputBindings, - std::vector<armnn::BindingPointInfo>& outputBindings) - : m_NetworkId(networkId), m_Runtime(runtime), m_InputBindings(inputBindings), m_OutputBindings(outputBindings) - {} - - static TfLiteStatus AddInputLayer(DelegateData& delegateData, - TfLiteContext* tfLiteContext, - const TfLiteIntArray* inputs, - std::vector<armnn::BindingPointInfo>& inputBindings); - - static TfLiteStatus AddOutputLayer(DelegateData& delegateData, - TfLiteContext* tfLiteContext, - const TfLiteIntArray* outputs, - std::vector<armnn::BindingPointInfo>& outputBindings); - - - /// The Network Id - armnn::NetworkId m_NetworkId; - /// ArmNN Rumtime - armnn::IRuntime* m_Runtime; - - // Binding information for inputs and outputs - std::vector<armnn::BindingPointInfo> m_InputBindings; - std::vector<armnn::BindingPointInfo> m_OutputBindings; - -}; - -} // armnnDelegate namespace - - +#include <armnn/delegate/classic/include/armnn_delegate.hpp> +#pragma message("armnn/delegate/include/armnn_delegate.hpp has been deprecated, it is due for removal in"\ + " 24.02 release. Please use public interface ")
\ No newline at end of file diff --git a/delegate/opaque/CMakeLists.txt b/delegate/opaque/CMakeLists.txt new file mode 100644 index 0000000000..11b938bcff --- /dev/null +++ b/delegate/opaque/CMakeLists.txt @@ -0,0 +1,64 @@ +# +# Copyright © 2023 Arm Ltd and Contributors. All rights reserved. +# SPDX-License-Identifier: MIT +# + +set(armnnOpaqueDelegateObject_sources) +list(APPEND armnnOpaqueDelegateObject_sources + include/armnn_delegate.hpp + include/Version.hpp) + +add_library(armnnOpaqueDelegateObject OBJECT ${armnnOpaqueDelegateObject_sources}) + +target_include_directories(armnnOpaqueDelegateObject + PUBLIC + $<INSTALL_INTERFACE:include> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/common/include> + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${PROJECT_SOURCE_DIR}/common/src) + +## Add Tflite dependency +if(NOT TfLite_INCLUDE_DIR OR NOT TfLite_Schema_INCLUDE_PATH) + find_package(TfLiteSrc REQUIRED MODULE) +endif() + +# Various tflite header files are not warning clean +# We can't change compilation flags on header files directly, so we need to add them to an interface library first +add_library(tflite_headers_opaque INTERFACE) +target_include_directories(tflite_headers_opaque + INTERFACE + $<BUILD_INTERFACE:${TfLite_INCLUDE_DIR}> + $<INSTALL_INTERFACE:include/tflite_headers_opaque>) + +target_compile_options(tflite_headers_opaque + INTERFACE + -Wno-conversion + -Wno-sign-conversion + -Wno-unused-parameter + -Wno-unused-function) + +target_link_libraries(armnnOpaqueDelegateObject PUBLIC tflite_headers_opaque) + +## Add Flatbuffers dependency +find_package(Flatbuffers REQUIRED MODULE) + +target_link_libraries(armnnOpaqueDelegateObject PRIVATE ${Flatbuffers_LIB}) + +# include/flatbuffers/flatbuffers.h is not warning clean +# We can't change compilation flags on header files directly, so we need to add them to an interface library first +add_library(flatbuffer_headers_opaque INTERFACE) +target_include_directories(flatbuffer_headers_opaque + INTERFACE + $<BUILD_INTERFACE:${Flatbuffers_INCLUDE_DIR}> + $<INSTALL_INTERFACE:include/flatbuffer_headers_opaque>) +target_compile_options(flatbuffer_headers_opaque INTERFACE -Wno-sign-conversion) + +target_link_libraries(armnnOpaqueDelegateObject PUBLIC flatbuffer_headers_opaque) + +#################################################### +## Export targets +install(TARGETS armnnOpaqueDelegateObject + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
\ No newline at end of file diff --git a/delegate/opaque/include/Version.hpp b/delegate/opaque/include/Version.hpp new file mode 100644 index 0000000000..35c5928b6a --- /dev/null +++ b/delegate/opaque/include/Version.hpp @@ -0,0 +1,29 @@ +// +// Copyright © 2023 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +namespace armnnDelegate +{ + +/// Macro utils +#define STRINGIFY_VALUE(s) STRINGIFY_MACRO(s) +#define STRINGIFY_MACRO(s) #s + +// ArmNN Delegate version components +#define OPAQUE_DELEGATE_MAJOR_VERSION 1 +#define OPAQUE_DELEGATE_MINOR_VERSION 0 +#define OPAQUE_DELEGATE_PATCH_VERSION 0 + +/// DELEGATE_VERSION: "X.Y.Z" +/// where: +/// X = Major version number +/// Y = Minor version number +/// Z = Patch version number +#define DELEGATE_VERSION STRINGIFY_VALUE(OPAQUE_DELEGATE_MAJOR_VERSION) "." \ + STRINGIFY_VALUE(OPAQUE_DELEGATE_MINOR_VERSION) "." \ + STRINGIFY_VALUE(OPAQUE_DELEGATE_PATCH_VERSION) + +} //namespace armnnDelegate
\ No newline at end of file diff --git a/delegate/opaque/include/armnn_delegate.hpp b/delegate/opaque/include/armnn_delegate.hpp new file mode 100644 index 0000000000..8957dc87d6 --- /dev/null +++ b/delegate/opaque/include/armnn_delegate.hpp @@ -0,0 +1,141 @@ +// +// Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include <DelegateOptions.hpp> + +#include <tensorflow/lite/builtin_ops.h> +#include <tensorflow/lite/c/builtin_op_data.h> +#include <tensorflow/lite/c/common.h> +#include <tensorflow/lite/minimal_logging.h> +#include <tensorflow/lite/version.h> + +#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 3) +#define ARMNN_POST_TFLITE_2_3 +#endif + +#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 4) +#define ARMNN_POST_TFLITE_2_4 +#endif + +#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 5) +#define ARMNN_POST_TFLITE_2_5 +#endif + +namespace armnnDelegate +{ + +struct DelegateData +{ + DelegateData(const std::vector<armnn::BackendId>& backends) + : m_Backends(backends) + , m_Network(nullptr, nullptr) + {} + + const std::vector<armnn::BackendId> m_Backends; + armnn::INetworkPtr m_Network; + std::vector<armnn::IOutputSlot*> m_OutputSlotForNode; +}; + +// Forward decleration for functions initializing the ArmNN Delegate +DelegateOptions TfLiteArmnnDelegateOptionsDefault(); + +TfLiteDelegate* TfLiteArmnnDelegateCreate(armnnDelegate::DelegateOptions options); + +void TfLiteArmnnDelegateDelete(TfLiteDelegate* tfLiteDelegate); + +TfLiteStatus DoPrepare(TfLiteContext* context, TfLiteDelegate* delegate); + +/// ArmNN Delegate +class Delegate +{ + friend class ArmnnSubgraph; +public: + explicit Delegate(armnnDelegate::DelegateOptions options); + + TfLiteIntArray* IdentifyOperatorsToDelegate(TfLiteContext* context); + + TfLiteDelegate* GetDelegate(); + + /// Retrieve version in X.Y.Z form + static const std::string GetVersion(); + +private: + /** + * Returns a pointer to the armnn::IRuntime* this will be shared by all armnn_delegates. + */ + armnn::IRuntime* GetRuntime(const armnn::IRuntime::CreationOptions& options) + { + static armnn::IRuntimePtr instance = armnn::IRuntime::Create(options); + // Instantiated on first use. + return instance.get(); + } + + TfLiteDelegate m_Delegate = { + reinterpret_cast<void*>(this), // .data_ + DoPrepare, // .Prepare + nullptr, // .CopyFromBufferHandle + nullptr, // .CopyToBufferHandle + nullptr, // .FreeBufferHandle + kTfLiteDelegateFlagsNone, // .flags + nullptr, // .opaque_delegate_builder + }; + + /// ArmNN Runtime pointer + armnn::IRuntime* m_Runtime; + /// ArmNN Delegate Options + armnnDelegate::DelegateOptions m_Options; +}; + +/// ArmnnSubgraph class where parsing the nodes to ArmNN format and creating the ArmNN Graph +class ArmnnSubgraph +{ +public: + static ArmnnSubgraph* Create(TfLiteContext* tfLiteContext, + const TfLiteDelegateParams* parameters, + const Delegate* delegate); + + TfLiteStatus Prepare(TfLiteContext* tfLiteContext); + + TfLiteStatus Invoke(TfLiteContext* tfLiteContext, TfLiteNode* tfLiteNode); + + static TfLiteStatus VisitNode(DelegateData& delegateData, + TfLiteContext* tfLiteContext, + TfLiteRegistration* tfLiteRegistration, + TfLiteNode* tfLiteNode, + int nodeIndex); + +private: + ArmnnSubgraph(armnn::NetworkId networkId, + armnn::IRuntime* runtime, + std::vector<armnn::BindingPointInfo>& inputBindings, + std::vector<armnn::BindingPointInfo>& outputBindings) + : m_NetworkId(networkId), m_Runtime(runtime), m_InputBindings(inputBindings), m_OutputBindings(outputBindings) + {} + + static TfLiteStatus AddInputLayer(DelegateData& delegateData, + TfLiteContext* tfLiteContext, + const TfLiteIntArray* inputs, + std::vector<armnn::BindingPointInfo>& inputBindings); + + static TfLiteStatus AddOutputLayer(DelegateData& delegateData, + TfLiteContext* tfLiteContext, + const TfLiteIntArray* outputs, + std::vector<armnn::BindingPointInfo>& outputBindings); + + + /// The Network Id + armnn::NetworkId m_NetworkId; + /// ArmNN Rumtime + armnn::IRuntime* m_Runtime; + + // Binding information for inputs and outputs + std::vector<armnn::BindingPointInfo> m_InputBindings; + std::vector<armnn::BindingPointInfo> m_OutputBindings; + +}; + +} // armnnDelegate namespace
\ No newline at end of file diff --git a/delegate/src/test/ActivationTest.cpp b/delegate/test/ActivationTest.cpp index 69041d77a2..8f2f198f88 100644 --- a/delegate/src/test/ActivationTest.cpp +++ b/delegate/test/ActivationTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -9,10 +9,7 @@ #include <flatbuffers/flatbuffers.h> #include <tensorflow/lite/interpreter.h> -#include <tensorflow/lite/kernels/register.h> -#include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> -#include <tensorflow/lite/version.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ActivationTestHelper.hpp b/delegate/test/ActivationTestHelper.hpp index 6475083da0..110c684c23 100644 --- a/delegate/src/test/ActivationTestHelper.hpp +++ b/delegate/test/ActivationTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ArgMinMaxTest.cpp b/delegate/test/ArgMinMaxTest.cpp index bf60a77cb2..1c0550313f 100644 --- a/delegate/src/test/ArgMinMaxTest.cpp +++ b/delegate/test/ArgMinMaxTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ArgMinMaxTestHelper.hpp b/delegate/test/ArgMinMaxTestHelper.hpp index 3e607d6b2b..91cf1f81e7 100644 --- a/delegate/src/test/ArgMinMaxTestHelper.hpp +++ b/delegate/test/ArgMinMaxTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ArmnnDelegateTest.cpp b/delegate/test/ArmnnDelegateTest.cpp index bc73dde2ef..c23c702af8 100644 --- a/delegate/src/test/ArmnnDelegateTest.cpp +++ b/delegate/test/ArmnnDelegateTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> -#include "tensorflow/lite/kernels/builtin_op_kernels.h" +#include <tensorflow/lite/kernels/builtin_op_kernels.h> #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> diff --git a/delegate/src/test/BatchMatMulTest.cpp b/delegate/test/BatchMatMulTest.cpp index 06ad2c3be2..c6d7bc5f32 100644 --- a/delegate/src/test/BatchMatMulTest.cpp +++ b/delegate/test/BatchMatMulTest.cpp @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/BatchMatMulTestHelper.hpp b/delegate/test/BatchMatMulTestHelper.hpp index 7437064a42..32b0a4fc71 100644 --- a/delegate/src/test/BatchMatMulTestHelper.hpp +++ b/delegate/test/BatchMatMulTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/BatchSpaceTest.cpp b/delegate/test/BatchSpaceTest.cpp index 47eba452e7..f4c041dffa 100644 --- a/delegate/src/test/BatchSpaceTest.cpp +++ b/delegate/test/BatchSpaceTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/BatchSpaceTestHelper.hpp b/delegate/test/BatchSpaceTestHelper.hpp index d4fa9837e8..597139d390 100644 --- a/delegate/src/test/BatchSpaceTestHelper.hpp +++ b/delegate/test/BatchSpaceTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/CastTest.cpp b/delegate/test/CastTest.cpp index a637071ffc..d3c3e294f2 100644 --- a/delegate/src/test/CastTest.cpp +++ b/delegate/test/CastTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/CastTestHelper.hpp b/delegate/test/CastTestHelper.hpp index 0448e65856..be1967ccd6 100644 --- a/delegate/src/test/CastTestHelper.hpp +++ b/delegate/test/CastTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ComparisonTest.cpp b/delegate/test/ComparisonTest.cpp index 95bfe21d27..b044c27693 100644 --- a/delegate/src/test/ComparisonTest.cpp +++ b/delegate/test/ComparisonTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ComparisonTestHelper.hpp b/delegate/test/ComparisonTestHelper.hpp index db337f9f8a..ef9f87a5d5 100644 --- a/delegate/src/test/ComparisonTestHelper.hpp +++ b/delegate/test/ComparisonTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ControlTest.cpp b/delegate/test/ControlTest.cpp index 18bbc5a9a8..ec7ff88e42 100644 --- a/delegate/src/test/ControlTest.cpp +++ b/delegate/test/ControlTest.cpp @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ControlTestHelper.hpp b/delegate/test/ControlTestHelper.hpp index 3e427e60c5..f68cc07519 100644 --- a/delegate/src/test/ControlTestHelper.hpp +++ b/delegate/test/ControlTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/Convolution2dTest.cpp b/delegate/test/Convolution2dTest.cpp index 10510792a1..3459e6883d 100644 --- a/delegate/src/test/Convolution2dTest.cpp +++ b/delegate/test/Convolution2dTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020,2023 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/Convolution3dTest.cpp b/delegate/test/Convolution3dTest.cpp index 06883f186d..fe987be5da 100644 --- a/delegate/src/test/Convolution3dTest.cpp +++ b/delegate/test/Convolution3dTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ConvolutionTestHelper.hpp b/delegate/test/ConvolutionTestHelper.hpp index 70c1da6dce..2e211b2ee9 100644 --- a/delegate/src/test/ConvolutionTestHelper.hpp +++ b/delegate/test/ConvolutionTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/DelegateOptionsTest.cpp b/delegate/test/DelegateOptionsTest.cpp index 98323131f9..ecd8c736e8 100644 --- a/delegate/src/test/DelegateOptionsTest.cpp +++ b/delegate/test/DelegateOptionsTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/test/DelegateOptionsTestHelper.hpp b/delegate/test/DelegateOptionsTestHelper.hpp index 00a3d95904..fb5403c7de 100644 --- a/delegate/src/test/DelegateOptionsTestHelper.hpp +++ b/delegate/test/DelegateOptionsTestHelper.hpp @@ -7,14 +7,13 @@ #include <armnn_delegate.hpp> -#include "ConvolutionTestHelper.hpp" #include "TestUtils.hpp" #include <flatbuffers/flatbuffers.h> #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/DepthwiseConvolution2dTest.cpp b/delegate/test/DepthwiseConvolution2dTest.cpp index ca10f2c0cb..9ee589c977 100644 --- a/delegate/src/test/DepthwiseConvolution2dTest.cpp +++ b/delegate/test/DepthwiseConvolution2dTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ElementwiseBinaryTest.cpp b/delegate/test/ElementwiseBinaryTest.cpp index 8099efebff..effed03e5e 100644 --- a/delegate/src/test/ElementwiseBinaryTest.cpp +++ b/delegate/test/ElementwiseBinaryTest.cpp @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ElementwiseBinaryTestHelper.hpp b/delegate/test/ElementwiseBinaryTestHelper.hpp index 09a715e7f1..47ee7c2410 100644 --- a/delegate/src/test/ElementwiseBinaryTestHelper.hpp +++ b/delegate/test/ElementwiseBinaryTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ElementwiseUnaryTest.cpp b/delegate/test/ElementwiseUnaryTest.cpp index 4d48d6e2ed..6331436308 100644 --- a/delegate/src/test/ElementwiseUnaryTest.cpp +++ b/delegate/test/ElementwiseUnaryTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ElementwiseUnaryTestHelper.hpp b/delegate/test/ElementwiseUnaryTestHelper.hpp index 230d0fcca5..f6a534a64f 100644 --- a/delegate/src/test/ElementwiseUnaryTestHelper.hpp +++ b/delegate/test/ElementwiseUnaryTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/FillTest.cpp b/delegate/test/FillTest.cpp index 50f7f53d56..a12715ccc1 100644 --- a/delegate/src/test/FillTest.cpp +++ b/delegate/test/FillTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/FillTestHelper.hpp b/delegate/test/FillTestHelper.hpp index 8479b72730..c8aadb087b 100644 --- a/delegate/src/test/FillTestHelper.hpp +++ b/delegate/test/FillTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/FullyConnectedTest.cpp b/delegate/test/FullyConnectedTest.cpp index 3ef5cedbd7..3ef5cedbd7 100644 --- a/delegate/src/test/FullyConnectedTest.cpp +++ b/delegate/test/FullyConnectedTest.cpp diff --git a/delegate/src/test/FullyConnectedTestHelper.hpp b/delegate/test/FullyConnectedTestHelper.hpp index a3f009a863..d6bbd93176 100644 --- a/delegate/src/test/FullyConnectedTestHelper.hpp +++ b/delegate/test/FullyConnectedTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/GatherNdTest.cpp b/delegate/test/GatherNdTest.cpp index 2b4fd4207e..066248f22a 100644 --- a/delegate/src/test/GatherNdTest.cpp +++ b/delegate/test/GatherNdTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/GatherNdTestHelper.hpp b/delegate/test/GatherNdTestHelper.hpp index c2cf9ffe9d..7b1595bafb 100644 --- a/delegate/src/test/GatherNdTestHelper.hpp +++ b/delegate/test/GatherNdTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/GatherTest.cpp b/delegate/test/GatherTest.cpp index 6dd015173c..e4012b49ee 100644 --- a/delegate/src/test/GatherTest.cpp +++ b/delegate/test/GatherTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/GatherTestHelper.hpp b/delegate/test/GatherTestHelper.hpp index 4763e06c73..41e3b55a50 100644 --- a/delegate/src/test/GatherTestHelper.hpp +++ b/delegate/test/GatherTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/LogicalTest.cpp b/delegate/test/LogicalTest.cpp index 9fa2d3dde0..57bbd318e7 100644 --- a/delegate/src/test/LogicalTest.cpp +++ b/delegate/test/LogicalTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -9,7 +9,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/LogicalTestHelper.hpp b/delegate/test/LogicalTestHelper.hpp index 2a1ff2b996..2f2ae7bf40 100644 --- a/delegate/src/test/LogicalTestHelper.hpp +++ b/delegate/test/LogicalTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/LstmTest.cpp b/delegate/test/LstmTest.cpp index 1fa9f0c8bf..1034a012e2 100644 --- a/delegate/src/test/LstmTest.cpp +++ b/delegate/test/LstmTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> namespace armnnDelegate diff --git a/delegate/src/test/LstmTestHelper.hpp b/delegate/test/LstmTestHelper.hpp index 082d5dea91..14776ca341 100644 --- a/delegate/src/test/LstmTestHelper.hpp +++ b/delegate/test/LstmTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <tensorflow/lite/c/common.h> diff --git a/delegate/src/test/MirrorPadTest.cpp b/delegate/test/MirrorPadTest.cpp index ca66181a30..14c4755d0b 100644 --- a/delegate/src/test/MirrorPadTest.cpp +++ b/delegate/test/MirrorPadTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/NeonDelegateTests_NDK_Issue.cpp b/delegate/test/NeonDelegateTests_NDK_Issue.cpp index a437a08a49..5dad598e63 100644 --- a/delegate/src/test/NeonDelegateTests_NDK_Issue.cpp +++ b/delegate/test/NeonDelegateTests_NDK_Issue.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -9,7 +9,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/NormalizationTest.cpp b/delegate/test/NormalizationTest.cpp index e33dcf056e..b3a6f4b81b 100644 --- a/delegate/src/test/NormalizationTest.cpp +++ b/delegate/test/NormalizationTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/test/NormalizationTestHelper.hpp b/delegate/test/NormalizationTestHelper.hpp index 510b578c02..eafdf84835 100644 --- a/delegate/src/test/NormalizationTestHelper.hpp +++ b/delegate/test/NormalizationTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/PackTest.cpp b/delegate/test/PackTest.cpp index aea903bcd0..1e7eb696c1 100644 --- a/delegate/src/test/PackTest.cpp +++ b/delegate/test/PackTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/PackTestHelper.hpp b/delegate/test/PackTestHelper.hpp index a9e2ee17bc..0fd2f195f4 100644 --- a/delegate/src/test/PackTestHelper.hpp +++ b/delegate/test/PackTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/PadTest.cpp b/delegate/test/PadTest.cpp index 4721b685cc..be54ede7a3 100644 --- a/delegate/src/test/PadTest.cpp +++ b/delegate/test/PadTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/PadTestHelper.hpp b/delegate/test/PadTestHelper.hpp index e96bc4bfe3..d049c52635 100644 --- a/delegate/src/test/PadTestHelper.hpp +++ b/delegate/test/PadTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/Pooling2dTest.cpp b/delegate/test/Pooling2dTest.cpp index fd52aee70d..ea87a29793 100644 --- a/delegate/src/test/Pooling2dTest.cpp +++ b/delegate/test/Pooling2dTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/Pooling2dTestHelper.hpp b/delegate/test/Pooling2dTestHelper.hpp index c7457dbb22..6de85b63c5 100644 --- a/delegate/src/test/Pooling2dTestHelper.hpp +++ b/delegate/test/Pooling2dTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/Pooling3dTest.cpp b/delegate/test/Pooling3dTest.cpp index c0a186210e..85202e1165 100644 --- a/delegate/src/test/Pooling3dTest.cpp +++ b/delegate/test/Pooling3dTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/Pooling3dTestHelper.hpp b/delegate/test/Pooling3dTestHelper.hpp index 47e00f7b7f..dd90e4bb1c 100644 --- a/delegate/src/test/Pooling3dTestHelper.hpp +++ b/delegate/test/Pooling3dTestHelper.hpp @@ -15,7 +15,7 @@ #include <tensorflow/lite/kernels/custom_ops_register.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/PreluTest.cpp b/delegate/test/PreluTest.cpp index d9e08d20ca..40bf1dda56 100644 --- a/delegate/src/test/PreluTest.cpp +++ b/delegate/test/PreluTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/PreluTestHelper.hpp b/delegate/test/PreluTestHelper.hpp index b50c37763f..0721c139ac 100644 --- a/delegate/src/test/PreluTestHelper.hpp +++ b/delegate/test/PreluTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/QuantizationTest.cpp b/delegate/test/QuantizationTest.cpp index fbc2903d38..0210602eb8 100644 --- a/delegate/src/test/QuantizationTest.cpp +++ b/delegate/test/QuantizationTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/QuantizationTestHelper.hpp b/delegate/test/QuantizationTestHelper.hpp index a8b102271a..af898f332d 100644 --- a/delegate/src/test/QuantizationTestHelper.hpp +++ b/delegate/test/QuantizationTestHelper.hpp @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/RedefineTestHelper.hpp b/delegate/test/RedefineTestHelper.hpp index 7f811d56dd..ce60db0664 100644 --- a/delegate/src/test/RedefineTestHelper.hpp +++ b/delegate/test/RedefineTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ReduceTest.cpp b/delegate/test/ReduceTest.cpp index 9c11c8736c..5c031d9312 100644 --- a/delegate/src/test/ReduceTest.cpp +++ b/delegate/test/ReduceTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ReduceTestHelper.hpp b/delegate/test/ReduceTestHelper.hpp index f500736080..fedf7ee150 100644 --- a/delegate/src/test/ReduceTestHelper.hpp +++ b/delegate/test/ReduceTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ReshapeTest.cpp b/delegate/test/ReshapeTest.cpp index 11449e29b8..c3df8b21d8 100644 --- a/delegate/src/test/ReshapeTest.cpp +++ b/delegate/test/ReshapeTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ResizeTest.cpp b/delegate/test/ResizeTest.cpp index 394ad6c7ae..20113875a8 100644 --- a/delegate/src/test/ResizeTest.cpp +++ b/delegate/test/ResizeTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ResizeTestHelper.hpp b/delegate/test/ResizeTestHelper.hpp index 6937a4ba43..ab7de14612 100644 --- a/delegate/src/test/ResizeTestHelper.hpp +++ b/delegate/test/ResizeTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/RoundTest.cpp b/delegate/test/RoundTest.cpp index 9d323f3700..b4f0446792 100644 --- a/delegate/src/test/RoundTest.cpp +++ b/delegate/test/RoundTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/RoundTestHelper.hpp b/delegate/test/RoundTestHelper.hpp index 6638607dcf..dc14abf6e3 100644 --- a/delegate/src/test/RoundTestHelper.hpp +++ b/delegate/test/RoundTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/ShapeTest.cpp b/delegate/test/ShapeTest.cpp index b49910adf6..309b071d9a 100644 --- a/delegate/src/test/ShapeTest.cpp +++ b/delegate/test/ShapeTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/test/ShapeTestHelper.hpp b/delegate/test/ShapeTestHelper.hpp index 9b3d574e23..54e27ac8fd 100644 --- a/delegate/src/test/ShapeTestHelper.hpp +++ b/delegate/test/ShapeTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/SliceTest.cpp b/delegate/test/SliceTest.cpp index 1d7133f1fd..88a70de03f 100644 --- a/delegate/src/test/SliceTest.cpp +++ b/delegate/test/SliceTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/test/SliceTestHelper.hpp b/delegate/test/SliceTestHelper.hpp index 94c076b4f7..c938fad31b 100644 --- a/delegate/src/test/SliceTestHelper.hpp +++ b/delegate/test/SliceTestHelper.hpp @@ -14,7 +14,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/SoftmaxTest.cpp b/delegate/test/SoftmaxTest.cpp index 3339c09918..27f780948d 100644 --- a/delegate/src/test/SoftmaxTest.cpp +++ b/delegate/test/SoftmaxTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/SoftmaxTestHelper.hpp b/delegate/test/SoftmaxTestHelper.hpp index f3367f9d24..15177b7088 100644 --- a/delegate/src/test/SoftmaxTestHelper.hpp +++ b/delegate/test/SoftmaxTestHelper.hpp @@ -12,7 +12,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/SpaceDepthTest.cpp b/delegate/test/SpaceDepthTest.cpp index f80e749b87..8a8bbaeccb 100644 --- a/delegate/src/test/SpaceDepthTest.cpp +++ b/delegate/test/SpaceDepthTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/SpaceDepthTestHelper.hpp b/delegate/test/SpaceDepthTestHelper.hpp index 737e199ef7..6e8e39d0b0 100644 --- a/delegate/src/test/SpaceDepthTestHelper.hpp +++ b/delegate/test/SpaceDepthTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/SplitTest.cpp b/delegate/test/SplitTest.cpp index 5940516583..b54ce217b5 100644 --- a/delegate/src/test/SplitTest.cpp +++ b/delegate/test/SplitTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/SplitTestHelper.hpp b/delegate/test/SplitTestHelper.hpp index 3c5f50ffac..503fbc85ae 100644 --- a/delegate/src/test/SplitTestHelper.hpp +++ b/delegate/test/SplitTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/StridedSliceTest.cpp b/delegate/test/StridedSliceTest.cpp index 43aea8a449..5b6d7efca0 100644 --- a/delegate/src/test/StridedSliceTest.cpp +++ b/delegate/test/StridedSliceTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/test/StridedSliceTestHelper.hpp b/delegate/test/StridedSliceTestHelper.hpp index ef944d7e7a..fde7e16c72 100644 --- a/delegate/src/test/StridedSliceTestHelper.hpp +++ b/delegate/test/StridedSliceTestHelper.hpp @@ -14,7 +14,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/TestUtils.cpp b/delegate/test/TestUtils.cpp index 9dce4461da..2689c2eaa3 100644 --- a/delegate/src/test/TestUtils.cpp +++ b/delegate/test/TestUtils.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/test/TestUtils.hpp b/delegate/test/TestUtils.hpp index 5d4a0ed7d4..95dd257c92 100644 --- a/delegate/src/test/TestUtils.hpp +++ b/delegate/test/TestUtils.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/test/TransposeTest.cpp b/delegate/test/TransposeTest.cpp index 67751e325a..c210128ac8 100644 --- a/delegate/src/test/TransposeTest.cpp +++ b/delegate/test/TransposeTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // diff --git a/delegate/src/test/TransposeTestHelper.hpp b/delegate/test/TransposeTestHelper.hpp index 4479c486cb..99bb60b91a 100644 --- a/delegate/src/test/TransposeTestHelper.hpp +++ b/delegate/test/TransposeTestHelper.hpp @@ -11,7 +11,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/UnidirectionalSequenceLstmTest.cpp b/delegate/test/UnidirectionalSequenceLstmTest.cpp index 4bee715788..6d896d7d5d 100644 --- a/delegate/src/test/UnidirectionalSequenceLstmTest.cpp +++ b/delegate/test/UnidirectionalSequenceLstmTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> namespace armnnDelegate diff --git a/delegate/src/test/UnidirectionalSequenceLstmTestHelper.hpp b/delegate/test/UnidirectionalSequenceLstmTestHelper.hpp index 10555aca1a..0ff04e7949 100644 --- a/delegate/src/test/UnidirectionalSequenceLstmTestHelper.hpp +++ b/delegate/test/UnidirectionalSequenceLstmTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <tensorflow/lite/c/common.h> diff --git a/delegate/src/test/UnpackTest.cpp b/delegate/test/UnpackTest.cpp index c036f649ef..7c4b12a6b8 100644 --- a/delegate/src/test/UnpackTest.cpp +++ b/delegate/test/UnpackTest.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021,2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,7 @@ #include <armnn_delegate.hpp> #include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <doctest/doctest.h> diff --git a/delegate/src/test/UnpackTestHelper.hpp b/delegate/test/UnpackTestHelper.hpp index 0e12d72279..a4c6bc01f3 100644 --- a/delegate/src/test/UnpackTestHelper.hpp +++ b/delegate/test/UnpackTestHelper.hpp @@ -13,7 +13,7 @@ #include <tensorflow/lite/interpreter.h> #include <tensorflow/lite/kernels/register.h> #include <tensorflow/lite/model.h> -#include <tensorflow/lite/schema/schema_generated.h> +#include <schema_generated.h> #include <tensorflow/lite/version.h> #include <doctest/doctest.h> |