gem5  v21.1.0.2
Public Member Functions | Public Attributes | List of all members
gem5::Random Class Reference

#include <random.hh>

Inheritance diagram for gem5::Random:
gem5::Serializable

Public Member Functions

 ~Random ()
 
void init (uint32_t s)
 
template<typename T >
std::enable_if_t< std::is_integral< T >::value, T > random ()
 Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating point. More...
 
template<typename T >
std::enable_if_t< std::is_floating_point< T >::value, T > random ()
 
template<typename T >
std::enable_if_t< std::is_integral< T >::value, T > random (T min, T max)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
 Random ()
 
 Random (uint32_t s)
 
- Public Member Functions inherited from gem5::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Public Attributes

std::mt19937_64 gen
 

Additional Inherited Members

- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 

Detailed Description

Definition at line 61 of file random.hh.

Constructor & Destructor Documentation

◆ ~Random()

gem5::Random::~Random ( )

Definition at line 62 of file random.cc.

Member Function Documentation

◆ init()

void gem5::Random::init ( uint32_t  s)

Definition at line 67 of file random.cc.

References gen, and gem5::ArmISA::s.

Referenced by gem5::DistIface::init(), gem5::pybind_init_core(), and Random().

◆ random()

template<typename T >
std::enable_if_t<std::is_floating_point<T>::value, T> gem5::Random::random ( )
inline

Definition at line 102 of file random.hh.

References gem5::statistics::dist, and gen.

◆ serialize()

void gem5::Random::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 73 of file random.cc.

References gen, panic, and gem5::paramOut().

◆ unserialize()

void gem5::Random::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 85 of file random.cc.

References gen, gem5::optParamIn(), and panic.


The documentation for this class was generated from the following files:

Generated on Tue Sep 21 2021 12:27:59 for gem5 by doxygen 1.8.17