MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / SupportedOpsMain

Function SupportedOpsMain

tensorflow/compiler/tf2xla/tf2xla_supported_ops.cc:69–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67} // namespace
68
69void SupportedOpsMain(int argc, char** argv, const char* regen_run) {
70 std::vector<string> device_names = XlaOpRegistry::BackendNames();
71 std::sort(device_names.begin(), device_names.end());
72
73 // Set up and parse flags.
74 string device;
75 std::vector<Flag> flag_list = {
76 {"device", &device,
77 "Name of the compilation device for which to print supported ops, "
78 "one of: " +
79 absl::StrJoin(device_names, ",")},
80 };
81 string usage = Flags::Usage(argv[0], flag_list);
82 bool parsed_flags_ok = Flags::Parse(&argc, argv, flag_list);
83 QCHECK(parsed_flags_ok) << "\n" << usage;
84 QCHECK(XlaOpRegistry::IsBackendRegistered(device))
85 << "\nUnknown device: " << device << "\n"
86 << usage;
87
88 // Run the program.
89 port::InitMain(usage.c_str(), &argc, &argv);
90 QCHECK(argc == 1) << "\nERROR: This command does not take any arguments "
91 "other than flags\n\n"
92 << usage;
93 PrintSupportedOps(device, regen_run);
94}
95
96} // namespace tf2xla
97} // namespace tensorflow

Callers 1

mainFunction · 0.85

Calls 8

sortFunction · 0.85
UsageFunction · 0.85
ParseFunction · 0.85
PrintSupportedOpsFunction · 0.85
c_strMethod · 0.80
InitMainFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected