Celeritas 0.6.0-dev.115+3b60a5fd
Loading...
Searching...
No Matches
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 consttype () const final
 This class type's description.
 
void output (JsonPimpl *json) const final
 Save context to a JSON object.
 
char constwhat () const noexcept final
 Get an explanatory message.
 
std::string constlabel () const
 Label of the kernel that died.
 
Track accessors
ThreadId thread () const
 Kernel thread 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 constpos () const
 Position.
 
Real3 constdir () 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:210
Provide contextual information about failed errors on CPU.
Definition KernelContextException.hh:42

Member Function Documentation

◆ output()

void celeritas::KernelContextException::output ( JsonPimpl json) const
finalvirtual

Save context to a JSON object.

Implements celeritas::RichContextException.

◆ type()

char const * celeritas::KernelContextException::type ( ) const
finalvirtual

This class type's description.

Implements celeritas::RichContextException.


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