Initialize OpenCL context at the end of getDevice call.
authorpeng xiao <hisenxpress@gmail.com>
Fri, 31 May 2013 08:48:40 +0000 (16:48 +0800)
committerpeng xiao <hisenxpress@gmail.com>
Fri, 31 May 2013 08:48:40 +0000 (16:48 +0800)
Added for better compatibility with the current samples/test cases.
User now will be able to initialize OpenCL context explicitly with
ocl::getDevice api.
This may be obsoleted in future releases.

modules/ocl/src/initialization.cpp

index fd462ad..a9cd08b 100644 (file)
@@ -333,6 +333,10 @@ namespace cv
                     oclinfo.push_back(ocltmpinfo);
                 }
             }
+            if(devcienums > 0)
+            {
+                setDevice(oclinfo[0]);
+            }
             return devcienums;
         }