mirror of https://github.com/davisking/dlib.git
Improved CHECK_CUDA() macro
This commit is contained in:
parent
935a0b4e48
commit
018e85f150
|
@ -15,7 +15,7 @@
|
|||
|
||||
// Check the return value of a call to the CUDA runtime for an error condition.
|
||||
#define CHECK_CUDA(call) \
|
||||
{ \
|
||||
do{ \
|
||||
const cudaError_t error = call; \
|
||||
if (error != cudaSuccess) \
|
||||
{ \
|
||||
|
@ -24,7 +24,7 @@
|
|||
sout << "code: " << error << ", reason: " << cudaGetErrorString(error);\
|
||||
throw dlib::cuda_error(sout.str()); \
|
||||
} \
|
||||
}
|
||||
}while(false)
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue