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).
| 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). |
| 148 | static int CurrentDeviceOrDie() { |
| 149 | int current = -1; |
| 150 | hipError_t result = tensorflow::wrap::hipGetDevice(¤t); |
| 151 | if (result != hipSuccess) { |
| 152 | LOG(FATAL) << "failed to query current device: " << ToString(result); |
| 153 | } |
| 154 | return current; |
| 155 | } |
| 156 | |
| 157 | namespace { |
| 158 |
no test coverage detected