Struct cubecl_runtime::channel::RefCellComputeChannel
source · pub struct RefCellComputeChannel<Server> { /* private fields */ }
Expand description
A channel using a ref cell to access the server with mutability.
§Important
Only use this channel if you don’t use any threading in your application, otherwise it will panic or cause undefined behaviors.
This is mosly useful for no-std
environments where threads aren’t supported, otherwise prefer
the mutex or the mpsc channels.
Implementations§
source§impl<Server> RefCellComputeChannel<Server>where
Server: ComputeServer,
impl<Server> RefCellComputeChannel<Server>where
Server: ComputeServer,
Trait Implementations§
source§impl<S> Clone for RefCellComputeChannel<S>
impl<S> Clone for RefCellComputeChannel<S>
source§impl<Server> ComputeChannel<Server> for RefCellComputeChannel<Server>where
Server: ComputeServer + Send,
impl<Server> ComputeChannel<Server> for RefCellComputeChannel<Server>where
Server: ComputeServer + Send,
source§fn read(&self, binding: Binding<Server>) -> Reader
fn read(&self, binding: Binding<Server>) -> Reader
Given a binding, returns owned resource as bytes
source§fn get_resource(
&self,
binding: Binding<Server>,
) -> <Server::Storage as ComputeStorage>::Resource
fn get_resource( &self, binding: Binding<Server>, ) -> <Server::Storage as ComputeStorage>::Resource
Given a resource handle, return the storage resource.
source§fn create(&self, resource: &[u8]) -> Handle<Server>
fn create(&self, resource: &[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_description: Server::Kernel,
count: Server::DispatchOptions,
bindings: Vec<Binding<Server>>,
kind: ExecutionMode,
)
unsafe fn execute( &self, kernel_description: Server::Kernel, count: Server::DispatchOptions, bindings: Vec<Binding<Server>>, kind: ExecutionMode, )
source§impl<Server: Debug> Debug for RefCellComputeChannel<Server>
impl<Server: Debug> Debug for RefCellComputeChannel<Server>
impl<Server: ComputeServer> Send for RefCellComputeChannel<Server>
This is unsafe, since no concurrency is supported by the RefCell
channel.
However using this channel should only be done in single threaded environments such as no-std
.
impl<Server: ComputeServer> Sync for RefCellComputeChannel<Server>
Auto Trait Implementations§
impl<Server> Freeze for RefCellComputeChannel<Server>
impl<Server> !RefUnwindSafe for RefCellComputeChannel<Server>
impl<Server> Unpin for RefCellComputeChannel<Server>
impl<Server> !UnwindSafe for RefCellComputeChannel<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
)