[][src]Trait dqcsim::host::accelerator::Accelerator

pub trait Accelerator {
    fn start(&mut self, args: impl Into<ArbData>) -> Result<()>;
fn wait(&mut self) -> Result<ArbData>;
fn send(&mut self, args: impl Into<ArbData>) -> Result<()>;
fn recv(&mut self) -> Result<ArbData>; }

Trait containing the primitive operations for an accelerator.

Required methods

fn start(&mut self, args: impl Into<ArbData>) -> Result<()>

Starts a program on the accelerator.

fn wait(&mut self) -> Result<ArbData>

Waits for the accelerator to finish its current program.

fn send(&mut self, args: impl Into<ArbData>) -> Result<()>

Sends a message to the accelerator.

fn recv(&mut self) -> Result<ArbData>

Waits for the accelerator to send a message to us.

Loading content...

Implementors

impl Accelerator for Simulation[src]

fn start(&mut self, args: impl Into<ArbData>) -> Result<()>[src]

Starts a program on the accelerator.

This is an asynchronous call: nothing happens until yield(), recv(), or wait() is called.

fn wait(&mut self) -> Result<ArbData>[src]

Waits for the accelerator to finish its current program.

When this succeeds, the return value of the accelerator's run() function is returned.

Deadlocks are detected and prevented by throwing an error message.

fn send(&mut self, args: impl Into<ArbData>) -> Result<()>[src]

Sends a message to the accelerator.

This is an asynchronous call: nothing happens until yield(), recv(), or wait() is called.

fn recv(&mut self) -> Result<ArbData>[src]

Waits for the accelerator to send a message to us.

Deadlocks are detected and prevented by throwing an error message.

Loading content...