| 32 | } |
| 33 | |
| 34 | std::string GetDeviceNamePrefix(const std::string& device_name) { |
| 35 | std::string prefix_token("device:GPU:"); |
| 36 | auto idx = device_name.find(prefix_token); |
| 37 | if (idx == std::string::npos) { |
| 38 | LOG(FATAL) << "Error device name, " << device_name; |
| 39 | } |
| 40 | std::string device_name_prefix = |
| 41 | device_name.substr(0, idx + prefix_token.length()); |
| 42 | |
| 43 | return device_name_prefix; |
| 44 | } |
| 45 | |
| 46 | } // namesapce |
| 47 |
no test coverage detected