Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-14 08:50:59

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 corecel/random/params/CuHipRngParams.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/data/CollectionMirror.hh"
0010 #include "corecel/data/ParamsDataInterface.hh"
0011 #include "corecel/random/data/CuHipRngData.hh"
0012 
0013 namespace celeritas
0014 {
0015 //---------------------------------------------------------------------------//
0016 /*!
0017  * Manage random number generation.
0018  *
0019  * Currently this just constructs a local seed number but should be extended to
0020  * handle RNG setup across multiple MPI processes.
0021  */
0022 class CuHipRngParams final : public ParamsDataInterface<CuHipRngParamsData>
0023 {
0024   public:
0025     // Construct with seed
0026     explicit CuHipRngParams(unsigned int seed);
0027 
0028     //! Access RNG properties for constructing RNG state
0029     HostRef const& host_ref() const final { return data_.host_ref(); }
0030 
0031     //! Access data on device
0032     DeviceRef const& device_ref() const final { return data_.device_ref(); }
0033 
0034   private:
0035     // Host/device storage and reference
0036     CollectionMirror<CuHipRngParamsData> data_;
0037 };
0038 
0039 //---------------------------------------------------------------------------//
0040 }  // namespace celeritas