Injecting Python Functions into a Template-Driven CUDA C++ Framework
summary
Integrates MCDC Python Monte Carlo code with a template CUDA C++ runtime called Harmonize, producing device PTX, object files with relocatable device code, and a shared library that Numba can load and call; automation generates FFI handles and wrappers so Python functions become GPU-callable. Highlights include FFI sandwich layering, manual demangling of Numba PTX names, and pitfalls like object mode copying of large global structs and strict Numba type/alignment rules; the system works but requires careful type and build automation, which is provided.
AI-written summary · about
chapters (11)
- 0:00Introduction to the talk
- 0:26Background on Monte Carlo neutron transport
- 3:15Challenges of GPU programming for domain experts
- 5:00Introducing Harmonize framework
- 8:13FFI sandwich architecture details
- 10:03Python to CUDA injection process
- 14:38Compiling and linking the runtime
- 17:27Benefits of the automated glue
- 18:10Pitfalls and limitations
- 22:22References and acknowledgments
- 22:43Q&A session
