Commit 56745b54 authored by Alexey Spizhevoy's avatar Alexey Spizhevoy

refactored gpu tests a little

parent c104cdce
......@@ -679,9 +679,14 @@ struct CV_GpuMinMaxTest: public CvTest
cv::gpu::GpuMat buf;
void run(int)
{
try
{
int depth_end;
if (cv::gpu::hasNativeDoubleSupport(cv::gpu::getDevice())) depth_end = CV_64F; else depth_end = CV_32F;
if (cv::gpu::hasNativeDoubleSupport(cv::gpu::getDevice()))
depth_end = CV_64F;
else
depth_end = CV_32F;
for (int depth = CV_8U; depth <= depth_end; ++depth)
{
for (int i = 0; i < 3; ++i)
......@@ -693,6 +698,12 @@ struct CV_GpuMinMaxTest: public CvTest
}
}
}
catch (const Exception& e)
{
if (!check_and_treat_gpu_exception(e, ts)) throw;
return;
}
}
void test(int rows, int cols, int cn, int depth)
{
......@@ -803,9 +814,14 @@ struct CV_GpuMinMaxLocTest: public CvTest
GpuMat valbuf, locbuf;
void run(int)
{
try
{
int depth_end;
if (cv::gpu::hasNativeDoubleSupport(cv::gpu::getDevice())) depth_end = CV_64F; else depth_end = CV_32F;
if (cv::gpu::hasNativeDoubleSupport(cv::gpu::getDevice()))
depth_end = CV_64F;
else
depth_end = CV_32F;
for (int depth = CV_8U; depth <= depth_end; ++depth)
{
int rows = 1, cols = 3;
......@@ -818,6 +834,12 @@ struct CV_GpuMinMaxLocTest: public CvTest
}
}
}
catch (const Exception& e)
{
if (!check_and_treat_gpu_exception(e, ts)) throw;
return;
}
}
void test(int rows, int cols, int depth)
{
......@@ -875,9 +897,13 @@ struct CV_GpuCountNonZeroTest: CvTest
void run(int)
{
srand(0);
try
{
int depth_end;
if (cv::gpu::hasNativeDoubleSupport(cv::gpu::getDevice())) depth_end = CV_64F; else depth_end = CV_32F;
if (cv::gpu::hasNativeDoubleSupport(cv::gpu::getDevice()))
depth_end = CV_64F;
else
depth_end = CV_32F;
for (int depth = CV_8U; depth <= CV_32F; ++depth)
{
for (int i = 0; i < 4; ++i)
......@@ -888,6 +914,12 @@ struct CV_GpuCountNonZeroTest: CvTest
}
}
}
catch (const Exception& e)
{
if (!check_and_treat_gpu_exception(e, ts)) throw;
return;
}
}
void test(int rows, int cols, int depth)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment