diff options
| author | Mahmoud <[email protected]> | 2020-05-23 20:06:25 -0400 |
|---|---|---|
| committer | Mahmoud <[email protected]> | 2020-05-23 20:06:25 -0400 |
| commit | d610fd81420979e956bf37100f7e1c7f1d153831 (patch) | |
| tree | 392a841f21fec5136339ff36ad9b5c7b1b4cb480 /src/statwrapper.cc | |
| parent | 6cedd3ef4973f3785757413db89a7c5d0ee2b58b (diff) | |
| parent | e9e9fcf5957530ecb927aecb5ea238e4b78a4f45 (diff) | |
Merge branch 'dev' of https://github.com/purdue-aalp/gpgpu-sim_distribution into dev-traces
Diffstat (limited to 'src/statwrapper.cc')
| -rw-r--r-- | src/statwrapper.cc | 59 |
1 files changed, 21 insertions, 38 deletions
diff --git a/src/statwrapper.cc b/src/statwrapper.cc index e273e78..cda25b6 100644 --- a/src/statwrapper.cc +++ b/src/statwrapper.cc @@ -1,48 +1,33 @@ -//a Wraper function for stats class -#include "intersim2/stats.hpp" +// a Wraper function for stats class #include <stdio.h> +#include "intersim2/stats.hpp" -Stats* StatCreate (const char * name, double bin_size, int num_bins) { - Stats* newstat = new Stats(NULL,name,bin_size,num_bins); - newstat->Clear (); - return newstat; +Stats *StatCreate(const char *name, double bin_size, int num_bins) { + Stats *newstat = new Stats(NULL, name, bin_size, num_bins); + newstat->Clear(); + return newstat; } -void StatClear(void * st) -{ - ((Stats *)st)->Clear(); -} +void StatClear(void *st) { ((Stats *)st)->Clear(); } -void StatAddSample (void * st, int val) -{ - ((Stats *)st)->AddSample(val); -} +void StatAddSample(void *st, int val) { ((Stats *)st)->AddSample(val); } -double StatAverage(void * st) -{ - return((Stats *)st)->Average(); -} +double StatAverage(void *st) { return ((Stats *)st)->Average(); } -double StatMax(void * st) -{ - return((Stats *)st)->Max(); -} +double StatMax(void *st) { return ((Stats *)st)->Max(); } -double StatMin(void * st) -{ - return((Stats *)st)->Min(); -} +double StatMin(void *st) { return ((Stats *)st)->Min(); } -void StatDisp (void * st) -{ - printf ("Stats for "); - ((Stats *)st)->DisplayHierarchy(); -// if (((Stats *)st)->NeverUsed()) { -// printf (" was never updated!\n"); -// } else { - printf("Min %f Max %f Average %f \n",((Stats *)st)->Min(),((Stats *)st)->Max(),StatAverage(st)); - ((Stats *)st)->Display(); -// } +void StatDisp(void *st) { + printf("Stats for "); + ((Stats *)st)->DisplayHierarchy(); + // if (((Stats *)st)->NeverUsed()) { + // printf (" was never updated!\n"); + // } else { + printf("Min %f Max %f Average %f \n", ((Stats *)st)->Min(), + ((Stats *)st)->Max(), StatAverage(st)); + ((Stats *)st)->Display(); + // } } #if 0 @@ -55,5 +40,3 @@ int main () StatDisp(mytest); } #endif - - |
