pub struct LoadedExecutable { /* private fields */ }Expand description
A program compiled for and loaded on the devices of a Client.
Implementations§
Source§impl LoadedExecutable
impl LoadedExecutable
Sourcepub fn num_outputs(&self) -> usize
pub fn num_outputs(&self) -> usize
Returns the number of outputs of the program.
Sourcepub fn execute(&self, args: &[&Buffer]) -> Result<Vec<Buffer>>
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.
Sourcepub fn execute_with(
&self,
args: &[&Buffer],
options: &ExecuteOptions,
) -> Result<(Vec<Buffer>, Event)>
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.