diff options
-rw-r--r-- | delegate/classic/CMakeLists.txt | 2 | ||||
-rw-r--r-- | delegate/classic/src/armnn_delegate.cpp | 2 | ||||
-rw-r--r-- | delegate/classic/src/test/ArmnnClassicDelegateTest.cpp | 12 | ||||
-rw-r--r-- | delegate/cmake/Modules/FindTfLite.cmake | 7 | ||||
-rw-r--r-- | delegate/opaque/CMakeLists.txt | 2 | ||||
-rw-r--r-- | delegate/opaque/include/armnn_delegate.hpp | 5 | ||||
-rw-r--r-- | delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp | 4 | ||||
-rwxr-xr-x | scripts/get_tensorflow.sh | 2 |
8 files changed, 23 insertions, 13 deletions
diff --git a/delegate/classic/CMakeLists.txt b/delegate/classic/CMakeLists.txt index dfd0cf985d..fbd19ede30 100644 --- a/delegate/classic/CMakeLists.txt +++ b/delegate/classic/CMakeLists.txt @@ -93,7 +93,7 @@ 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_compile_options(flatbuffer_headers INTERFACE -Wno-sign-conversion -Wno-sign-compare) target_link_libraries(armnnClassicDelegateObject PUBLIC flatbuffer_headers) diff --git a/delegate/classic/src/armnn_delegate.cpp b/delegate/classic/src/armnn_delegate.cpp index c428d46d87..c8f57d6cc3 100644 --- a/delegate/classic/src/armnn_delegate.cpp +++ b/delegate/classic/src/armnn_delegate.cpp @@ -124,6 +124,8 @@ TfLiteStatus DoPrepare(TfLiteContext* tfLiteContext, TfLiteDelegate* tfLiteDeleg .custom_name = "TfLiteArmNnDelegate", .version = 1, .registration_external = nullptr, + .async_kernel = nullptr, + .inplace_operator = 0 }; const TfLiteStatus status = diff --git a/delegate/classic/src/test/ArmnnClassicDelegateTest.cpp b/delegate/classic/src/test/ArmnnClassicDelegateTest.cpp index 409b769273..e83f47f244 100644 --- a/delegate/classic/src/test/ArmnnClassicDelegateTest.cpp +++ b/delegate/classic/src/test/ArmnnClassicDelegateTest.cpp @@ -31,9 +31,13 @@ TEST_CASE ("ArmnnDelegate Registered") tfLiteInterpreter->SetTensorParametersReadWrite(1, kTfLiteFloat32, "input2", {1,2,2,1}, TfLiteQuantization()); tfLiteInterpreter->SetTensorParametersReadWrite(2, kTfLiteFloat32, "output", {1,2,2,1}, TfLiteQuantization()); + TfLiteAddParams* addParams = reinterpret_cast<TfLiteAddParams*>(malloc(sizeof(TfLiteAddParams))); + addParams->activation = kTfLiteActNone; + addParams->pot_scale_int16 = false; + tflite::ops::builtin::BuiltinOpResolver opResolver; const TfLiteRegistration* opRegister = opResolver.FindOp(BuiltinOperator_ADD, 1); - tfLiteInterpreter->AddNodeWithParameters({0, 1}, {2}, "", 0, nullptr, opRegister); + tfLiteInterpreter->AddNodeWithParameters({0, 1}, {2}, "", 0, addParams, opRegister); // Create the Armnn Delegate std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; @@ -69,9 +73,13 @@ TEST_CASE ("ArmnnDelegateOptimizerOptionsRegistered") tfLiteInterpreter->SetTensorParametersReadWrite(1, kTfLiteFloat32, "input2", {1,2,2,1}, TfLiteQuantization()); tfLiteInterpreter->SetTensorParametersReadWrite(2, kTfLiteFloat32, "output", {1,2,2,1}, TfLiteQuantization()); + TfLiteAddParams* addParams = reinterpret_cast<TfLiteAddParams*>(malloc(sizeof(TfLiteAddParams))); + addParams->activation = kTfLiteActNone; + addParams->pot_scale_int16 = false; + tflite::ops::builtin::BuiltinOpResolver opResolver; const TfLiteRegistration* opRegister = opResolver.FindOp(BuiltinOperator_ADD, 1); - tfLiteInterpreter->AddNodeWithParameters({0, 1}, {2}, "", 0, nullptr, opRegister); + tfLiteInterpreter->AddNodeWithParameters({0, 1}, {2}, "", 0, addParams, opRegister); // Create the Armnn Delegate std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; diff --git a/delegate/cmake/Modules/FindTfLite.cmake b/delegate/cmake/Modules/FindTfLite.cmake index 634aaea511..20f93ca4ae 100644 --- a/delegate/cmake/Modules/FindTfLite.cmake +++ b/delegate/cmake/Modules/FindTfLite.cmake @@ -26,6 +26,9 @@ if (TfLite_LIB MATCHES .a$) PATH ${TFLITE_LIB_ROOT}/_deps/abseil-cpp-build/absl/strings) find_library(TfLite_abseil_synchronization_LIB "libabsl_synchronization.a" PATH ${TFLITE_LIB_ROOT}/_deps/abseil-cpp-build/absl/synchronization) + # Required for building TensorFlow in Debug + find_library(TfLite_abseil_graphCycle_internal_LIB "libabsl_graphcycles_internal.a" + PATH ${TFLITE_LIB_ROOT}/_deps/abseil-cpp-build/absl/synchronization) find_library(TfLite_farmhash_LIB "libfarmhash.a" @@ -111,7 +114,7 @@ if (TfLite_LIB MATCHES .a$) TfLite_ruy_pack_avx2_fma_LIB TfLite_ruy_pack_avx512_LIB TfLite_ruy_pack_avx_LIB TfLite_ruy_prepacked_cache_LIB TfLite_ruy_prepare_packed_matrices_LIB TfLite_ruy_system_aligned_alloc_LIB TfLite_ruy_threadpool_LIB TfLite_ruy_trmul_LIB TfLite_ruy_tune_LIB TfLite_ruy_wait_LIB TfLite_ruy_profiler_LIB TfLite_cpuinfo_LIB - TfLite_abseil_synchronization_LIB TfLite_pthread_pool_LIB) + TfLite_abseil_synchronization_LIB TfLite_abseil_graphCycle_internal_LIB TfLite_pthread_pool_LIB) # Set external variables for usage in CMakeLists.txt if (TFLITE_FOUND) # WARNING! The order of these libraries is critical. Moving them @@ -126,7 +129,7 @@ if (TfLite_LIB MATCHES .a$) ${TfLite_ruy_pack_avx2_fma_LIB} ${TfLite_ruy_pack_avx512_LIB} ${TfLite_ruy_pack_avx_LIB} ${TfLite_ruy_prepacked_cache_LIB} ${TfLite_ruy_prepare_packed_matrices_LIB} ${TfLite_ruy_system_aligned_alloc_LIB} ${TfLite_ruy_tune_LIB} ${TfLite_ruy_wait_LIB} ${TfLite_ruy_profiler_LIB} - ${TfLite_cpuinfo_LIB} ${TfLite_abseil_synchronization_LIB} ${TfLite_pthread_pool_LIB}) + ${TfLite_cpuinfo_LIB} ${TfLite_abseil_synchronization_LIB} ${TfLite_abseil_graphCycle_internal_LIB} ${TfLite_pthread_pool_LIB}) endif () elseif (TfLite_LIB MATCHES .so$) message("-- Dynamic tensorflow lite library found, using for ArmNN build") diff --git a/delegate/opaque/CMakeLists.txt b/delegate/opaque/CMakeLists.txt index 365e0166ba..abbf38d071 100644 --- a/delegate/opaque/CMakeLists.txt +++ b/delegate/opaque/CMakeLists.txt @@ -92,7 +92,7 @@ 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_compile_options(flatbuffer_headers_opaque INTERFACE -Wno-sign-conversion -Wno-sign-compare) target_link_libraries(armnnOpaqueDelegateObject PUBLIC flatbuffer_headers_opaque) diff --git a/delegate/opaque/include/armnn_delegate.hpp b/delegate/opaque/include/armnn_delegate.hpp index ff860c4b1c..474d5978c9 100644 --- a/delegate/opaque/include/armnn_delegate.hpp +++ b/delegate/opaque/include/armnn_delegate.hpp @@ -10,8 +10,9 @@ #include <tensorflow/core/public/version.h> #include <tensorflow/lite/c/c_api_opaque.h> -#include <tensorflow/lite/core/experimental/acceleration/configuration/c/stable_delegate.h> -#include <tensorflow/lite/experimental/acceleration/configuration/delegate_registry.h> + +#include <tensorflow/lite/acceleration/configuration/delegate_registry.h> +#include <tensorflow/lite/core/acceleration/configuration/c/stable_delegate.h> #if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 5) #define ARMNN_POST_TFLITE_2_5 diff --git a/delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp b/delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp index 2669bc8480..9d255b1126 100644 --- a/delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp +++ b/delegate/opaque/src/test/ArmnnOpaqueDelegateTest.cpp @@ -7,10 +7,6 @@ #include <doctest/doctest.h> #include <opaque/include/armnn_delegate.hpp> -#include <opaque/include/Version.hpp> - -#include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/experimental/acceleration/configuration/delegate_registry.h> namespace armnnOpaqueDelegate { diff --git a/scripts/get_tensorflow.sh b/scripts/get_tensorflow.sh index 15307bbda4..6587cfcfe5 100755 --- a/scripts/get_tensorflow.sh +++ b/scripts/get_tensorflow.sh @@ -8,7 +8,7 @@ CMD=$( basename "$0" ) # Revision or tag that Arm NN has been tested with: -DEFAULT_TENSORFLOW_REVISION=6f692f73cb2043b4a0b0446539cd8c15b3dd9220 # r2.12 + PR #60015 to fix Cmake build. +DEFAULT_TENSORFLOW_REVISION=v2.14.0-rc1 # r2.14 branch Usage() { echo "Gets the revision or tag of TensorFlow that this version of Arm NN has been" |