pub trait Allocator:
Send
+ Sync
+ Debug {
// Required methods
fn alloc(&self, size: usize, options: &BufferOptions) -> Result<RawBuffer>;
fn name(&self) -> &str;
fn device_spec(&self) -> DeviceSpec;
// Provided methods
fn free(&self, _buffer: RawBuffer, _options: &BufferOptions) { ... }
fn synchronize(&self) -> Result<()> { ... }
}Required Methods§
fn alloc(&self, size: usize, options: &BufferOptions) -> Result<RawBuffer>
fn name(&self) -> &str
Sourcefn device_spec(&self) -> DeviceSpec
fn device_spec(&self) -> DeviceSpec
Get the device specification for this allocator.