Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- a/tensorflow/lite/CMakeLists.txt
+++ b/tensorflow/lite/CMakeLists.txt
@@ -507,6 +507,11 @@
if(TFLITE_ENABLE_XNNPACK)
find_package(fp16_headers REQUIRED)
find_package(XNNPACK REQUIRED)
+ set(XNNPACK_NEON_2_SSE "")
+ if (NOT CMAKE_SYSTEM_PROCESSOR OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
+ find_package(NEON_2_SSE REQUIRED)
+ list(APPEND XNNPACK_NEON_2_SSE NEON_2_SSE::NEON_2_SSE)
+ endif()
populate_tflite_source_vars("delegates/xnnpack"
TFLITE_DELEGATES_XNNPACK_SRCS
FILTER ".*(_test|_tester)\\.(cc|h)"
@@ -533,6 +538,7 @@
flatbuffers::flatbuffers
gemmlowp::gemmlowp
ruy::ruy
+ ${XNNPACK_NEON_2_SSE}
)

list(APPEND TFLITE_TARGET_PUBLIC_OPTIONS "-DTFLITE_KERNEL_USE_XNNPACK")
13 changes: 12 additions & 1 deletion tur-pypi-312/python3.12-tflite-runtime/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ TERMUX_PKG_HOMEPAGE=https://www.tensorflow.org/lite
TERMUX_PKG_DESCRIPTION="TensorFlow Lite Python bindings"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@termux-user-repository"
TERMUX_PKG_VERSION="2.17.0"
TERMUX_PKG_VERSION="2.18.0"
TERMUX_PKG_SRCURL=git+https://github.com/tensorflow/tensorflow
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="python, python-numpy, python-pip"
TERMUX_PKG_UPDATE_TAG_TYPE="latest-release-tag"
TERMUX_PKG_PYTHON_COMMON_DEPS="setuptools, wheel, pybind11"
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DTFLITE_HOST_TOOLS_DIR=$TERMUX_PKG_HOSTBUILD_DIR
"

TERMUX_PYTHON_VERSION=3.12
TERMUX_PYTHON_HOME=$TERMUX_PREFIX/lib/python${TERMUX_PYTHON_VERSION}
Expand All @@ -19,6 +23,13 @@ TUR_WHEEL_DIR="build-wheel/dist"

source $TERMUX_SCRIPTDIR/common-files/tur_build_wheel.sh

termux_step_host_build() {
termux_setup_cmake

cmake "$TERMUX_PKG_SRCDIR"/tensorflow/lite
cmake --build . --verbose -j $TERMUX_PKG_MAKE_PROCESSES -t flatbuffers-flatc
}

termux_step_pre_configure() {
termux_setup_cmake
termux_setup_ninja
Expand Down