MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / main

Function main

lite/example/cpp_example/main.cpp:116–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116int main(int argc, char** argv) {
117 set_log_level(LiteLogLevel::WARN);
118 auto&& args = Args::from_argv(argc, argv);
119 if (args.args_parse_ret)
120 return -1;
121 auto map = get_example_function_map();
122 auto example = (*map)[args.example_name];
123 if (example) {
124 printf("Begin to run %s example.\n", args.example_name.c_str());
125 if (example(args)) {
126 return 0;
127 } else {
128 return -1;
129 }
130 } else {
131 printf("The example of %s is not registed.", args.example_name.c_str());
132 return -1;
133 }
134}
135
136// vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}}

Callers

nothing calls this directly

Calls 1

set_log_levelFunction · 0.50

Tested by

no test coverage detected