Trait cubecl_runtime::storage::ComputeStorage
source · pub trait ComputeStorage: Send {
type Resource: Send;
// Required methods
fn get(&mut self, handle: &StorageHandle) -> Self::Resource;
fn alloc(&mut self, size: usize) -> StorageHandle;
fn dealloc(&mut self, id: StorageId);
fn copy(&mut self, from: &StorageHandle, to: &StorageHandle);
}
Expand description
Storage types are responsible for allocating and deallocating memory.
Required Associated Types§
Required Methods§
sourcefn get(&mut self, handle: &StorageHandle) -> Self::Resource
fn get(&mut self, handle: &StorageHandle) -> Self::Resource
Returns the underlying resource for a specified storage handle
sourcefn alloc(&mut self, size: usize) -> StorageHandle
fn alloc(&mut self, size: usize) -> StorageHandle
Allocates size
units of memory and returns a handle to it
sourcefn copy(&mut self, from: &StorageHandle, to: &StorageHandle)
fn copy(&mut self, from: &StorageHandle, to: &StorageHandle)
Copy