Skip to content

Commit eb3e52e

Browse files
koupitrou
authored andcommitted
ARROW-7402: [C++] Add more information on CUDA error
This change adds error name and error description. Closes #6041 from kou/cpp-cuda-add-more-error-information and squashes the following commits: 38292a5 <Sutou Kouhei> Add more information on CUDA error Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
1 parent 6b2bf28 commit eb3e52e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cpp/src/arrow/gpu/cuda_common.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ namespace cuda {
2929
do { \
3030
CUresult ret = (STMT); \
3131
if (ret != CUDA_SUCCESS) { \
32+
const char* name; \
33+
const char* description; \
34+
cuGetErrorName(ret, &name); \
35+
cuGetErrorString(ret, &description); \
3236
return Status::IOError("Cuda Driver API call in ", __FILE__, " at line ", \
33-
__LINE__, " failed with code ", ret, ": ", #STMT); \
37+
__LINE__, " failed with ", name, "[", ret, "] (", \
38+
description, "): ", #STMT); \
3439
} \
3540
} while (0)
3641

0 commit comments

Comments
 (0)