pub struct GpuManagementTasks { /* private fields */ }Expand description
A collection of GPU management tasks.
This struct is used to send commands to the GPU management tasks. It’s also application state that gets cloned and passed to request handlers by actix-web.
Implementations§
Source§impl GpuManagementTasks
impl GpuManagementTasks
Sourcepub fn start<T>(gpus: Vec<T>) -> Result<Self, ZeusdError>where
T: GpuManager + Send + 'static,
pub fn start<T>(gpus: Vec<T>) -> Result<Self, ZeusdError>where
T: GpuManager + Send + 'static,
Start GPU management tasks for the given GPUs. It’s generic over the type of GPU manager to allow for testing.
Sourcepub fn device_count(&self) -> usize
pub fn device_count(&self) -> usize
Return the number of GPUs managed by these tasks.
Sourcepub fn send_command_nonblocking(
&self,
gpu_id: usize,
command: GpuCommand,
request_start_time: Instant,
) -> Result<(), ZeusdError>
pub fn send_command_nonblocking( &self, gpu_id: usize, command: GpuCommand, request_start_time: Instant, ) -> Result<(), ZeusdError>
Send a command to the corresponding GPU management task and immediately return
without checking the result. Results will be logged via tracing.
Returns Ok(()) if the command was sent successfully.
Sourcepub async fn send_command_blocking(
&self,
gpu_id: usize,
command: GpuCommand,
request_start_time: Instant,
) -> Result<GpuResponse, ZeusdError>
pub async fn send_command_blocking( &self, gpu_id: usize, command: GpuCommand, request_start_time: Instant, ) -> Result<GpuResponse, ZeusdError>
Send a command to the corresponding GPU management task and wait for completion.
Trait Implementations§
Source§impl Clone for GpuManagementTasks
impl Clone for GpuManagementTasks
Source§fn clone(&self) -> GpuManagementTasks
fn clone(&self) -> GpuManagementTasks
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GpuManagementTasks
impl RefUnwindSafe for GpuManagementTasks
impl Send for GpuManagementTasks
impl Sync for GpuManagementTasks
impl Unpin for GpuManagementTasks
impl UnsafeUnpin for GpuManagementTasks
impl UnwindSafe for GpuManagementTasks
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