提交 f05ae826 编写于 作者: B Bruce Lai

[TFLite] Fix cmake build kernel test fail

Using CMake to build the TFLite kernel test will fail in linking stage when `-DTFLITE_ENABLE_GPU=OFF`

ld: libtensorflow-lite-test-base.a(op_version.cc.o): in function `.LBB1_18':
op_version.cc:(.text._ZN6tflite15UpdateOpVersionEPh+0x14c): undefined reference to `tflite::GetOpSignature(tflite::OperatorCode const*, tflite::Operator const*, tflite::SubGraph const*, tflite::Model const*)'
clang++: rror: linker command failed with exit code 1 (use -v to see invocation)

Solution:
Add `versioning/op_signature.cc` to TEST_FRAMEWORK_SRC if `-DTFLITE_ENABLE_GPU=OFF`.
`versioning/op_version.cc` depends on `versioning/op_signature.cc` because of using GetOpSignature().

We don't need to add `versioning/op_signature.cc` to TEST_FRAMEWORK_SRC if `-DTFLITE_ENABLE_GPU=ON`.
Because `versioning/op_signature.cc` is appended in `TFLITE_DELEGATES_GPU_SRCS`, it makes `tensorflow-lite.a` define `GetOpSignature`.
Signed-off-by: NBruce Lai <bruce.lai@sifive.com>
上级 eb842cd5
......@@ -107,6 +107,11 @@ if(NOT _TFLITE_ENABLE_NNAPI)
${TFLITE_SOURCE_DIR}/nnapi/nnapi_util.cc
)
endif()
if(NOT TFLITE_ENABLE_GPU)
list(APPEND TEST_FRAMEWORK_SRC
${TFLITE_SOURCE_DIR}/tools/versioning/op_signature.cc
)
endif()
set(TEST_FRAMEWORK_OPTIONS "")
if(TFLITE_ENABLE_XNNPACK)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册