[][src]Struct emu_core::device::ArgsBuilder

pub struct ArgsBuilder<'a> { /* fields omitted */ }

Helps with building a DeviceFnMutArgs

ArgsBuilder helps you build a DeviceFnMutArgs by providing references to each DeviceBox argument. It's perfectly safe to pass a reference to a mutable DeviceBox. If the kernel these arguments are being passed to only accepts mutable arguments, Emu will assert that they are at runtime.

let data: DeviceBox<[f32]> = vec![0.0; 4096].as_device_boxed()?;
let tau = DeviceBox::new(6.2832)?;
let args = ArgsBuilder::new()
    .arg(&data)
    .arg(&tau)
    .build();

Methods

impl<'a> ArgsBuilder<'a>[src]

pub fn new() -> Self[src]

Creates a new builder with no arguments

pub fn arg<T: ?Sized>(self, device_obj: &'a DeviceBox<T>) -> Self[src]

Declare a new arguments by passing in a DeviceBox

pub fn build(self) -> DeviceFnMutArgs<'a>[src]

Builds the final DeviceFnMutArgs

Auto Trait Implementations

impl<'a> !RefUnwindSafe for ArgsBuilder<'a>

impl<'a> Send for ArgsBuilder<'a>

impl<'a> Sync for ArgsBuilder<'a>

impl<'a> Unpin for ArgsBuilder<'a>

impl<'a> !UnwindSafe for ArgsBuilder<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> AsDeviceBoxed<T> for U where
    T: AsBytes + ?Sized,
    U: Borrow<T>, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.