| 1683 | } // namespace tensorflow |
| 1684 | |
| 1685 | int main(int argc, char** argv) { |
| 1686 | tensorflow::xla_test_device_ptr = new tensorflow::string("XLA_CPU"); |
| 1687 | tensorflow::xla_platform_ptr = new tensorflow::string("CPU"); |
| 1688 | std::vector<tensorflow::Flag> flag_list = { |
| 1689 | tensorflow::Flag("xla_test_device", tensorflow::xla_test_device_ptr, |
| 1690 | "Tensorflow device type to use for test, e.g., XLA_CPU"), |
| 1691 | tensorflow::Flag("xla_platform", tensorflow::xla_platform_ptr, |
| 1692 | "The XLA platform to select for the device"), |
| 1693 | }; |
| 1694 | tensorflow::string usage = tensorflow::Flags::Usage(argv[0], flag_list); |
| 1695 | const bool parse_result = tensorflow::Flags::Parse(&argc, argv, flag_list); |
| 1696 | if (!parse_result) { |
| 1697 | LOG(ERROR) << "\n" << usage; |
| 1698 | return 2; |
| 1699 | } |
| 1700 | testing::InitGoogleTest(&argc, argv); |
| 1701 | if (argc > 1) { |
| 1702 | LOG(ERROR) << "Unknown argument " << argv[1] << "\n" << usage; |
| 1703 | return 2; |
| 1704 | } |
| 1705 | return RUN_ALL_TESTS(); |
| 1706 | } |