Celeritas 0.7+dc90c550f
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
celeritas::StepperInterface Class Referenceabstract

Interface class for stepper classes. More...

#include <Stepper.hh>

Inheritance diagram for celeritas::StepperInterface:
Inheritance graph
[legend]

Public Types

Type aliases
using Input = StepperInput
 
using SpanConstPrimary = Span< Primary const >
 
using result_type = StepperResult
 
using SPState = std::shared_ptr< CoreStateInterface >
 

Public Member Functions

virtual void warm_up ()=0
 
virtual void async ()=0
 
virtual void async (SpanConstPrimary primaries)=0
 
virtual bool valid () const noexcept=0
 Whether an asynchronous step result can be retrieved.
 
virtual bool ready () const =0
 
virtual void wait () const =0
 
virtual StepperResult get ()=0
 
virtual StepperResult operator() ()=0
 
virtual StepperResult operator() (SpanConstPrimary primaries)=0
 
virtual void kill_active ()=0
 
virtual void reseed (UniqueEventId event_id)=0
 
virtual ActionSequence constactions () const =0
 Get action sequence for timing diagnostics.
 
virtual CoreStateInterface conststate () const =0
 Get the core state interface.
 
virtual SPState sp_state ()=0
 Get a shared pointer to the state (TEMPORARY)
 

Protected Member Functions

 StepperInterface (StepperInterface const &)=default
 
StepperInterfaceoperator= (StepperInterface const &)=default
 
 StepperInterface (StepperInterface &&)=default
 
StepperInterfaceoperator= (StepperInterface &&)=default
 

Detailed Description

Interface class for stepper classes.

This allows higher-level classes not to care whether the stepper operates on host or device.

A stepper initially has no asynchronous result, so valid returns false. Calling async, with or without primaries, starts one step and makes the result valid. No other step can be started until get returns the result and restores the initial state. The ready function queries completion without blocking, wait blocks without consuming the result, and get waits if necessary before consuming it. All three require a valid result. A valid result can be ready: valid describes whether the result can be retrieved, rather than whether device execution is still underway.

Host steps execute synchronously and are immediately ready. The deprecated call operators preserve synchronous behavior by calling async followed by get.

Before destroying a device Stepper, the caller must ensure that any valid asynchronous operation has completed by calling wait or get.

Note
This class and its daughter may be removed soon to facilitate step gathering.

Member Function Documentation

◆ actions()

virtual ActionSequence const & celeritas::StepperInterface::actions ( ) const
pure virtual

Get action sequence for timing diagnostics.

Implemented in celeritas::Stepper< M >.

◆ async() [1/2]

virtual void celeritas::StepperInterface::async ( )
pure virtual

Implemented in celeritas::Stepper< M >.

◆ async() [2/2]

virtual void celeritas::StepperInterface::async ( SpanConstPrimary  primaries)
pure virtual

Implemented in celeritas::Stepper< M >.

◆ get()

virtual StepperResult celeritas::StepperInterface::get ( )
pure virtual

Implemented in celeritas::Stepper< M >.

◆ kill_active()

virtual void celeritas::StepperInterface::kill_active ( )
pure virtual

Implemented in celeritas::Stepper< M >.

◆ operator()() [1/2]

virtual StepperResult celeritas::StepperInterface::operator() ( )
pure virtual
Deprecated:
Transport existing states

Implemented in celeritas::Stepper< M >.

◆ operator()() [2/2]

virtual StepperResult celeritas::StepperInterface::operator() ( SpanConstPrimary  primaries)
pure virtual
Deprecated:
Transport existing states and these new primaries

Implemented in celeritas::Stepper< M >.

◆ ready()

virtual bool celeritas::StepperInterface::ready ( ) const
pure virtual

Implemented in celeritas::Stepper< M >.

◆ reseed()

virtual void celeritas::StepperInterface::reseed ( UniqueEventId  event_id)
pure virtual

Implemented in celeritas::Stepper< M >.

◆ sp_state()

virtual SPState celeritas::StepperInterface::sp_state ( )
pure virtual

Get a shared pointer to the state (TEMPORARY)

Implemented in celeritas::Stepper< M >.

◆ state()

virtual CoreStateInterface const & celeritas::StepperInterface::state ( ) const
pure virtual

Get the core state interface.

Implemented in celeritas::Stepper< M >.

◆ valid()

virtual bool celeritas::StepperInterface::valid ( ) const
pure virtualnoexcept

Whether an asynchronous step result can be retrieved.

Implemented in celeritas::Stepper< M >.

◆ wait()

virtual void celeritas::StepperInterface::wait ( ) const
pure virtual

Implemented in celeritas::Stepper< M >.

◆ warm_up()

virtual void celeritas::StepperInterface::warm_up ( )
pure virtual

Implemented in celeritas::Stepper< M >.


The documentation for this class was generated from the following files: