static */
| 329 | } |
| 330 | |
| 331 | /* static */ bool GpuDriver::GetDeviceName(CUdevice device, |
| 332 | string* device_name) { |
| 333 | static const size_t kCharLimit = 64; |
| 334 | absl::InlinedVector<char, 4> chars(kCharLimit); |
| 335 | CUresult res = cuDeviceGetName(chars.begin(), kCharLimit - 1, device); |
| 336 | if (res != CUDA_SUCCESS) { |
| 337 | LOG(ERROR) << "failed to get device name for " << device << ": " |
| 338 | << ToString(res); |
| 339 | return false; |
| 340 | } |
| 341 | chars[kCharLimit - 1] = '\0'; |
| 342 | *device_name = chars.begin(); |
| 343 | return true; |
| 344 | } |
| 345 | |
| 346 | bool DeviceOptionsToContextFlags(const DeviceOptions& device_options, |
| 347 | int* flags) { |