pub struct GpuSimThread { /* private fields */ }Expand description
Handle on a running GPU simulation, driven by the same commands as a
SimThread.
Implementations§
Source§impl GpuSimThread
impl GpuSimThread
Sourcepub fn new(
ctx: GpuContext,
state: Box<dyn GpuSimState>,
settings: GpuBatchSettings,
wake: Option<WakeFn>,
) -> Self
pub fn new( ctx: GpuContext, state: Box<dyn GpuSimState>, settings: GpuBatchSettings, wake: Option<WakeFn>, ) -> Self
Starts a paused runner over state on ctx, in the batch mode that settings specifies.
A panic out of the loop is stored in ctx.faults.
Sourcepub fn send(&mut self, cmd: SimCommand)
pub fn send(&mut self, cmd: SimCommand)
Sends a command to the loop.
Sourcepub fn take_snapshot(&mut self) -> Option<Snapshot>
pub fn take_snapshot(&mut self) -> Option<Snapshot>
Takes the latest snapshot, or None when nothing new has been published since the last take.
Sourcepub fn play(&mut self)
pub fn play(&mut self)
Sends SimCommand::Play.
Sourcepub fn pause(&mut self)
pub fn pause(&mut self)
Sends SimCommand::Pause.
Sourcepub fn step_once(&mut self)
pub fn step_once(&mut self)
Sends SimCommand::StepOnce.
Sourcepub fn set_schedule(&mut self, schedule: Schedule)
pub fn set_schedule(&mut self, schedule: Schedule)
Sends SimCommand::SetSchedule.
Sourcepub fn run_to(&mut self, tick: u64)
pub fn run_to(&mut self, tick: u64)
Sends SimCommand::RunTo.
Sourcepub fn set_batch_size(&mut self, batch_size: u32)
pub fn set_batch_size(&mut self, batch_size: u32)
Sets the manual batch size used in fixed mode. It has no visible effect while adaptive mode is on, and is kept for when it is turned back off.
Sourcepub fn set_adaptive(&mut self, enabled: bool)
pub fn set_adaptive(&mut self, enabled: bool)
Turns adaptive batching on or off. Fixed mode’s manual batch size and adaptive mode’s target are each preserved independently across toggles.
Sourcepub fn set_target_ms(&mut self, target_ms: f64)
pub fn set_target_ms(&mut self, target_ms: f64)
Sets the per-batch wall-clock budget (ms) used by the adaptive controller.
Trait Implementations§
Source§impl Debug for GpuSimThread
impl Debug for GpuSimThread
Source§impl Drop for GpuSimThread
impl Drop for GpuSimThread
Auto Trait Implementations§
impl !RefUnwindSafe for GpuSimThread
impl !UnwindSafe for GpuSimThread
impl Freeze for GpuSimThread
impl Send for GpuSimThread
impl Sync for GpuSimThread
impl Unpin for GpuSimThread
impl UnsafeUnpin for GpuSimThread
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more