MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / EndEvent

Method EndEvent

tensorflow/lite/profiling/profile_buffer.h:87–101  ·  view source on GitHub ↗

Sets the end timestamp for event for the handle to current time. If the buffer is disabled or previous event has been overwritten this operation has not effect.

Source from the content-addressed store, hash-verified

85 // If the buffer is disabled or previous event has been overwritten this
86 // operation has not effect.
87 void EndEvent(uint32_t event_handle) {
88 if (!enabled_ || event_handle == kInvalidEventHandle ||
89 event_handle > current_index_) {
90 return;
91 }
92 const uint32_t max_size = event_buffer_.size();
93 if (current_index_ > (max_size + event_handle)) {
94 // Ignore, buffer has already overflowed.
95 fprintf(stderr, "Warning: Dropping ProfileBuffer event.\n");
96 return;
97 }
98
99 int event_index = event_handle % max_size;
100 event_buffer_[event_index].end_timestamp_us = time::NowMicros();
101 }
102
103 // Returns the size of the buffer.
104 size_t Size() const {

Callers

nothing calls this directly

Calls 2

NowMicrosFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected