| 1589 | |
| 1590 | namespace { |
| 1591 | std::unique_ptr<std::map<std::pair<PlatformGpuId, PlatformGpuId>, bool>> |
| 1592 | GetPeerAccessMap(se::Platform* platform, |
| 1593 | const std::vector<PlatformGpuId>& visible_gpu_order) { |
| 1594 | std::unique_ptr<std::map<std::pair<PlatformGpuId, PlatformGpuId>, bool>> map( |
| 1595 | new std::map<std::pair<PlatformGpuId, PlatformGpuId>, bool>); |
| 1596 | for (PlatformGpuId platform_gpu_i : visible_gpu_order) { |
| 1597 | for (PlatformGpuId platform_gpu_j : visible_gpu_order) { |
| 1598 | se::StreamExecutor* from = |
| 1599 | GpuIdUtil::ExecutorForPlatformGpuId(platform, platform_gpu_i) |
| 1600 | .ValueOrDie(); |
| 1601 | se::StreamExecutor* to = |
| 1602 | GpuIdUtil::ExecutorForPlatformGpuId(platform, platform_gpu_j) |
| 1603 | .ValueOrDie(); |
| 1604 | (*map)[{platform_gpu_i, platform_gpu_j}] = |
| 1605 | from->CanEnablePeerAccessTo(to); |
| 1606 | } |
| 1607 | } |
| 1608 | |
| 1609 | return map; |
| 1610 | } |
| 1611 | |
| 1612 | } // namespace |
| 1613 |
no test coverage detected