| 52 | } |
| 53 | ~DeviceScope() { if (previous >= 0) cudaSetDevice(previous); } |
| 54 | std::string error(int device) const { |
| 55 | return std::string("CUDA") + std::to_string(device) + " experts: " + |
| 56 | (failed_step ? failed_step : "device switch") + |
| 57 | "(" + std::to_string(device) + ") failed: " + cudaGetErrorString(status) + |
| 58 | " (CUDA error " + std::to_string((int) status) + ")"; |
| 59 | } |
| 60 | }; |
| 61 | |
| 62 | bool check(cudaError_t result, const char* what, std::string& err, int device) { |
no test coverage detected