KPETOB.COM

Kretov Nikolai Nikolaevich: Introduction to OpenCL

The development is led by the notorious Khronos Group. The one that promotes OpenGl and OpenAL. Moreover, OpenGL and OpenCL are essentially from the same software infrastructure and can interact very closely.

The essence of the idea is that we absolutely do not care - the processor in front of us or the video card. We abstract from the platform as such and consider that we have N computing devices. OpenCL as a standard describes the rules for computing on these devices. Thus, we get a single code that will be absolutely portable to any platform. AMD or Intel you have a processor, nVidia or ATI video card, or Blade-server with Cell-cores - it doesn't matter at all. The application will work wherever devices support the OpenCL standard.

It is worth noting that we are talking about parallel computing about SIMD instructions.

OpenCL is an extension of the C language. We have a host application and an OpenCL application. The host prepares a set of available devices for use and passes the task to the OpenCL part for execution. After that, OpenCL fulfills and returns the result to the host.

OpenCL code is stored in *.cl files and compiled at runtime for a given architecture. This ensures the portability of the application.

Apple has taken it a step further by releasing kernel-level support for OpenCL in its Snow Leopard operating system, achieving significant performance gains.

What is it needed for?

OpenCL eats SIMD algorithms well. This is what he was created for. And this is various cryptography, various post-processing effects, sound processing and various mathematical models, video encoding.

For developers

At the moment, versions of nVidia OpenCL SDK, AMD OpenCL SDK are available. You can always download them from the official websites of these companies.

In future articles, I will tell you how to use this technology in practice in your own applications.