Bringing Existing Code to CUDA Using constexpr and std::pmr
summary
Existing options-pricing code is adapted to run on GPU by changing where and how memory is allocated and by making functions visible to the device: allocation uses a custom std::pmr memory_resource that delegates to cudaMallocManaged for unified memory or to device-only allocation, and a polymorphic allocator that avoids CPU-side default construction; functions stay unchanged by relying on constexpr as __device__ via the NVCC flag so existing libraries work on the GPU.
AI-written summary · about
chapters (31)
- 0:00Introduction
- 1:49Bowies background
- 8:44Memory
- 11:51stdpmr
- 14:12Unified Memory Resource
- 14:56Allocation and Deallocation
- 17:14Object Allocation
- 18:18Callable Objects
- 21:22Unified Memory
- 22:49Device Memory Resource
- 23:08CUDA Malloc vs CUDA Malloc Managed
- 24:16Why doesnt this example work
- 26:01Solution
- 28:18Nonprimitive
- 29:16Create Memory
- 29:43Create Allocator
- 30:19Recap
- 34:49UnifiedMemory Resource
- 36:36Host vs Device Functions
- 36:48What are Host and Device Functions
- 38:39Execution Space Specifiers
- 39:39Host
- 45:28Nvidia compiler flag
- 46:03Using constexpr
- 49:52Libraries that support constexpr
- 52:02No work less work
- 54:06Return on Investment
- 54:52Standard PMR
- 56:20constexpr
- 58:42Questions
- 59:10Static analyzers
related talks
01h 00mMemory Resources in a Heterogeneous World
01h 10mBasic usage of PMRs for better performance
27m“From security to performance to GPU programming..."
20mMemory Harvesting in Multi-GPU Systems with Hierarchical Unified Virtual Memory
58mC++ Performance and Optimisation
24mZero Code Change Acceleration: familiar interfaces and high performance
23mOffload Annotations: Bringing Heterogeneous Computing to Existing Libraries...
49mMaking Allocators Work, Part I
