All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros Groups Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MeterPU::NVML_Energy_Measurement_Controller< device_id > Struct Template Reference

CUDA-enabled GPU Energy Measurement Controller. More...

#include <MeterPU.h>

Inheritance diagram for MeterPU::NVML_Energy_Measurement_Controller< device_id >:
Inheritance graph
[legend]
Collaboration diagram for MeterPU::NVML_Energy_Measurement_Controller< device_id >:
Collaboration graph
[legend]

Classes

struct  NVML_Energy_Device_Init
 
class  Sampling_Thread_Controller
 Sampling Thread Controller. More...
 

Public Member Functions

void init ()
 Initialize a GPU device. More...
 
void start ()
 mark the start of a measurement phase/period. More...
 
void stop ()
 mark the end of a measurement phase/period. More...
 
void calc ()
 calculate the metric value between start() and stop(). More...
 
NVML_Energy::Energy_Unit get_value () const
 Get calculated metric value, require calc() to be called already. More...
 
void show_meter_reading () const
 Print the calculated metric value to standard output, requires an invocation of calc() already done. More...
 

Private Member Functions

 DECLARE_CLASS_NAME ("NVML_Energy_Measurement_Controller")
 
const CPU_Time::Time_Unitget_start_time () const
 
const CPU_Time::Time_Unitget_stop_time () const
 
void record_start_time ()
 
void record_stop_time ()
 
CPU_Time::ResultType diff ()
 
void resetDir ()
 
void dumpTimeEvent ()
 
template<class T1 , class T2 >
void dumpTwoVectors (const std::string &filename, const std::string &header, const T1 &keys, const T2 &values) const
 
void dumpOriginalPowerData () const
 
void dumpCorrectedPowerData ()
 
void removeRedundantSamplesByDistance (const CPU_Time::ResultType &time_distance_ms)
 
void correctPowerSamplesByBurtscherApproach ()
 
void fillPowerValuesAtStartAndEnd ()
 
NVML_Energy::Energy_Unit calTotalArea ()
 
NVML_Energy::Energy_Unit calTotalArea (NVML_Energy<>::Hp_Power_DB_Type const &power_db, NVML_Energy<>::Time_DB_Type const &time_db)
 
NVML_Energy::Energy_Unit calAreaForOneTrapezoid (NVML_Energy<>::Time_Unit start_time, NVML_Energy<>::Time_Unit end_time, NVML_Energy<>::Hp_Power_Unit start_power, NVML_Energy<>::Hp_Power_Unit end_power)
 

Private Attributes

NVML_Energy_Device_Init nvml_energy_device_init
 
nvmlDevice_t device
 
NVML_Energy::Energy_Unit meter_reading
 
CPU_Time::Time_Unit start_time
 
CPU_Time::Time_Unit stop_time
 
std::string path
 
NVML_Energy::Hp_Power_DB_Type correctedPowerDB
 
Sampling_Thread_Controller sampling_thread_controller
 

Detailed Description

template<GPU_Device_Id_Type device_id>
struct MeterPU::NVML_Energy_Measurement_Controller< device_id >

CUDA-enabled GPU Energy Measurement Controller.

It internally use NVML nvmlDeviceGetPowerUsage(), note that not all CUDA-enabled GPU support this functionality, please check your GPU specification.

To calculate the energy value based on power samples obtained by NVML, it implement the techniques described in the following paper:

[1] Martin Burtscher, Ivan Zecena, and Ziliang Zong. 2014. Measuring GPU Power with the K20 Built-in Sensor. In Proceedings of Workshop on General Purpose Processing Using GPUs (GPGPU-7). ACM, New York, NY, USA, Pages 28 , 9 pages. DOI=10.1145/2576779.2576783 http://doi.acm.org/10.1145/2576779.2576783

Member Function Documentation

template<GPU_Device_Id_Type device_id>
NVML_Energy ::Energy_Unit MeterPU::NVML_Energy_Measurement_Controller< device_id >::calAreaForOneTrapezoid ( NVML_Energy<>::Time_Unit  start_time,
NVML_Energy<>::Time_Unit  end_time,
NVML_Energy<>::Hp_Power_Unit  start_power,
NVML_Energy<>::Hp_Power_Unit  end_power 
)
inlineprivate

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::calc ( )
inlinevirtual

