pub enum ContextMsg {
Show 23 variants
Init,
SnapshotStream {
reply: Sender<Option<Arc<CudaStream>>>,
},
Alloc(Box<dyn AllocDispatch>),
CopyToHost(Box<dyn CopyToHostDispatch>),
CopyFromHost(Box<dyn CopyFromHostDispatch>),
AllocateF32 {
len: usize,
reply: Sender<Result<GpuRef<f32>, GpuError>>,
},
AllocateF64 {
len: usize,
reply: Sender<Result<GpuRef<f64>, GpuError>>,
},
AllocateI8 {
len: usize,
reply: Sender<Result<GpuRef<i8>, GpuError>>,
},
AllocateI32 {
len: usize,
reply: Sender<Result<GpuRef<i32>, GpuError>>,
},
AllocateI64 {
len: usize,
reply: Sender<Result<GpuRef<i64>, GpuError>>,
},
AllocateU8 {
len: usize,
reply: Sender<Result<GpuRef<u8>, GpuError>>,
},
AllocateU32 {
len: usize,
reply: Sender<Result<GpuRef<u32>, GpuError>>,
},
AllocateU64 {
len: usize,
reply: Sender<Result<GpuRef<u64>, GpuError>>,
},
CopyToHostF32 {
src: GpuRef<f32>,
dst: HostBuf<f32>,
reply: Sender<Result<HostBuf<f32>, GpuError>>,
},
CopyFromHostF32 {
src: HostBuf<f32>,
dst: GpuRef<f32>,
reply: Sender<Result<HostBuf<f32>, GpuError>>,
},
CopyToHostF64 {
src: GpuRef<f64>,
dst: HostBuf<f64>,
reply: Sender<Result<HostBuf<f64>, GpuError>>,
},
CopyFromHostF64 {
src: HostBuf<f64>,
dst: GpuRef<f64>,
reply: Sender<Result<HostBuf<f64>, GpuError>>,
},
CopyToHostI32 {
src: GpuRef<i32>,
dst: HostBuf<i32>,
reply: Sender<Result<HostBuf<i32>, GpuError>>,
},
CopyFromHostI32 {
src: HostBuf<i32>,
dst: GpuRef<i32>,
reply: Sender<Result<HostBuf<i32>, GpuError>>,
},
CopyToHostU32 {
src: GpuRef<u32>,
dst: HostBuf<u32>,
reply: Sender<Result<HostBuf<u32>, GpuError>>,
},
CopyFromHostU32 {
src: HostBuf<u32>,
dst: GpuRef<u32>,
reply: Sender<Result<HostBuf<u32>, GpuError>>,
},
CopyToHostU8 {
src: GpuRef<u8>,
dst: HostBuf<u8>,
reply: Sender<Result<HostBuf<u8>, GpuError>>,
},
CopyFromHostU8 {
src: HostBuf<u8>,
dst: GpuRef<u8>,
reply: Sender<Result<HostBuf<u8>, GpuError>>,
},
}Variants§
Init
Self-sent from pre_start and post_restart. Builds (or
rebuilds) the CudaContext and spawns library children.
SnapshotStream
Phase 4.5++ — reply with the primary Arc<CudaStream> owned
by this ContextActor. Used by downstream raw-pointer FFI
shims (TensorRT enqueueV3) that need to share the device’s
execution timeline. Replies None when the context hasn’t
finished Init yet (or in mock mode).
Alloc(Box<dyn AllocDispatch>)
Phase 0.4 generic allocation. Carries a typed
Box<dyn AllocDispatch> that the handler invokes via
AllocDispatch::run. Replaces the per-dtype Allocate*
variants below — those remain as #[deprecated] aliases
constructed by DeviceActor::handle so existing call sites
keep compiling.
CopyToHost(Box<dyn CopyToHostDispatch>)
Phase 0.4 generic D2H copy.
CopyFromHost(Box<dyn CopyFromHostDispatch>)
Phase 0.4 generic H2D copy.
AllocateF32
AllocateF64
AllocateI8
AllocateI32
AllocateI64
AllocateU8
AllocateU32
AllocateU64
CopyToHostF32
CopyFromHostF32
CopyToHostF64
CopyFromHostF64
CopyToHostI32
CopyFromHostI32
CopyToHostU32
CopyFromHostU32
CopyToHostU8
CopyFromHostU8
Auto Trait Implementations§
impl Freeze for ContextMsg
impl !RefUnwindSafe for ContextMsg
impl Send for ContextMsg
impl !Sync for ContextMsg
impl Unpin for ContextMsg
impl UnsafeUnpin for ContextMsg
impl !UnwindSafe for ContextMsg
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