Skip to main content

CudaUnifiedBackend

Struct CudaUnifiedBackend 

Source
pub struct CudaUnifiedBackend;
Expand description

A zero-copy memory backend mapping memory blocks directly using CUDA managed memory.

allocate returns null when the NVIDIA driver is not loaded, when the driver allocation fails, or when the bounded CUDA allocation registry is full (the fresh allocation is released first). There is no host fallback; callers must select another backend on null.

Trait Implementations§

Source§

impl HasSegmentPool for CudaUnifiedBackend

Source§

fn pools() -> &'static BackendPools

Returns this backend’s pool bundle.
Source§

fn global_segment_pool() -> &'static GlobalSegmentPool

Returns the global segment pool for this backend.
Source§

fn global_orphan_pool() -> &'static GlobalSegmentPool

Returns the global orphan pool for this backend.
Source§

fn global_huge_pool() -> &'static GlobalHugePool

Returns the global huge allocation pool for this backend.
Source§

impl LocalAllocatorSelector<CudaUnifiedBackend> for CudaUnifiedBackend

Source§

fn with_allocator<R>( f: impl FnOnce(&mut ThreadAllocator<CudaUnifiedBackend>) -> 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<CudaUnifiedBackend>) -> 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 more
Source§

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

Returns the raw pointer to the thread-local allocator cache without triggering lazy initialization.
Source§

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<CudaUnifiedBackend>) -> R, ) -> Option<R>
where P: AllocPolicy,

Runs f against the TLS allocator selected by the compile-time free-list encryption mode. Read more
Source§

unsafe fn with_allocator_unguarded_for_policy<P, R>( f: impl FnOnce(&mut ThreadAllocator<CudaUnifiedBackend>) -> R, ) -> Option<R>
where P: AllocPolicy,

Mode-keyed counterpart of Self::with_allocator_unguarded. Read more
Source§

fn get_allocator_ptr_for_policy<P>() -> *mut c_void
where 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_void
where P: AllocPolicy,

Returns the initialized mode-keyed allocator pointer without creating its slot.
Source§

fn get_allocator_ptr_raw_for_encryption<const ENCRYPTED: bool>() -> *mut c_void

Returns the raw pointer for a statically selected free-list encoding mode without creating its slot.
Source§

impl MemoryBackend for CudaUnifiedBackend

Source§

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

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

Indicates whether the backend supports advisory page resetting.
Source§

const SUPPORTS_MAKE_GUARD: bool = false

Indicates whether the backend supports page protection guard installation.
Source§

const SUPPORTS_DECOMMIT: bool = false

Indicates whether the backend supports releasing memory commitment while keeping the reservation.
Source§

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

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§

unsafe fn make_guard(ptr: *mut u8, size: usize) -> bool

Marks a page-aligned range as an inaccessible guard region. Read more
Source§

unsafe fn decommit(ptr: *mut u8, size: usize) -> bool

Releases the commit charge / physical backing of a page-aligned range while keeping the surrounding reservation intact, so the range can still be covered by the eventual deallocate of the base allocation. Read more
Source§

impl PolicySlotSelection<CudaUnifiedBackend> for StandardPolicy

Source§

fn with_allocator<R>( f: impl FnOnce(&mut ThreadAllocator<CudaUnifiedBackend>) -> 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<CudaUnifiedBackend>) -> R, ) -> Option<R>

Runs f with access to the selected policy cache without arming the re-entrancy gate. Read more
Source§

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

Returns the raw allocator pointer for this policy’s TLS slot without forcing lazy initialization.
Source§

impl PolicySlotSelection<CudaUnifiedBackend> for SecurePolicy

Source§

fn with_allocator<R>( f: impl FnOnce(&mut ThreadAllocator<CudaUnifiedBackend>) -> 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<CudaUnifiedBackend>) -> R, ) -> Option<R>

Runs f with access to the selected policy cache without arming the re-entrancy gate. Read more
Source§

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

Returns the raw allocator pointer for this policy’s TLS slot without forcing lazy initialization.
Source§

impl PolicySlotSelection<CudaUnifiedBackend> for HardenedPolicy

Source§

fn with_allocator<R>( f: impl FnOnce(&mut ThreadAllocator<CudaUnifiedBackend>) -> 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<CudaUnifiedBackend>) -> R, ) -> Option<R>

Runs f with access to the selected policy cache without arming the re-entrancy gate. Read more
Source§

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

Returns the raw allocator pointer for this policy’s TLS slot without forcing lazy initialization.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.