The GPU kernels (Slang, compiled to SPIR-V by slangpy) around the update maths
the CPU core runs (core/fdtd_core.h, read by Slang as it is): one thread per
node for the H and E updates (on the compressed operator: codes, tables and
line arrays, no coefficient arrays), the sparse kernels on flat indices into
the (3, Nx, Ny, Nz) arrays. A CUDA version for CuPy, kernel for kernel the same,
was removed in 2026-11. What is Vulkan's own:
- the model's arrays are reached through one struct in device memory (Model:
their device addresses and the sizes), so a launch sets a pointer and a few
values, not twenty arguments (each costs host time in slangpy);
- a launch's threads cover its range in a grid-stride loop (`stride`: the
threads launched), the node index in 32 bits (the backend keeps 3 nx ny nz
below 2^31);
- the energy: a double per workgroup into part[], their sum on the host (no
float64 atomics on RDNA's Vulkan), and the lumped branches' energy in
part[nblk] by the first thread;
- probe() adds the voltage and the current probes in one launch.
source('uint16_t') # the module's source, for uint8_t / uint16_t / uint32_t
# codes
MODEL # Model's fields in order: (name, kind), kind 'p' a
# pointer, 'i' int32, 'f' float32