| 49 | } |
| 50 | |
| 51 | Status StatusFromCuda(CUresult res, const char* function_name) { |
| 52 | if (res == CUDA_SUCCESS) { |
| 53 | return Status::OK(); |
| 54 | } |
| 55 | std::stringstream ss; |
| 56 | ss << "Cuda error " << res; |
| 57 | if (function_name != nullptr) { |
| 58 | ss << " in function '" << function_name << "'"; |
| 59 | } |
| 60 | ss << ": " << CudaErrorDescription(res); |
| 61 | return Status::IOError(ss.str()); |
| 62 | } |
| 63 | |
| 64 | } // namespace internal |
| 65 | } // namespace cuda |