fdtd-cuda-cuda-graphs
Table of Contents
CUDA graphs (2D FDTD)
A CUDA graph records GPU operations for replay with less host submission work. FDTD CUDA wraps replay in its Graph class:
void Graph::launch(const Stream &stream) const { check(cudaGraphLaunch(m_exec, stream.handle()), "cudaGraphLaunch"); }
The graph is built using stream capture:
check(cudaStreamBeginCapture(stream.handle(), cudaStreamCaptureModeThreadLocal), "cudaStreamBeginCapture");
v2 introduces captured batches of sixteen steps; v3 and v4 retain graph replay. Remaining steps outside a complete batch are queued individually. The graph preserves operation dependencies and uses a device step counter for changing source samples.
Replay reduces launch submission overhead rather than the field arithmetic itself. It is most useful when repeated short kernels make host launch costs visible.
Source: fdtd_tmz_backend_gpu_graph.cu.
fdtd-cuda-cuda-graphs.md · Last modified: by 127.0.0.1
