pub struct NumaWorkerPool { /* private fields */ }Expand description
Pool of NUMA workers, one per node.
This pool manages dedicated worker threads that are pinned to specific NUMA nodes. When you request an allocation for a GPU, the pool automatically determines the GPU’s NUMA node and routes the request to the appropriate worker.
Implementations§
Source§impl NumaWorkerPool
impl NumaWorkerPool
Sourcepub fn global() -> &'static Self
pub fn global() -> &'static Self
Get the global worker pool.
The pool is created lazily on first access and lives for the entire process lifetime.
Sourcepub fn allocate_pinned_for_gpu(
&self,
size: usize,
gpu_id: u32,
) -> Result<Option<*mut u8>, String>
pub fn allocate_pinned_for_gpu( &self, size: usize, gpu_id: u32, ) -> Result<Option<*mut u8>, String>
Allocate CUDA pinned memory for a specific GPU (auto-detects NUMA node).
This method:
- Determines the GPU’s NUMA node via CUDA driver PCI attributes + sysfs
- Routes the allocation to a worker pinned to that node
- The worker allocates and touches pages to ensure first-touch placement
Returns None if the GPU’s NUMA node cannot be determined, signaling
the caller to fall back to non-NUMA allocation.
§Arguments
size- Number of bytes to allocategpu_id- CUDA device ID
§Returns
Some(ptr) on success, None if NUMA node is unknown (caller should
use non-NUMA allocation). Returns Err on allocation failure.
Auto Trait Implementations§
impl !Freeze for NumaWorkerPool
impl RefUnwindSafe for NumaWorkerPool
impl Send for NumaWorkerPool
impl Sync for NumaWorkerPool
impl Unpin for NumaWorkerPool
impl UnsafeUnpin for NumaWorkerPool
impl UnwindSafe for NumaWorkerPool
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