pub struct PinnedArena { /* private fields */ }Expand description
One page-locked host arena with its device alias.
Implementations§
Source§impl PinnedArena
impl PinnedArena
Sourcepub fn alloc(gpu: &dyn GpuBackend, bytes: usize) -> Result<Self>
pub fn alloc(gpu: &dyn GpuBackend, bytes: usize) -> Result<Self>
alloc_host_pinned zero-fills, so a large arena costs one memset at
load. The device alias is what the kernels are handed.
pub fn host(&self) -> *mut u8
pub fn dev(&self) -> DevicePtr
pub fn bytes(&self) -> usize
pub fn free(self, gpu: &dyn GpuBackend) -> Result<()>
Trait Implementations§
impl Send for PinnedArena
impl Sync for PinnedArena
Auto Trait Implementations§
impl Freeze for PinnedArena
impl RefUnwindSafe for PinnedArena
impl Unpin for PinnedArena
impl UnwindSafe for PinnedArena
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