diff options
Diffstat (limited to 'lib/layer_by_layer_profiler')
-rw-r--r-- | lib/layer_by_layer_profiler/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/layer_by_layer_profiler/src/layer_by_layer_profiler.cpp | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/layer_by_layer_profiler/CMakeLists.txt b/lib/layer_by_layer_profiler/CMakeLists.txt index 9774685..7a16da2 100644 --- a/lib/layer_by_layer_profiler/CMakeLists.txt +++ b/lib/layer_by_layer_profiler/CMakeLists.txt @@ -21,6 +21,6 @@ if (NOT TARGET ethosu_core_driver) endif() add_library(layer_by_layer_profiler INTERFACE) -target_link_libraries(layer_by_layer_profiler INTERFACE ethosu_core_driver tflu event_recorder) +target_link_libraries(layer_by_layer_profiler INTERFACE ethosu_core_driver tflu event_recorder ethosu_log) target_include_directories(layer_by_layer_profiler INTERFACE include) target_sources(layer_by_layer_profiler INTERFACE src/layer_by_layer_profiler.cpp) diff --git a/lib/layer_by_layer_profiler/src/layer_by_layer_profiler.cpp b/lib/layer_by_layer_profiler/src/layer_by_layer_profiler.cpp index f7922cb..0211414 100644 --- a/lib/layer_by_layer_profiler/src/layer_by_layer_profiler.cpp +++ b/lib/layer_by_layer_profiler/src/layer_by_layer_profiler.cpp @@ -23,6 +23,7 @@ #include <string.h> +#include "ethosu_log.h" #include "layer_by_layer_profiler.hpp" #include <ethosu_driver.h> #include <inttypes.h> @@ -88,9 +89,9 @@ void LayerByLayerProfiler::EndEvent(uint32_t event_handle) { } if (backend_ == PRINTF) { - printf("%s : cycle_cnt : %" PRIu64 " cycles\n", - tags_[event_handle], - end_ticks_[event_handle] - start_ticks_[event_handle]); + LOG("%s : cycle_cnt : %" PRIu64 " cycles\n", + tags_[event_handle], + end_ticks_[event_handle] - start_ticks_[event_handle]); } else { EventRecord2(event_id_, (int32_t)event_handle, end_ticks_[event_handle] - start_ticks_[event_handle]); } @@ -112,7 +113,7 @@ void LayerByLayerProfiler::Log() const { if (backend_ == PRINTF) { for (size_t i = 0; i < num_events_; ++i) { uint64_t ticks = end_ticks_[i] - start_ticks_[i]; - printf("%s took %" PRIu64 " cycles\n", tags_[i], ticks); + LOG("%s took %" PRIu64 " cycles", tags_[i], ticks); } } #endif |