blob: 84ba8e1ff64f4f1aee6e8cddd961849c357b5def [file] [log] [blame] [edit]
// Copyright 2017-2024 The Khronos Group Inc.
// SPDX-License-Identifier: CC-BY-4.0
= Introduction
Modern processor architectures have embraced parallelism as an important
pathway to increased performance.
Facing technical challenges with higher clock speeds in a fixed power
envelope, Central Processing Units (CPUs) now improve performance by adding
multiple cores.
Graphics Processing Units (GPUs) have also evolved from fixed function
rendering devices into programmable parallel processors.
As todays computer systems often include highly parallel CPUs, GPUs and
other types of processors, it is important to enable software developers to
take full advantage of these heterogeneous processing platforms.
Creating applications for heterogeneous parallel processing platforms is
challenging as traditional programming approaches for multi-core CPUs and
GPUs are very different.
CPU-based parallel programming models are typically based on standards but
usually assume a shared address space and do not encompass vector
operations.
General purpose GPU programming models address complex memory hierarchies
and vector operations but are traditionally platform-, vendor- or
hardware-specific.
These limitations make it difficult for a developer to access the compute
power of heterogeneous CPUs, GPUs and other types of processors from a
single, multi-platform source code base.
More than ever, there is a need to enable software developers to effectively
take full advantage of heterogeneous processing platforms from high
performance compute servers, through desktop computer systems to handheld
devices - that include a diverse mix of parallel CPUs, GPUs and other
processors such as DSPs and the Cell/B.E.
processor.
*OpenCL* (Open Computing Language) is an open royalty-free standard for
general purpose parallel programming across CPUs, GPUs and other processors,
giving software developers portable and efficient access to the power of
these heterogeneous processing platforms.
OpenCL supports a wide range of applications, ranging from embedded and
consumer software to HPC solutions, through a low-level, high-performance,
portable abstraction.
By creating an efficient, close-to-the-metal programming interface, OpenCL
will form the foundation layer of a parallel computing ecosystem of
platform-independent tools, middleware and applications.
OpenCL is particularly suited to play an increasingly significant role in
emerging interactive graphics applications that combine general parallel
compute algorithms with graphics rendering pipelines.
OpenCL consists of an API for coordinating parallel computation across
heterogeneous processors, a cross-platform programming language, and a
cross-platform intermediate language with a well-specified computation
environment.
The OpenCL standard:
* Supports both data- and task-based parallel programming models
* Supports kernels written using a subset of ISO C99 with extensions
for parallel execution
* Supports kernels represented by a portable and self-contained
intermediate language (e.g. SPIR-V) with support for parallel execution
* Defines consistent numerical requirements based on IEEE 754
* Defines a configuration profile for handheld and embedded devices
* Supports efficient interop with OpenGL, OpenGL ES and other APIs
This document begins with an overview of basic concepts and the architecture
of OpenCL, followed by a detailed description of its execution model, memory
model and synchronization support.
It then discusses the OpenCL platform and runtime API.
Some examples are given that describe sample compute use-cases and how they
would be written in OpenCL.
The specification is divided into a core specification that any OpenCL
compliant implementation must support; a handheld/embedded profile which
relaxes the OpenCL compliance requirements for handheld and embedded
devices; and a set of optional extensions that are likely to move into the
core specification in later revisions of the OpenCL specification.
== Normative References
Normative references are references to external documents or resources to
which implementers of OpenCL must comply with all, or specified portions of,
as described in this specification.
[[iso-c11]]
_ISO/IEC 9899:2011 - Information technology - Programming languages - C_,
https://www.iso.org/standard/57853.html (final specification),
http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf (last public
draft).
== Version Numbers
The OpenCL version number follows a _major.minor-revision_ scheme. When this
version number is used within the API it generally only includes the
_major.minor_ components of the version number.
A difference in the _major_ or _minor_ version number indicates that some
amount of new functionality has been added to the specification, and may also
include behavior changes and bug fixes.
Functionality may also be deprecated or removed when the _major_ or _minor_
version changes.
A difference in the _revision_ number indicates small changes to the
specification, typically to fix a bug or to clarify language.
When the _revision_ number changes there may be an impact on the behavior of
existing functionality, but this should not affect backwards compatibility.
Functionality should not be added or removed when the _revision_ number
changes.
[[unified-spec]]
== Unified Specification
This document specifies all versions of the OpenCL API.
There are three ways that an OpenCL feature may be described in terms of what
versions of OpenCL support that feature.
* Missing before _major.minor_: Features that were introduced in
version _major.minor_. Implementations of an earlier version of OpenCL
will not provide these features.
* Deprecated by _major.minor_: Features that were deprecated
in version _major.minor_, see the definition of deprecation in the
glossary.
* Universal: Features that have no mention of what version they are missing
before or deprecated by are available in all versions of OpenCL.