Struct cubecl_runtime::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, features: Arc<Server::FeatureSet>) -> Self
pub fn new(channel: Channel, features: Arc<Server::FeatureSet>) -> Self
Create a new client.
sourcepub async fn read_async(&self, binding: Binding<Server>) -> Vec<u8> ⓘ
pub async fn read_async(&self, binding: Binding<Server>) -> Vec<u8> ⓘ
Given a binding, returns owned resource as bytes.
sourcepub fn get_resource(
&self,
binding: Binding<Server>,
) -> <Server::Storage as ComputeStorage>::Resource
pub fn get_resource( &self, binding: Binding<Server>, ) -> <Server::Storage as ComputeStorage>::Resource
Given a resource handle, returns the storage resource.
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,
count: Server::DispatchOptions,
bindings: Vec<Binding<Server>>,
)
pub fn execute( &self, kernel: Server::Kernel, count: Server::DispatchOptions, bindings: Vec<Binding<Server>>, )
Executes the kernel
over the given bindings
.
sourcepub fn features(&self) -> &Server::FeatureSet
pub fn features(&self) -> &Server::FeatureSet
Get the features supported by the compute server.
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>,
source§impl<Server: Debug + ComputeServer, Channel: Debug> Debug for ComputeClient<Server, Channel>where
Server::FeatureSet: Debug,
impl<Server: Debug + ComputeServer, Channel: Debug> Debug for ComputeClient<Server, Channel>where
Server::FeatureSet: Debug,
Auto Trait Implementations§
impl<Server, Channel> Freeze for ComputeClient<Server, Channel>where
Channel: Freeze,
impl<Server, Channel> RefUnwindSafe for ComputeClient<Server, Channel>
impl<Server, Channel> Send for ComputeClient<Server, Channel>where
Channel: Send,
impl<Server, Channel> Sync for ComputeClient<Server, Channel>where
Channel: Sync,
impl<Server, Channel> Unpin for ComputeClient<Server, Channel>where
Channel: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)