background preloader

C++ AMP

Facebook Twitter

Windows AMP Introduction and Best Practices sample in C++ for Visual Studio 2012. Multicoreware / cppamp-driver-ng. This repository hosts a C++AMP compiler implementation project. The goal is to implement a compiler that takes a program conforming C++AMP 1.2 standard and transforms it into HSAIL, SPIR binary, or OpenCL-C. Tested targets are: Khronos OpenCL SPIR 1.2 and OpenCL C forAMD Stack/AMD GPU with Khronos SPIR 1.2 and OpenCL CNVIDIA Stack/NVIDIA GPU with OpenCL CApple Mac OS X 10.9 Stack with OpenCL CHSAIL and BRIG for HSA devices:AMD Kaveri APU Please notice HSA packages can't work on OpenCL/SPIR machines yet. See also Downloads for older versions To install, download clamp and libcxxamp DEB files from links above, and: sudo dpkg -i libcxxamp-<version>-Linux.deb clamp-<version>-Linux.deb Default installation directory is /opt/clamp. To install, download clamp and libcxxamp tar.gz files from links above, and: sudo tar zxvf libcxxamp-<version>-Linux.tar.gzsudo tar zxvf clamp-<version>-Linux.tar.gz See InstallOnMacOSX See HSA Support Status # Assume clamp and libcxxamp are installed and added to PATH # 1.

Parallel Programming in Native Code. C++ AMP Conformance Test Suite - Home. GPGPU. This is a very long post, but it also covers what are probably the classes (well, array_view at least) that you will use the most with C++ AMP, so I hope you enjoy it! Overview The concurrency::array and concurrency::array_view template classes represent multi-dimensional data of type T, of N dimensions, specified at compile time (and you can later access the number of dimensions via the rank property). If N is not specified, it is assumed that it is 1 (i.e. single-dimensional case). They are rectangular (not jagged). The difference between them is that array is a container of data, whereas array_view is a wrapper of a container of data.

The data in the array (whether provided at creation time or added later) resides on an accelerator (which is specified at creation time either explicitly by the developer, or set to the default accelerator at creation time by the runtime) and is laid out contiguously in memory. Creating array and array_view objects and relevant properties Not Covered. C++ AMP Open Spec V1.2 Published - Parallel Programming in Native Code. Please don't give up on C++ AMP. Microsoft has a history of abandoning these types of unique opportunities that benefits them and their customers. I'm mainly a CUDA programmer, and I have experimented with C++ AMP as well. I've been using OpenCL for a project recently, it's really a pain in the neck, I can't understand how these big names in the industry came together and proposed this mess as a "platform-independent" alternative to CUDA.

As far as competing with CUDA, it's a complete failure in my view, it will never become mainstream, I can't see how anyone in their right mind would expect a 21st century programmer crying for garbage-collection and higher levels of abstraction to use OpenCL or anything like it as their main tool. It's verbose, counter-intuitive, counter-productive, you are forced to do repetitive tasks that could easily be automated without any sort of performance cost, and for all of that headache you don't get any performance advantage over CUDA or C++ AMP. Parallel Programming in Native Code. Msdn forums - Parallel Computing in C++ and Native Code. Present on C++ AMP - Parallel Programming in Native Code. Some of you don't just want to learn C++ AMP, but you also want to present on C++ AMP to your colleagues, or at user groups and other such events. To help you with that goal, we have made available a set of slides from which you can pick the ones that fit your style and approach, and also links to screencasts showing how we do demos of samples and code.

Also, I recommend that you print the C++ AMP one-pager (pdf) and hand it out to your attendees (or leave it on their chairs, etc.). Before reading below the proposed seven sections of any C++ AMP presentation, please download the slide deck and notice how many slides have links to resources for more information on the content that the slide represents. I strongly suggest you have the PowerPoint pptx file open while reading the rest of this blog post, so you can cross-reference from the text below - enjoy! Cartoonizer screencast - this is slide 4NBody screencast - this is slide 5Morph screencast - this is slide 6. Learn C++ AMP - Parallel Programming in Native Code. So you are a newbie to C++ AMP – you know nothing and want to quickly get started, we have you covered – keep on reading! Step 1 – Do this first! While it is typical for many to learn a new technology by writing your own "Hello World", if you don’t want to wander off into the minefield of GPU programming on your own, please start with what we provide in terms of articles and videos.

There are two articles specifically aimed at newcomers: When you are done with the articles, please invest 68 minutes to sit back and watch 4 screencast videos: Step 2 – optional if you are already an expert in GPU computing At this point you’ve spent 2 hours and you understand not only how to hit the ground running with your own algorithms, but also how C++ AMP is positioned. Step 3 – Dive into code This is probably the step most of you wanted to start with, and I hope you resisted until now. Step 4 – Become an expert. [Updated 31 Jan 13] SystemCompute v0.5.7.2. HWBot Thread: Got my head around some C++ AMP at the weekend and wrote a benchmark for DX11 GPUs that probes some of the computational aspects in grid solvers.

Each stage lasts for 30 seconds, user can either select CPU tests or GPU tests, but having a fast CPU helps keep the GPU fed. AMD doesn't fair too well, but that's more a weakness of the DX11 API with C++ AMP for this sort of thing. Download below and feel free to test! v0.5.7 is the latest beta: 2,908k .zip file v0.5.7 CPU Results (Click to show) v0.5.7 AMP Results (Click to show) Changelog: Warning: Spoiler! // Changelog // v0.5.7.2 : Back to S-GPU // : Either CPU or AMP, not both // v0.5.6 : Big change in n-Body example // v0.5.5 : Add in N-Body from Example // : Add in M-GPU NBody // v0.5.4 : Optimisations // : Add in OS detection // v0.5.3 : Optimisations // : 3DPMo-AMP now is blinding. // first then making them reads is better // This is so newer hardware is tested to a limit. Kate Gregory and Ade Miller - C++ AMP book. Updated October 16th 2012. Want the sample code? It is now available on Codeplex. There are also resources there including links to tutorials and recordings of sessions on C++ AMP.

You can now buy this book! Please do: Need support? O'Reilly maintains the Errata page and there is a mechanism there for reporting errors to us. This page, www.gregcons.com/cppamp, will be the landing page for the book for all time. We wrote the book to be a great way to learn C++ AMP. The Parallel Programming in Native Code blog where a number of samples are posted. Kate Gregory and Ade Miller. C++ AMP: Accelerated Massive Parallelism with Microsoft Visual C++ - Home. Introducing C++ Accelerated Massive Parallelism (C++ AMP) - Visual C++ Team Blog.

C++ AMP sample projects for download - Parallel Programming in Native Code. For some developers, reading code (that fully compiles in a Visual Studio project) is a much better way to learn an API than reading documentation about an API. If that describes you, then you'll be happy to know that in between our blog posts explaining various aspects of C++ AMP, we also post blog entries that have ZIP files attached with VS 2012 projects, representing C++ AMP samples.

This blog post will serve as a table of contents (toc) for all such blog posts. We'll come back and update this toc whenever we post a new entry with a VS project attached - enjoy! This is our current list of public VS 2012 projects using C++ AMP - follow the link (Ctrl+Click) to open a new web page and then browse to the bottom of the new page to download the ZIP file: Note 1: As we release new versions of Visual Studio and C++ AMP, we'll try to go back and update the ZIP file of each sample to be compatible with the latest Visual Studio and C++ AMP release, i.e. like we did with the Beta. C++ AMP Algorithms Library - Home. C++ AMP (C++ Accelerated Massive Parallelism) C++ AMP in a nutshell - Parallel Programming in Native Code.