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 #include <string_view>
0012
0013 #include "corecel/Macros.hh"
0014 #include "corecel/data/AuxInterface.hh"
0015 #include "celeritas/global/ActionInterface.hh"
0016
0017 namespace celeritas
0018 {
0019
0020 template<class P, template<MemSpace M> class S>
0021 class ActionGroups;
0022 class CoreParams;
0023
0024 namespace optical
0025 {
0026 class CoreParams;
0027 template<MemSpace M>
0028 class CoreState;
0029 class MaterialParams;
0030 }
0031
0032 namespace detail
0033 {
0034 class OffloadParams;
0035 }
0036
0037 namespace detail
0038 {
0039
0040
0041
0042
0043
0044
0045
0046
0047 class OpticalLaunchAction : public AuxParamsInterface,
0048 public CoreStepActionInterface
0049 {
0050 public:
0051
0052
0053 using SPOffloadParams = std::shared_ptr<detail::OffloadParams>;
0054 using SPConstMaterial = std::shared_ptr<optical::MaterialParams const>;
0055
0056
0057 public:
0058
0059 static std::shared_ptr<OpticalLaunchAction>
0060 make_and_insert(CoreParams const& core,
0061 SPConstMaterial material,
0062 SPOffloadParams offload,
0063 size_type primary_capacity);
0064
0065
0066 OpticalLaunchAction(ActionId id,
0067 AuxId data_id,
0068 CoreParams const& core,
0069 SPConstMaterial material,
0070 SPOffloadParams offload,
0071 size_type primary_capacity);
0072
0073
0074
0075
0076 std::string_view label() const final { return "optical-offload-launch"; }
0077
0078 std::string_view description() const final;
0079
0080
0081
0082
0083
0084 AuxId aux_id() const final { return aux_id_; }
0085
0086 UPState create_state(MemSpace, StreamId, size_type) const final;
0087
0088
0089
0090
0091
0092 ActionId action_id() const final { return action_id_; }
0093
0094 StepActionOrder order() const final { return StepActionOrder::user_post; }
0095
0096 void step(CoreParams const&, CoreStateHost&) const final;
0097
0098 void step(CoreParams const&, CoreStateDevice&) const final;
0099
0100
0101
0102
0103 private:
0104 using ActionGroupsT = ActionGroups<optical::CoreParams, optical::CoreState>;
0105 using SPOpticalParams = std::shared_ptr<optical::CoreParams>;
0106 using SPActionGroups = std::shared_ptr<ActionGroupsT>;
0107
0108
0109
0110 ActionId action_id_;
0111 AuxId aux_id_;
0112 SPOffloadParams offload_params_;
0113 SPOpticalParams optical_params_;
0114 SPActionGroups optical_actions_;
0115
0116
0117
0118 template<MemSpace M>
0119 void execute_impl(CoreParams const&, CoreState<M>&) const;
0120 };
0121
0122
0123 }
0124 }