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

Method Application

tutorials/common/tutorial/application.cpp:38–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 }
37
38 Application::Application(int features)
39 : rtcore(""), verbosity(0),
40 features((Features)features),
41 log_delta(false),
42 start_time(getSeconds()),
43 last_time(start_time),
44 last_virtual_memory(0),
45 last_resident_memory(0)
46 {
47 if (instance)
48 throw std::runtime_error("internal error: application already created");
49
50 instance = this;
51
52 registerOption("help", [this] (Ref<ParseStream> cin, const FileName& path) {
53 printCommandLineHelp();
54 exit(1);
55 }, "--help: prints help for all supported command line options");
56
57 if (features & FEATURE_RTCORE)
58 {
59 registerOption("rtcore", [this] (Ref<ParseStream> cin, const FileName& path) {
60 rtcore += "," + cin->getString();
61 }, "--rtcore <string>: uses <string> to configure Embree device");
62
63 registerOption("threads", [this] (Ref<ParseStream> cin, const FileName& path) {
64 rtcore += ",threads=" + toString(cin->getInt());
65 }, "--threads <int>: number of threads to use");
66
67 registerOption("affinity", [this] (Ref<ParseStream> cin, const FileName& path) {
68 rtcore += ",set_affinity=1";
69 }, "--affinity: affinitize threads");
70
71 registerOption("set_affinity", [this] (Ref<ParseStream> cin, const FileName& path) {
72 rtcore += ",set_affinity=" + cin->getString();
73 }, "--set_affinity <0/1>: enables or disables affinitizing of threads");
74 registerOptionAlias("set_affinity","set-affinity");
75
76 registerOption("start_threads", [this] (Ref<ParseStream> cin, const FileName& path) {
77 rtcore += ",start_threads=" + cin->getString();
78 }, "--start_threads <0/1>: starts threads at device creation time if set to 1");
79 registerOptionAlias("start_threads","start-threads");
80
81 registerOption("verbose", [this] (Ref<ParseStream> cin, const FileName& path) {
82 verbosity = cin->getInt();
83 rtcore += ",verbose=" + toString(verbosity);
84 }, "--verbose <int>: sets verbosity level");
85
86 registerOption("delta", [this] (Ref<ParseStream> cin, const FileName& path) {
87 log_delta = true;
88 }, "--delta: print delta numbers in log");
89
90 registerOption("isa", [this] (Ref<ParseStream> cin, const FileName& path) {
91 rtcore += ",isa=" + cin->getString();
92 }, "--isa <string>: selects instruction set to use:\n"
93 " sse: select SSE codepath\n"
94 " sse2: select SSE2 codepath\n"
95 " sse3: select SSE3 codepath\n"

Callers

nothing calls this directly

Calls 4

getSecondsFunction · 0.85
toStringFunction · 0.85
getStringMethod · 0.45
getIntMethod · 0.45

Tested by

no test coverage detected