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

Method GetDeviceName

tensorflow/stream_executor/rocm/rocm_driver.cc:335–349  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

ToStringFunction · 0.70
beginMethod · 0.45

Tested by

no test coverage detected