From 9cafb850bdc8ba404add817f90c25faef6ecf9e3 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 13 Sep 2019 07:48:05 -0400 Subject: Revert "add /src/gpuwattch formatting" This reverts commit b7776785a18d3f4e6229cd625f92c11b55894b75. --- src/gpuwattch/basic_components.cc | 142 ++++++++++++++++++++------------------ 1 file changed, 76 insertions(+), 66 deletions(-) (limited to 'src/gpuwattch/basic_components.cc') diff --git a/src/gpuwattch/basic_components.cc b/src/gpuwattch/basic_components.cc index d58023a..d66c280 100644 --- a/src/gpuwattch/basic_components.cc +++ b/src/gpuwattch/basic_components.cc @@ -30,87 +30,97 @@ ***************************************************************************/ #include "basic_components.h" +#include #include #include -#include -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; - - 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 - } - - 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; +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; + + 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 + } + + 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"<