pub struct AffinityManager { /* private fields */ }Expand description
GPU affinity manager for thread-GPU binding
Implementations§
Source§impl AffinityManager
impl AffinityManager
Sourcepub fn pin_thread(&self, gpu_index: usize) -> Result<(), String>
pub fn pin_thread(&self, gpu_index: usize) -> Result<(), String>
Pin current thread to a specific GPU
Sourcepub fn unpin_thread(&self)
pub fn unpin_thread(&self)
Unpin current thread
Sourcepub fn get_thread_gpu(&self) -> Option<usize>
pub fn get_thread_gpu(&self) -> Option<usize>
Get GPU index for current thread (if pinned)
Sourcepub fn get_thread_device(&self) -> Option<Arc<GpuDevice>>
pub fn get_thread_device(&self) -> Option<Arc<GpuDevice>>
Get device for current thread (if pinned)
Sourcepub fn get_gpu_threads(&self, gpu_index: usize) -> Vec<ThreadId>
pub fn get_gpu_threads(&self, gpu_index: usize) -> Vec<ThreadId>
Get all threads pinned to a GPU
Sourcepub fn auto_pin_thread(&self) -> Result<usize, String>
pub fn auto_pin_thread(&self) -> Result<usize, String>
Auto-pin current thread to least loaded GPU
Sourcepub fn get_stats(&self) -> AffinityStats
pub fn get_stats(&self) -> AffinityStats
Get affinity statistics
Sourcepub fn print_affinity_info(&self)
pub fn print_affinity_info(&self)
Print affinity information
Sourcepub fn device_count(&self) -> usize
pub fn device_count(&self) -> usize
Get total number of devices
Auto Trait Implementations§
impl Freeze for AffinityManager
impl !RefUnwindSafe for AffinityManager
impl Send for AffinityManager
impl Sync for AffinityManager
impl Unpin for AffinityManager
impl UnsafeUnpin for AffinityManager
impl !UnwindSafe for AffinityManager
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