summaryrefslogtreecommitdiff
path: root/externals/CMakeLists.txt
diff options
context:
space:
mode:
author이상규/동작제어Lab(SR)/Principal Engineer/삼성전자 <sg5.lee@samsung.com>2018-08-09 10:21:39 +0900
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>2018-08-09 10:21:39 +0900
commit640f05feba2c4b54e55c205bce646bfa323bb1e5 (patch)
treee0719555ab61e4bba83aaeb0d091611fdcd5a724 /externals/CMakeLists.txt
parentd1fc4074bc2f8af76088fe3518e57bda34b152bd (diff)
downloadnnfw-640f05feba2c4b54e55c205bce646bfa323bb1e5.tar.gz
nnfw-640f05feba2c4b54e55c205bce646bfa323bb1e5.tar.bz2
nnfw-640f05feba2c4b54e55c205bce646bfa323bb1e5.zip
Introduce BUILD_TFLITE_BENCHMARK_MODEL option (#2226)
Related Issue: #1760, #1696 `tflite_benchmark_model` is a tool for profiling a given model. The tools is under development in tensorflow upstream. It was not shipped in v1.9.0 release. Thus I made `tflite_benchmark_model` work for tflite interpreter by chery-picking needed patches. (#2212) This patch is a part of full changes. It only introduces build option. By default, tflite_benchmark_model will not be built. To build tflite_benchmark_model tool, use ``` $ OPTIONS='-DBUILD_PURE_ARM_COMPUTE=ON -DBUILD_TFLITE_BENCHMARK_MODEL=ON' \ CROSS_BUILD=1 TARGET_ARCH=armv7l make all install ``` Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
Diffstat (limited to 'externals/CMakeLists.txt')
-rw-r--r--externals/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index 9c99c01cc..26cc1b4f2 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -39,6 +39,15 @@ list(APPEND TFLITE_SRCS ${TFLITE_KERNEL_SRCS})
list(APPEND TFLITE_SRCS "${TFLITE_DEPEND_DIR}/farmhash/src/farmhash.cc")
+# Profiling
+if(BUILD_TFLITE_BENCHMARK_MODEL)
+ file(GLOB TFLITE_PROFILING_SRCS "${TENSORFLOW_LITE_BASE}/profiling/*.cc")
+ file(GLOB TFLITE_PROFILING_TESTS "${TENSORFLOW_LITE_BASE}/profiling/*test*.cc")
+ list(REMOVE_ITEM TFLITE_PROFILING_SRCS ${TFLITE_PROFILING_TESTS})
+ list(APPEND TFLITE_PROFILING_SRCS "${TENSORFLOW_BASE}/tensorflow/core/util/stats_calculator.cc")
+ list(APPEND TFLITE_SRCS ${TFLITE_PROFILING_SRCS})
+endif()
+
list(APPEND TFLITE_INCLUDES "${TFLITE_DEPEND_DIR}/")
list(APPEND TFLITE_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/tensorflow")
list(APPEND TFLITE_INCLUDES "${TFLITE_DEPEND_DIR}/gemmlowp")
@@ -77,6 +86,9 @@ endif()
add_library(tensorflow-lite ${TFLITE_SRCS})
target_include_directories(tensorflow-lite PUBLIC ${TFLITE_INCLUDES})
target_compile_definitions(tensorflow-lite PUBLIC "GEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK")
+if(BUILD_TFLITE_BENCHMARK_MODEL)
+ target_compile_definitions(tensorflow-lite PUBLIC "TFLITE_PROFILING_ENABLED")
+endif()
target_link_libraries(tensorflow-lite eigen3 ${LIB_PTHREAD} dl)
if("${TARGET_OS}" STREQUAL "android")