~/talk

Using Template Magic to Automatically Generate Hybrid CPU/GPU-Code

Talkat CppCon 2018 · 2018-09-23..09-28· [c-and-cpp, machine-learning]
links:none on file
slides:none on file

Template-based wrappers let the same C++ code compile either into a CPU loop or a CUDA kernel by using a cudaMallocManaged allocator for transparent memory and a hybrid functor/kernel wrapper that inspects arguments and launches device or host paths. Worked example: ported a multi-particle collision dynamics solver (MPCD) and verified the functor path compiles to equivalent PTX with no measurable overhead. Measured throughput: ~1.2 billion particles/s on 192 CPU cores, one machine with four GTX1080 cards exceeds that and multi‑GPU runs show about 3.5× speedup; sample code is on the CppCon/GitHub resources.

AI-written summary · about

  1. 0:00Introduction to hybrid code
  2. 2:57Why use GPUs for computation
  3. 8:05GPU architecture overview
  4. 11:43Types of GPU memory
  5. 17:08Threading model in CUDA
  6. 19:20CUDA C++ language basics
  7. 23:52Memory allocation in CUDA
  8. 28:18Problems with repetitive GPU code
  9. 29:46Goal of hybrid platform-agnostic code
  10. 31:57Managed memory allocator design
  11. 34:29Vector type for hybrid use
  12. 35:12Hybrid functor concept
  13. 37:11Deploying code to CPU or GPU
  14. 40:41Kernel wrapper and argument handling
  15. 44:45Performance impact of wrappers
  16. 45:53Using the hybrid.hpp library
  17. 47:01Example vector addition
  18. 48:07Histogram example and atomic operations
  19. 51:36Real-world performance gains
  20. 53:54Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.