pub struct CudaHostPinnedBackend;Expand description
A memory backend allocating CUDA page-locked (pinned) host memory.
allocate returns null on failure (driver unavailable, driver allocation
failure, or registry full); there is no host fallback.
Trait Implementations§
Source§impl HasSegmentPool for CudaHostPinnedBackend
impl HasSegmentPool for CudaHostPinnedBackend
Source§fn pools() -> &'static BackendPools
fn pools() -> &'static BackendPools
Returns this backend’s pool bundle.
Source§fn global_segment_pool() -> &'static GlobalSegmentPool
fn global_segment_pool() -> &'static GlobalSegmentPool
Returns the global segment pool for this backend.
Source§fn global_orphan_pool() -> &'static GlobalSegmentPool
fn global_orphan_pool() -> &'static GlobalSegmentPool
Returns the global orphan pool for this backend.
Source§fn global_huge_pool() -> &'static GlobalHugePool
fn global_huge_pool() -> &'static GlobalHugePool
Returns the global huge allocation pool for this backend.
Source§impl LocalAllocatorSelector<CudaHostPinnedBackend> for CudaHostPinnedBackend
impl LocalAllocatorSelector<CudaHostPinnedBackend> for CudaHostPinnedBackend
Source§fn with_allocator<R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>
fn with_allocator<R>( f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R, ) -> Option<R>
Evaluates the closure with a mutable reference to the thread-local allocator cache,
arming the re-entrancy guard. Read more
Source§unsafe fn with_allocator_unguarded<R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>
unsafe fn with_allocator_unguarded<R>( f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R, ) -> Option<R>
Runs
f with the thread-local allocator cache without arming the
re-entrancy guard, returning None on same-thread re-entry. Read moreSource§fn get_allocator_ptr() -> *mut c_void
fn get_allocator_ptr() -> *mut c_void
Returns the raw pointer to the thread-local allocator cache.
Source§fn get_allocator_ptr_raw() -> *mut c_void
fn get_allocator_ptr_raw() -> *mut c_void
Returns the raw pointer to the thread-local allocator cache without triggering lazy initialization.
Source§fn register_current_allocator_ptr(ptr: *mut c_void)
fn register_current_allocator_ptr(ptr: *mut c_void)
Registers a manually created allocator instance as the current thread’s
active cache pointer for this backend mode so direct
ThreadAllocator::new() uses remain compatible with the public free path.Source§fn with_allocator_for_policy<P, R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>where
P: AllocPolicy,
fn with_allocator_for_policy<P, R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>where
P: AllocPolicy,
Runs
f against the TLS allocator selected by the compile-time
free-list encryption mode. Read moreSource§unsafe fn with_allocator_unguarded_for_policy<P, R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>where
P: AllocPolicy,
unsafe fn with_allocator_unguarded_for_policy<P, R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>where
P: AllocPolicy,
Mode-keyed counterpart of
Self::with_allocator_unguarded. Read moreSource§fn get_allocator_ptr_for_policy<P>() -> *mut c_voidwhere
P: AllocPolicy,
fn get_allocator_ptr_for_policy<P>() -> *mut c_voidwhere
P: AllocPolicy,
Returns the initialized mode-keyed allocator pointer, arming its TLS
slot when necessary.
Source§fn get_allocator_ptr_raw_for_policy<P>() -> *mut c_voidwhere
P: AllocPolicy,
fn get_allocator_ptr_raw_for_policy<P>() -> *mut c_voidwhere
P: AllocPolicy,
Returns the initialized mode-keyed allocator pointer without creating
its slot.
Source§impl MemoryBackend for CudaHostPinnedBackend
impl MemoryBackend for CudaHostPinnedBackend
Source§unsafe fn allocate(size: usize) -> *mut u8
unsafe fn allocate(size: usize) -> *mut u8
Allocates CUDA-backed memory. Returns null on failure.
§Safety
The size must be greater than zero and page-aligned.
Source§unsafe fn deallocate(ptr: *mut u8, _size: usize) -> bool
unsafe fn deallocate(ptr: *mut u8, _size: usize) -> bool
Deallocates memory allocated by this backend.
§Safety
The pointer must be valid and the size must match the allocation.
Source§const SUPPORTS_PAGE_RESET: bool = false
const SUPPORTS_PAGE_RESET: bool = false
Indicates whether the backend supports advisory page resetting.
Source§const SUPPORTS_MAKE_GUARD: bool = false
const SUPPORTS_MAKE_GUARD: bool = false
Indicates whether the backend supports page protection guard installation.
Source§const SUPPORTS_DECOMMIT: bool = false
const SUPPORTS_DECOMMIT: bool = false
Indicates whether the backend supports releasing memory commitment while keeping the reservation.
Source§const ENABLE_CPU_CACHE: bool = false
const ENABLE_CPU_CACHE: bool = false
Indicates whether the backend enables the lock-free per-CPU block cache.
Source§unsafe fn page_reset(ptr: *mut u8, size: usize) -> bool
unsafe fn page_reset(ptr: *mut u8, size: usize) -> bool
Asks the OS to drop the physical backing of a mapped page range while
keeping the virtual address range reserved and accessible. Read more
Source§impl PolicySlotSelection<CudaHostPinnedBackend> for StandardPolicy
impl PolicySlotSelection<CudaHostPinnedBackend> for StandardPolicy
Source§fn with_allocator<R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>
fn with_allocator<R>( f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R, ) -> Option<R>
Runs
f with access to the allocator cache selected for this policy.Source§unsafe fn with_allocator_unguarded<R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>
unsafe fn with_allocator_unguarded<R>( f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R, ) -> Option<R>
Runs
f with access to the selected policy cache without arming the
re-entrancy gate. Read moreSource§fn get_allocator_ptr() -> *mut c_void
fn get_allocator_ptr() -> *mut c_void
Returns the initialized allocator pointer for this policy’s TLS slot.
Source§fn get_allocator_ptr_raw() -> *mut c_void
fn get_allocator_ptr_raw() -> *mut c_void
Returns the raw allocator pointer for this policy’s TLS slot without
forcing lazy initialization.
Source§impl PolicySlotSelection<CudaHostPinnedBackend> for SecurePolicy
impl PolicySlotSelection<CudaHostPinnedBackend> for SecurePolicy
Source§fn with_allocator<R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>
fn with_allocator<R>( f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R, ) -> Option<R>
Runs
f with access to the allocator cache selected for this policy.Source§unsafe fn with_allocator_unguarded<R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>
unsafe fn with_allocator_unguarded<R>( f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R, ) -> Option<R>
Runs
f with access to the selected policy cache without arming the
re-entrancy gate. Read moreSource§fn get_allocator_ptr() -> *mut c_void
fn get_allocator_ptr() -> *mut c_void
Returns the initialized allocator pointer for this policy’s TLS slot.
Source§fn get_allocator_ptr_raw() -> *mut c_void
fn get_allocator_ptr_raw() -> *mut c_void
Returns the raw allocator pointer for this policy’s TLS slot without
forcing lazy initialization.
Source§impl PolicySlotSelection<CudaHostPinnedBackend> for HardenedPolicy
impl PolicySlotSelection<CudaHostPinnedBackend> for HardenedPolicy
Source§fn with_allocator<R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>
fn with_allocator<R>( f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R, ) -> Option<R>
Runs
f with access to the allocator cache selected for this policy.Source§unsafe fn with_allocator_unguarded<R>(
f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R,
) -> Option<R>
unsafe fn with_allocator_unguarded<R>( f: impl FnOnce(&mut ThreadAllocator<CudaHostPinnedBackend>) -> R, ) -> Option<R>
Runs
f with access to the selected policy cache without arming the
re-entrancy gate. Read moreSource§fn get_allocator_ptr() -> *mut c_void
fn get_allocator_ptr() -> *mut c_void
Returns the initialized allocator pointer for this policy’s TLS slot.
Source§fn get_allocator_ptr_raw() -> *mut c_void
fn get_allocator_ptr_raw() -> *mut c_void
Returns the raw allocator pointer for this policy’s TLS slot without
forcing lazy initialization.
Auto Trait Implementations§
impl Freeze for CudaHostPinnedBackend
impl RefUnwindSafe for CudaHostPinnedBackend
impl Send for CudaHostPinnedBackend
impl Sync for CudaHostPinnedBackend
impl Unpin for CudaHostPinnedBackend
impl UnsafeUnpin for CudaHostPinnedBackend
impl UnwindSafe for CudaHostPinnedBackend
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