| 496 | } |
| 497 | |
| 498 | Status EagerContext::FindDeviceFromName(const char* device_name, |
| 499 | Device** device) const { |
| 500 | *device = HostCPU(); |
| 501 | if (device_name == nullptr || strlen(device_name) == 0) { |
| 502 | return Status::OK(); |
| 503 | } |
| 504 | |
| 505 | auto status = local_device_mgr()->LookupDevice(device_name, device); |
| 506 | if (status.ok()) { |
| 507 | return status; |
| 508 | } |
| 509 | |
| 510 | if (remote_device_mgr() != nullptr) { |
| 511 | return remote_device_mgr()->LookupDevice(device_name, device); |
| 512 | } |
| 513 | |
| 514 | return status; |
| 515 | } |
| 516 | |
| 517 | bool EagerContext::OnSameTask(const Device* first, const Device* second) const { |
| 518 | if (first == nullptr) first = HostCPU(); |
no test coverage detected