Skip to main content

Module fdtd_dsl

Module fdtd_dsl 

Source
Expand description

FDTD kernel defined using the Rust DSL.

This module demonstrates how to define stencil kernels in pure Rust that get transpiled to CUDA at compile time.

The generated CUDA code is equivalent to the handwritten version in shaders/fdtd_tile.cu, but is written in a high-level Rust DSL.

Structs§

GridPos
CPU-side GridPos for when cuda-codegen is not enabled.

Functions§

fdtd_tile_step_dsl
Run FDTD on an entire tile using the DSL kernel.
fdtd_wave_step_cpu
FDTD wave equation kernel for 16x16 tiles with 1-cell halo.
fdtd_wave_step_dsl
FDTD wave equation kernel using the GridPos DSL.
generate_fdtd_cuda
handwritten_fdtd_cuda
Get the handwritten CUDA source for comparison.