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