calculate the metric value between start() and stop().

Implements MeterPU::Measurement_Controller.

Here is the call graph for this function:

template<GPU_Device_Id_Type device_id>
NVML_Energy ::Energy_Unit MeterPU::NVML_Energy_Measurement_Controller< device_id >::calTotalArea ( )
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
NVML_Energy ::Energy_Unit MeterPU::NVML_Energy_Measurement_Controller< device_id >::calTotalArea ( NVML_Energy<>::Hp_Power_DB_Type const &  power_db,
NVML_Energy<>::Time_DB_Type const &  time_db 
)
inlineprivate

Here is the call graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::correctPowerSamplesByBurtscherApproach ( )
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
MeterPU::NVML_Energy_Measurement_Controller< device_id >::DECLARE_CLASS_NAME ( "NVML_Energy_Measurement_Controller< device_id >"  )
private
template<GPU_Device_Id_Type device_id>
CPU_Time::ResultType MeterPU::NVML_Energy_Measurement_Controller< device_id >::diff ( )
inlineprivate

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::dumpCorrectedPowerData ( )
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::dumpOriginalPowerData ( ) const
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::dumpTimeEvent ( )
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
template<class T1 , class T2 >
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::dumpTwoVectors ( const std::string &  filename,
const std::string &  header,
const T1 &  keys,
const T2 &  values 
) const
inlineprivate

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::fillPowerValuesAtStartAndEnd ( )
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
const CPU_Time::Time_Unit& MeterPU::NVML_Energy_Measurement_Controller< device_id >::get_start_time ( ) const
inlineprivate

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
const CPU_Time::Time_Unit& MeterPU::NVML_Energy_Measurement_Controller< device_id >::get_stop_time ( ) const
inlineprivate

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
NVML_Energy ::Energy_Unit MeterPU::NVML_Energy_Measurement_Controller< device_id >::get_value ( ) const
inline

Get calculated metric value, require calc() to be called already.

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::init ( )
inline

Initialize a GPU device.

This function make if possible to initialize different CUDA GPUs if many exists.

Here is the call graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::record_start_time ( )
inlineprivate

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::record_stop_time ( )
inlineprivate

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::removeRedundantSamplesByDistance ( const CPU_Time::ResultType time_distance_ms)
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::resetDir ( )
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::show_meter_reading ( ) const
inlinevirtual

Print the calculated metric value to standard output, requires an invocation of calc() already done.

Implements MeterPU::Measurement_Controller.

Here is the call graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::start ( )
inlinevirtual

mark the start of a measurement phase/period.

Implements MeterPU::Measurement_Controller.

Here is the call graph for this function:

template<GPU_Device_Id_Type device_id>
void MeterPU::NVML_Energy_Measurement_Controller< device_id >::stop ( )
inlinevirtual

mark the end of a measurement phase/period.

Implements MeterPU::Measurement_Controller.

Here is the call graph for this function:

Member Data Documentation

template<GPU_Device_Id_Type device_id>
NVML_Energy ::Hp_Power_DB_Type MeterPU::NVML_Energy_Measurement_Controller< device_id >::correctedPowerDB
private
template<GPU_Device_Id_Type device_id>
nvmlDevice_t MeterPU::NVML_Energy_Measurement_Controller< device_id >::device
private
template<GPU_Device_Id_Type device_id>
NVML_Energy ::Energy_Unit MeterPU::NVML_Energy_Measurement_Controller< device_id >::meter_reading
private
template<GPU_Device_Id_Type device_id>
NVML_Energy_Device_Init MeterPU::NVML_Energy_Measurement_Controller< device_id >::nvml_energy_device_init
private
template<GPU_Device_Id_Type device_id>
std::string MeterPU::NVML_Energy_Measurement_Controller< device_id >::path
private
template<GPU_Device_Id_Type device_id>
Sampling_Thread_Controller MeterPU::NVML_Energy_Measurement_Controller< device_id >::sampling_thread_controller
private
template<GPU_Device_Id_Type device_id>
CPU_Time::Time_Unit MeterPU::NVML_Energy_Measurement_Controller< device_id >::start_time
private
template<GPU_Device_Id_Type device_id>
CPU_Time::Time_Unit MeterPU::NVML_Energy_Measurement_Controller< device_id >::stop_time
private

The documentation for this struct was generated from the following file: