summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/histogram.h
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-10-16 14:25:19 -0800
committerTor Aamodt <[email protected]>2010-10-16 14:25:19 -0800
commit2072e7ff2037c19a0c346e60469949c9437569bf (patch)
tree8235c2c67ca8f231c14d99bc1db660b26812734e /src/gpgpu-sim/histogram.h
parent58459bf7a55010eccf9940cfdb53cbc854b0989c (diff)
1. refactoring histogram/logger so that classes are in header files
2. starting to redo cache_t 3. deleting more perf counters 4. other minor cleaning [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7869]
Diffstat (limited to 'src/gpgpu-sim/histogram.h')
-rw-r--r--src/gpgpu-sim/histogram.h41
1 files changed, 14 insertions, 27 deletions
diff --git a/src/gpgpu-sim/histogram.h b/src/gpgpu-sim/histogram.h
index 5470050..e3d8f57 100644
--- a/src/gpgpu-sim/histogram.h
+++ b/src/gpgpu-sim/histogram.h
@@ -71,57 +71,44 @@
#include <string>
class binned_histogram {
-protected:
-
- std::string m_name;
- int m_nbins;
- int *m_bins; // bin boundaries
- int *m_bin_cnts; // counters
- int m_maximum; // the maximum sample
- signed long long int m_sum; // for calculating the average
-
public:
-
+ // creators
binned_histogram (std::string name = "", int nbins = 32, int* bins = NULL);
-
binned_histogram (const binned_histogram& other);
+ virtual ~binned_histogram ();
+ // modifiers:
void reset_bins ();
-
void add2bin (int sample);
- void fprint (FILE *fout);
-
- virtual ~binned_histogram ();
+ // accessors:
+ void fprint (FILE *fout) const;
+protected:
+ std::string m_name;
+ int m_nbins;
+ int *m_bins; // bin boundaries
+ int *m_bin_cnts; // counters
+ int m_maximum; // the maximum sample
+ signed long long int m_sum; // for calculating the average
};
class pow2_histogram : public binned_histogram {
-
public:
-
pow2_histogram ( std::string name = "", int nbins = 32, int* bins = NULL);
-
~pow2_histogram() {}
void add2bin (int sample);
-
};
class linear_histogram : public binned_histogram {
-
-private:
-
- int m_stride;
-
public:
-
linear_histogram (int stride = 1, const char *name = NULL, int nbins = 32, int* bins = NULL);
-
~linear_histogram() {}
void add2bin (int sample);
-
+private:
+ int m_stride;
};
#endif