Celeritas 0.6.0-47+develop.b3cbb238
|
Store all state data for a single thread. More...
#include <CoreState.hh>
Public Types | |
Type aliases | |
template<template< Ownership, MemSpace > class S> | |
using | StateRef = S< Ownership::reference, M > |
using | SPAuxStateVec = std::shared_ptr< AuxStateVec > |
using | Ref = StateRef< CoreStateData > |
using | Ptr = ObserverPtr< Ref, M > |
![]() | |
using | size_type = TrackSlotId::size_type |
![]() | |
using | SPState = std::shared_ptr< AuxStateInterface > |
Default destructor. | |
Public Member Functions | |
CoreState (CoreParams const ¶ms, StreamId stream_id, size_type num_track_slots) | |
Construct from CoreParams. | |
StreamId | stream_id () const final |
Thread/stream ID. | |
size_type | size () const final |
Number of track slots. | |
bool | warming_up () const |
Whether the state is being transported with no active particles. | |
Ref & | ref () |
Get a reference to the mutable state data. | |
Ref const & | ref () const |
Get a reference to the mutable state data. | |
Ptr | ptr () |
Get a native-memspace pointer to the mutable state data. | |
void | reset () |
Reset the state data. | |
void | insert_primaries (Span< TrackInitializer const > host_primaries) final |
Inject primaries to be turned into TrackInitializers. | |
SPAuxStateVec const & | aux () const |
Access auxiliary core state data. | |
SPAuxStateVec & | aux () |
Access auxiliary core state data (mutable) | |
![]() | |
CoreStateCounters & | counters () |
Track initialization counters. | |
CoreStateCounters const & | counters () const final |
Track initialization counters. | |
OpticalAccumStats & | accum () |
Optical loop statistics. | |
![]() | |
~CoreStateInterface () override | |
Support polymorphic deletion. | |
![]() | |
virtual | ~AuxStateInterface () |
Default destructor. | |
Additional Inherited Members | |
![]() | |
CELER_DEFAULT_COPY_MOVE (CoreStateInterface) | |
![]() | |
AuxStateInterface ()=default | |
CELER_DEFAULT_COPY_MOVE (AuxStateInterface) | |
Default destructor. | |
Store all state data for a single thread.
When the state lives on the device, we maintain a separate copy of the device "ref" in device memory: otherwise we'd have to copy the entire state in launch arguments and access it through constant memory.
|
finalvirtual |
Inject primaries to be turned into TrackInitializers.
These will be converted by the ProcessPrimaries action.
Implements celeritas::optical::CoreStateInterface.
void celeritas::optical::CoreState< M >::reset | ( | ) |
Reset the state data.
This clears the state counters and initializes the necessary state data so the state can be reused for the next step in the core stepping loop. This should only be necessary if the previous event aborted early.
|
inlinefinalvirtual |
Number of track slots.
Implements celeritas::optical::CoreStateInterface.
|
inlinefinalvirtual |
Thread/stream ID.
Implements celeritas::optical::CoreStateInterface.
bool celeritas::optical::CoreState< M >::warming_up | ( | ) | const |
Whether the state is being transported with no active particles.
The warmup stage is useful for profiling and debugging since the first step iteration can do the following: