Struct burn_compute::ComputeRuntime
source · pub struct ComputeRuntime<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> ComputeRuntime<Device, Server, Channel>where
Device: Hash + PartialEq + Eq + Clone + Debug,
Server: ComputeServer,
Channel: ComputeChannel<Server>,
impl<Device, Server, Channel> ComputeRuntime<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> !Freeze for ComputeRuntime<Device, Server, Channel>
impl<Device, Server, Channel> !RefUnwindSafe for ComputeRuntime<Device, Server, Channel>
impl<Device, Server, Channel> Send for ComputeRuntime<Device, Server, Channel>
impl<Device, Server, Channel> Sync for ComputeRuntime<Device, Server, Channel>
impl<Device, Server, Channel> Unpin for ComputeRuntime<Device, Server, Channel>
impl<Device, Server, Channel> UnwindSafe for ComputeRuntime<Device, Server, Channel>where
Device: UnwindSafe,
Channel: UnwindSafe,
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