From 97b86aa259ec1b33d1c5b28bd04d6247e7671a93 Mon Sep 17 00:00:00 2001 From: peng xiao Date: Fri, 31 May 2013 16:48:40 +0800 Subject: [PATCH] Initialize OpenCL context at the end of getDevice call. 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ocl/src/initialization.cpp b/modules/ocl/src/initialization.cpp index fd462ad916..a9cd08b9f4 100644 --- a/modules/ocl/src/initialization.cpp +++ b/modules/ocl/src/initialization.cpp @@ -333,6 +333,10 @@ namespace cv oclinfo.push_back(ocltmpinfo); } } + if(devcienums > 0) + { + setDevice(oclinfo[0]); + } return devcienums; }