Celeritas 0.6.0-dev.115+3b60a5fd
Loading...
Searching...
No Matches
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);
}
}
Type-safe non-owning pointer.
Definition ObserverPtr.hh:32
Call a CoreTrackView executor for a given ThreadId.
Definition TrackExecutor.hh:51
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: