Struct kn_cuda_sys::wrapper::mem::pool::DevicePool
source · pub struct DevicePool { /* private fields */ }Expand description
A device memory pool, allocated once up front and then uses a bump allocator to return sub-allocations.
Implementations§
source§impl DevicePool
impl DevicePool
pub fn new(device: CudaDevice, total_size_bytes: usize) -> Self
pub fn alloc(&mut self, size_bytes: usize) -> DevicePtr
pub fn clear(&mut self)
pub unsafe fn clear_unsafe(&mut self)
pub fn total_size_bytes(&self) -> usize
pub fn size_left_bytes(&self) -> usize
pub fn buffer(&self) -> &DevicePtr
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for DevicePool
impl Send for DevicePool
impl Sync for DevicePool
impl Unpin for DevicePool
impl UnwindSafe for DevicePool
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