OpenCL and Computer Vision Talk at UFMG

The Department of Computer Science of Federal University of Minas Gerais – DCC/UFMG and Khronos Chapter Brazil have been working together to spread and strengthen industrial and scientific use of Khronos’ standards, most notably OpenCL and OpenGL.

On March 12th a talk was held with students and researchers of the Computer Vision laboratory – VeRLAB to present benefits of using GPGPU through OpenCL to accelerate CV algorithms.


Machine learning and computer vision have become a reality in people’s daily life through smart wearables (smart glasses, watches phones), vehicles capable of recognizing traffic signs, biometric systems and many others. These technologies increase safety and comfort when using such machines and are currently object of active research. However, development of better algorithms and the possibility of executing them in mobile devices under acceptable time frames and lower energy consumption still remain as open challenges.

This presentation covers topics on how GPU parallel processing allows performance and energy efficiency increases when executing algorithms whose inputs are images. Accelerations up to 800x may be obtained by intelligent use of appropriate parallel algorithms suited to SIMD architectures, explicit cache management and use of texture samplers.


Video: Generalized Hough Transform

Video: Dynamic shader:

Video: Heat transfer simulation

Simple CLGL Interop Demo

We have had some requests from users to post a simple OpenCL OpenGL Interoperation example using vertexes and we decided to post a fresh example.

This is the same video that is used in the tutorials. However, the code has been updated to use simple instructions from OpenCLTemplate.

OpenCL/GL Interop is a powerful tool to manipulate OpenGL graphics directly in GPU memory with minimal data transfer. All GL Buffer objects as well as textures can be manipulated.

 Download CLGLInterop demonstration.

SPIR Protects OpenCL C Code

One very important issue with OpenCL code at the moment is that it needs to either be compiled at runtime by vendor’s compilers or be precompiled but also restricted to the hardware it has been precompiled to. This is a problem because programmers cannot protect sensitive parallel code unless it is delivered precompiled to each specific platform, a very tedious task that completely challenges the goals of having an open specification.

Khronos’ SPIR (Standard Portable Intermediate Representation) specification is an important step towards protecting sensitive source code while still maintaining cross-platform capabilities.

This may very well be the last step that gaming industry and multimedia processing companies were waiting to fully incorporate heterogeneous computing into their applications.

Further details can be found at