19 #include "c10/util/Flags.h" 20 #include "caffe2/core/init.h" 21 #include "caffe2/core/logging.h" 22 #include "caffe2/core/operator.h" 23 #include "caffe2/proto/caffe2_pb.h" 24 #include "caffe2/utils/proto_utils.h" 26 C10_DEFINE_string(plan,
"",
"The given path to the plan protobuffer.");
28 int main(
int argc,
char** argv) {
31 MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_ret);
32 if (mpi_ret != MPI_THREAD_MULTIPLE &&
33 mpi_ret != MPI_THREAD_SERIALIZED) {
34 std::cerr <<
"Caffe2 MPI requires the underlying MPI to support the " 35 "MPI_THREAD_SERIALIZED or MPI_THREAD_MULTIPLE mode.\n";
39 LOG(INFO) <<
"Loading plan: " << FLAGS_plan;
40 caffe2::PlanDef plan_def;
41 CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_plan, &plan_def));
43 workspace->RunPlan(plan_def);
46 caffe2::ShutdownProtobufLibrary();
C10_API void SetUsageMessage(const std::string &str)
Sets the usage message when a commandline tool is called with "--help".
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
bool GlobalInit(int *pargc, char ***pargv)
Initialize the global environment of caffe2.