fixed tests (call resetDevice, if there was a gpu failure)

This commit is contained in:
Vladislav Vinogradov
2013-01-23 15:31:10 +04:00
parent 0773ab4d07
commit b7e6b5af1b
34 changed files with 2673 additions and 2556 deletions

View File

@@ -1,5 +1,9 @@
#include "precomp.hpp"
#ifdef HAVE_CUDA
#include "opencv2/core/gpumat.hpp"
#endif
#ifdef ANDROID
# include <sys/time.h>
#endif
@@ -1160,6 +1164,10 @@ void TestBase::RunPerfTestBody()
catch(cv::Exception e)
{
metrics.terminationReason = performance_metrics::TERM_EXCEPTION;
#ifdef HAVE_CUDA
if (e.code == CV_GpuApiCallError)
cv::gpu::resetDevice();
#endif
FAIL() << "Expected: PerfTestBody() doesn't throw an exception.\n Actual: it throws cv::Exception:\n " << e.what();
}
catch(std::exception e)