Issue link: https://digital.copcomm.com/i/2965
12 n n n n Viewpoint September 2009 Recently, there have been two APIs created to address cross- vendor computation on GPUs: DirectX 11 DirectCompute and OpenCL. OpenCL goes further by targeting parallel processors more generally and providing cross-platform support. Apple provided the initial proposal for OpenCL and the cata- lyst to gather the major silicon vendors to work on an industry standard for compute in 2008. e main goals of OpenCL are to provide a cross-platform, cross-vendor, cross-architecture, roy- alty-free industry standard for parallel programming. While hav- ing solid support for GPU compute, the working group strove to make OpenCL applicable beyond GPUs, providing a framework for writing software that can exploit the vast, heterogeneous com- puting power of multi-core CPUs, GPUs, cells, and DSPs. us, OpenCL addresses the need for a cross-platform, indus- try-standard approach toward development for heterogeneous a rchitectures. OpenCL is a C-based language, with a structure familiar to parallel programmers. is allows developers, who are used to programming in C for multi-core CPUs and other GPU computation languages, to easily transition to OpenCL, providing portability of their applications/programs across a wider range of devices and platforms. OpenCL includes a platform API that lets developers query, select, and initialize compute devices, as well as a run-time API to execute the compute kernels and manage the scheduling of c ompute and memory resources. It is designed as a low-level inter- face to maximize the performance that can be extracted from the targeted devices. By creating efficient, close-to-the-metal programming inter- faces, OpenCL forms the foundational layer of a parallel computing ecosystem of platform-independent tools, middle- ware, and applications. Of course, no application runs en- tirely on the GPU. Beyond the obvi- ous need for CPUs to drive execution, most mainstream applications are het- erogeneous in nature: ey have some functions that accelerate well on multi- core CPUs and others that are per- fectly suited for a GPU's data-parallel architecture (see "Power Play," pg. 21). GPUs excel at mathematically inten- sive algorithms with a high degree of data parallelism. Many algorithms, like those discussed above, can be excellent candidates for acceleration; however, some algorithms generally thought of as perfect GPGPU algorithms, such as image convolution with small window sizes, may be faster on a multi-core CPU system than on a GPU because of the expense of off-loading the computation to the GPU. Current GPUs require a high degree of arithmetic intensity, a measurement of the amount of computation performed per data read, to effectively accelerate algorithms. A developer must take a balanced approach and match the algorithms to the best-suited device in the system. For some algorithms, that may be just the GPU, or just the CPU, but many algorithms benefit from using both the GPU and the CPU. AMD's first public beta release of OpenCL targets multi-core x86 processors. Beyond being part of a full-platform approach to OpenCL, it also enables developers to begin exploring OpenCL on the systems they already have, without having to first invest in new hardware. Moreover, the techniques critical to GPU per- formance, such as data locality awareness, use of vector types, and large amounts of parallelism, are also critical to CPU performance. Coding in OpenCL provides a solid methodology for writing par- allel code that is scalable on multi-core x86. In fact, AMD has shown some applications scaling well on a 24-core system based on four Six-Core AMD Opteron processors. Programming that takes maximum advantage of all the parallel- computing resources in the system is the next frontier of applica- tion acceleration. OpenCL and the burgeoning ecosystem around it form a solid foundation for this up-and-coming revolution to flourish and take off. n Traditional GPUs used for manipulating raster graphics can also handle demanding algorithms

