Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::KernelContextException Class Reference

Provide contextual information about failed errors on CPU. More...

#include <KernelContextException.hh>

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

Public Types

Type aliases
using Energy = units::MevEnergy
 

Public Member Functions

 KernelContextException (HostCRef< CoreParamsData > const &params, HostRef< CoreStateData > const &states, ThreadId tid, std::string_view label)
 Construct with track data and kernel label.
 
char const * type () const final
 This class type's description.
 
void output (JsonPimpl *json) const final
 Save context to a JSON object.
 
char const * what () const noexcept final
 Get an explanatory message.
 
std::string const & label () const
 Label of the kernel that died.
 
Track accessors

Kernel thread ID

ThreadId thread () const
 Track slot ID.
 
TrackSlotId track_slot () const
 Track slot ID.
 
EventId event () const
 Event ID.
 
TrackId track () const
 Track ID.
 
TrackId parent () const
 Parent track ID.
 
size_type num_steps () const
 Step counter.
 
ParticleId particle () const
 Particle type.
 
Energy energy () const
 Particle energy.
 
Real3 const & pos () const
 Position.
 
Real3 const & dir () const
 Direction.
 
VolumeId volume () const
 Volume ID.
 
SurfaceId surface () const
 Surface.
 

Detailed Description

Provide contextual information about failed errors on CPU.

When a CPU track hits an exception, gather properties about the current thread and failing track. These properties are accessible through this exception class or they can be chained into the failing exception and processed by ExceptionOutput as context for the failure.

step(ThreadId{i}),
capture_exception,
KernelContextException(data.params, data.states, ThreadId{i},
this->label())
);
#define CELER_TRY_HANDLE_CONTEXT( STATEMENT, HANDLE_EXCEPTION, CONTEXT_EXCEPTION)
Try the given statement, and if it fails, chain it into the given exception.
Definition: Macros.hh:208
KernelContextException(HostCRef< CoreParamsData > const &params, HostRef< CoreStateData > const &states, ThreadId tid, std::string_view label)
Construct with track data and kernel label.
Definition: KernelContextException.cc:43

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