Caffe2 - C++ API
A deep learning, cross platform ML framework
benchmark.h
1 #pragma once
2 #include "caffe2/core/logging.h"
3 #include "caffe2/predictor/emulator/emulator.h"
4 #include "caffe2/predictor/emulator/output_formatter.h"
5 #include "caffe2/predictor/emulator/profiler.h"
6 
7 C10_DECLARE_int(warmup);
8 C10_DECLARE_int(iter);
9 C10_DECLARE_int(threads);
10 C10_DECLARE_int(runs);
11 C10_DECLARE_string(run_net);
12 C10_DECLARE_string(init_net);
13 C10_DECLARE_string(data_net);
14 C10_DECLARE_string(input_dims);
15 C10_DECLARE_string(input_types);
16 
17 namespace caffe2 {
18 namespace emulator {
19 
21  std::unique_ptr<Profiler> profiler;
22  std::unique_ptr<Emulator> emulator;
23  std::unique_ptr<OutputFormatter> formatter;
24 };
25 
26 /*
27  * benchmark runner takes an @emulator to run nets.
28  * The runtime will be measured by @profiler.
29  * The output will be formatted by @formatter
30  */
32  public:
33  void benchmark(const BenchmarkParam& param);
34 
35  virtual ~BenchmarkRunner() noexcept {}
36 
37  protected:
38  virtual void pre_benchmark_setup() {}
39 
40  virtual void post_benchmark_cleanup() {}
41 };
42 
43 } // namespace emulator
44 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13