Auto-Vectorizer in Visual Studio 2012 – How it Works

  I assume you have read previous posts in this blog about auto-vectorization, starting with auto-vectorization-overview. In this post, we will look at how the auto-vectorizer works. Here is a tiny program that calculates the cube of each element in array b, setting the answer into a matching array called a. Of course, this program…

18

Avoiding Contention using Combinable Objects

When attempting to parallelize an algorithm, programmers are frequently thwarted by the presence of shared state.  Any state that can potentially be modified by multiple threads simultaneously during a parallel operation must be synchronized somehow to prevent race conditions, data corruption, and all kinds of nasty behaviour.  If the shared state is modified infrequently, the…

12

C++ AMP open spec published

Feb 2012: Published original v0.9. May 2012: Attachment Updated to v0.99. August 2012: Updated to v1.0. December 2013: Published v1.2. When we announced C++ AMP in June 2011, we also announced that it would be an open specification. Since then we have made multiple interim releases (of both the product and the open spec) with…

12

What do you want in the next version of C++ AMP? – we are listening

Visual Studio 2012 includes the first release of the C++ AMP technology and hopefully by now you have had a chance to learn about and even better try your hands at it. We would like you to know that this first release is just a beginning and our team is actively planning new features and…

11

Changes in VS 11 Beta for C++ AMP

With the release of Visual Studio 11 Beta, you get among other things an updated version of C++ AMP. After the Beta, we aspire to have no breaking changes (or even major additions) in C++ AMP, so that when you receive the final RTM release your upgrade process will be super smooth (the goal is…

11

Binomial Option using C++ AMP

In the financial industry, Binomial Option is a one of the methods to valuate options. Another one is Black-Scholes, which is faster than Binomial Option, but is not as accurate. main – Program entry point Let’s start with main(). First it generates random data (financial options), then it normalizes random options (meaning updates the options’…

11

Start GPU Debugging in Visual Studio 2012

There is fantastic debugging support for C++ AMP in Visual Studio 2012, and in this post I’ll show you how easy it is to get started. 1. Create a new “Hello World” project Follow the steps described in an earlier post to create the “Hello World” project. Do not try this on one of your…

11

Guided Tour of the Concurrency Runtime and Parallel Libraries Part 1: supporting fine-grained tasks

In the next several blog posts I want to continue the early look of what we’re considering in the Concurrency Runtime and the Parallel Libraries built on top of it.  Today, I’ll share primitives for expressing fine-grained parallelism and concurrency.  In the next few posts in this series, I’ll provide a look at the additional primitives for…

11

Auto-Vectorizer in Visual Studio 2012 – Overview

This post will introduce and explain a new compiler feature in Visual Studio 2012, called auto-vectorization.  (A previous post – what is vectorization? – provides background) The Visual Studio 2012 auto-vectorizer tries to make loops in your code run faster by automatically vectorizing your code – that’s to say, using the SSE instructions available in all current mainline…

10

Double precision support in C++ AMP

C++ AMP supports various data types for usage in the restrict(amp) functions that you schedule on the accelerator. One of those types is double. There are caveats and extra information that you need to know with regards to double precision and this post aims to help you with that. It all depends on your driver…

9