Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:53:39

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file celeritas/global/detail/KillActive.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Macros.hh"
0010 #include "celeritas/Types.hh"
0011 #include "celeritas/track/SimTrackView.hh"
0012 
0013 #include "../CoreState.hh"
0014 #include "../CoreTrackView.hh"
0015 
0016 namespace celeritas
0017 {
0018 //---------------------------------------------------------------------------//
0019 class CoreParams;
0020 template<MemSpace M>
0021 class CoreState;
0022 
0023 namespace detail
0024 {
0025 //---------------------------------------------------------------------------//
0026 /*!
0027  * Mark active tracks as "errored".
0028  */
0029 struct KillActiveExecutor
0030 {
0031     inline CELER_FUNCTION void operator()(celeritas::CoreTrackView& track);
0032 };
0033 
0034 //---------------------------------------------------------------------------//
0035 
0036 void kill_active(CoreParams const& params, CoreState<MemSpace::host>& state);
0037 void kill_active(CoreParams const& params, CoreState<MemSpace::device>& state);
0038 
0039 //---------------------------------------------------------------------------//
0040 // INLINE DEFINITIONS
0041 //---------------------------------------------------------------------------//
0042 /*!
0043  * Construct with defaults.
0044  */
0045 CELER_FUNCTION void
0046 KillActiveExecutor::operator()(celeritas::CoreTrackView& track)
0047 {
0048     if (track.sim().status() != TrackStatus::inactive)
0049     {
0050         track.apply_errored();
0051     }
0052 }
0053 
0054 //---------------------------------------------------------------------------//
0055 }  // namespace detail
0056 }  // namespace celeritas