“CUDA Kernels with C++”
summary
Shows concrete C++ applied to CUDA: template kernels replace duplicated int/float kernels, and type-safe DevicePtr vs raw pointers prevents host/device pointer mixups; constructs objects on the GPU with placement new via a one-thread AllocateObject kernel and a DevObject wrapper; overlaps transfers and compute with cudaMemcpyAsync with pinned host memory (copy/compute pipelining), while ZeroCopy spikes latency (example jumping ~2 ms to ~70 ms) and Unified Memory uses cudaMallocManaged plus prefetch advice; NVRTC enables runtime template instantiation; Compiler Explorer and cuobjdump confirm many C++ abstractions compile away to zero overhead.
AI-written summary · about
chapters (29)
- 0:00Introduction to CUDA
- 1:08Vector addition example
- 4:02C++ features in CUDA
- 6:13Device pointers in CUDA
- 8:50Device memory helpers
- 11:48Type safety in device pointers
- 12:34Static polymorphism with templates
- 13:42Dynamic polymorphism challenges
- 15:57Device object allocation
- 18:50Dynamic object destruction
- 19:11New and delete in kernels
- 19:32Memory transfer optimization
- 21:01Overlapping copy and compute
- 22:09Pinned and zero copy memory
- 23:57Unified memory overview
- 26:30Sparse access use cases
- 26:53Lambda expressions in CUDA
- 27:58Passing lambdas to GPU
- 29:47Struct-based lambda creation
- 30:51Returning lambdas to GPU
- 32:39Zero-overhead abstractions
- 33:03Profiling CUDA code
- 34:53Other C++ features in CUDA
- 35:59Pragma unroll in CUDA
- 37:05Runtime compilation benefits
- 38:55Runtime compilation steps
- 42:14Thrust library overview
- 43:17Resources and references
- 44:24Q&A session
related talks
01h 05mWhy You Should Write Code That You Should Never Write
01h 03mIntro to 3D Graphics
40mGraphics Programming with Kotlin
01h 01m3D Graphics for Dummies
58mGraphics Programming with LambdaCube 3D - Part 1 of 2
01h 02mHigh Performance Graphics and Text Rendering on the GPU
39mHidden Gems of Everyday Game Development with C#
59mGraphics Programming with LambdaCube 3D - Part 2 of 2
