Opencl

Páginas: 9 (2147 palabras) Publicado: 7 de diciembre de 2012
N

ovEl

A

rChItECturES

Editors: Volodymyr Kindratenko, kindr@ncsa.uiuc.edu
Pedro Trancoso, pedro@cs.ucy.ac.cy

OpenCL: A pArALLeL prOgrAmming
StAndArd fOr HeterOgeneOuS
COmputing SyStemS
By John E. Stone, David Gohara, and Guochun Shi
The OpenCL standard offers a common API for program execution on systems composed of different types
of computational devices such as multicoreCPUs, GPUs, or other accelerators.

T

he strong need for increased
computational performance in
science and engineering has led
to the use of heterogeneous computing, with GPUs and other accelerators
acting as coprocessors for arithmetic
intensive data-parallel workloads.1–4
OpenCL is a new industry standard
for task-parallel and data-parallel heterogeneous computing on a variety
ofmodern CPUs, GPUs, DSPs, and
other microprocessor designs.5 This
trend toward heterogeneous computing and highly parallel architectures
has created a strong need for software
development infrastructure in the
form of parallel programming languages and subroutine libraries that
can support heterogeneous computing on multiple vendors’ hardware
platforms. To address this, developers
adaptedmany existing science and engineering applications to take advantage of multicore CPUs and massively
parallel GPUs using toolkits such as
Threading Building Blocks (TBB),
OpenMP, Compute Unified Device
Architecture (CUDA),6 and others.7,8
Existing programming toolkits, however, were either limited to a single
microprocessor family or didn’t support heterogeneous computing.
OpenCL provideseasy-to-use
abstractions and a broad set of
programming APIs based on past
successes with CUDA and other

programming toolkits. OpenCL
defines core functionality that all
devices support, as well as optional
functionality for high-function devices; it also includes an extension
mechanism that lets vendors expose
unique hardware features and experimental programming interfaces
forapplication developers’ benefit.
Although OpenCL can’t mask significant differences in hardware architecture, it does guarantee portability
and correctness. This makes it much
easier for developers to start with a
correctly functioning OpenCL program tuned for one architecture
and produce a correctly functioning program optimized for another
architecture.

66

1521-9615/10/$26.00 © 2010 IEEECopublished by the IEEE CS and the AIP

The OpenCL
Programming Model

I n OpenCL, a program is executed on
a computational device, which can be a
CPU, GPU, or another accelerator
(see Figure 1). Devices contain one or
more compute units (processor cores).
These units are themselves composed
of one or more single-instruction
multiple-data (SIMD) processing elements (PE) t hat executeinstructions
in lock-step.
OpenCL Device Management

By providing a common language
and common programming interfaces

and hardware abstractions, OpenCL
lets developers accelerate applications
with task- or data-parallel computations in a heterogeneous computing
environment consisting of the host
CPU and any attached OpenCL devices. Such devices might or might
not share memory with thehost CPU,
and typically have a different machine instruction set. The OpenCL
programming interfaces therefore assume heterogeneity between the host
and all attached devices.
OpenCL’s key programming interfaces include functions for
• enumerating available target devices (CPUs, GPUs, and various
accelerators);
• managing the target devices’
contexts;
• managing memory allocations;
•performing host-device memory
transfers;
• compiling the OpenCL programs
and kernel functions that the
devices will execute;
• launching kernels on the target
devices;
• querying execution progress; and
• checking for errors.
Although developers can compile
and link OpenCL programs into
inary objects using off line compilation methodology, OpenCL

Computing in SCienCe & engineering...
Leer documento completo

Regístrate para leer el documento completo.

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS