OpenCL™规范 1.简介

1. Introduction

1.简介

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.

现代处理器体系结构已经将并行性作为提高性能的重要途径。面对在固定电源范围内更高时钟速度的技术挑战,中央处理器(CPU)现在通过添加多个内核来提高性能。图形处理单元(GPU)也从固定功能渲染设备发展成可编程并行处理器。由于当今的计算机系统通常包括高度并行的CPU、GPU和其他类型的处理器,使软件开发人员能够充分利用这些异构处理平台是很重要的。

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.

为异构并行处理平台创建应用程序具有挑战性,因为多核CPU和GPU的传统编程方法非常不同。基于CPU的并行编程模型通常基于标准,但通常假设共享地址空间,并且不包括矢量运算。通用GPU编程模型处理复杂的内存层次结构和矢量操作,但传统上是特定于平台、供应商或硬件的。这些限制使得开发人员很难从单个多平台源代码库访问异构CPU、GPU和其他类型处理器的计算能力。现在比以往任何时候都更需要使软件开发人员能够有效地充分利用异构处理平台,从高性能计算服务器,到台式计算机系统,再到手持设备,其中包括并行CPU、GPU和其他处理器(如DSP和Cell/B.E.处理器)的各种组合。

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(开放计算语言)是一种开放的免版税标准,用于跨CPU、GPU和其他处理器的通用并行编程,为软件开发人员提供了便携式和高效的访问这些异构处理平台的能力。

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通过低级别、高性能、可移植的抽象,支持广泛的应用程序,从嵌入式和消费类软件到HPC解决方案。通过创建一个高效、接近metal的编程接口,OpenCL将形成独立于平台的工具、中间件和应用程序的并行计算生态系统的基础层。OpenCL特别适合在新兴的交互式图形应用程序中发挥越来越重要的作用,这些应用程序将通用并行计算算法与图形渲染管道相结合。

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:

OpenCL由一个用于协调异构处理器之间的并行计算的API、一种跨平台编程语言和一种具有良好指定计算环境的跨平台中间语言组成。OpenCL标准:

  • Supports both data- and task-based parallel programming models.

  • 支持基于数据和任务的并行编程模型

  • Supports kernels written using a subset of ISO C99 with extensions for parallel execution

  • 支持使用ISO C99的子集编写的内核,并扩展并行执行

  • Supports kernels represented by a portable and self-contained intermediate language (e.g. SPIR-V) with support for parallel execution

  • 支持由可移植且自包含的中间语言(例如SPIR-V)表示的内核,并支持并行执行

  • Defines consistent numerical requirements based on IEEE 754

  • 基于IEEE 754定义一致的数字要求

  • Defines a configuration profile for handheld and embedded devices

  • 定义手持设备和嵌入式设备的配置文件

  • Supports efficient interop with OpenGL, OpenGL ES and other APIs

  • 支持与OpenGL、OpenGL ES和其他API的高效互操作

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.

本文档首先概述了OpenCL的基本概念和体系结构,然后详细描述了它的执行模型、内存模型和同步支持。然后讨论了OpenCL平台和运行时API。给出了一些示例,描述了示例计算用例以及如何在OpenCL中编写这些用例。该规范分为核心规范,任何符合OpenCL的实现都必须支持该核心规范;手持式/嵌入式配置文件,其放宽了对手持式和嵌入式设备的OpenCL合规性要求;以及一组可选扩展,这些扩展可能会在OpenCL规范的后续修订中进入核心规范。

1.1. Normative References

1.1.规范性引用文件

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.

规范性引用是对外部文件或资源的引用,OpenCL的实现者必须遵守本规范中描述的所有或指定部分。

ISO/IEC 9899:2011 - Information technology - Programming languages - CISO/IEC 9899:2011 - Information technology — Programming languages — C (final specification), http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf (last public draft).

1.2. Version Numbers

1.2.版本号

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.

OpenCL版本号遵循major.minor修订方案。当在API中使用此版本号时,通常只包括版本号的major.mino组件。

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.

修订号的差异表示对规范的微小更改,通常是为了修复错误或澄清语言。当修订号更改时,可能会对现有功能的行为产生影响,但这不应影响向后兼容性。当修订号更改时,不应添加或删除功能。

1.3. Unified Specification

1.3.统一规范

This document specifies all versions of the OpenCL API.

本文档指定了OpenCL API的所有版本。

There are three ways that an OpenCL feature may be described in terms of what versions of OpenCL support that feature.

有三种方式可以描述OpenCL功能,即OpenCL的哪些版本支持该功能。

  • Missing before major.minor: Features that were introduced in version major.minor. Implementations of an earlier version of OpenCL will not provide these features.

  • 在major.minor之前缺少:在major.minor版本中引入的功能。早期版本的OpenCL的实现将不提供这些功能。

  • Deprecated by major.minor: Features that were deprecated in version major.minor, see the definition of deprecation in the glossary.

  • 被major.minor弃用:在major.mior版本中被弃用的功能,请参阅词汇表中的弃用定义。

  • Universal: Features that have no mention of what version they are missing before or deprecated by are available in all versions of OpenCL.

  • 通用:所有版本的OpenCL都提供了一些功能,这些功能没有提及它们之前缺少的版本或被弃用的版本。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值