CUDA Kernels with C++
summary
Shows concrete C++ techniques that run on NVIDIA GPUs: a templated device_ptr type and device_memory class to avoid host/device pointer bugs, placement-new to construct polymorphic objects on the GPU, and using templates for zero-cost static polymorphism. Demonstrates lambdas that cross CPU/GPU with the need for lambda capture by value, confirms via Compiler Explorer and cuobjdump that static polymorphism and lambdas produce no assembly overhead, notes new/delete work on device but exceptions are unsupported.
AI-written summary · about
chapters (11)
- 0:00Start
- 1:32Setting the Ground
- 2:26Vector Addition in CUDA
- 4:47CUDA C
- 6:58Compiles, but fails in runtime
- 7:35Let's use explicit device memory pointers
- 12:18Static Polymorphism
- 15:34Dynamic allocation in CUDA
- 19:28Lambda parameters!!
- 26:00Godbolting CUDA
- 29:59Runtime Templates
related talks
48mBridging the Gap: Writing Portable C++ Programs for CPU and GPU
01h 00mGPU Accelerated Computing & Optimizations on Cross-Vendor Graphics Cards with Vulkan & Kompute
37mC++ for multi-accelerator, multi-vendor systems
01h 32mHeterogeneous Programming in C++ today
58mGenerating OpenCL/CUDA source code from C++ expressions in VexCL
56m“Towards Heterogeneous Programming in C++"
01h 01mTake Advantage of All the MIPS - SYCL & C++
30mCuPy: A NumPy-compatible Library for GPU
