Parallel and Heterogeneous Computing with Microsoft PPL and AMP in C++
Computationally intensive work is often best solved by moving to parallel processing, to take advantage of multiple cores. In addition many developers are starting to look towards using different types of hardware to optimize their software further.
Today many C++ programmers are looking to the Microsoft PPL (Parallel Patterns Library) and Microsoft AMP (Accelerated Massive Parallelism) to help them write parallel algorithms to run on both the CPU and GPU. Microsoft PPL is designed to help developers quickly get their code running on multiple cores, while the AMP libraries are intended to remove much of the complexity of heterogeneous computing (particularly around mixing hardware from different manufacturers). This course investigates both PPL and AMP, however it has a larger focus on the more advanced AMP functionality.
You will come out of “Parallel and Heterogeneous Computing” knowing the following:
- How to avoid common optimization pitfalls.
- When to benefit from parallelism.
- How the underlying hardware contributes to parallelism.
- How to take advantage of multiple cores with C++ and Microsoft PPL.
- How to take advantage of the GPU across multiple manufacturers with C++ and Microsoft AMP.
- How to avoid common parallel and heterogeneous computing pitfalls.
- How to debug and dig into parallel and heterogeneous programs.
- Experienced C++ Developers.
- Knowledge of multi-threaded programming using threads.
Introduction to Parallelism
- Move semantics
- Deleted/Defaulted Functions
- Types of performance
- Taking good benchmarks
- Accounting for error
Instruction level parallelism
- Understanding Limitations
- Caching (NUMA)
- Cost of shared writes
- Common Pitfalls
- 0.1 + 0.2 != 0.3
- Limitations of floating point
- Compiler optimizations with floating point
- Parallel processing and accuracy
Identifying algorithms that are parallelizable
- CPU bound Vs. IO bound
- Re-writing for better parallelization.
- Amdahl’s Law
Parallel patterns and algorithms
- Command queues
- Combined examples
- Why tasks instead of threads?
- Runtime support
- costs of synchronization
Visual Studio Debug Tools for Concurrency
- Concurrency Visualizer
- Parallel Stacks
- Parallel Tasks
- Parallel Watch
- Identifying anti-patterns
- Debugging PPL Algorithms
- Event Tracing
- Catching task::get/task::wait
- Exceptions inside parallel_for vs for loops
Similar Technologies to PPL
Introduction to Vector programming
- What is SIMD
- Masking and execution coherence
- Memory Layout
- Structure of Array
- Array of Structs
- Auto vectorization
Introduction to the GPU Hardware
- Memory Types and Caching
- Cores, Threads, Tiles and Warps
- PCIe Bus
Methods of writing code for the GPU
- Microsoft C++ AMP
- AMP Syntax and Data Types
- array, array_view
- How to use
- Optimizing Memory Move/Copy
Synchronizing memory with accelerators
- Implicit synchronization
- Lost Exceptions
Concurrency::fastmath and precisemath
- What’s inside
- Comparison to “standard” math.
- Accelerator requirements
- Visual Studio Tools
- GPU Threads
- Parallel Stacks
- Parallel Watch
- How they are handled
- Why they are different from CPU
- Performance of float/double operations
- Determining tile size
- Memory Coalescence
- Memory Collisions
- Tile Synchronization
Parallel patterns with AMP
- Accelerator properties
- Shared memory
- Using multiple accelerators
- Exploiting the texture cache
- Detecting/Recovering from TDR
Other relevant courses