Returns ParsedName whose address space (i.e. job, replica, task) identifies the address space directly accessible by the local process. If the address space is fully specified and it is exactly the same as the address space of a device, then all kernels of that device should be registered in the local process.
| 554 | // of a device, then all kernels of that device should be registered in the |
| 555 | // local process. |
| 556 | static const DeviceNameUtils::ParsedName LocalAddressSpec( |
| 557 | const Device* client_device, const Device* default_local_device) { |
| 558 | if (client_device != nullptr) { |
| 559 | return DeviceNameUtils::AddressSpace(client_device->parsed_name()); |
| 560 | } |
| 561 | |
| 562 | if (default_local_device != nullptr) { |
| 563 | return DeviceNameUtils::AddressSpace(default_local_device->parsed_name()); |
| 564 | } |
| 565 | |
| 566 | // TODO(b/139617593) Return the name of the first local device in device_set_ |
| 567 | // once we can trust the output of Device::IsLocal(). |
| 568 | return DeviceNameUtils::ParsedName(); |
| 569 | } |
| 570 | |
| 571 | ColocationGraph::ColocationGraph(const Graph* graph, const FunctionStack& stack, |
| 572 | const FunctionLibraryDefinition* flib_def, |
no test coverage detected