Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

Entry points that pick a Backend and run a generic Kernel: runtime CPU detection chooses the widest implemented backend per scalar (build-time target_features on no-std or under --cfg hp_static_dispatch), with ScalarBackend as the universal fallback.

Traits§

Kernel
A unit of work generic over the execution backend. Implement this once; hydroplane runs it on the backend it selects, handing run a Gang context to build varying values through (splat, load, …). The raw Backend token is reachable via Gang::backend.
SimdDispatch
Per-scalar dispatch policy. f32/f64 try a SIMD backend then fall back to scalar; other scalars (e.g. f16 before the native-FP16 milestone) use the scalar path.

Functions§

dispatch
Run kernel on the best available backend for T, chosen by runtime CPU detection.
run_scalar
Run kernel on the always-available scalar (1-lane) backend. Useful as a correctness oracle or baseline; normal code should use dispatch.