address review comments.
This commit is contained in:
parent
b885fb44dd
commit
9f5f278e83
@ -248,6 +248,7 @@ tflite_micro_cc_test(
|
|||||||
"micro_interpreter_test.cc",
|
"micro_interpreter_test.cc",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
|
":micro_compatibility",
|
||||||
":micro_framework",
|
":micro_framework",
|
||||||
":micro_utils",
|
":micro_utils",
|
||||||
":op_resolvers",
|
":op_resolvers",
|
||||||
|
@ -84,14 +84,14 @@ int main(int argc, char** argv) {
|
|||||||
CreateBenchmarkRunner(&profiler);
|
CreateBenchmarkRunner(&profiler);
|
||||||
profiler.EndEvent(event_handle);
|
profiler.EndEvent(event_handle);
|
||||||
profiler.Log();
|
profiler.Log();
|
||||||
MicroPrintf("");
|
MicroPrintf(""); // null MicroPrintf serves as a newline.
|
||||||
|
|
||||||
tflite::KeywordRunNIerations(1, "KeywordRunNIerations(1)", *benchmark_runner,
|
tflite::KeywordRunNIerations(1, "KeywordRunNIerations(1)", *benchmark_runner,
|
||||||
profiler);
|
profiler);
|
||||||
profiler.Log();
|
profiler.Log();
|
||||||
MicroPrintf("");
|
MicroPrintf(""); // null MicroPrintf serves as a newline.
|
||||||
|
|
||||||
tflite::KeywordRunNIerations(10, "KeywordRunNIerations(10)",
|
tflite::KeywordRunNIerations(10, "KeywordRunNIerations(10)",
|
||||||
*benchmark_runner, profiler);
|
*benchmark_runner, profiler);
|
||||||
MicroPrintf("");
|
MicroPrintf(""); // null MicroPrintf serves as a newline.
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "tensorflow/lite/core/api/flatbuffer_conversions.h"
|
#include "tensorflow/lite/core/api/flatbuffer_conversions.h"
|
||||||
#include "tensorflow/lite/micro/all_ops_resolver.h"
|
#include "tensorflow/lite/micro/all_ops_resolver.h"
|
||||||
|
#include "tensorflow/lite/micro/compatibility.h"
|
||||||
#include "tensorflow/lite/micro/micro_error_reporter.h"
|
#include "tensorflow/lite/micro/micro_error_reporter.h"
|
||||||
#include "tensorflow/lite/micro/micro_profiler.h"
|
#include "tensorflow/lite/micro/micro_profiler.h"
|
||||||
#include "tensorflow/lite/micro/micro_utils.h"
|
#include "tensorflow/lite/micro/micro_utils.h"
|
||||||
@ -46,6 +47,8 @@ class MockProfiler : public MicroProfiler {
|
|||||||
private:
|
private:
|
||||||
int event_starts_;
|
int event_starts_;
|
||||||
int event_ends_;
|
int event_ends_;
|
||||||
|
|
||||||
|
TF_LITE_REMOVE_VIRTUAL_DELETE
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -18,6 +18,8 @@ limitations under the License.
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
#include "tensorflow/lite/micro/compatibility.h"
|
||||||
|
|
||||||
namespace tflite {
|
namespace tflite {
|
||||||
|
|
||||||
// MicroProfiler creates a common way to gain fine-grained insight into runtime
|
// MicroProfiler creates a common way to gain fine-grained insight into runtime
|
||||||
@ -27,7 +29,7 @@ namespace tflite {
|
|||||||
class MicroProfiler {
|
class MicroProfiler {
|
||||||
public:
|
public:
|
||||||
MicroProfiler() = default;
|
MicroProfiler() = default;
|
||||||
~MicroProfiler() = default;
|
virtual ~MicroProfiler() = default;
|
||||||
|
|
||||||
// Marks the start of a new event and returns an event handle that can be used
|
// 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
|
// to mark the end of the event via EndEvent. The lifetime of the tag
|
||||||
@ -64,6 +66,8 @@ class MicroProfiler {
|
|||||||
int32_t start_ticks_[kMaxEvents];
|
int32_t start_ticks_[kMaxEvents];
|
||||||
int32_t end_ticks_[kMaxEvents];
|
int32_t end_ticks_[kMaxEvents];
|
||||||
int num_events_ = 0;
|
int num_events_ = 0;
|
||||||
|
|
||||||
|
TF_LITE_REMOVE_VIRTUAL_DELETE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(NDEBUG)
|
#if defined(NDEBUG)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user