added cv::gpu::resetDevice to RunPerfTestBody
This commit is contained in:
@@ -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
|
||||
|
@@ -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(...)
|
||||
|
Reference in New Issue
Block a user