From f89dee4f3e12469d2d161ef09086aa8267c5b485 Mon Sep 17 00:00:00 2001 From: cudawarped <12133430+cudawarped@users.noreply.github.com> Date: Thu, 13 Oct 2022 10:15:40 +0300 Subject: [PATCH] Reset cuda error code to cudasuccess. --- modules/core/include/opencv2/core/cuda/common.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/core/include/opencv2/core/cuda/common.hpp b/modules/core/include/opencv2/core/cuda/common.hpp index 80b2ff0..b36b3d1 100644 --- a/modules/core/include/opencv2/core/cuda/common.hpp +++ b/modules/core/include/opencv2/core/cuda/common.hpp @@ -65,8 +65,10 @@ namespace cv { namespace cuda { static inline void checkCudaError(cudaError_t err, const char* file, const int line, const char* func) { - if (cudaSuccess != err) + if (cudaSuccess != err) { + cudaGetLastError(); // reset the last stored error to cudaSuccess cv::error(cv::Error::GpuApiCallError, cudaGetErrorString(err), func, file, line); + } } }} -- 2.7.4