Returns a fully qualified device name given the parameters.
| 87 | |
| 88 | // Returns a fully qualified device name given the parameters. |
| 89 | static string DeviceName(const string& job, int replica, int task, |
| 90 | const string& device_prefix, const string& device_type, |
| 91 | int id) { |
| 92 | CHECK(IsJobName(job)) << job; |
| 93 | CHECK_LE(0, replica); |
| 94 | CHECK_LE(0, task); |
| 95 | CHECK(!device_type.empty()); |
| 96 | CHECK_LE(0, id); |
| 97 | return strings::StrCat("/job:", job, "/replica:", replica, "/task:", task, |
| 98 | device_prefix, device_type, ":", id); |
| 99 | } |
| 100 | |
| 101 | /* static */ |
| 102 | string DeviceNameUtils::FullName(const string& job, int replica, int task, |
no test coverage detected