File indexing completed on 2025-09-18 09:09:09
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "corecel/Assert.hh"
0010 #include "corecel/Macros.hh"
0011 #include "corecel/Types.hh"
0012 #include "corecel/data/Collection.hh"
0013 #include "celeritas/Types.hh"
0014
0015 namespace celeritas
0016 {
0017 namespace optical
0018 {
0019 namespace detail
0020 {
0021
0022 template<MemSpace M>
0023 using TrackSlotRef = StateCollection<TrackSlotId, Ownership::reference, M>;
0024 template<MemSpace M>
0025 using TrackStatusRef = StateCollection<TrackStatus, Ownership::reference, M>;
0026
0027
0028
0029 struct IsVacant
0030 {
0031 CELER_FUNCTION bool operator()(TrackStatus status) const
0032 {
0033 return status != TrackStatus::alive;
0034 }
0035 };
0036
0037
0038
0039 size_type copy_if_vacant(TrackStatusRef<MemSpace::host> const&,
0040 TrackSlotRef<MemSpace::host> const&,
0041 StreamId);
0042 size_type copy_if_vacant(TrackStatusRef<MemSpace::device> const&,
0043 TrackSlotRef<MemSpace::device> const&,
0044 StreamId);
0045
0046
0047
0048
0049 #if !CELER_USE_DEVICE
0050 inline size_type copy_if_vacant(TrackStatusRef<MemSpace::device> const&,
0051 TrackSlotRef<MemSpace::device> const&,
0052 StreamId)
0053 {
0054 CELER_NOT_CONFIGURED("CUDA or HIP");
0055 }
0056 #endif
0057
0058 }
0059 }
0060 }