gem5  v22.1.0.0
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_v< T >, 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_v< T >, T > random ()
 
template<typename T >
std::enable_if_t< std::is_integral_v< T >, 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::VegaISA::s.

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

◆ random()

template<typename T >
std::enable_if_t<std::is_floating_point_v<T>, 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, gem5::paramOut(), and state.

◆ 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::ArmISA::iss, gem5::optParamIn(), panic, and state.


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

Generated on Wed Dec 21 2022 10:23:12 for gem5 by doxygen 1.9.1