Skip to content

Commit

Permalink
Add LogTicksPerTagCsv() back
Browse files Browse the repository at this point in the history
  • Loading branch information
andresovela committed Oct 21, 2024
1 parent 8911d4c commit ec67287
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tensorflow/lite/micro/micro_profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@ class MicroProfiler : public MicroProfilerInterface {
#endif // !defined(TF_LITE_STRIP_ERROR_STRINGS)
}

// Prints the profiling information of each of the events in CSV format.
void LogCsv() const { Log(MicroProfilerLogFormat::Csv); }

// Prints the profiling information of each of the events in human readable
// form, grouped per tag, sorted by execution time.
// Prints the profiling information of each of the events, grouped by tag.
void LogGrouped(MicroProfilerLogFormat format) {
#if !defined(TF_LITE_STRIP_ERROR_STRINGS)
for (int i = 0; i < num_events_; ++i) {
Expand Down Expand Up @@ -173,6 +169,12 @@ class MicroProfiler : public MicroProfilerInterface {
#endif // !defined(TF_LITE_STRIP_ERROR_STRINGS)
}

// Convenience function to call Log with CSV format.
void LogCsv() const { Log(MicroProfilerLogFormat::Csv); }

// Convenience function to call LogGrouped with CSV format.
void LogTicksPerTagCsv() const { LogGrouped(MicroProfilerLogFormat::Csv); }

private:
const char* tags_[MAX_EVENTS];
uint32_t start_ticks_[MAX_EVENTS];
Expand Down

0 comments on commit ec67287

Please sign in to comment.