As known, OpenCV 3.0 supports new class cv::Umat
which provides Transparent API (TAPI) to use OpenCL automaticaly if it can: http://code.opencv.org/projects/opencv/wiki/Opencv3#tapi
There are two introductions to the cv::Umat
and TAPI:
- Intel: https://software.intel.com/en-us/articles/opencv-30-architecture-guide-for-intel-inde-opencv
- AMD: http://developer.amd.com/community/blog/2014/10/15/opencv-3-0-transparent-api-opencl-acceleration/
But if I have:
- Intel CPU Core i5 (Haswell) 4xCores (OpenCL Intel CPUs with SSE 4.1, SSE 4.2 or AVX support)
- Intel Integrated HD Graphics which supports OpenCL 1.2
- 1st nVidia GPU GeForce GTX 970 (Maxwell) which supports OpenCL 1.2 and CUDA
- 2nd nVidia GPU GeForce GTX 970 ...
If I turn on OpenCL in OpenCV, then how can I change the device on which OpenCL-code will be executed: on 8 Cores of CPU, on Integrated HD Graphics, on 1st nVidia GPU or 2nd nVidia GPU?
How can I select one of each of these 4 devices to use OpenCL for parallel execution algorithms with cv::Umat
?
For example, how can I use OpenCL acceleration on 4xCores of CPU Core-i5 with cv::Umat
?
cv::ocl::setDevice
is not in OpenCV 3.0 where appearedcv:Umat
. There are namespaceocl
docs.opencv.org/master/d5/d96/namespacecv_1_1ocl.html#gsc.tab=0 alsoclass Device
withenum
-sTYPE_
andVENDOR_
docs.opencv.org/master/d7/d9f/… and functionsattachContext()
/initializeContextFromHandle()
. But there are not function to set global variable to use requiredDevice
. How can I setDevice
for whole program, or this thread, or thiscv::Umat
in OpenCV3.0? – Alex Oct 29 '15 at 15:46