Celeritas 0.6.0-47+develop.b3cbb238
Loading...
Searching...
No Matches
Public Member Functions | List of all members
celeritas::optical::CoreState< M > Class Template Reference

Store all state data for a single thread. More...

#include <CoreState.hh>

Inheritance diagram for celeritas::optical::CoreState< M >:
Inheritance graph
[legend]

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 >
 
- Public Types inherited from celeritas::optical::CoreStateInterface
using size_type = TrackSlotId::size_type
 
- Public Types inherited from celeritas::AuxStateInterface
using SPState = std::shared_ptr< AuxStateInterface >
 Default destructor.
 

Public Member Functions

 CoreState (CoreParams const &params, 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 constref () 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 constaux () const
 Access auxiliary core state data.
 
SPAuxStateVec & aux ()
 Access auxiliary core state data (mutable)
 
- Public Member Functions inherited from celeritas::optical::CoreStateBase
CoreStateCounterscounters ()
 Track initialization counters.
 
CoreStateCounters constcounters () const final
 Track initialization counters.
 
OpticalAccumStatsaccum ()
 Optical loop statistics.
 
- Public Member Functions inherited from celeritas::optical::CoreStateInterface
 ~CoreStateInterface () override
 Support polymorphic deletion.
 
- Public Member Functions inherited from celeritas::AuxStateInterface
virtual ~AuxStateInterface ()
 Default destructor.
 

Additional Inherited Members

- Protected Member Functions inherited from celeritas::optical::CoreStateInterface
 CELER_DEFAULT_COPY_MOVE (CoreStateInterface)
 
- Protected Member Functions inherited from celeritas::AuxStateInterface
 AuxStateInterface ()=default
 
 CELER_DEFAULT_COPY_MOVE (AuxStateInterface)
 Default destructor.
 

Detailed Description

template<MemSpace M>
class celeritas::optical::CoreState< M >

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.

Todo:
Encapsulate all the action management accessors in a helper class.

Member Function Documentation

◆ insert_primaries()

template<MemSpace M>
void celeritas::optical::CoreState< M >::insert_primaries ( Span< TrackInitializer const host_primaries)
finalvirtual

Inject primaries to be turned into TrackInitializers.

These will be converted by the ProcessPrimaries action.

Implements celeritas::optical::CoreStateInterface.

◆ reset()

template<MemSpace M>
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.

◆ size()

template<MemSpace M>
size_type celeritas::optical::CoreState< M >::size ( ) const
inlinefinalvirtual

Number of track slots.

Implements celeritas::optical::CoreStateInterface.

◆ stream_id()

template<MemSpace M>
StreamId celeritas::optical::CoreState< M >::stream_id ( ) const
inlinefinalvirtual

Thread/stream ID.

Implements celeritas::optical::CoreStateInterface.

◆ warming_up()

template<MemSpace M>
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:

  • Initialize asynchronous memory pools
  • Interrogate kernel functions for properties to be output later
  • Allocate "lazy" auxiliary data (e.g. action diagnostics)

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