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,
Trait Implementations§
Source§impl<S> Clone for MutexComputeChannel<S>
impl<S> Clone for MutexComputeChannel<S>
Source§impl<Server> ComputeChannel<Server> for MutexComputeChannel<Server>where
Server: ComputeServer,
impl<Server> ComputeChannel<Server> for MutexComputeChannel<Server>where
Server: ComputeServer,
Source§async fn read(&self, handle: Binding) -> Vec<u8> ⓘ
async fn read(&self, handle: Binding) -> Vec<u8> ⓘ
Given a binding, returns owned resource as bytes
Source§fn get_resource(&self, binding: Binding) -> BindingResource<Server>
fn get_resource(&self, binding: Binding) -> BindingResource<Server>
Given a resource handle, return the storage resource.
Source§fn create(&self, data: &[u8]) -> Handle
fn create(&self, data: &[u8]) -> Handle
Given a resource as bytes, stores it and returns the resource handle
Source§fn empty(&self, size: usize) -> Handle
fn empty(&self, size: usize) -> Handle
Reserves
size
bytes in the storage, and returns a handle over themSource§unsafe fn execute(
&self,
kernel: Server::Kernel,
count: CubeCount,
handles: Vec<Binding>,
kind: ExecutionMode,
)
unsafe fn execute( &self, kernel: Server::Kernel, count: CubeCount, handles: Vec<Binding>, kind: ExecutionMode, )
Source§async fn sync_elapsed(&self) -> TimestampsResult
async fn sync_elapsed(&self) -> TimestampsResult
Wait for the completion of every task in the server. Read more
Source§fn memory_usage(&self) -> MemoryUsage
fn memory_usage(&self) -> MemoryUsage
Get the current memory usage of the server.
Source§fn enable_timestamps(&self)
fn enable_timestamps(&self)
Enable collecting timestamps.
Source§fn disable_timestamps(&self)
fn disable_timestamps(&self)
Disable collecting timestamps.
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
)