MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetPeerAccessMap

Function GetPeerAccessMap

tensorflow/core/common_runtime/gpu/gpu_device.cc:1591–1610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1589
1590namespace {
1591std::unique_ptr<std::map<std::pair<PlatformGpuId, PlatformGpuId>, bool>>
1592GetPeerAccessMap(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

Callers 2

EnablePeerAccessMethod · 0.85
gpu_device.ccFile · 0.85

Calls 1

CanEnablePeerAccessToMethod · 0.45

Tested by

no test coverage detected