Course Outline
Foundations of GPU-Accelerated Computing
- Heterogeneous computing and CPU-GPU architectural differences
- CUDA execution models and memory hierarchies
- Compiling CUDA C++ using nvcc and CMake
- Validating the GPU development setup
Parallel Algorithms via Thrust and CUB
- GPU-accelerated sorting, reduction, and transformation
- Refactoring STL algorithms for GPU deployment
- Utilizing Thrust device vectors and execution policies
- Implementing CUB device-wide primitives for custom workflows
GPU Memory Structures and Control
- Types of memory: global, constant, and texture
- Explicit device memory allocation and transfer mechanisms
- Unified Memory for streamlined data access
- Optimizing memory coalescing and access patterns
Asynchronous Operations with CUDA Streams
- Creation and management of CUDA streams
- Concurrent execution of kernels and data transfers
- Using CUDA events to manage dependencies
- Tuning stream priorities and concurrency
Developing Custom CUDA Kernels
- The SIMT programming model and warp execution dynamics
- Configuring kernel launches and implementing grid-stride loops
- Thread indexing strategies and multidimensional grids
- Error handling and CUDA runtime API verification
Thread Hierarchy and Execution Logic
- Structures of grids, blocks, and threads in device code
- Warp-level primitives and ballot operations
- Block-level synchronization and barrier mechanisms
- Analyzing occupancy and resource utilization
Cooperative Groups for Adaptive Parallelism
- Overview of the cooperative_groups API and group types
- Thread-block tiles and tiled_partition techniques
- Grid-level cooperative launch strategies
- Patterns for multi-grid synchronization
Strategies for Shared Memory Optimization
- Shared memory bank structures and avoiding conflicts
- Tiling methods for matrix computations
- Utilizing shared memory as a user-managed cache
- Using cuda::shared_memory_mdspan for multidimensional views
Kernel Fusion and Complex Parallel Patterns
- Combining multiple kernels to minimize launch overhead
- Scan, reduce-by-key, and segmented algorithm implementations
- Atomic operations and lock-free data structures
- Warp-aggregated atomics to improve throughput
Performance Analysis with Nsight Systems
- Timeline analysis of CPU and GPU activities
- Detecting bottlenecks in memory transfers
- Profiling kernel performance and occupancy
- Iterative optimization workflows using Nsight Compute
Modern C++ Features within CUDA Device Code
- Applying lambdas, constexpr, and auto in kernels
- C++17 parallel algorithms and execution policies
- C++20 concepts and ranges in device environments
- C++23 support via nvcc and CCCL 3.x
CUDA Graphs and Advanced Asynchrony
- Defining and launching CUDA graphs
- Capturing graphs from stream execution
- Updating graphs and managing conditional execution nodes
- Minimizing launch latency for iterative tasks
Integration Strategies for Existing Systems
- Encapsulating GPU code behind C++ interfaces
- Managing multi-GPU and NUMA system configurations
- Integrating CUDA into CMake build systems
- Debugging device code using cuda-gdb
Conclusion and Best Practices
- Selecting between Thrust, CUB, and custom kernels
- Achieving performance portability across GPU architectures
- Organizing code and applying RAII for CUDA resources
- Exploring next steps and advanced CUDA learning trajectories
Requirements
- Proficiency in fundamental C++, including lambda expressions, templates, and the STL
- Understanding of standard algorithms, containers, and iterators
- Confidence with loops, conditional logic, and functions
- No prior experience with CUDA or GPU programming is necessary
Target Audience
- C++ developers aiming to optimize compute-heavy applications using GPUs
- Software engineers shifting from CPU-only to heterogeneous parallel programming
- Performance engineers and quantitative developers handling large-scale datasets
Testimonials (3)
Detailed explanation, re-iteration of points in a quite subtle way that really drove the knowledge home very well. Rod's willingness to double-check the odd obscure question that we rasied, to be sure that his answers were 100% right. Also, his interest in discussing the pros & cons of alternate coding styles so that we learnt not only how to use C++ in our intended way, but why it should be done that way.
Nick Dillon - cellxica Ltd
Course - Using C++ in Embedded Systems - Applying C++11/C++14
Experience sharing, it's teacher's know-how and valuable.
Carey Fan - Logitech
Course - C/C++ Secure Coding
The online-ness of it meant that we could save a lot of time. Much appreciated. Also, the fact that the trainer knew both c# and Cpp was a huge help since he could explain everything through knowledge we already possessed.