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<*mut u8, String>
pub fn allocate_pinned_for_gpu( &self, size: usize, gpu_id: u32, ) -> Result<*mut u8, String>
Allocate CUDA pinned memory for a specific GPU (auto-detects NUMA node).
This method:
- Determines the GPU’s NUMA node via nvidia-smi
- Routes the allocation to a worker pinned to that node
- The worker allocates and touches pages to ensure first-touch placement
§Arguments
size- Number of bytes to allocategpu_id- CUDA device ID
§Returns
Raw pointer to the allocated memory. Caller is responsible for freeing via
cudarc::driver::result::free_host.
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