File indexing completed on 2025-02-22 10:31:26
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 CerenkovParams;
0025 class MaterialParams;
0026 }
0027
0028 namespace detail
0029 {
0030
0031
0032
0033
0034 class CerenkovOffloadAction final : public CoreStepActionInterface
0035 {
0036 public:
0037
0038
0039 using SPConstCerenkov
0040 = std::shared_ptr<celeritas::optical::CerenkovParams const>;
0041 using SPConstMaterial
0042 = std::shared_ptr<celeritas::optical::MaterialParams const>;
0043
0044
0045 public:
0046
0047 CerenkovOffloadAction(ActionId id,
0048 AuxId data_id,
0049 SPConstMaterial material,
0050 SPConstCerenkov cerenkov);
0051
0052
0053 void step(CoreParams const&, CoreStateHost&) const final;
0054
0055
0056 void step(CoreParams const&, CoreStateDevice&) const final;
0057
0058
0059 ActionId action_id() const final { return id_; }
0060
0061
0062 std::string_view label() const final { return "cerenkov-offload"; }
0063
0064
0065 std::string_view description() const final;
0066
0067
0068 StepActionOrder order() const final { return StepActionOrder::user_post; }
0069
0070 private:
0071
0072
0073 ActionId id_;
0074 AuxId data_id_;
0075 SPConstMaterial material_;
0076 SPConstCerenkov cerenkov_;
0077
0078
0079
0080 template<MemSpace M>
0081 void step_impl(CoreParams const&, CoreState<M>&) const;
0082
0083 void pre_generate(CoreParams const&, CoreStateHost&) const;
0084 void pre_generate(CoreParams const&, CoreStateDevice&) const;
0085 };
0086
0087
0088 }
0089 }