added support of old CC into GPU mean shift routines
authorAlexey Spizhevoy <no@email>
Fri, 8 Jul 2011 13:59:23 +0000 (13:59 +0000)
committerAlexey Spizhevoy <no@email>
Fri, 8 Jul 2011 13:59:23 +0000 (13:59 +0000)
modules/gpu/src/cuda/imgproc.cu
modules/gpu/src/imgproc_gpu.cpp
modules/gpu/src/mssegmentation.cpp
modules/gpu/test/test_imgproc.cpp

index e89b055..7b762ab 100644 (file)
@@ -251,9 +251,11 @@ namespace cv { namespace gpu { namespace imgproc
     }\r
 \r
     extern "C" void meanShiftFiltering_gpu(const DevMem2D& src, DevMem2D dst, int sp, int sr, int maxIter, float eps)\r
-    {                        \r
+    {\r
+        printFuncAttrib(meanshift_kernel);\r
+\r
         dim3 grid(1, 1, 1);\r
-        dim3 threads(32, 16, 1);\r
+        dim3 threads(32, 8, 1);\r
         grid.x = divUp(src.cols, threads.x);\r
         grid.y = divUp(src.rows, threads.y);\r
 \r
@@ -269,7 +271,7 @@ namespace cv { namespace gpu { namespace imgproc
     extern "C" void meanShiftProc_gpu(const DevMem2D& src, DevMem2D dstr, DevMem2D dstsp, int sp, int sr, int maxIter, float eps) \r
     {\r
         dim3 grid(1, 1, 1);\r
-        dim3 threads(32, 16, 1);\r
+        dim3 threads(32, 8, 1);\r
         grid.x = divUp(src.cols, threads.x);\r
         grid.y = divUp(src.rows, threads.y);\r
 \r
index de23877..52e23d6 100644 (file)
@@ -129,8 +129,6 @@ void cv::gpu::remap(const GpuMat& src, GpuMat& dst, const GpuMat& xmap, const Gp
 \r
 void cv::gpu::meanShiftFiltering(const GpuMat& src, GpuMat& dst, int sp, int sr, TermCriteria criteria)\r
 {\r
-    CV_Assert(TargetArchs::builtWith(FEATURE_SET_COMPUTE_12) && DeviceInfo().supports(FEATURE_SET_COMPUTE_12));\r
-\r
     if( src.empty() )\r
         CV_Error( CV_StsBadArg, "The input image is empty" );\r
 \r
@@ -157,8 +155,6 @@ void cv::gpu::meanShiftFiltering(const GpuMat& src, GpuMat& dst, int sp, int sr,
 \r
 void cv::gpu::meanShiftProc(const GpuMat& src, GpuMat& dstr, GpuMat& dstsp, int sp, int sr, TermCriteria criteria)\r
 {\r
-    CV_Assert(TargetArchs::builtWith(FEATURE_SET_COMPUTE_12) && DeviceInfo().supports(FEATURE_SET_COMPUTE_12));\r
-\r
     if( src.empty() )\r
         CV_Error( CV_StsBadArg, "The input image is empty" );\r
 \r
index fd62f43..609fdda 100644 (file)
@@ -227,8 +227,6 @@ inline int dist2(const cv::Vec2s& lhs, const cv::Vec2s& rhs)
 \r
 void cv::gpu::meanShiftSegmentation(const GpuMat& src, Mat& dst, int sp, int sr, int minsize, TermCriteria criteria)\r
 {\r
-    CV_Assert(TargetArchs::builtWith(FEATURE_SET_COMPUTE_12) && DeviceInfo().supports(FEATURE_SET_COMPUTE_12));\r
-\r
     CV_Assert(src.type() == CV_8UC4);\r
     const int nrows = src.rows;\r
     const int ncols = src.cols;\r
index 575f45c..05654f9 100644 (file)
@@ -1478,7 +1478,7 @@ TEST_P(MeanShift, Proc)
     EXPECT_MAT_NEAR(spmap_template, spmap, 0.0);\r
 }\r
 \r
-INSTANTIATE_TEST_CASE_P(ImgProc, MeanShift, testing::ValuesIn(devices(cv::gpu::FEATURE_SET_COMPUTE_12)));\r
+INSTANTIATE_TEST_CASE_P(ImgProc, MeanShift, testing::ValuesIn(devices()));\r
 \r
 struct MeanShiftSegmentation : testing::TestWithParam< std::tr1::tuple<cv::gpu::DeviceInfo, int> >\r
 {\r
@@ -1540,7 +1540,7 @@ TEST_P(MeanShiftSegmentation, Regression)
 }\r
 \r
 INSTANTIATE_TEST_CASE_P(ImgProc, MeanShiftSegmentation, testing::Combine(\r
-                        testing::ValuesIn(devices(cv::gpu::FEATURE_SET_COMPUTE_12)), \r
+                        testing::ValuesIn(devices()),\r
                         testing::Values(0, 4, 20, 84, 340, 1364)));\r
 \r
 ////////////////////////////////////////////////////////////////////////////////\r