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

Function CurrentDeviceOrDie

tensorflow/stream_executor/rocm/rocm_driver.cc:148–155  ·  view source on GitHub ↗

Returns the current device set in HIP. This is done by calling the HIP driver (e.g., this value is not our cached view of the current device).

Source from the content-addressed store, hash-verified

146// Returns the current device set in HIP. This is done by calling the
147// HIP driver (e.g., this value is not our cached view of the current device).
148static int CurrentDeviceOrDie() {
149 int current = -1;
150 hipError_t result = tensorflow::wrap::hipGetDevice(&current);
151 if (result != hipSuccess) {
152 LOG(FATAL) << "failed to query current device: " << ToString(result);
153 }
154 return current;
155}
156
157namespace {
158

Callers 2

ScopedActivateContextMethod · 0.85

Calls 1

ToStringFunction · 0.70

Tested by

no test coverage detected