[−][src]Struct emu_core::device::ArgsBuilder
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]
T: 'static + ?Sized,
impl<T, U> AsDeviceBoxed<T> for U where
T: AsBytes + ?Sized,
U: Borrow<T>,
[src]
T: AsBytes + ?Sized,
U: Borrow<T>,
fn as_device_boxed(&Self) -> Result<DeviceBox<T>, NoDeviceError>
[src]
fn as_device_boxed_mut(&Self) -> Result<DeviceBox<T>, NoDeviceError>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,