Struct cubecl_core::channel::MutexComputeChannel
source · pub struct MutexComputeChannel<Server> { /* private fields */ }
Expand description
The MutexComputeChannel ensures thread-safety by locking the server on every operation
Implementations§
source§impl<Server> MutexComputeChannel<Server>where
Server: ComputeServer,
impl<Server> MutexComputeChannel<Server>where
Server: ComputeServer,
sourcepub fn new(server: Server) -> MutexComputeChannel<Server>
pub fn new(server: Server) -> MutexComputeChannel<Server>
Create a new mutex compute channel.
Trait Implementations§
source§impl<S> Clone for MutexComputeChannel<S>
impl<S> Clone for MutexComputeChannel<S>
source§fn clone(&self) -> MutexComputeChannel<S>
fn clone(&self) -> MutexComputeChannel<S>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Server> ComputeChannel<Server> for MutexComputeChannel<Server>where
Server: ComputeServer,
impl<Server> ComputeChannel<Server> for MutexComputeChannel<Server>where
Server: ComputeServer,
source§fn read(
&self,
handle: Binding<Server>,
) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send>>
fn read( &self, handle: Binding<Server>, ) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send>>
Given a binding, returns owned resource as bytes
source§fn get_resource(
&self,
binding: Binding<Server>,
) -> <<Server as ComputeServer>::Storage as ComputeStorage>::Resource
fn get_resource( &self, binding: Binding<Server>, ) -> <<Server as ComputeServer>::Storage as ComputeStorage>::Resource
Given a resource handle, return the storage resource.
source§fn create(&self, data: &[u8]) -> Handle<Server>
fn create(&self, data: &[u8]) -> Handle<Server>
Given a resource as bytes, stores it and returns the resource handle
source§fn empty(&self, size: usize) -> Handle<Server>
fn empty(&self, size: usize) -> Handle<Server>
Reserves
size
bytes in the storage, and returns a handle over themsource§unsafe fn execute(
&self,
kernel: <Server as ComputeServer>::Kernel,
count: <Server as ComputeServer>::DispatchOptions,
handles: Vec<Binding<Server>>,
kind: ExecutionMode,
)
unsafe fn execute( &self, kernel: <Server as ComputeServer>::Kernel, count: <Server as ComputeServer>::DispatchOptions, handles: Vec<Binding<Server>>, kind: ExecutionMode, )
Auto Trait Implementations§
impl<Server> Freeze for MutexComputeChannel<Server>
impl<Server> !RefUnwindSafe for MutexComputeChannel<Server>
impl<Server> Send for MutexComputeChannel<Server>where
Server: Send,
impl<Server> Sync for MutexComputeChannel<Server>where
Server: Send,
impl<Server> Unpin for MutexComputeChannel<Server>
impl<Server> !UnwindSafe for MutexComputeChannel<Server>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)