Skip to content

Commit

Permalink
Merge pull request #928 from xmos/muldefs
Browse files Browse the repository at this point in the history
Build without linker flags for multiple symbols
  • Loading branch information
panickal-xmos authored Sep 17, 2024
2 parents fee9e88 + 8924fe0 commit 07fa0de
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 19 deletions.
4 changes: 2 additions & 2 deletions python/xmos_ai_tools/xinterpreters/src/dll_interpreter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//*****************************************

void add_lib_vision_ops(
tflite::MicroMutableOpResolver<XTFLM_OPERATORS> *resolver) {
tflite_micro::MicroMutableOpResolver<XTFLM_OPERATORS> *resolver) {
resolver->AddAddN();
resolver->AddCast();
resolver->AddFloor();
Expand Down Expand Up @@ -88,7 +88,7 @@ DLLEXPORT inference_engine *new_interpreter(size_t max_model_size) {
resolver->AddIf();
resolver->AddWhile();
resolver->AddCallOnce();
tflite::ops::micro::xcore::RegisterXCOps(resolver);
tflite_micro::ops::micro::xcore::RegisterXCOps(resolver);
add_lib_vision_ops(resolver);

return ie;
Expand Down
2 changes: 1 addition & 1 deletion third_party/lib_tflite_micro
Submodule lib_tflite_micro updated 47 files
+1 −1 host_cmd_line_interpreter/src/main.cc
+9 −9 lib_tflite_micro/api/inference_engine.h
+7 −7 lib_tflite_micro/src/inference_engine.cc
+2 −2 lib_tflite_micro/src/tflite-xcore-kernels/micro_time.cc
+8 −8 lib_tflite_micro/src/tflite-xcore-kernels/xcore_3_to_4.cc
+9 −9 lib_tflite_micro/src/tflite-xcore-kernels/xcore_add.cc
+12 −12 lib_tflite_micro/src/tflite-xcore-kernels/xcore_batched_softmax.cc
+8 −8 lib_tflite_micro/src/tflite-xcore-kernels/xcore_beta_activationf32.cc
+9 −9 lib_tflite_micro/src/tflite-xcore-kernels/xcore_beta_concatf32.cc
+11 −11 lib_tflite_micro/src/tflite-xcore-kernels/xcore_beta_convf32.cc
+9 −9 lib_tflite_micro/src/tflite-xcore-kernels/xcore_beta_fcf32.cc
+11 −11 lib_tflite_micro/src/tflite-xcore-kernels/xcore_beta_transposeconvf32.cc
+13 −13 lib_tflite_micro/src/tflite-xcore-kernels/xcore_binaryi16.cc
+6 −6 lib_tflite_micro/src/tflite-xcore-kernels/xcore_broadcast.cc
+6 −6 lib_tflite_micro/src/tflite-xcore-kernels/xcore_bsign.cc
+2 −2 lib_tflite_micro/src/tflite-xcore-kernels/xcore_common.cc
+2 −2 lib_tflite_micro/src/tflite-xcore-kernels/xcore_common.h
+5 −5 lib_tflite_micro/src/tflite-xcore-kernels/xcore_concat.cc
+16 −16 lib_tflite_micro/src/tflite-xcore-kernels/xcore_conv2d_v2.cc
+2 −2 lib_tflite_micro/src/tflite-xcore-kernels/xcore_custom_options.cc
+2 −2 lib_tflite_micro/src/tflite-xcore-kernels/xcore_custom_options.h
+31 −31 lib_tflite_micro/src/tflite-xcore-kernels/xcore_detection_post.cc
+2 −2 lib_tflite_micro/src/tflite-xcore-kernels/xcore_error_reporter.cc
+3 −3 lib_tflite_micro/src/tflite-xcore-kernels/xcore_error_reporter.h
+12 −12 lib_tflite_micro/src/tflite-xcore-kernels/xcore_interpreter.cc
+8 −8 lib_tflite_micro/src/tflite-xcore-kernels/xcore_interpreter.h
+8 −8 lib_tflite_micro/src/tflite-xcore-kernels/xcore_load_weights.cc
+10 −10 lib_tflite_micro/src/tflite-xcore-kernels/xcore_lookup.cc
+8 −8 lib_tflite_micro/src/tflite-xcore-kernels/xcore_maxpool2d.cc
+6 −6 lib_tflite_micro/src/tflite-xcore-kernels/xcore_mean.cc
+9 −9 lib_tflite_micro/src/tflite-xcore-kernels/xcore_mul.cc
+2 −2 lib_tflite_micro/src/tflite-xcore-kernels/xcore_ops.cc
+3 −3 lib_tflite_micro/src/tflite-xcore-kernels/xcore_ops.h
+6 −6 lib_tflite_micro/src/tflite-xcore-kernels/xcore_pad.cc
+5 −5 lib_tflite_micro/src/tflite-xcore-kernels/xcore_profiler.cc
+4 −4 lib_tflite_micro/src/tflite-xcore-kernels/xcore_profiler.h
+6 −6 lib_tflite_micro/src/tflite-xcore-kernels/xcore_slice.cc
+10 −10 lib_tflite_micro/src/tflite-xcore-kernels/xcore_softmax.cc
+10 −10 lib_tflite_micro/src/tflite-xcore-kernels/xcore_unaryi16.cc
+2 −2 lib_tflite_micro/src/tflite-xcore-kernels/xcore_utils.cc
+5 −5 lib_tflite_micro/src/tflite-xcore-kernels/xcore_utils.h
+56,292 −444 patches/tflite-micro.patch
+1 −1 repos.list
+29 −29 tflite_micro_compiler/src/CodeWriter.cc
+3 −3 tflite_micro_compiler/src/CodeWriter.h
+98 −92 tflite_micro_compiler/src/Compiler.cc
+7 −7 tflite_micro_compiler/src/Compiler.h
2 changes: 0 additions & 2 deletions xformer/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ build:windows --features=compiler_param_file
build:windows --features=archive_param_file

build:windows --enable_runfiles
build:windows --linkopt=/FORCE:MULTIPLE
build:windows --host_linkopt=/FORCE:MULTIPLE

# Link with these libs only on macos
build:macos --linkopt=-framework
Expand Down
13 changes: 0 additions & 13 deletions xformer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,7 @@ cc_binary(
name = "xcore-opt",
srcs = ["XCoreOptMain.cpp",
"Version.h",
"@org_tensorflow//tensorflow/lite/kernels:padding.h",
"@org_tensorflow//tensorflow/lite/kernels/internal:reference/pooling.h",
"@org_tensorflow//tensorflow/lite/kernels/internal:reference/integer_ops/pooling.h",
"@org_tensorflow//tensorflow/lite/c:common.h",
"@org_tensorflow//tensorflow/lite/c:builtin_op_data.h",
"@org_tensorflow//tensorflow/lite/c:c_api_types.h",
],
# Tensorflow and tflite-micro contain common tflite files in global namespace.
# Tell the compiler to allow multiple definitions when linking this.
linkopts = select({
"@org_tensorflow//tensorflow:macos": [],
"@org_tensorflow//tensorflow:windows": [],
"//conditions:default": ["-Wl,-z,muldefs"],
}),
deps = [
"@lib_tflite_micro//:shared_headers",
"@lib_tflmc//:tflmc_lib",
Expand Down
2 changes: 2 additions & 0 deletions xformer/lib_tflmc.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ package(
filegroup(
name = "TFLITE_SOURCES",
srcs = [
"@tflite_micro//tensorflow/lite:array.cc",
"@tflite_micro//tensorflow/lite/core/c:common.cc",
"@tflite_micro//tensorflow/lite/kernels/internal:common.cc",
"@tflite_micro//tensorflow/lite/core/api:error_reporter.cc",
"@tflite_micro//tensorflow/lite/core/api:tensor_utils.cc",
"@tflite_micro//tensorflow/lite/core/api:flatbuffer_conversions.cc",
Expand Down

0 comments on commit 07fa0de

Please sign in to comment.