Celeritas  0.5.0-56+6b053cd
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 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. More...
 
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.
 
CoreStateCounterscounters ()
 Track initialization counters.
 
CoreStateCounters const & counters () const final
 Track initialization counters.
 
void insert_primaries (Span< TrackInitializer const > host_primaries) final
 Inject primaries to be turned into TrackInitializers. More...
 
- Public Member Functions inherited from celeritas::optical::CoreStateInterface
virtual ~CoreStateInterface ()
 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.

◆ warming_up()

template<MemSpace M>
bool celeritas::optical::CoreState< M >::warming_up

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: