| 65 | .GetOrRegisterGlobalDeviceTypeId(dev_type)) {} |
| 66 | |
| 67 | std::string Place::DebugString() const { |
| 68 | std::ostringstream os; |
| 69 | os << "Place("; |
| 70 | if (alloc_type_ == AllocationType::CUSTOM) { |
| 71 | os << phi::CustomRegisteredDeviceMap::Instance().GetGlobalDeviceType( |
| 72 | device_type_id_); |
| 73 | } else { |
| 74 | os << AllocationTypeStr(alloc_type_); |
| 75 | } |
| 76 | if (alloc_type_ == AllocationType::GPUPINNED || |
| 77 | alloc_type_ == AllocationType::XPUPINNED || |
| 78 | alloc_type_ == AllocationType::CPU) { |
| 79 | os << ")"; |
| 80 | } else { |
| 81 | os << ":" << std::to_string(device) << ")"; |
| 82 | } |
| 83 | return os.str(); |
| 84 | } |
| 85 | |
| 86 | std::ostream &operator<<(std::ostream &os, const Place &p) { |
| 87 | os << p.DebugString(); |
no test coverage detected