Module runtime

Module runtime 

Source
Expand description

Runtime for dispatching device functions to CPU or device.

Structs§

Buffer
Opaque handle to a device-runtime buffer.
Cpu
CPU backend: mapping-expression-based interpretation.
Kernel
Device kernel loaded from a serialized binary.
Npu
NPU backend: PCIe DMA to/from device.
NpuDesc

Traits§

Backend
Backend for tensor operations.
DeviceFn
Device function trait, generated by #[device] macro.
TupleApply
Trait for applying a function to arguments.

Functions§

kernel_path
Builds the on-disk .bin path for a kernel, from the perspective of the #[device] macro expansion. module_path!() includes the crate name (my_crate::sub::mod), but the plugin’s artifact names use tcx.def_path_str which strips it (sub::mod); this helper drops the leading crate segment and mangles ::__ so the stem agrees with rustc_plugin::build_one.
launch
Launches a device function. Takes F by value so callers can pass the snake_case const emitted by #[device] (launch(my_fn, args)) rather than turbofishing the generated PascalCase unit struct (<MyFn as DeviceFn<_>>::execute(args)). The value is discarded; only its type drives trait dispatch.