Site Tools


fdtd-cuda-simulation-backends

Table of Contents

Simulation backends (2D FDTD)

Simulation backends run the same numerical model using different hardware and execution strategies. The driver makes the choice explicit:

# CPU reference implementation.
$ build/out/debug/fdtd --nx 256 --ny 256 --steps 400 --backend serial
 
# Parallel CPU updates.
$ build/out/debug/fdtd --nx 256 --ny 256 --steps 400 --backend openmp
 
# GPU updates.
$ build/out/debug/fdtd --nx 256 --ny 256 --steps 400 --backend cuda

These commands hold grid dimensions and step count constant. Backend availability depends on the build and hardware.

The serial backend is the reference. The OpenMP and CUDA backends provide v1 through v4 optimization levels. Select a level with --variant v2, for example. Comparisons should also hold precision, boundary conditions, and output settings constant so that timings reflect execution strategy rather than different work.

fdtd-cuda-simulation-backends.md · Last modified: by 127.0.0.1