MCPcopy Create free account
hub / github.com/apache/arrow / CudaErrorDescription

Function CudaErrorDescription

cpp/src/arrow/gpu/cuda_internal.cc:29–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27namespace internal {
28
29std::string CudaErrorDescription(CUresult err) {
30 DCHECK_NE(err, CUDA_SUCCESS);
31 std::stringstream ss;
32
33 const char* name = nullptr;
34 auto err_result = cuGetErrorName(err, &name);
35 if (err_result == CUDA_SUCCESS) {
36 DCHECK_NE(name, nullptr);
37 ss << "[" << name << "] ";
38 }
39
40 const char* str = nullptr;
41 err_result = cuGetErrorString(err, &str);
42 if (err_result == CUDA_SUCCESS) {
43 DCHECK_NE(str, nullptr);
44 ss << str;
45 } else {
46 ss << "unknown error";
47 }
48 return ss.str();
49}
50
51Status StatusFromCuda(CUresult res, const char* function_name) {
52 if (res == CUDA_SUCCESS) {

Callers 1

StatusFromCudaFunction · 0.85

Calls 1

strMethod · 0.80

Tested by

no test coverage detected