Thursday, April 25, 2024

“We are At The Dawn of an Era That Transcends CPU and GPU Computing”

- Advertisement -

Q. Could you tell us how this interface works?
A. Certainly. My main idea was to introduce a new data structure, ‘universal’ or ‘unified’ matrix (Umat), to replace the ‘Mat’ data structure, which was historically the basic image data structure in OpenCV. The goal was to hide data locality under the UMat hood, in a way that is appropriate for each class of device. E.g., in the case of discreet GPUs, UMat would have the responsibility to synchronise data between the CPU and the GPU, by doing a copy. On the other extreme, for platforms supporting fine-grain shared virtual memory (SVM), an OpenCL 2.0 construct, the CPU and GPU can use exactly the same memory pointer (doing a memory map operation if needed). In the case where OpenCL is not available (or enabled), UMat just acts as a Mat. Therefore, code that uses UMat has nothing to lose (will work on CPUs) and potentially has very much to gain! As part of this effort, OpenCL moved into the core module and the 2.4 style ocl namespace got buried under the hood, and people do not need to use it anymore.

Q. To what effect can embedded engineers use OpenCV?
A. OpenCV, traditionally, has been great for prototyping, given the wealth of algorithms that have been implemented. OpenCV 3.0 brought about a general re-architecture, further strengthening the library in terms of having it organised in a more modular fashion. In the past, it was difficult to attain real-time performance on embedded CPUs. However, with AMD’s embedded product lines that feature cost effective, yet powerful integrated GPUs, it makes great sense to use them!

Q. Have you seen any changes with either the adaptation of OpenCV or its applications since the transparent API was introduced? Has there been any problem during implementation?
A. The OpenCV community is very excited with the recent release of 3.0. It is expected over time that 3.0 will replace previous generations (e.g. 2.4) and it is strongly encouraged to use UMat’s instead of Mat’s. That is all it takes to get OpenCL acceleration, in OpenCV!

- Advertisement -

Q. How far has OpenCL penetrated mobile and embedded systems?
A. The mobile space has unique requirements, where OpenCL may be less suited or at least is less publicised, compared to other technologies such as NEON intrinsics or render script. On high-end embedded systems, traditionally, vendors would employ specialised hardware solutions like digital signal processors (DSPs) or field-programmable gate arrays (FPGAs). However, embedded vendors now realise that there are credible, high performance and relatively low-cost embedded solutions using GPUs. In the cost, one has to factor in the total cost of ownership, as developing in generic language like OpenCL is arguably significantly cheaper than developing for a specialised processor.

Q. What would be the next step forward for OpenCV?
A. The next step in OpenCV will be to fully take advantage of the advanced features of OpenCL 2.0. I am particularly excited with the prospect of extensively using fine grain SVM, as this would enable efficient hybrid imaging pipelines, where one would mix and match CPU and GPU execution, with no performance penalty!


The author is a Technical Journalist at EFY.

SHARE YOUR THOUGHTS & COMMENTS

Unique DIY Projects

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components

Calculators