| 73 | } |
| 74 | |
| 75 | int64_t SubTskGphBuilderUtil::GetDistance( |
| 76 | const int64_t src_machine_id, const int64_t src_dev_phy_id, const DeviceType src_device_type, |
| 77 | const int64_t dst_machine_id, const int64_t dst_dev_phy_id, const DeviceType dst_device_type) { |
| 78 | if (src_machine_id != dst_machine_id) { |
| 79 | return kDistanceDiffMachine; |
| 80 | } else if (src_device_type != dst_device_type) { |
| 81 | return kDistanceSameMachine; |
| 82 | } else if (src_device_type == DeviceType::kCPU) { |
| 83 | return kDistanceSameDevice; |
| 84 | } else { |
| 85 | if (src_dev_phy_id == dst_dev_phy_id) { |
| 86 | return kDistanceSameDevice; |
| 87 | } else { |
| 88 | return kDistanceSameMachine; |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | int64_t SubTskGphBuilderUtil::GetDistance(const ParallelDesc& src_parallel_desc, |
| 94 | const int64_t src_parallel_id, |
nothing calls this directly
no test coverage detected