reafactoring: replaced query device props functions with the DeviceInfo class
This commit is contained in:
@@ -660,7 +660,7 @@ struct CV_GpuMinMaxTest: public CvTest
|
||||
try
|
||||
{
|
||||
bool double_ok = gpu::TargetArchs::builtWith(gpu::NATIVE_DOUBLE) &&
|
||||
gpu::hasNativeDoubleSupport(gpu::getDevice());
|
||||
gpu::DeviceInfo().has(gpu::NATIVE_DOUBLE);
|
||||
int depth_end = double_ok ? CV_64F : CV_32F;
|
||||
|
||||
for (int depth = CV_8U; depth <= depth_end; ++depth)
|
||||
@@ -794,7 +794,7 @@ struct CV_GpuMinMaxLocTest: public CvTest
|
||||
try
|
||||
{
|
||||
bool double_ok = gpu::TargetArchs::builtWith(gpu::NATIVE_DOUBLE) &&
|
||||
gpu::hasNativeDoubleSupport(gpu::getDevice());
|
||||
gpu::DeviceInfo().has(gpu::NATIVE_DOUBLE);
|
||||
int depth_end = double_ok ? CV_64F : CV_32F;
|
||||
|
||||
for (int depth = CV_8U; depth <= depth_end; ++depth)
|
||||
@@ -875,7 +875,7 @@ struct CV_GpuCountNonZeroTest: CvTest
|
||||
try
|
||||
{
|
||||
int depth_end;
|
||||
if (cv::gpu::hasNativeDoubleSupport(cv::gpu::getDevice()))
|
||||
if (cv::gpu::DeviceInfo().has(cv::gpu::NATIVE_DOUBLE))
|
||||
depth_end = CV_64F;
|
||||
else
|
||||
depth_end = CV_32F;
|
||||
|
@@ -60,7 +60,7 @@ struct CV_GpuBitwiseTest: public CvTest
|
||||
int rows, cols;
|
||||
|
||||
bool double_ok = gpu::TargetArchs::builtWith(gpu::NATIVE_DOUBLE) &&
|
||||
gpu::hasNativeDoubleSupport(gpu::getDevice());
|
||||
gpu::DeviceInfo().has(gpu::NATIVE_DOUBLE);
|
||||
int depth_end = double_ok ? CV_64F : CV_32F;
|
||||
|
||||
for (int depth = CV_8U; depth <= depth_end; ++depth)
|
||||
|
@@ -65,7 +65,7 @@ struct CV_GpuMatchTemplateTest: CvTest
|
||||
try
|
||||
{
|
||||
bool double_ok = gpu::TargetArchs::builtWith(gpu::NATIVE_DOUBLE) &&
|
||||
gpu::hasNativeDoubleSupport(gpu::getDevice());
|
||||
gpu::DeviceInfo().has(gpu::NATIVE_DOUBLE);
|
||||
if (!double_ok)
|
||||
{
|
||||
// For sqrIntegral
|
||||
@@ -245,7 +245,7 @@ struct CV_GpuMatchTemplateFindPatternInBlackTest: CvTest
|
||||
try
|
||||
{
|
||||
bool double_ok = gpu::TargetArchs::builtWith(gpu::NATIVE_DOUBLE) &&
|
||||
gpu::hasNativeDoubleSupport(gpu::getDevice());
|
||||
gpu::DeviceInfo().has(gpu::NATIVE_DOUBLE);
|
||||
if (!double_ok)
|
||||
{
|
||||
// For sqrIntegral
|
||||
|
@@ -54,12 +54,9 @@ struct CV_GpuMeanShiftTest : public CvTest
|
||||
int colorRad = 30;
|
||||
|
||||
cv::Mat img = cv::imread(std::string(ts->get_data_path()) + "meanshift/cones.png");
|
||||
cv::Mat img_template;
|
||||
cv::Mat img_template;
|
||||
|
||||
int major, minor;
|
||||
cv::gpu::getComputeCapability(cv::gpu::getDevice(), major, minor);
|
||||
|
||||
if (cv::gpu::TargetArchs::hasEqualOrGreater(2, 0) && major >= 2)
|
||||
if (cv::gpu::TargetArchs::hasEqualOrGreater(2, 0) && cv::gpu::DeviceInfo().major() >= 2)
|
||||
img_template = cv::imread(std::string(ts->get_data_path()) + "meanshift/con_result.png");
|
||||
else
|
||||
img_template = cv::imread(std::string(ts->get_data_path()) + "meanshift/con_result_CC1X.png");
|
||||
@@ -202,10 +199,7 @@ struct CV_GpuMeanShiftProcTest : public CvTest
|
||||
cv::Mat spmap_template;
|
||||
cv::FileStorage fs;
|
||||
|
||||
int major, minor;
|
||||
cv::gpu::getComputeCapability(cv::gpu::getDevice(), major, minor);
|
||||
|
||||
if (cv::gpu::TargetArchs::hasEqualOrGreater(2, 0) && major >= 2)
|
||||
if (cv::gpu::TargetArchs::hasEqualOrGreater(2, 0) && cv::gpu::DeviceInfo().major() >= 2)
|
||||
fs.open(std::string(ts->get_data_path()) + "meanshift/spmap.yaml", cv::FileStorage::READ);
|
||||
else
|
||||
fs.open(std::string(ts->get_data_path()) + "meanshift/spmap_CC1X.yaml", cv::FileStorage::READ);
|
||||
|
@@ -63,15 +63,13 @@ struct CV_GpuMeanShiftSegmentationTest : public CvTest {
|
||||
|
||||
Mat img;
|
||||
cvtColor(img_rgb, img, CV_BGR2BGRA);
|
||||
|
||||
int major, minor;
|
||||
cv::gpu::getComputeCapability(cv::gpu::getDevice(), major, minor);
|
||||
|
||||
|
||||
for (int minsize = 0; minsize < 2000; minsize = (minsize + 1) * 4)
|
||||
{
|
||||
stringstream path;
|
||||
path << ts->get_data_path() << "meanshift/cones_segmented_sp10_sr10_minsize" << minsize;
|
||||
if (TargetArchs::hasEqualOrGreater(2, 0) && major >= 2)
|
||||
if (TargetArchs::hasEqualOrGreater(2, 0) && DeviceInfo().major() >= 2)
|
||||
path << ".png";
|
||||
else
|
||||
path << "_CC1X.png";
|
||||
|
@@ -64,7 +64,7 @@ struct CV_MergeTest : public CvTest
|
||||
void CV_MergeTest::can_merge(size_t rows, size_t cols)
|
||||
{
|
||||
bool double_ok = gpu::TargetArchs::builtWith(gpu::NATIVE_DOUBLE) &&
|
||||
gpu::hasNativeDoubleSupport(gpu::getDevice());
|
||||
gpu::DeviceInfo().has(gpu::NATIVE_DOUBLE);
|
||||
size_t depth_end = double_ok ? CV_64F : CV_32F;
|
||||
|
||||
for (size_t num_channels = 1; num_channels <= 4; ++num_channels)
|
||||
@@ -106,7 +106,7 @@ void CV_MergeTest::can_merge(size_t rows, size_t cols)
|
||||
void CV_MergeTest::can_merge_submatrixes(size_t rows, size_t cols)
|
||||
{
|
||||
bool double_ok = gpu::TargetArchs::builtWith(gpu::NATIVE_DOUBLE) &&
|
||||
gpu::hasNativeDoubleSupport(gpu::getDevice());
|
||||
gpu::DeviceInfo().has(gpu::NATIVE_DOUBLE);
|
||||
size_t depth_end = double_ok ? CV_64F : CV_32F;
|
||||
|
||||
for (size_t num_channels = 1; num_channels <= 4; ++num_channels)
|
||||
@@ -180,7 +180,7 @@ struct CV_SplitTest : public CvTest
|
||||
void CV_SplitTest::can_split(size_t rows, size_t cols)
|
||||
{
|
||||
bool double_ok = gpu::TargetArchs::builtWith(gpu::NATIVE_DOUBLE) &&
|
||||
gpu::hasNativeDoubleSupport(gpu::getDevice());
|
||||
gpu::DeviceInfo().has(gpu::NATIVE_DOUBLE);
|
||||
size_t depth_end = double_ok ? CV_64F : CV_32F;
|
||||
|
||||
for (size_t num_channels = 1; num_channels <= 4; ++num_channels)
|
||||
@@ -222,7 +222,7 @@ void CV_SplitTest::can_split(size_t rows, size_t cols)
|
||||
void CV_SplitTest::can_split_submatrix(size_t rows, size_t cols)
|
||||
{
|
||||
bool double_ok = gpu::TargetArchs::builtWith(gpu::NATIVE_DOUBLE) &&
|
||||
gpu::hasNativeDoubleSupport(gpu::getDevice());
|
||||
gpu::DeviceInfo().has(gpu::NATIVE_DOUBLE);
|
||||
size_t depth_end = double_ok ? CV_64F : CV_32F;
|
||||
|
||||
for (size_t num_channels = 1; num_channels <= 4; ++num_channels)
|
||||
@@ -293,7 +293,7 @@ struct CV_SplitMergeTest : public CvTest
|
||||
|
||||
void CV_SplitMergeTest::can_split_merge(size_t rows, size_t cols) {
|
||||
bool double_ok = gpu::TargetArchs::builtWith(gpu::NATIVE_DOUBLE) &&
|
||||
gpu::hasNativeDoubleSupport(gpu::getDevice());
|
||||
gpu::DeviceInfo().has(gpu::NATIVE_DOUBLE);
|
||||
size_t depth_end = double_ok ? CV_64F : CV_32F;
|
||||
|
||||
for (size_t num_channels = 1; num_channels <= 4; ++num_channels)
|
||||
|
Reference in New Issue
Block a user