Skip to content

Commit 6f118d9

Browse files
committed
Merge branch 'patch/xnnpack-bazel-build-fix' into 'dev'
Fix inclusion of xnnpack delegate in bazel build See merge request arm-research/smarter/armnn_tflite_backend!26
2 parents 00c7645 + 87a2789 commit 6f118d9

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ if (TFLITE_BAZEL_BUILD)
144144
endif()
145145

146146
if (TFLITE_ENABLE_XNNPACK)
147-
LIST(APPEND BAZEL_BUILD_FLAGS "--define=tflite_with_xnnpack=true")
147+
SET(BAZEL_BUILD_PATCH "${CMAKE_CURRENT_SOURCE_DIR}/patches/tflite_bazel_build_with_xnnpack.patch")
148148
else()
149-
LIST(APPEND BAZEL_BUILD_FLAGS "--define=tflite_with_xnnpack=false")
149+
SET(BAZEL_BUILD_PATCH "${CMAKE_CURRENT_SOURCE_DIR}/patches/tflite_bazel_build.patch")
150150
endif()
151151

152152
if (TFLITE_ENABLE_FLEX_OPS)
153-
SET(TFLITE_PATCH_COMMAND "git" "apply" "${CMAKE_CURRENT_SOURCE_DIR}/patches/tflite_bazel_build.patch" "||" "true")
153+
SET(TFLITE_PATCH_COMMAND "git" "apply" ${BAZEL_BUILD_PATCH} "||" "true")
154154
else()
155155
SET(TFLITE_PATCH_COMMAND "")
156156
endif()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/tensorflow/lite/BUILD b/tensorflow/lite/BUILD
2+
index 597f81194cd..788decaec74 100644
3+
--- a/tensorflow/lite/BUILD
4+
+++ b/tensorflow/lite/BUILD
5+
@@ -775,6 +775,8 @@ tflite_cc_shared_object(
6+
":tflite_exported_symbols.lds",
7+
":tflite_version_script.lds",
8+
"//tensorflow/lite/kernels:builtin_ops_all_linked",
9+
+ "//tensorflow/lite/delegates/flex:delegate",
10+
+ "//tensorflow/lite/delegates/xnnpack:xnnpack_delegate",
11+
],
12+
)
13+

0 commit comments

Comments
 (0)