( SPIR) OpenCL SPIR programs (required 'cl_khr_spir' extension support from OpenCL runtime).They are usually not portable between devices (and/or OpenCL vendors) ( binary) Binary programs compiled for specific device.( source) "OpenCL C" source code (without "#includes" support).OpenCV API can handle these types of programs sources: OpenCL kernels are part of OpenCL programs. OpenCV provides API to load, build and execute OpenCL kernels. OpenCV has experimental OpenCL SVM support (disabled by default via build flag). The most part of OpenCL kernels is designed to work with OpenCL buffers. The primary OpenCL storage is OpenCL buffers. Instead OpenCV switches to other available implementation branches (generic CPU-based branch is always available) according to "Transparent API" design. If the OpenCL device doesn't support something or not able to process requested operation, then OpenCV doesn't generate an error. OpenCV design guidelines prefer not to invoke OpenCL kernels for non-UMat parameters. and there may be cost associated with data transfer, so this operations should not be implemented implicitly.įor best performance, in either case, it is recommended that you do not introduce unnecessary data transfers between CPU and the discrete GPU.there is no direct access to accelerator memory from CPU host program, so cv::Mat::data pointer is not available.It is necessary because in a heterogeneous device environment: To store data and operate with OpenCL OpenCV uses cv::UMat instead of CPU-based cv::Mat. OPENCV_OPENCL_CACHE_CLEANUP= (default value is true, use false to prevent cache removal for other versions of OpenCL devices).OPENCV_OPENCL_CACHE_LOCK_ENABLE= (default value is true, necessary for cache integrity in multiprocess application setups).OPENCV_OPENCL_CACHE_WRITE= (default value is true, use false to forbid writing of new kernels into binary cache).OPENCV_OPENCL_CACHE_ENABLE= (default value is true).Override path to OpenCL runtime or disable OpenCL completelly ( =disabled)Īllow the user to select OpenCL device in this format: There are several runtime options to configure OpenCL optimizations: OpenCV is able to detect, load and utilize OpenCL devices automatically.īy default, it enables the first GPU-based OpenCL device. In general, "accelerated" results of algorithms should be similar,īut there is no guarantee of bit-exact results from OpenCL backend due different algorithms implementations. OpenCV can utilize acceleration on devices with OpenCL 1.2 (and OpenCL 1.1 with limited functionality) "FULL PROFILE" capability (with online compiler from OpenCL C language).Īccelerated implementations are added via "Transparent API" design. Refer to OpenCL official page for OpenCL conception and details: OpenCL (Open Computing Language) is a Khronos(R) standard for software API, with goal to accelerate data processing by a variety of devices (GPUs, CPUs, FPGAs, DSPs, etc), abstracting the exact hardware details. A subset of functions and algorithms in OpenCV library is accelerated on OpenCL(TM) compatible devices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |