Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:31:30

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2021-2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file celeritas/random/CuHipRngParams.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/data/CollectionMirror.hh"
0011 #include "corecel/data/ParamsDataInterface.hh"
0012 
0013 #include "CuHipRngData.hh"
0014 
0015 namespace celeritas
0016 {
0017 //---------------------------------------------------------------------------//
0018 /*!
0019  * Manage random number generation.
0020  *
0021  * Currently this just constructs a local seed number but should be extended to
0022  * handle RNG setup across multiple MPI processes.
0023  */
0024 class CuHipRngParams final : public ParamsDataInterface<CuHipRngParamsData>
0025 {
0026   public:
0027     // Construct with seed
0028     explicit CuHipRngParams(unsigned int seed);
0029 
0030     //! Access RNG properties for constructing RNG state
0031     HostRef const& host_ref() const final { return data_.host_ref(); }
0032 
0033     //! Access data on device
0034     DeviceRef const& device_ref() const final { return data_.device_ref(); }
0035 
0036   private:
0037     // Host/device storage and reference
0038     CollectionMirror<CuHipRngParamsData> data_;
0039 };
0040 
0041 //---------------------------------------------------------------------------//
0042 }  // namespace celeritas