Celeritas  0.5.0-86+4a8eea4
Public Member Functions | List of all members
celeritas::TrackExecutor< T > Class Template Reference

Call a CoreTrackView executor for a given ThreadId. More...

#include <TrackExecutor.hh>

Public Types

Type aliases
using ParamsPtr = CoreParamsPtr< MemSpace::native >
 
using StatePtr = CoreStatePtr< MemSpace::native >
 
using Applier = T
 

Public Member Functions

CELER_FUNCTION TrackExecutor (ParamsPtr params, StatePtr state, T &&execute_track)
 Construct with core data and executor.
 
CELER_FUNCTION void operator() (ThreadId thread)
 Call the underlying function, using indirection array if needed.
 

Detailed Description

template<class T>
class celeritas::TrackExecutor< T >

Call a CoreTrackView executor for a given ThreadId.

This class can be used to call a functor that applies to CoreTrackView using a ThreadId, so that the tracks can be easily looped over as a group on CPU or GPU. It applies a remapping from thread to slot if the tracks are sorted. Otherwise, thread and track slot have the same numerical value.

This is primarily used by ActionLauncher .

void foo_kernel(CoreParamsPtr const params,
CoreStatePtr const state)
{
TrackExecutor execute{params, state, MyTrackApplier{}};
for (auto tid : range(ThreadID{123}))
{
step(tid);
}
}
CELER_CONSTEXPR_FUNCTION Range< T > range(T begin, T end)
Return a range over fixed beginning and end values.
Definition: Range.hh:190
CELER_FUNCTION TrackExecutor(ParamsPtr params, StatePtr state, T &&execute_track)
Construct with core data and executor.
Definition: TrackExecutor.hh:64
Todo:
Rename to ThreadExecutor. The template parameter, which must operate on a core track view, is a track executor.

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