Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2023-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/RngReseed.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Assert.hh"
0011 #include "corecel/Macros.hh"
0012 #include "corecel/Types.hh"
0013 #include "corecel/data/Collection.hh"
0014 
0015 #include "RngData.hh"
0016 
0017 namespace celeritas
0018 {
0019 //---------------------------------------------------------------------------//
0020 // Reinitialize the RNG states on host/device at the start of an event
0021 void reseed_rng(DeviceCRef<RngParamsData> const&,
0022                 DeviceRef<RngStateData> const&,
0023                 size_type);
0024 
0025 void reseed_rng(HostCRef<RngParamsData> const&,
0026                 HostRef<RngStateData> const&,
0027                 size_type);
0028 
0029 #if !CELER_USE_DEVICE
0030 //---------------------------------------------------------------------------//
0031 /*!
0032  * Reinitialize the RNG states on device at the start of an event.
0033  */
0034 inline void reseed_rng(DeviceCRef<RngParamsData> const&,
0035                        DeviceRef<RngStateData> const&,
0036                        size_type)
0037 {
0038     CELER_ASSERT_UNREACHABLE();
0039 }
0040 #endif
0041 
0042 //---------------------------------------------------------------------------//
0043 }  // namespace celeritas