Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:54:44

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/inp/System.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <map>
0010 #include <optional>
0011 #include <string>
0012 
0013 #include "celeritas/Types.hh"
0014 
0015 namespace celeritas
0016 {
0017 namespace inp
0018 {
0019 //---------------------------------------------------------------------------//
0020 /*!
0021  * Set up GPU capabilities and debugging options.
0022  *
0023  * Stream sharing and synchronization might be helpful for debugging potential
0024  * race conditions or improving timing accuracy (at the cost of reducing
0025  * performance).
0026  *
0027  * The CUDA heap and stack sizes may be needed for VecGeom, which has dynamic
0028  * resource requirements.
0029  *
0030  * \todo Move the \c CELER_DEVICE_ASYNC environment variable here
0031  */
0032 struct Device
0033 {
0034     //! Per-thread CUDA stack size (ignored if zero) [B]
0035     size_type stack_size{};
0036     //! Global dynamic CUDA heap size (ignored if zero) [B]
0037     size_type heap_size{};
0038 
0039     // TODO: could add preferred device ID, etc.
0040 };
0041 
0042 //---------------------------------------------------------------------------//
0043 /*!
0044  * Set up system parameters defined once at program startup.
0045  *
0046  * \todo Add OpenMP options
0047  * \todo Add MPI options
0048  * \todo Add Logger verbosity
0049  */
0050 struct System
0051 {
0052     //! Environment variables used for program setup/diagnostic
0053     std::map<std::string, std::string> environment;
0054 
0055     //! Optional: activate GPU
0056     std::optional<Device> device;
0057 };
0058 
0059 //---------------------------------------------------------------------------//
0060 }  // namespace inp
0061 }  // namespace celeritas