gem5  v21.1.0.2
Classes | Public Member Functions | Private Attributes | List of all members
gem5::statistics::SampleStor Class Reference

Templatized storage and interface for a distribution that calculates mean and variance. More...

#include <storage.hh>

Classes

struct  Params
 

Public Member Functions

 SampleStor (const StorageParams *const storage_params)
 Create and initialize this storage. More...
 
void sample (Counter val, int number)
 Add a value the given number of times to this running average. More...
 
size_type size () const
 Return the number of entries in this stat, 1. More...
 
bool zero () const
 Return true if no samples have been added. More...
 
void prepare (const StorageParams *const storage_params, DistData &data)
 
void reset (const StorageParams *const storage_params)
 Reset stat value to default. More...
 

Private Attributes

Counter sum
 The current sum. More...
 
Counter squares
 The sum of squares. More...
 
Counter samples
 The number of samples. More...
 

Detailed Description

Templatized storage and interface for a distribution that calculates mean and variance.

Definition at line 560 of file storage.hh.

Constructor & Destructor Documentation

◆ SampleStor()

gem5::statistics::SampleStor::SampleStor ( const StorageParams *const  storage_params)
inline

Create and initialize this storage.

Definition at line 579 of file storage.hh.

Member Function Documentation

◆ prepare()

void gem5::statistics::SampleStor::prepare ( const StorageParams *const  storage_params,
DistData data 
)
inline

Definition at line 611 of file storage.hh.

References data, gem5::statistics::Deviation, samples, squares, sum, and gem5::statistics::DistParams::type.

Referenced by TEST().

◆ reset()

void gem5::statistics::SampleStor::reset ( const StorageParams *const  storage_params)
inline

Reset stat value to default.

Definition at line 626 of file storage.hh.

References samples, squares, and sum.

Referenced by TEST().

◆ sample()

void gem5::statistics::SampleStor::sample ( Counter  val,
int  number 
)
inline

Add a value the given number of times to this running average.

Update the running sum and sum of squares, increment the number of values seen by the given number.

Parameters
valThe value to add.
numberThe number of times to add the value.

Definition at line 591 of file storage.hh.

References samples, squares, sum, and gem5::X86ISA::val.

Referenced by TEST().

◆ size()

size_type gem5::statistics::SampleStor::size ( ) const
inline

Return the number of entries in this stat, 1.

Returns
1.

Definition at line 602 of file storage.hh.

Referenced by TEST().

◆ zero()

bool gem5::statistics::SampleStor::zero ( ) const
inline

Return true if no samples have been added.

Returns
True if no samples have been added.

Definition at line 608 of file storage.hh.

References samples.

Referenced by TEST().

Member Data Documentation

◆ samples

Counter gem5::statistics::SampleStor::samples
private

The number of samples.

Definition at line 568 of file storage.hh.

Referenced by prepare(), reset(), sample(), and zero().

◆ squares

Counter gem5::statistics::SampleStor::squares
private

The sum of squares.

Definition at line 566 of file storage.hh.

Referenced by prepare(), reset(), and sample().

◆ sum

Counter gem5::statistics::SampleStor::sum
private

The current sum.

Definition at line 564 of file storage.hh.

Referenced by prepare(), reset(), and sample().


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

Generated on Tue Sep 21 2021 12:32:30 for gem5 by doxygen 1.8.17