list(APPEND TFLITE_SRCS ${TFLITE_LIB_SRCS})
list(APPEND TFLITE_SRCS ${TFLITE_API_SRCS})
+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})
+
+ # We will use our won summarizer
+ list(REMOVE_ITEM TFLITE_PROFILING_SRCS "${TENSORFLOW_LITE_BASE}/profiling/profile_summarizer.cc")
+ list(APPEND TFLITE_SRCS ${TFLITE_PROFILING_SRCS})
+endif(BUILD_TFLITE_BENCHMARK_MODEL)
+
list(APPEND TFLITE_SRCS "${TFLITE_DEPEND_DIR}/farmhash/src/farmhash.cc")
list(APPEND TFLITE_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/tensorflow")
list(APPEND NNFW_UTILITY_SRCS src/tensor/NonIncreasingStride.cpp)
list(APPEND NNFW_UTILITY_SRCS src/tensor/IndexFormatter.cpp)
list(APPEND NNFW_UTILITY_SRCS src/tensor/Comparator.cpp)
-list(APPEND NNFW_UTILITY_SRCS src/profiling/time.cc)
add_library(nnfw_lib_misc STATIC ${NNFW_UTILITY_SRCS})
target_include_directories(nnfw_lib_misc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
--- /dev/null
+file(GLOB_RECURSE SOURCES "src/*.cpp")
+
+add_library(nnfw_lib_profiling STATIC ${SOURCES})
+set_property(TARGET nnfw_lib_profiling PROPERTY POSITION_INDEPENDENT_CODE ON)
+target_include_directories(nnfw_lib_profiling PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
#include <cstddef>
#include <cstdint>
-#include "util/profiling/time.h"
+#include "profiling/time.h"
namespace tflite {
namespace profiling {
#include <vector>
-#include "util/profiling/profile_buffer.h"
+#include "profiling/profile_buffer.h"
#ifdef TFLITE_PROFILING_ENABLED
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
-#include "util/profiling/time.h"
+
+// NOTE To minimize diff with upstream tensorflow, disable clang-format
+// clang-format off
+
+// NOTE This header is derived from the following file (in TensorFlow v1.12)
+// 'externals/tensorflow/tensorflow/contrib/lite/profiling/time.cpp
+#include "profiling/time.h"
#if defined(_MSC_VER)
#include <chrono> // NOLINT(build/c++11)
} // namespace time
} // namespace profiling
} // namespace tflite
+
+// clang-format on
if(BUILD_TFLITE_BENCHMARK_MODEL)
target_compile_definitions(nnapi_pure_arm_compute PUBLIC "TFLITE_PROFILING_ENABLED")
endif()
-target_link_libraries(nnapi_pure_arm_compute arm_compute)
-target_link_libraries(nnapi_pure_arm_compute arm_compute_ex)
-target_link_libraries(nnapi_pure_arm_compute nnfw_lib_misc)
-target_link_libraries(nnapi_pure_arm_compute nnfw_lib_cpp14)
+target_link_libraries(nnapi_pure_arm_compute arm_compute arm_compute_ex)
+target_link_libraries(nnapi_pure_arm_compute nnfw_lib_cpp14 nnfw_lib_misc nnfw_lib_profiling)
if("${TARGET_OS}" STREQUAL "android")
target_link_libraries(nnapi_pure_arm_compute log)
#include "compilation.h"
#include "execution.h"
-#include "util/profiling/profiling.h"
-#include "util/profiling/profiler.h"
+#include "profiling/profiling.h"
+#include "profiling/profiler.h"
#include "event.h"
#include "internal/VectorSource.h"
add_executable(tflite_benchmark_model ${SOURCES})
target_compile_definitions(tflite_benchmark_model PUBLIC "TFLITE_PROFILING_ENABLED")
-target_link_libraries(tflite_benchmark_model tensorflow-lite ${LIB_PTHREAD} dl nnfw_lib_misc nnfw_lib_tflite)
+target_link_libraries(tflite_benchmark_model nnfw_lib_misc nnfw_lib_tflite nnfw_lib_profiling)
+target_link_libraries(tflite_benchmark_model tensorflow-lite ${LIB_PTHREAD} dl)
install(TARGETS tflite_benchmark_model DESTINATION bin)
#include "tensorflow/contrib/lite/tools/benchmark/logging.h"
// For profiling nnapi_delegate
-#include "util/profiling/profiling.h"
+#include "profiling/profiling.h"
#include "tflite/ext/nnapi_delegate.h"
namespace {