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

Method GetDeviceName

tensorflow/stream_executor/cuda/cuda_driver.cc:331–344  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

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
346bool DeviceOptionsToContextFlags(const DeviceOptions& device_options,
347 int* flags) {

Callers

nothing calls this directly

Calls 2

ToStringFunction · 0.70
beginMethod · 0.45

Tested by

no test coverage detected