MCPcopy Create free account
hub / github.com/RenderKit/embree / TutorialBenchmark

Method TutorialBenchmark

tutorials/common/tutorial/benchmark.h:85–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83 }
84
85 TutorialBenchmark(BenchFunc func) :
86 commandLineParser(CommandLineParser(CommandLineParser::SILENT)),
87 func(func)
88 {
89 commandLineParser.registerOption("help", [this] (Ref<ParseStream> cin, const FileName& path) {
90 commandLineParser.printCommandLineHelp();
91 exit(1);
92 }, "--help: prints help for all supported command line options");
93 commandLineParser.registerOption("i", [&] (Ref<ParseStream> cin, const FileName& path) {
94 inputFile = cin->getString();
95 }, "-i <filepath>: .xml ");
96 commandLineParser.registerOption("c", [&] (Ref<ParseStream> cin, const FileName& path) {
97 inputFile = cin->getString();
98 }, "-c <filepath>: .ecs ");
99 commandLineParser.registerOption("benchmark", [&] (Ref<ParseStream> cin, const FileName& path) {
100 params.skipIterations = cin->getInt();
101 params.minTimeOrIterations = cin->getInt();
102 processedCommandLineOptions.push_back("--benchmark");
103 }, "--benchmark <N> <M>: run benchmark for M seconds (M iterations in legacy mode) with N iterations warm-up");
104 commandLineParser.registerOption("legacy", [&] (Ref<ParseStream> cin, const FileName& path) {
105 params.legacy = true;
106 processedCommandLineOptions.push_back("--legacy");
107 }, "--legacy: run old benchmark version (without google benchmark)");
108 commandLineParser.registerOption("benchmark_repetitions", [&] (Ref<ParseStream> cin, const FileName& path) {
109 params.repetitions = cin->getInt();
110 processedCommandLineOptions.push_back("--benchmark_repetitions");
111 }, "--benchmark_repetitions <R>: run R repetitions when using google benchmark");
112 commandLineParser.registerOption("benchmark_name", [&] (Ref<ParseStream> cin, const FileName& path) {
113 params.name = cin->getString();
114 processedCommandLineOptions.push_back("--benchmark_name");
115 }, "--benchmark_name <string>: override name of the benchmark");
116 }
117
118 TutorialBenchmark() : TutorialBenchmark(nullptr)
119 {

Callers

nothing calls this directly

Calls 6

CommandLineParserClass · 0.85
registerOptionMethod · 0.45
printCommandLineHelpMethod · 0.45
getStringMethod · 0.45
getIntMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected