From the main function, say:
1, the GFlags library is the main function set usage information is the repository of Google's open-source Processor command line. In a folder file that uses command-line parameters (source or head file), the definition of the variable is first used in the following definition. Define_int32, Define_int64, Define_bool, etc., the Language law: Define_int32 (Name,default_value, "description"). Then you can use the Flags_name variable, the value of which is the command line to pass the parameters, regardless of the value, in other code files if you want to use the command parameters, can be used Declare_int32 (name) (Name for int32 type, Other supported types can also be used)
2, the main function, the Getbrewfunction function, under the standard instruction, the main function will execute Getbrewfunction function.
In Caffe.cpp, some brewfunction functions are established and registered into the container g_brew_map by registerbrewfunction (function):
int device_query (): Used to query GPU information
int train (): Training neural network
int time (): Test model execution times
The Getbrewfunction function finds the corresponding function pointer in the G_BREW_MAP container and returns it through the Caffe command after the first argument.
Caffe source code Read (iii) caffe.cpp