Skip to content

Commit

Permalink
Fixed build error on ARM 32bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
NobuoTsukamoto committed Sep 30, 2023
1 parent 791423e commit 2afe0c3
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 345 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
index 40f9485b5d6..86e50cb0650 100644
index 0924ca9dacd..30455458ce8 100644
--- a/tensorflow/lite/CMakeLists.txt
+++ b/tensorflow/lite/CMakeLists.txt
@@ -67,7 +67,7 @@ cmake_dependent_option(TFLITE_ENABLE_NNAPI_VERBOSE_VALIDATION "Enable NNAPI verb
@@ -69,7 +69,7 @@ cmake_dependent_option(TFLITE_ENABLE_NNAPI_VERBOSE_VALIDATION "Enable NNAPI verb
option(TFLITE_ENABLE_MMAP "Enable MMAP (unsupported on Windows)" ON)
option(TFLITE_ENABLE_GPU "Enable GPU" OFF)
option(TFLITE_ENABLE_METAL "Enable Metal delegate (iOS only)" OFF)
Expand All @@ -11,3 +11,13 @@ index 40f9485b5d6..86e50cb0650 100644
option(TFLITE_ENABLE_EXTERNAL_DELEGATE "Enable External Delegate backend" ON)

option(TFLITE_KERNEL_TEST "Enable tflite kernel unit test" OFF)
@@ -81,6 +81,9 @@ if(TFLITE_KERNEL_TEST AND ${CMAKE_CROSSCOMPILING})
endif()
endif()

+set(CMAKE_SYSTEM_PROCESSOR ${TENSORFLOW_TARGET_ARCH})
+message(STATUS "CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}")
+
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(_TFLITE_ENABLE_RUY "${TFLITE_ENABLE_RUY}")
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
index 0924ca9dacd..c1c528ce809 100644
--- a/tensorflow/lite/CMakeLists.txt
+++ b/tensorflow/lite/CMakeLists.txt
@@ -539,7 +539,7 @@ populate_tflite_source_vars("kernels/internal/reference/sparse_ops"
)
populate_tflite_source_vars("kernels/internal/optimized/4bit"
TFLITE_KERNEL_INTERNAL_OPT_4BIT_SRCS
- FILTER "(.*neon.*|.*sse.*)\\.(cc|h)"
+ FILTER "(.*neon_.*|.*sse_.*)\\.(cc|h)"
)
set(TFLITE_PROFILER_SRCS
${TFLITE_SOURCE_DIR}/profiling/platform_profiler.cc

This file was deleted.

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions recipes-framework/tensorflow-lite/files/001-flatbuffers.patch

This file was deleted.

13 changes: 10 additions & 3 deletions recipes-framework/tensorflow-lite/libtensorflow-lite-c_2.14.0.bb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SRCREV_tensorflow = "4dacf3f368eb7965e9b5c3bbdd5193986081c3b2"

SRC_URI = " \
git://github.com/tensorflow/tensorflow.git;name=tensorflow;branch=r${BPV};protocol=https \
file://001-Disable-XNNPACKPack-CMakeFile.patch \
file://001-Add-CMAKE_SYSTEM_PROCESSOR.patch \
file://001-Disable-XNNPACK-CMakeFile.patch \
file://001-Fix-neon-sse-file-name-filter.patch \
"

SRC_URI:append:riscv32 = " \
Expand All @@ -29,6 +29,8 @@ S = "${WORKDIR}/git"

DEPENDS = " \
libgfortran \
libeigen \
abseil-cpp \
"

OECMAKE_SOURCEPATH = "${S}/tensorflow/lite/c"
Expand Down Expand Up @@ -65,10 +67,15 @@ EXTRA_OECMAKE:append:riscv64 = " -DTFLITE_ENABLE_XNNPACK=ON"
# Note:
# Download the submodule using FetchContent_Populate.
# Therefore, turn off FETCHCONTENT_FULLY_DISCONNECTED.
EXTRA_OECMAKE:append = " -DFETCHCONTENT_FULLY_DISCONNECTED=OFF -DTENSORFLOW_TARGET_ARCH=${TENSORFLOW_TARGET_ARCH}"
EXTRA_OECMAKE:append = " -DFETCHCONTENT_FULLY_DISCONNECTED=OFF -DTENSORFLOW_TARGET_ARCH=${TENSORFLOW_TARGET_ARCH} -DCMAKE_SYSTEM_PROCESSOR=${TENSORFLOW_TARGET_ARCH}"

do_configure[network] = "1"

do_configure:prepend() {
rm -rf ${S}/tensorflow/lite/tools/cmake/modules/Findabsl.cmake
rm -rf ${S}/tensorflow/lite/tools/cmake/modules/FindEigen3.cmake
}

do_configure:append() {
if [ -e ${S}/tensorflow/lite/tools/pip_package/riscv32_pthread.patch ]; then
cd ${B}/pthreadpool-source/src
Expand Down
Loading

0 comments on commit 2afe0c3

Please sign in to comment.