Advertisement

OpenCL tackles graphics and parallel processing

OpenCL is the an open, royalty-free standard for cross-platform, parallel programming of modern processors found in personal computers, servers, and handheld/embedded devices. OpenCL greatly improves speed and responsiveness for a wide spectrum of applications in numerous market categories from gaming and entertainment to scientific and medical software.

CUDA and OpenCL are two different frameworks for GPU programming. OpenCL is an open standard that can be used to program CPUs, GPUs, and other devices from many different vendors, while CUDA is specific to NVIDIA GPUs.

Open Computing Language is a framework for writing programs that execute across heterogeneous platforms — that is, multiple CPUs, GPUs, DSPs, and other specialized processors. OpenCL includes a language (based on C99) for writing kernels (functions that execute on OpenCL devices), plus APIs that are used to define and then control the platforms. It provides for parallel computing using task-based and data-based parallelism and is an open standard maintained by the non-profit technology consortium Khronos Group. It has been adopted by Intel, AMD, Nvidia, Altera, Samsung, Vivante, and ARM.

WCJH_1_Jun201316

The growth of higher performance graphics processor makes OpenCL more viable

The Khronos Compute Working Group finished the technical details of the specification for OpenCL 1.0 in November of 2008. This technical specification was approved for public release on 8 December 2008. Khronos released a “significant” OpenCL 1.2 specification update in November 2012.

Originally OpenCL was intended for high performance graphics cards. Since nowadays every Tom, Dick, and Core i3 has a graphics co-processor, and probably a security co-processor as well, it is useful in a lot more instances. OpenCL can be used to give an application access to a graphics processing unit for non-graphical computing, such as data analysis.

The big idea behind OpenCL is a portable execution model that allows a kernel to execute at each point in a problem domain. A kernel is a function declared in a program and executed on an OpenCL device . Kernels can operate in either a data-parallel or task-parallel fashion.

Choose the task-parallel model when independent threads can process separate functions. This calls for independent work encapsulated in functions to be mapped to individual threads, which execute asynchronously.

Choose the data-parallel threading model for compute-intensive loops where the same, independent operations are performed repeatedly. Data parallelism implies that the same independent operation is applied repeatedly to different data.

An OpenCL application runs on a host which submits work to the compute devices via queues.

Jeff Bier of Berkeley Design Technology (www.BDTI.com) tells us that “OpenCL was originally developed to enable personal computer application developers to harness the massive parallel computing power of modern GPUs for tasks other than rendering 3D graphics. This concept, often called “GPU computing” or “general-purpose GPU,” was pioneered by NVIDIA with its CUDA technology. And now it's relevant to mobile applications since OpenCL support is starting to appear for the GPUs found in mobile application processors, such as those offered by Imagination Technologies and Vivante. And while the GPUs found in application processors don't offer anything close to the eye-popping processing power of desktop GPUs, they are nevertheless powerful and energy-efficient parallel processors.”

One factor working against OpenCL in the mobile computing area is that it is based on C and most mobile application developers work in higher-level languages. But, fundamentally, parallel programming is parallel programming, regardless of the language or API used. Jeff added, “Parallel programming is a profoundly different type of programming from what most application developers are accustomed to. For OpenCL, or any other parallel-programming-enabling paradigm to really take off, a huge amount of education will be needed.”

Advertisement

Leave a Reply