Celeritas  0.5.0-86+4a8eea4
Classes | Typedefs | Functions
XorwowRngData.hh File Reference
#include <cstdint>
#include "corecel/Assert.hh"
#include "corecel/Macros.hh"
#include "corecel/Types.hh"
#include "corecel/cont/Array.hh"
#include "corecel/cont/Span.hh"
#include "corecel/data/Collection.hh"
This graph shows which files directly or indirectly include this file:

Classes

struct  celeritas::XorwowRngParamsData< W, M >
 Persistent data for XORWOW generator. More...
 
struct  celeritas::XorwowRngInitializer
 Initialize an RNG. More...
 
struct  celeritas::XorwowState
 Individual RNG state. More...
 
struct  celeritas::XorwowRngStateData< W, M >
 XORWOW generator states for all threads. More...
 

Typedefs

using celeritas::XorwowUInt = std::uint32_t
 32-bit unsigned integer type for xorwow
 
using celeritas::XorwowSeed = Array< XorwowUInt, 1 >
 Seed type used to generate initial states for the RNG.
 

Functions

void celeritas::initialize_xorwow (Span< XorwowState > state, XorwowSeed const &seed, StreamId stream)
 Initialize XORWOW states with well-distributed random data. More...
 
template<MemSpace M>
void celeritas::resize (XorwowRngStateData< Ownership::value, M > *state, HostCRef< XorwowRngParamsData > const &params, StreamId stream, size_type size)
 Resize and seed the RNG states.
 

Function Documentation

◆ initialize_xorwow()

void celeritas::initialize_xorwow ( Span< XorwowState state,
XorwowSeed const &  seed,
StreamId  stream 
)

Initialize XORWOW states with well-distributed random data.

cuRAND and hipRAND implement functions that permute the original (but seemingly arbitrary) seeds given in Marsaglia with 64 bits of seed data. We simply generate pseudorandom, independent starting states for all data in all threads using a 32-bit MT19937 engine.