Skip to content
heliaRT
API reference
HELIA HUB

MicroProfiler

Record and report runtime profiling events.

Machine-readable model

class

MicroProfiler creates a common way to gain fine-grained insight into runtime performance.

tensorflow/lite/micro/micro_profiler.h:28

class MicroProfiler : public tflite::MicroProfilerInterface

MicroProfiler creates a common way to gain fine-grained insight into runtime performance. Bottleck operators can be identified along with slow code sections. This can be used in conjunction with running the relevant micro benchmark to evaluate end-to-end performance.

method

Marks the start of a new event and returns an event handle that can be used to mark the end of the event via EndEvent.

tensorflow/lite/micro/micro_profiler.h:36

virtual uint32_t tflite::MicroProfiler::BeginEvent(const char *tag)

Marks the start of a new event and returns an event handle that can be used to mark the end of the event via EndEvent. The lifetime of the tag parameter must exceed that of the MicroProfiler.

Parameters of BeginEvent
NameTypeDefaultDescription
tagconst char *Required
method

Marks the end of an event associated with eventhandle.

tensorflow/lite/micro/micro_profiler.h:45

virtual void tflite::MicroProfiler::EndEvent(uint32_t event_handle)

Marks the end of an event associated with event_handle. It is the responsibility of the caller to ensure than EndEvent is called once and only once per event_handle.

If EndEvent is called more than once for the same event_handle, the last call will be used as the end of event marker. If EndEvent is called 0 times for a particular event_handle, the duration of that event will be 0 ticks.

Parameters of EndEvent
NameTypeDefaultDescription
event_handleuint32_tRequired
method

Returns the sum of the ticks taken across all the events.

tensorflow/lite/micro/micro_profiler.h:53

uint32_t tflite::MicroProfiler::GetTotalTicks() const

Returns the sum of the ticks taken across all the events. This number is only meaningful if all of the events are disjoint (the end time of event[i] <= start time of event[i+1]).

method

Log

C++

Prints the profiling information of each of the events in human readable form.

tensorflow/lite/micro/micro_profiler.h:57

void tflite::MicroProfiler::Log() const

Prints the profiling information of each of the events in human readable form.

method

Prints the profiling information of each of the events in CSV (Comma Separated Value) form.

tensorflow/lite/micro/micro_profiler.h:61

void tflite::MicroProfiler::LogCsv() const

Prints the profiling information of each of the events in CSV (Comma Separated Value) form.

method

Prints total ticks for each unique tag in CSV format.

tensorflow/lite/micro/micro_profiler.h:66

void tflite::MicroProfiler::LogTicksPerTagCsv()

Prints total ticks for each unique tag in CSV format. Output will have one row for each unique tag along with the total ticks summed across all events with that particular tag.