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<RwLock<Tuner<Server, Channel>>>) -> Self
pub fn new(channel: Channel, tuner: Arc<RwLock<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 autotune_execute(
&self,
autotune_operation_set: Box<dyn AutotuneOperationSet<Server::AutotuneKey>>,
)
pub fn autotune_execute( &self, autotune_operation_set: Box<dyn AutotuneOperationSet<Server::AutotuneKey>>, )
Executes the fastest kernel in the autotune operation, using (cached) runtime benchmarks
Sourcepub fn autotune_result(&self, key: &Server::AutotuneKey) -> Option<usize>
pub fn autotune_result(&self, key: &Server::AutotuneKey) -> Option<usize>
Get the fastest kernel for the given autotune key if it exists.
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> Freeze for ComputeClient<Server, Channel>where
Channel: Freeze,
impl<Server, Channel> RefUnwindSafe for ComputeClient<Server, Channel>where
Channel: RefUnwindSafe,
impl<Server, Channel> Send for ComputeClient<Server, Channel>
impl<Server, Channel> Sync for ComputeClient<Server, Channel>
impl<Server, Channel> Unpin for ComputeClient<Server, Channel>where
Channel: Unpin,
impl<Server, Channel> UnwindSafe for ComputeClient<Server, Channel>where
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