summaryrefslogtreecommitdiff
path: root/src/gpuwattch/basic_components.cc
diff options
context:
space:
mode:
authorNick <[email protected]>2019-09-13 08:02:14 -0400
committerNick <[email protected]>2019-09-13 08:02:14 -0400
commitf2aa87a330dc68207088bf60828376f9fa454d72 (patch)
treec329fe2a9b754de23acc8dc99e9d3e5d44139e1d /src/gpuwattch/basic_components.cc
parenta34a4baad45a40840308167307c79371b4024a9d (diff)
Seems like multiple passes for reformatting comments
Diffstat (limited to 'src/gpuwattch/basic_components.cc')
-rw-r--r--src/gpuwattch/basic_components.cc132
1 files changed, 61 insertions, 71 deletions
diff --git a/src/gpuwattch/basic_components.cc b/src/gpuwattch/basic_components.cc
index d66c280..d58023a 100644
--- a/src/gpuwattch/basic_components.cc
+++ b/src/gpuwattch/basic_components.cc
@@ -30,97 +30,87 @@
***************************************************************************/
#include "basic_components.h"
-#include <iostream>
#include <assert.h>
#include <cmath>
+#include <iostream>
-double longer_channel_device_reduction(
- enum Device_ty device_ty,
- enum Core_type core_ty)
-{
-
- double longer_channel_device_percentage_core;
- double longer_channel_device_percentage_uncore;
- double longer_channel_device_percentage_llc;
+double longer_channel_device_reduction(enum Device_ty device_ty,
+ enum Core_type core_ty) {
+ double longer_channel_device_percentage_core;
+ double longer_channel_device_percentage_uncore;
+ double longer_channel_device_percentage_llc;
- double long_channel_device_reduction;
+ double long_channel_device_reduction;
- longer_channel_device_percentage_llc = 1.0;
- longer_channel_device_percentage_uncore = 0.82;
- if (core_ty==OOO)
- {
- longer_channel_device_percentage_core = 0.56;//0.54 Xeon Tulsa //0.58 Nehelam
- //longer_channel_device_percentage_uncore = 0.76;//0.85 Nehelam
+ longer_channel_device_percentage_llc = 1.0;
+ longer_channel_device_percentage_uncore = 0.82;
+ if (core_ty == OOO) {
+ longer_channel_device_percentage_core =
+ 0.56; // 0.54 Xeon Tulsa //0.58 Nehelam
+ // longer_channel_device_percentage_uncore = 0.76;//0.85 Nehelam
- }
- else
- {
- longer_channel_device_percentage_core = 0.8;//0.8;//Niagara
- //longer_channel_device_percentage_uncore = 0.9;//Niagara
- }
+ } else {
+ longer_channel_device_percentage_core = 0.8; // 0.8;//Niagara
+ // longer_channel_device_percentage_uncore = 0.9;//Niagara
+ }
- if (device_ty==Core_device)
- {
- long_channel_device_reduction = (1- longer_channel_device_percentage_core)
- + longer_channel_device_percentage_core * g_tp.peri_global.long_channel_leakage_reduction;
- }
- else if (device_ty==Uncore_device)
- {
- long_channel_device_reduction = (1- longer_channel_device_percentage_uncore)
- + longer_channel_device_percentage_uncore * g_tp.peri_global.long_channel_leakage_reduction;
- }
- else if (device_ty==LLC_device)
- {
- long_channel_device_reduction = (1- longer_channel_device_percentage_llc)
- + longer_channel_device_percentage_llc * g_tp.peri_global.long_channel_leakage_reduction;
- }
- else
- {
- cout<<"unknown device category"<<endl;
- exit(0);
- }
+ if (device_ty == Core_device) {
+ long_channel_device_reduction =
+ (1 - longer_channel_device_percentage_core) +
+ longer_channel_device_percentage_core *
+ g_tp.peri_global.long_channel_leakage_reduction;
+ } else if (device_ty == Uncore_device) {
+ long_channel_device_reduction =
+ (1 - longer_channel_device_percentage_uncore) +
+ longer_channel_device_percentage_uncore *
+ g_tp.peri_global.long_channel_leakage_reduction;
+ } else if (device_ty == LLC_device) {
+ long_channel_device_reduction =
+ (1 - longer_channel_device_percentage_llc) +
+ longer_channel_device_percentage_llc *
+ g_tp.peri_global.long_channel_leakage_reduction;
+ } else {
+ cout << "unknown device category" << endl;
+ exit(0);
+ }
- return long_channel_device_reduction;
+ return long_channel_device_reduction;
}
-statsComponents operator+(const statsComponents & x, const statsComponents & y)
-{
- statsComponents z;
+statsComponents operator+(const statsComponents& x, const statsComponents& y) {
+ statsComponents z;
- z.access = x.access + y.access;
- z.hit = x.hit + y.hit;
- z.miss = x.miss + y.miss;
+ z.access = x.access + y.access;
+ z.hit = x.hit + y.hit;
+ z.miss = x.miss + y.miss;
- return z;
+ return z;
}
-statsComponents operator*(const statsComponents & x, double const * const y)
-{
- statsComponents z;
+statsComponents operator*(const statsComponents& x, double const* const y) {
+ statsComponents z;
- z.access = x.access*y[0];
- z.hit = x.hit*y[1];
- z.miss = x.miss*y[2];
+ z.access = x.access * y[0];
+ z.hit = x.hit * y[1];
+ z.miss = x.miss * y[2];
- return z;
+ return z;
}
-statsDef operator+(const statsDef & x, const statsDef & y)
-{
- statsDef z;
+statsDef operator+(const statsDef& x, const statsDef& y) {
+ statsDef z;
- z.readAc = x.readAc + y.readAc;
- z.writeAc = x.writeAc + y.writeAc;
- z.searchAc = x.searchAc + y.searchAc;
- return z;
+ z.readAc = x.readAc + y.readAc;
+ z.writeAc = x.writeAc + y.writeAc;
+ z.searchAc = x.searchAc + y.searchAc;
+ return z;
}
-statsDef operator*(const statsDef & x, double const * const y)
-{
- statsDef z;
+statsDef operator*(const statsDef& x, double const* const y) {
+ statsDef z;
- z.readAc = x.readAc*y;
- z.writeAc = x.writeAc*y;
- z.searchAc = x.searchAc*y;
- return z;
+ z.readAc = x.readAc * y;
+ z.writeAc = x.writeAc * y;
+ z.searchAc = x.searchAc * y;
+ return z;
}