Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:53:43

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file celeritas/optical/detail/OffloadGatherAction.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <memory>
0010 #include <vector>
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 
0017 namespace celeritas
0018 {
0019 namespace detail
0020 {
0021 //---------------------------------------------------------------------------//
0022 /*!
0023  * Collect pre-step data needed to generate optical distribution data.
0024  *
0025  * This pre-step action stores the optical material ID and other
0026  * beginning-of-step properties so that optical photons can be generated
0027  * between the start and end points of the step.
0028  *
0029  * \sa OffloadGatherExecutor
0030  */
0031 class OffloadGatherAction final : public CoreStepActionInterface
0032 {
0033   public:
0034     // Construct with action ID and storage
0035     OffloadGatherAction(ActionId id, AuxId data_id);
0036 
0037     // Launch kernel with host data
0038     void step(CoreParams const&, CoreStateHost&) const final;
0039 
0040     // Launch kernel with device data
0041     void step(CoreParams const&, CoreStateDevice&) const final;
0042 
0043     //! ID of the model
0044     ActionId action_id() const final { return id_; }
0045 
0046     //! Short name for the action
0047     std::string_view label() const final { return "optical-offload-gather"; }
0048 
0049     // Name of the action (for user output)
0050     std::string_view description() const final;
0051 
0052     //! Dependency ordering of the action
0053     StepActionOrder order() const final { return StepActionOrder::user_pre; }
0054 
0055   private:
0056     //// DATA ////
0057 
0058     ActionId id_;
0059     AuxId data_id_;
0060 };
0061 
0062 //---------------------------------------------------------------------------//
0063 }  // namespace detail
0064 }  // namespace celeritas