Struct burn_compute::Compute
source · pub struct Compute<Device, Server: ComputeServer, Channel> { /* private fields */ }Expand description
The compute type has the responsibility to retrieve the correct compute client based on the given device.
Implementations§
source§impl<Device, Server, Channel> Compute<Device, Server, Channel>where
Device: Hash + PartialEq + Eq + Clone + Debug,
Server: ComputeServer,
Channel: ComputeChannel<Server>,
impl<Device, Server, Channel> Compute<Device, Server, Channel>where Device: Hash + PartialEq + Eq + Clone + Debug, Server: ComputeServer, Channel: ComputeChannel<Server>,
sourcepub fn client<Init>(
&self,
device: &Device,
init: Init
) -> ComputeClient<Server, Channel>where
Init: Fn() -> ComputeClient<Server, Channel>,
pub fn client<Init>( &self, device: &Device, init: Init ) -> ComputeClient<Server, Channel>where Init: Fn() -> ComputeClient<Server, Channel>,
Get the compute client for the given device.
Provide the init function to create a new client if it isn’t already initialized.
sourcepub fn register(&self, device: &Device, client: ComputeClient<Server, Channel>)
pub fn register(&self, device: &Device, client: ComputeClient<Server, Channel>)
Auto Trait Implementations§
impl<Device, Server, Channel> !RefUnwindSafe for Compute<Device, Server, Channel>
impl<Device, Server, Channel> Send for Compute<Device, Server, Channel>where Channel: Send, Device: Send, <Server as ComputeServer>::AutotuneKey: Send,
impl<Device, Server, Channel> Sync for Compute<Device, Server, Channel>where Channel: Send, Device: Send, <Server as ComputeServer>::AutotuneKey: Send,
impl<Device, Server, Channel> Unpin for Compute<Device, Server, Channel>where Channel: Unpin, Device: Unpin, Server: Unpin,
impl<Device, Server, Channel> !UnwindSafe for Compute<Device, Server, Channel>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more