GPU Compute and OpenCL: an introduction.

November 03, 2014 // By Freescale Semiconductor
This article provides, to the reader unfamiliar with the subject, an introduction to the GPU evolution, current architecture, and suitability for compute intensive applications.

OpenCL is introduced in this context (in this first part of the article), and a sample application is presented (in the second instalment of the article), together with indications on setting up the development environment, building and running the application on a Freescale i.MX6-based platform.

Editor's note; If the reader has come first to this, part 1, of this article, a pdf of parts 1 & 2, complete, is now available by clicking here.

Basics of today's GPU hardware architecture

....and the forces that created it (e.g. graphic pipeline).

We cannot discuss OpenCL/GPU Compute, even in context of a highly integrated System on Chip (SoC), without at least a basic level of understanding of the GPU architecture and factors that shaped it. So let's first take an overview of this subject.

While pervasive today, and a big selling point for many everyday objects, the complex and elaborate GUIs (graphical user interaces) we use today rely on GPUs (graphics processing units) that are the culmination of more than 30 years of evolution, driven first by a nascent graphics industry, then mostly by PC and console gaming, and being strongly influenced by the needs of low-power/high performance SoCs today.

Starting with the first monochrome video display controllers, at incredibly low resolutions (“up to” 62 x 128 for CDP1861 in mid ’70s) moving to EGA adapters with 16 colours and 640 x 350 in mid ’80s (VGA/SVGA, with up to 800 x 600 would come soon after), we had to wait until the early ’90s for the first products that start to shape the GPU architectures in use today.

By 1996, the major players that would dominate the 3D graphics world for almost two decades are there (most of them defunct by now) and will make furious progress primarily driven by the gaming world, but with a direct impact on all devices that surround us. Also, the APIs that will enable the industry to move forward are established (OpenGL and Direct 3D), replacing proprietary ones that we see so often in nascent industries (one exception, Glide from 3dfx, still endured, and was open-sourced too late, contributing to the death of this much loved 3D pioneer). All this rapid development contributed to establishing a graphics processing pipeline that, at a high enough level, remains largely the same today, and is depicted in Figure 1.

Figure 1 The basic elements of what has become the “standard” graphics processing pipleine

next; early GPUs...