Reset last cuda error (#2685)

as error is handled here (exception is being thrown), we do not
want cudaGetLastError() to return any errors.
This commit is contained in:
Michał Walenciak 2022-11-12 18:57:38 +01:00 committed by GitHub
parent 05d3f6eb17
commit 136b2d9e5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,7 @@ do{
{ \
std::ostringstream sout; \
sout << "Error while calling " << #call << " in file " << __FILE__ << ":" << __LINE__ << ". ";\
sout << "code: " << error << ", reason: " << cudaGetErrorString(error);\
sout << "code: " << cudaGetLastError() << ", reason: " << cudaGetErrorString(error);\
throw dlib::cuda_error(sout.str()); \
} \
}while(false)