From 019840d1161738aefd6ebd32ccf4e72e618cae15 Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Mon, 30 Nov 2020 17:43:28 +0000 Subject: IVGCVSW-5374 Provide an Android build for the delegate Signed-off-by: Finn Williams Change-Id: I33eb8c650be654ad891afd2295f2057f13a9d084 --- delegate/CMakeLists.txt | 10 +++++----- delegate/cmake/Modules/FindTfLite.cmake | 1 + delegate/src/Split.hpp | 6 ++---- delegate/src/test/GatherTestHelper.hpp | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/delegate/CMakeLists.txt b/delegate/CMakeLists.txt index 5303d81d26..9be2f44d44 100644 --- a/delegate/CMakeLists.txt +++ b/delegate/CMakeLists.txt @@ -71,10 +71,10 @@ add_library(tflite_headers INTERFACE) target_include_directories(tflite_headers INTERFACE $ $) -target_compile_options(tflite_headers INTERFACE $<$:-Wno-conversion - -Wno-sign-conversion - -Wno-unused-parameter - -Wno-unused-function>) +target_compile_options(tflite_headers INTERFACE -Wno-conversion + -Wno-sign-conversion + -Wno-unused-parameter + -Wno-unused-function) target_link_libraries(armnnDelegate PUBLIC tflite_headers) @@ -89,7 +89,7 @@ target_link_libraries(armnnDelegate PRIVATE add_library(flatbuffer_headers INTERFACE) target_include_directories(flatbuffer_headers INTERFACE $ $) -target_compile_options(flatbuffer_headers INTERFACE $<$:-Wno-sign-conversion>) +target_compile_options(flatbuffer_headers INTERFACE -Wno-sign-conversion) target_link_libraries(armnnDelegate PUBLIC flatbuffer_headers) diff --git a/delegate/cmake/Modules/FindTfLite.cmake b/delegate/cmake/Modules/FindTfLite.cmake index 9bb117efac..18d6032147 100644 --- a/delegate/cmake/Modules/FindTfLite.cmake +++ b/delegate/cmake/Modules/FindTfLite.cmake @@ -16,6 +16,7 @@ find_path(TfLite_INCLUDE_DIR find_library(TfLite_LIB NAMES "libtensorflow_lite_all.so" + "libtensorflowlite.so" HINTS ${TFLITE_LIB_ROOT}) diff --git a/delegate/src/Split.hpp b/delegate/src/Split.hpp index c76ad60ace..8248be9413 100644 --- a/delegate/src/Split.hpp +++ b/delegate/src/Split.hpp @@ -42,10 +42,9 @@ TfLiteStatus VisitSplitOperator(DelegateData& delegateData, return kTfLiteError; } - const armnn::TensorInfo& axisTensorInfo = GetTensorInfoForTfLiteTensor(tfLiteAxisTensor); const armnn::TensorInfo& inputTensorInfo = GetTensorInfoForTfLiteTensor(tfLiteInputTensor); - ARMNN_ASSERT(axisTensorInfo.GetNumElements() == 1); + ARMNN_ASSERT(GetTensorInfoForTfLiteTensor(tfLiteAxisTensor).GetNumElements() == 1); auto* axisTensorDataPtr = tflite::GetTensorData(&tfLiteAxisTensor); std::vector axisTensorData(axisTensorDataPtr, axisTensorDataPtr + 1); const unsigned int splitDim = axisTensorData[0]; @@ -168,9 +167,8 @@ TfLiteStatus VisitSplitVOperator(DelegateData& delegateData, const armnn::TensorInfo& inputTensorInfo = GetTensorInfoForTfLiteTensor(tfLiteInputTensor); const armnn::TensorInfo& splitsTensorInfo = GetTensorInfoForTfLiteTensor(tfLiteSplitsTensor); ARMNN_ASSERT(splitsTensorInfo.GetNumDimensions() == 1); + ARMNN_ASSERT(GetTensorInfoForTfLiteTensor(tfLiteAxisTensor).GetNumElements() == 1); - const armnn::TensorInfo& axisTensorInfo = GetTensorInfoForTfLiteTensor(tfLiteAxisTensor); - ARMNN_ASSERT(axisTensorInfo.GetNumElements() == 1); auto* axisTensorDataPtr = tflite::GetTensorData(&tfLiteAxisTensor); std::vector axisTensorData(axisTensorDataPtr, axisTensorDataPtr + 1); diff --git a/delegate/src/test/GatherTestHelper.hpp b/delegate/src/test/GatherTestHelper.hpp index d8bfe37842..fcacf04134 100644 --- a/delegate/src/test/GatherTestHelper.hpp +++ b/delegate/src/test/GatherTestHelper.hpp @@ -71,7 +71,7 @@ std::vector CreateGatherTfLiteModel(tflite::TensorType tensorType, flatbuffers::Offset operatorBuiltinOptions = CreateGatherOptions(flatBufferBuilder).Union(); const std::vector operatorInputs{{0, 1}}; - const std::vector operatorOutputs{{2}}; + const std::vector operatorOutputs{2}; flatbuffers::Offset controlOperator = CreateOperator(flatBufferBuilder, 0, @@ -83,7 +83,7 @@ std::vector CreateGatherTfLiteModel(tflite::TensorType tensorType, operatorBuiltinOptions); const std::vector subgraphInputs{{0, 1}}; - const std::vector subgraphOutputs{{2}}; + const std::vector subgraphOutputs{2}; flatbuffers::Offset subgraph = CreateSubGraph(flatBufferBuilder, flatBufferBuilder.CreateVector(tensors.data(), tensors.size()), -- cgit v1.2.1