This deck has 1-, 2-, and 3- slide variants for C++ AMP If your own deck uses 4:3, get with the 21 st century and switch to 16:9 ( Design tab, Page Setup button )
C++ AMP in 1 slide (for notes see comments section of slides from the 2- and 3- slide variant)
C++ Accelerated Massive Parallelism What – Heterogeneous platform support – Part of C++ & Visual Studio – STL-like library for parallel patterns on large arrays – Builds on DirectX Why – Performance – Productivity – Portability How #include using namespace concurrency; void AddArrays(int n, int * pA, int * pB, int * pC) { array_view a(n, pA); array_view b(n, pB); array_view sum(n, pC); parallel_for_each( sum.extent, [=](index idx) restrict(amp) { sum[idx] = a[idx] + b[idx]; } ); }
C++ AMP in 2 or 3 slides (for 2 slides, just drop the 3 rd one) (see comments section of each slide for notes)
C++ AMP Heterogeneous platform support Part of Visual C++ Visual Studio integration STL-like library for multidimensional data Builds on DirectX Is open spec performance portability productivity
Basic Elements of C++ AMP coding void AddArrays(int n, int * pA, int * pB, int * pC) { array_view a(n, pA); array_view b(n, pB); array_view sum(n, pC); parallel_for_each( sum.extent, [=](index idx) restrict(amp) { sum[idx] = a[idx] + b[idx]; } ); } array_view variables captured and associated data copied to accelerator (on demand) restrict(amp): tells the compiler to check that this code can execute on Direct3D hardware (aka accelerator) parallel_for_each: execute the lambda on the accelerator once per thread extent: the number and shape of threads to execute the lambda index: the thread ID that is running the lambda, used to index into data array_view: wraps the data to operate on the accelerator
C++ AMP at a Glance restrict(amp, cpu) parallel_for_each class array class array_view class index class extent class accelerator class accelerator_view class tiled_extent class tiled_index class tile_barrier tile_static storage class
C++ AMP resources Native parallelism blog (team blog) – MSDN Forums to ask questions – Daniel Moth's blog (PM of C++ AMP) –