OpenCL

Write it once, run on anything“.

Every vendor that provides OpenCL-compliant hardware also provides the tools that compile OpenCL code to tun on the hardware.  This means you can write your own OpenCL routines once and compile them for any compliant device, whether it’s a multi-core processor or a graphic card.

OpenCL (Open Computing Language) is a framework for writing programs that execute across heterogeneous platforms consisting of central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), field-programmable gate arrays (FPGAs) and other processors or hardware accelerators.

Using GPUs to perform non graphical routines is called general-purpose GPU computing, or GPGPU.  Before 2010, GPGPU computing was considered a novelty in the world of high-performance computing and not worthy of series  attention.  But today, engineers and academics are reaching the conclusion that CPU/GPU system represent the future of super computing.

Now an important question arises: how can you program these new hybrid devices ? Traditional C/C++ only target traditional CPUs.  Nvidia’s CUDA (Compute Unified Device Architecture) can be used to program Nvidia’s GPUs, but not CPUs.

The answer is OpenCL.  OpenCL routines can be executed on GPUs and CPUs from major manufacturers like AMD, Nvidia, and Intel, and will even on Sony’s PS3.  OpenCL is non-proprietary — it’s based on a public standard, and you can freely download all the development tools you need.  When you code routines in OpenCL, you don’t have to worry about which company designed the processor or how many cores it contains.  Your code will compile and execute on AMD’s Fusion processors, Intel’s Core processors, Nivdia’s Fermi/Pascal processors, and IBM’s Cell Broadband Engine.

OpenCL standard defines a set of data types, data structures, and functions that augment C and C++.  There main advantages: portability, standardized vector processing, and parallel programming.