static */
| 333 | } |
| 334 | |
| 335 | /* static */ bool GpuDriver::GetDeviceName(hipDevice_t device, |
| 336 | string* device_name) { |
| 337 | static const size_t kCharLimit = 64; |
| 338 | absl::InlinedVector<char, 4> chars(kCharLimit); |
| 339 | hipError_t res = |
| 340 | tensorflow::wrap::hipDeviceGetName(chars.begin(), kCharLimit - 1, device); |
| 341 | if (res != hipSuccess) { |
| 342 | LOG(ERROR) << "failed to get device name for " << device << ": " |
| 343 | << ToString(res); |
| 344 | return false; |
| 345 | } |
| 346 | chars[kCharLimit - 1] = '\0'; |
| 347 | *device_name = chars.begin(); |
| 348 | return true; |
| 349 | } |
| 350 | |
| 351 | bool DeviceOptionsToContextFlags(const DeviceOptions& device_options, |
| 352 | int* flags) { |