Struct burn_compute::client::ComputeClient
source · pub struct ComputeClient<Server: ComputeServer, Channel> { /* private fields */ }Expand description
The ComputeClient is the entry point to require tasks from the ComputeServer. It should be obtained for a specific device via the Compute struct.
Implementations§
source§impl<Server, Channel> ComputeClient<Server, Channel>where
Server: ComputeServer,
Channel: ComputeChannel<Server>,
impl<Server, Channel> ComputeClient<Server, Channel>where Server: ComputeServer, Channel: ComputeChannel<Server>,
sourcepub fn new(channel: Channel, tuner: Arc<Mutex<Tuner<Server, Channel>>>) -> Self
pub fn new(channel: Channel, tuner: Arc<Mutex<Tuner<Server, Channel>>>) -> Self
Create a new client.
sourcepub fn read(&self, handle: &Handle<Server>) -> Reader<Vec<u8>>
pub fn read(&self, handle: &Handle<Server>) -> Reader<Vec<u8>>
Given a handle, returns owned resource as bytes.
sourcepub fn create(&self, data: &[u8]) -> Handle<Server>
pub fn create(&self, data: &[u8]) -> Handle<Server>
Given a resource, stores it and returns the resource handle.
sourcepub fn empty(&self, size: usize) -> Handle<Server>
pub fn empty(&self, size: usize) -> Handle<Server>
Reserves size bytes in the storage, and returns a handle over them.
sourcepub fn execute(&self, kernel: Server::Kernel, handles: &[&Handle<Server>])
pub fn execute(&self, kernel: Server::Kernel, handles: &[&Handle<Server>])
Executes the kernel over the given handles.
sourcepub fn execute_autotune(
&self,
autotune_operation_set: Box<dyn AutotuneOperationSet<Server::AutotuneKey>>
)
pub fn execute_autotune( &self, autotune_operation_set: Box<dyn AutotuneOperationSet<Server::AutotuneKey>> )
Executes the fastest kernel in the autotune operation, using (cached) runtime benchmarks
Trait Implementations§
source§impl<S, C> Clone for ComputeClient<S, C>where
S: ComputeServer,
C: ComputeChannel<S>,
impl<S, C> Clone for ComputeClient<S, C>where S: ComputeServer, C: ComputeChannel<S>,
Auto Trait Implementations§
impl<Server, Channel> !RefUnwindSafe for ComputeClient<Server, Channel>
impl<Server, Channel> Send for ComputeClient<Server, Channel>where Channel: Send, <Server as ComputeServer>::AutotuneKey: Send,
impl<Server, Channel> Sync for ComputeClient<Server, Channel>where Channel: Send + Sync, Server: Sync, <Server as ComputeServer>::AutotuneKey: Send,
impl<Server, Channel> Unpin for ComputeClient<Server, Channel>where Channel: Unpin, Server: Unpin,
impl<Server, Channel> !UnwindSafe for ComputeClient<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