1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

fixed gpu::sum* on CC1.0, updated some tests

This commit is contained in:
Alexey Spizhevoy
2011-02-02 07:23:55 +00:00
parent f7e62d89f8
commit 557dd39f03
6 changed files with 27 additions and 11 deletions
+10
View File
@@ -947,6 +947,16 @@ struct CV_GpuSumTest: CvTest
// sum
//
gen(1 + rand() % 500, 1 + rand() % 500, CV_MAKETYPE(type, 1), src);
a = sum(src);
b = sum(GpuMat(src));
if (abs(a[0] - b[0]) > src.size().area() * max_err)
{
ts->printf(CvTS::CONSOLE, "1 cols: %d, rows: %d, expected: %f, actual: %f\n", src.cols, src.rows, a[0], b[0]);
ts->set_failed_test_info(CvTS::FAIL_INVALID_OUTPUT);
return;
}
gen(1 + rand() % 500, 1 + rand() % 500, CV_MAKETYPE(type, 2), src);
a = sum(src);
b = sum(GpuMat(src));
+2 -2
View File
@@ -56,7 +56,7 @@ struct CV_GpuMeanShiftTest : public CvTest
cv::Mat img = cv::imread(std::string(ts->get_data_path()) + "meanshift/cones.png");
cv::Mat img_template;
if (cv::gpu::TargetArchs::hasEqualOrGreater(2, 0) && cv::gpu::DeviceInfo().major() >= 2)
if (cv::gpu::TargetArchs::builtWith(cv::gpu::COMPUTE_20) && 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");
@@ -199,7 +199,7 @@ struct CV_GpuMeanShiftProcTest : public CvTest
cv::Mat spmap_template;
cv::FileStorage fs;
if (cv::gpu::TargetArchs::hasEqualOrGreater(2, 0) && cv::gpu::DeviceInfo().major() >= 2)
if (cv::gpu::TargetArchs::builtWith(cv::gpu::COMPUTE_20) && 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);
+1 -1
View File
@@ -69,7 +69,7 @@ struct CV_GpuMeanShiftSegmentationTest : public CvTest {
{
stringstream path;
path << ts->get_data_path() << "meanshift/cones_segmented_sp10_sr10_minsize" << minsize;
if (TargetArchs::hasEqualOrGreater(2, 0) && DeviceInfo().major() >= 2)
if (TargetArchs::builtWith(COMPUTE_20) && DeviceInfo().major() >= 2)
path << ".png";
else
path << "_CC1X.png";