Skip to main content

LoadedExecutable

Struct LoadedExecutable 

Source
pub struct LoadedExecutable { /* private fields */ }
Expand description

A program compiled for and loaded on the devices of a Client.

Implementations§

Source§

impl LoadedExecutable

Source

pub fn num_outputs(&self) -> usize

Returns the number of outputs of the program.

Source

pub fn execute(&self, args: &[&Buffer]) -> Result<Vec<Buffer>>

Runs the program on the first device and waits for it to finish.

The arguments must be on the device the program runs on, and must match the parameters of the program’s main function.

§Errors

Returns an error if an argument belongs to another client or if the execution fails.

Source

pub fn execute_with( &self, args: &[&Buffer], options: &ExecuteOptions, ) -> Result<(Vec<Buffer>, Event)>

Starts the program on the first device and returns its outputs without waiting for it to finish, with an event that completes when it does. The outputs can be passed to further executions (which the device runs in order) or copied to the host (which waits for them).

Arguments that the program aliases with outputs (donated, see ExecuteOptions) are consumed: their buffers are deleted.

§Errors

Returns an error if an argument belongs to another client or if the execution cannot start; errors during the execution are reported by the event and by the outputs.

Trait Implementations§

Source§

impl Debug for LoadedExecutable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for LoadedExecutable

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for LoadedExecutable

Source§

impl Sync for LoadedExecutable

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.