Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-07 10:11:37

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/gen/detail/OffloadGatherTraits.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Types.hh"
0010 #include "corecel/sys/ActionInterface.hh"
0011 
0012 #include "../OffloadData.hh"
0013 
0014 namespace celeritas
0015 {
0016 namespace detail
0017 {
0018 struct OffloadPreGatherExecutor;
0019 struct OffloadPrePostGatherExecutor;
0020 
0021 //---------------------------------------------------------------------------//
0022 //! Traits for gathering state data needed for optical distributions
0023 template<StepActionOrder S>
0024 struct OffloadGatherTraits;
0025 
0026 template<>
0027 struct OffloadGatherTraits<StepActionOrder::pre>
0028 {
0029     //! Pre-step gather data
0030     template<Ownership W, MemSpace M>
0031     using Data = OffloadPreStateData<W, M>;
0032 
0033     //! Optical gather executor
0034     using Executor = OffloadPreGatherExecutor;
0035 
0036     //! Label of the gather action
0037     static constexpr char const label[] = "offload-pre-gather";
0038 
0039     //! Description of the gather action
0040     static constexpr char const description[]
0041         = "gather pre-step data for optical distributions";
0042 };
0043 
0044 template<>
0045 struct OffloadGatherTraits<StepActionOrder::pre_post>
0046 {
0047     //! Pre-post-step gather data
0048     template<Ownership W, MemSpace M>
0049     using Data = OffloadPrePostStateData<W, M>;
0050 
0051     //! Optical gather executor
0052     using Executor = OffloadPrePostGatherExecutor;
0053 
0054     //! Label of the gather action
0055     static constexpr char const label[] = "offload-pre-post-gather";
0056 
0057     //! Description of the gather action
0058     static constexpr char const description[]
0059         = "gather pre-post-step data for scintillation optical distributions";
0060 };
0061 
0062 //---------------------------------------------------------------------------//
0063 }  // namespace detail
0064 }  // namespace celeritas