File indexing completed on 2025-02-22 10:31:32
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include <memory>
0011 #include <string>
0012 #include <type_traits>
0013 #include <vector>
0014
0015 #include "corecel/Assert.hh"
0016 #include "corecel/Macros.hh"
0017 #include "corecel/data/CollectionMirror.hh"
0018 #include "corecel/data/CollectionStateStore.hh"
0019 #include "celeritas/global/ActionInterface.hh"
0020 #include "celeritas/global/CoreTrackDataFwd.hh"
0021
0022 #include "StepStorage.hh"
0023 #include "../StepData.hh"
0024 #include "../StepInterface.hh"
0025
0026 namespace celeritas
0027 {
0028 namespace detail
0029 {
0030
0031
0032
0033
0034
0035
0036 template<StepPoint P>
0037 class StepGatherAction final : public CoreStepActionInterface
0038 {
0039 public:
0040
0041
0042 using SPStepStorage = std::shared_ptr<StepStorage>;
0043 using SPStepInterface = std::shared_ptr<StepInterface>;
0044 using VecInterface = std::vector<SPStepInterface>;
0045
0046
0047 public:
0048
0049 StepGatherAction(ActionId id, SPStepStorage storage, VecInterface callbacks);
0050
0051
0052 void step(CoreParams const&, CoreStateHost&) const final;
0053
0054
0055 void step(CoreParams const&, CoreStateDevice&) const final;
0056
0057
0058 ActionId action_id() const final { return id_; }
0059
0060
0061 std::string_view label() const final
0062 {
0063 return P == StepPoint::pre ? "step-gather-pre"
0064 : P == StepPoint::post ? "step-gather-post"
0065 : std::string_view{};
0066 }
0067
0068
0069 std::string_view description() const final { return description_; }
0070
0071
0072 StepActionOrder order() const final
0073 {
0074 return P == StepPoint::pre ? StepActionOrder::user_pre
0075 : P == StepPoint::post ? StepActionOrder::user_post
0076 : StepActionOrder::size_;
0077 }
0078
0079 private:
0080
0081
0082 ActionId id_;
0083 SPStepStorage storage_;
0084 VecInterface callbacks_;
0085 std::string description_;
0086 };
0087
0088
0089 template<StepPoint P>
0090 void step_gather_device(DeviceCRef<CoreParamsData> const&,
0091 DeviceRef<CoreStateData>&,
0092 DeviceCRef<StepParamsData> const&,
0093 DeviceRef<StepStateData>&);
0094
0095
0096
0097
0098
0099 extern template class StepGatherAction<StepPoint::pre>;
0100 extern template class StepGatherAction<StepPoint::post>;
0101
0102
0103 }
0104 }