Celeritas
0.5.0-56+6b053cd
|
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 | Ref = StateRef< CoreStateData > |
using | Ptr = ObserverPtr< Ref, M > |
Public Types inherited from celeritas::CoreStateInterface | |
using | size_type = TrackSlotId::size_type |
Public Member Functions | |
CoreState (CoreParams const ¶ms, StreamId stream_id, size_type num_track_slots) | |
Construct from CoreParams. | |
~CoreState () | |
Print diagnostic when core state is being deleted. | |
CELER_DELETE_COPY_MOVE (CoreState) | |
StreamId | stream_id () const final |
Thread/stream ID. | |
size_type | size () const final |
Number of track slots. | |
void | warming_up (bool) |
Whether the state should be transported with no active particles. More... | |
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. More... | |
CoreStateCounters & | counters () |
Track initialization counters. | |
CoreStateCounters const & | counters () const final |
Track initialization counters. | |
AuxStateVec const & | aux () const final |
Access auxiliary state data. | |
AuxStateVec & | aux () |
Access auxiliary state data (mutable) | |
template<template< Ownership, MemSpace > class S> | |
StateRef< S > & | aux_data (AuxId auxid) |
bool | has_action_range () const |
Return whether tracks can be sorted by action. | |
Range< ThreadId > | get_action_range (ActionId action_id) const |
Get a range of sorted track slots about to undergo a given action. More... | |
auto & | action_thread_offsets () |
Access the range of actions to apply for all track IDs. | |
auto const & | action_thread_offsets () const |
Access the range of actions to apply for all track IDs. | |
auto & | native_action_thread_offsets () |
Access action offsets for computation (native memory space). | |
template<template< Ownership, MemSpace > class S> | |
auto | aux_data (AuxId auxid) -> StateRef< S > & |
Convenience function to access auxiliary "collection group" data. | |
Public Member Functions inherited from celeritas::CoreStateInterface | |
virtual | ~CoreStateInterface () |
Support polymorphic deletion. | |
Additional Inherited Members | |
Protected Member Functions inherited from celeritas::CoreStateInterface | |
CELER_DEFAULT_COPY_MOVE (CoreStateInterface) | |
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.
Range< ThreadId > celeritas::CoreState< M >::get_action_range | ( | ActionId | action_id | ) | const |
Get a range of sorted track slots about to undergo a given action.
The result delimits the [start, end) of the track partition assigned action_id
in track_slots.
void celeritas::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 a new event. This should only be necessary if the previous event aborted early.
void celeritas::CoreState< M >::warming_up | ( | bool | new_state | ) |
Whether the state should be transported with no active particles.
This can only be called when there are no active tracks. It should be immediately cleared after a step.