pub struct DeviceState { /* private fields */ }Implementations§
Source§impl DeviceState
impl DeviceState
pub fn new(device_id: u32) -> Self
pub fn device_id(&self) -> u32
pub fn generation(&self) -> u64
Sourcepub fn bump_generation(&self) -> u64
pub fn bump_generation(&self) -> u64
Bump the generation. Called by ContextActor after building a
new CudaContext and before spawning library children.
Sourcepub fn generation_watch(&self) -> Receiver<u64>
pub fn generation_watch(&self) -> Receiver<u64>
Subscribe to generation changes. Receivers see every
DeviceState::bump_generation call. Used by top-level
observers that need to react to context rebuilds.
pub fn accepting_ops(&self) -> bool
Sourcepub fn begin_shutdown(&self)
pub fn begin_shutdown(&self)
Mark that the DeviceActor is winding down. Any subsequent
GpuRef::access() returns GpuRefStale.
Sourcepub fn install_context(&self, ctx: Arc<CudaContext>)
pub fn install_context(&self, ctx: Arc<CudaContext>)
Install a freshly built CUDA context into the shared state.
Called from ContextActor::pre_start (and the post-restart path).
Sourcepub fn clear_context(&self)
pub fn clear_context(&self)
Drop the current context reference held by the shared state.
Called from ContextActor::post_stop so a poisoned context can be
torn down before the new incarnation builds its replacement.
Sourcepub fn current_context(&self) -> Option<Arc<CudaContext>>
pub fn current_context(&self) -> Option<Arc<CudaContext>>
Snapshot of the current CudaContext, if any. KernelActors use
this in their own pre_start to acquire the handle they need.