From 69f2911e04ffb1b19eef1fafb8c040af271f656e Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Thu, 15 Jul 2010 18:09:46 -0800 Subject: creating branch for adding support for CUDA 3.x and Fermi [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6829] --- src/intersim/stats.hpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/intersim/stats.hpp (limited to 'src/intersim/stats.hpp') diff --git a/src/intersim/stats.hpp b/src/intersim/stats.hpp new file mode 100644 index 0000000..7c2a398 --- /dev/null +++ b/src/intersim/stats.hpp @@ -0,0 +1,39 @@ +#ifndef _STATS_HPP_ +#define _STATS_HPP_ + +#include "module.hpp" + +class Stats : public Module { + int _num_samples; + double _sample_sum; + + bool _reset; + double _min; + double _max; + + int _num_bins; + double _bin_size; + + int *_hist; + +public: + Stats( Module *parent, const string &name, + double bin_size = 1.0, int num_bins = 10 ); + ~Stats( ); + + void Clear( ); + + double Average( ) const; + double Max( ) const; + double Min( ) const; + int NumSamples( ) const; + + void AddSample( double val ); + void AddSample( int val ); + + + void Display( ) const; + bool NeverUsed() const; +}; + +#endif -- cgit v1.3