DeviceFn

Trait DeviceFn 

Source
pub trait DeviceFn<Args: DeviceSend> {
    type Output: DeviceSend;

    // Required method
    fn execute(args: Args) -> impl Future<Output = Self::Output>;
}
Expand description

Device function trait, generated by #[device] macro.

cargo <subcommand>: execute() runs the original function body on CPU. cargo furiosa-opt <subcommand>: execute() loads the compiled EDF and runs on NPU.

Required Associated Types§

Source

type Output: DeviceSend

Return type of the device function.

Required Methods§

Source

fn execute(args: Args) -> impl Future<Output = Self::Output>

Execute the device function.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§