gem5 v24.0.0.0
Loading...
Searching...
No Matches
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.
 
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.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
 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.
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object.
 
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.
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it.
 

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)

◆ 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 Tue Jun 18 2024 16:24:13 for gem5 by doxygen 1.11.0