C++ AMP : Language and Programming Model - Microsoft Download ...

The programmer must carefully balance the cost of this potential data ...... function and the barrier dominates the load and no potential store into the same ...
3MB Sizes 3 Downloads 70 Views
C++ AMP : Language and Programming Model Version 1.0, August 2012

© 2012 Microsoft Corporation. All rights reserved. This specification reflects input from NVIDIA Corporation (Nvidia) and Advanced Micro Devices, Inc. (AMD). Copyright License. Microsoft grants you a license under its copyrights in the specification to (a) make copies of the specification to develop your implementation of the specification, and (b) distribute portions of the specification in your implementation or your documentation of your implementation. Patent Notice. Microsoft provides you certain patent rights for implementations of this specification under the terms of Microsoft’s Community Promise, available at http://www.microsoft.com/openspecifications/en/us/programs/communitypromise/default.aspx. THIS SPECIFICATION IS PROVIDED "AS IS." MICROSOFT MAY CHANGE THIS SPECIFICATION OR ITS OWN IMPLEMENTATIONS AT ANY TIME AND WITHOUT NOTICE. MICROSOFT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, (1) AS TO THE INFORMATION IN THIS SPECIFICATION, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; OR (2) THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS OR OTHER RIGHTS.

C++ AMP : Language and Programming Model : Version 0. 2012

ABSTRACT C++ AMP (Accelerated Massive Parallelism) is a native programming model that contains elements that span the C++ programming language and its runtime library. It provides an easy way to write programs that compile and execute on dataparallel hardware, such as graphics cards (GPUs). The syntactic changes introduced by C++ AMP are minimal, but additional restrictions are enforced to reflect the limitations of data parallel hardware. Data parallel algorithms are supported by the introduction of multi-dimensional array types, array operations on those types, indexing, asynchronous memory transfer, shared memory, synchronization and tiling/partitioning techniques.

1

Overview .................................................................................................................................................................. 1 1.1 1.2 1.3 1.4

2

Conformance ............................................................................................................................................................ 1 Definitions ................................................................................................................................................................. 2 Error Model ............................................................................................................................................................... 4 Programming Model ................................................................................................................................................. 5

C++ Language Extensions for Accelerated Computing ............................................................................................... 6 2.1 Syntax........................................................................................................................................................................ 6 2.1.1 Function Declarator Syntax .................................................................................................................................... 7 2.1.2

Lambda Expression Syntax ..................................................................................................................................... 7

2.1.3

Type Specifiers ....................................................................................................................................................... 7

2.2 Meaning of Restriction Specifiers ............................................................................................................................. 8 2.2.1 Function Definitions ........................