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.
- Device
Fn - Device function trait, generated by
#[device]macro. - Tuple
Apply - Trait for applying a function to arguments.
Functions§
- kernel_
path - Builds the on-disk
.binpath 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 usetcx.def_path_strwhich strips it (sub::mod); this helper drops the leading crate segment and mangles::→__so the stem agrees withrustc_plugin::build_one. - launch
- Launches a device function. Takes
Fby 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.