OLD | NEW |
(Empty) | |
| 1 /* |
| 2 Copyright (c) (2013) Intel Corporation All Rights Reserved. |
| 3 |
| 4 The source code, information and material ("Material") contained herein is owned
by Intel Corporation or its suppliers or licensors, and title to such Material
remains with Intel Corporation or its suppliers or licensors. The Material conta
ins proprietary information of Intel or its suppliers and licensors. The Materia
l is protected by worldwide copyright laws and treaty provisions. No part of the
Material may be used, copied, reproduced, modified, published, uploaded, posted
, transmitted, distributed or disclosed in any way without Intel's prior express
written permission. No license under any patent, copyright or other intellectua
l property rights in the Material is granted to or conferred upon you, either ex
pressly, by implication, inducement, estoppel or otherwise. Any license under su
ch intellectual property rights must be express and approved by Intel in writing
. |
| 5 |
| 6 |
| 7 Include any supplier copyright notices as supplier requires Intel to use. |
| 8 |
| 9 Include supplier trademarks or logos as supplier requires Intel to use, preceded
by an asterisk. An asterisked footnote can be added as follows: *Third Party tr
ademarks are the property of their respective owners. |
| 10 |
| 11 Unless otherwise agreed by Intel in writing, you may not remove or alter this no
tice or any other notice embedded in Materials by Intel or Intels suppliers or
licensors in any way. |
| 12 */ |
| 13 |
| 14 #include <Windows.h> |
| 15 #include <string> |
| 16 |
| 17 using namespace std; |
| 18 |
| 19 typedef bool (*IPGInitialize) (); |
| 20 typedef bool (*IPGGetNumNodes) (int *nNodes); |
| 21 typedef bool (*IPGGetNumMsrs) (int *nMsr); |
| 22 typedef bool (*IPGGetMsrName) (int iMsr, wchar_t *szName); |
| 23 typedef bool (*IPGGetMsrFunc) (int iMsr, int *funcID); |
| 24 typedef bool (*IPGGetIAFrequency) (int iNode, int *freqInMHz); |
| 25 typedef bool (*IPGGetTDP) (int iNode, double *TDP); |
| 26 typedef bool (*IPGGetMaxTemperature) (int iNode, int *degreeC); |
| 27 typedef bool (*IPGGetTemperature) (int iNode, int *degreeC); |
| 28 typedef bool (*IPGReadSample) (); |
| 29 typedef bool (*IPGGetSysTime) (SYSTEMTIME *pSysTime); |
| 30 typedef bool (*IPGGetRDTSC) (UINT64 *TSC); |
| 31 typedef bool (*IPGGetTimeInterval) (double *offset); |
| 32 typedef bool (*IPGGetBaseFrequency) (int iNode, double *baseFrequency); |
| 33 typedef bool (*IPGGetPowerData) (int iNode, int iMSR, double *result, int *nResu
lt); |
| 34 typedef bool (*IPGStartLog) (wchar_t *szFileName); |
| 35 typedef bool (*IPGStopLog) (); |
| 36 |
| 37 class CIntelPowerGadgetLib |
| 38 { |
| 39 public: |
| 40 CIntelPowerGadgetLib(void); |
| 41 ~CIntelPowerGadgetLib(void); |
| 42 |
| 43 bool IntelEnergyLibInitialize(void); |
| 44 bool GetNumNodes(int * nNodes); |
| 45 bool GetNumMsrs(int *nMsrs); |
| 46 bool GetMsrName(int iMsr, wchar_t *szName); |
| 47 bool GetMsrFunc(int iMsr, int *funcID); |
| 48 bool GetIAFrequency(int iNode, int *freqInMHz); |
| 49 bool GetTDP(int iNode, double *TDP); |
| 50 bool GetMaxTemperature(int iNode, int *degreeC); |
| 51 bool GetTemperature(int iNode, int *degreeC); |
| 52 bool ReadSample(); |
| 53 bool GetSysTime(SYSTEMTIME *sysTime); |
| 54 bool GetRDTSC(UINT64 *TSC); |
| 55 bool GetTimeInterval(double *offset); |
| 56 bool GetBaseFrequency(int iNode, double *baseFrequency); |
| 57 bool GetPowerData(int iNode, int iMSR, double *results, int *nResult); |
| 58 bool StartLog(wchar_t *szFilename); |
| 59 bool StopLog(); |
| 60 wstring GetLastError(); |
| 61 |
| 62 private: |
| 63 IPGInitialize pInitialize; |
| 64 IPGGetNumNodes pGetNumNodes; |
| 65 IPGGetNumMsrs pGetNumMsrs; |
| 66 IPGGetMsrName pGetMsrName; |
| 67 IPGGetMsrFunc pGetMsrFunc; |
| 68 IPGGetIAFrequency pGetIAFrequency; |
| 69 IPGGetTDP pGetTDP; |
| 70 IPGGetMaxTemperature pGetMaxTemperature; |
| 71 IPGGetTemperature pGetTemperature; |
| 72 IPGReadSample pReadSample; |
| 73 IPGGetSysTime pGetSysTime; |
| 74 IPGGetRDTSC pGetRDTSC; |
| 75 IPGGetTimeInterval pGetTimeInterval; |
| 76 IPGGetBaseFrequency pGetBaseFrequency; |
| 77 IPGGetPowerData pGetPowerData; |
| 78 IPGStartLog pStartLog; |
| 79 IPGStopLog pStopLog; |
| 80 }; |
| 81 |
OLD | NEW |