added cv::gpu::resetDevice to RunPerfTestBody

This commit is contained in:
Vladislav Vinogradov
2012-12-19 16:44:34 +04:00
parent 1a76242d99
commit 660d23aa04
3 changed files with 17 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
#ifndef __OPENCV_GTESTCV_HPP__
#define __OPENCV_GTESTCV_HPP__
#if HAVE_CVCONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
#ifndef GTEST_CREATE_SHARED_LIBRARY

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
@@ -1145,6 +1149,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:\n " << e.what();
}
catch(...)