gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::statistics::AvgSampleStor Class Reference

Templatized storage for distribution that calculates per tick mean and variance. More...

#include <storage.hh>

Classes

struct  Params
 

Public Member Functions

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

Private Attributes

Counter sum
 Current total.
 
Counter squares
 Current sum of squares.
 

Detailed Description

Templatized storage for distribution that calculates per tick mean and variance.

Definition at line 637 of file storage.hh.

Constructor & Destructor Documentation

◆ AvgSampleStor()

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

Create and initialize this storage.

Definition at line 654 of file storage.hh.

Member Function Documentation

◆ prepare()

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

◆ reset()

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

Reset stat value to default.

Definition at line 699 of file storage.hh.

References squares, and sum.

Referenced by TEST(), TEST(), and TEST().

◆ sample()

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

Add a value to the distribution for the given number of times.

Update the running sum and sum of squares.

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

Definition at line 665 of file storage.hh.

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

Referenced by TEST(), TEST(), and TEST().

◆ size()

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

Return the number of entries, in this case 1.

Returns
1.

Definition at line 675 of file storage.hh.

Referenced by TEST().

◆ zero()

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

Return true if no samples have been added.

Returns
True if the sum is zero.

Definition at line 681 of file storage.hh.

References sum.

Referenced by TEST(), and TEST().

Member Data Documentation

◆ squares

Counter gem5::statistics::AvgSampleStor::squares
private

Current sum of squares.

Definition at line 643 of file storage.hh.

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

◆ sum

Counter gem5::statistics::AvgSampleStor::sum
private

Current total.

Definition at line 641 of file storage.hh.

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


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

Generated on Tue Jun 18 2024 16:24:23 for gem5 by doxygen 1.11.0