pub struct GpuAlloc;Expand description
Allocate memory on the GPU, visible to the CPU as well.
GpuBox is a convenient Box using this allocator.
Trait Implementations§
Source§impl Allocator for GpuAlloc
Available on crate feature amd and neither AMD GPU nor NVidia GPU only.
impl Allocator for GpuAlloc
Available on crate feature
amd and neither AMD GPU nor NVidia GPU only.Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Attempts to allocate a block of memory. Read more
Source§unsafe fn deallocate(&self, ptr: NonNull<u8>, _: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, _: Layout)
🔬This is a nightly-only experimental API. (
allocator_api)Deallocates the memory referenced by
ptr. Read moreSource§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Behaves like
allocate, but also ensures that the returned memory is zero-initialized. Read moreSource§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Attempts to extend the memory block. Read more
Auto Trait Implementations§
impl Freeze for GpuAlloc
impl RefUnwindSafe for GpuAlloc
impl Send for GpuAlloc
impl Sync for GpuAlloc
impl Unpin for GpuAlloc
impl UnsafeUnpin for GpuAlloc
impl UnwindSafe for GpuAlloc
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