| 713 | } // namespace xla |
| 714 | |
| 715 | int main(int argc, char** argv) { |
| 716 | xla::tools::Options opts; |
| 717 | opts.browser = "/usr/bin/sensible-browser"; |
| 718 | bool need_help = false; |
| 719 | const std::vector<tensorflow::Flag> flag_list = { |
| 720 | tensorflow::Flag("hlo_snapshot", &opts.hlo_snapshot, |
| 721 | "HloSnapshot proto to interactively dump to graphviz"), |
| 722 | tensorflow::Flag("hlo_proto", &opts.hlo_proto, |
| 723 | "XLA hlo proto to interactively dump to graphviz"), |
| 724 | tensorflow::Flag("hlo_text", &opts.hlo_text, |
| 725 | "XLA hlo proto to interactively dump to graphviz"), |
| 726 | tensorflow::Flag("platform", &opts.platform, |
| 727 | "Platform to compile for: CPU, CUDA, etc"), |
| 728 | tensorflow::Flag("browser", &opts.browser, |
| 729 | "Path to web browser used to display produced graphs."), |
| 730 | tensorflow::Flag("help", &need_help, "Prints this help message"), |
| 731 | }; |
| 732 | xla::string usage = tensorflow::Flags::Usage(argv[0], flag_list); |
| 733 | bool parse_ok = tensorflow::Flags::Parse(&argc, argv, flag_list); |
| 734 | tensorflow::port::InitMain(argv[0], &argc, &argv); |
| 735 | if (argc != 1 || !parse_ok || need_help) { |
| 736 | LOG(QFATAL) << usage; |
| 737 | } |
| 738 | xla::tools::RealMain(opts); |
| 739 | return 0; |
| 740 | } |