File indexing completed on 2025-10-31 08:58:47
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <memory>
0010
0011 #include "corecel/Macros.hh"
0012 #include "corecel/data/AuxInterface.hh"
0013 #include "corecel/data/Collection.hh"
0014 #include "celeritas/global/ActionInterface.hh"
0015
0016 #include "OffloadParams.hh"
0017 #include "../GeneratorDistributionData.hh"
0018
0019 namespace celeritas
0020 {
0021 namespace optical
0022 {
0023 class ScintillationParams;
0024 }
0025
0026 namespace detail
0027 {
0028
0029
0030
0031
0032 class ScintOffloadAction final : public CoreStepActionInterface
0033 {
0034 public:
0035
0036
0037 using SPConstScintillation
0038 = std::shared_ptr<celeritas::optical::ScintillationParams const>;
0039
0040
0041 public:
0042
0043 ScintOffloadAction(ActionId id,
0044 AuxId data_id,
0045 SPConstScintillation scintillation);
0046
0047
0048 void step(CoreParams const&, CoreStateHost&) const final;
0049
0050
0051 void step(CoreParams const&, CoreStateDevice&) const final;
0052
0053
0054 ActionId action_id() const final { return id_; }
0055
0056
0057 std::string_view label() const final { return "scintillation-offload"; }
0058
0059
0060 std::string_view description() const final;
0061
0062
0063 StepActionOrder order() const final { return StepActionOrder::user_post; }
0064
0065 private:
0066
0067
0068 ActionId id_;
0069 AuxId data_id_;
0070 SPConstScintillation scintillation_;
0071
0072
0073
0074 template<MemSpace M>
0075 void step_impl(CoreParams const&, CoreState<M>&) const;
0076
0077 void pre_generate(CoreParams const&, CoreStateHost&) const;
0078 void pre_generate(CoreParams const&, CoreStateDevice&) const;
0079 };
0080
0081
0082 }
0083 }