-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.h
75 lines (61 loc) · 2.03 KB
/
constants.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* Copyright (C) 2015 Mountassir El Hafi, ([email protected])
*
* Constants.h: Part of gmonitor
*
* gmonitor is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* gmonitor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with gmonitor. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONSTANTS_H_
#define CONSTANTS_H_
#include <list>
using namespace std;
typedef struct GpuStates
{
double gpuUsage; //gpu usage (%)
double memoryUsage; //memory usage (%)
double usedMemory; //used memory (MB)
double totalMemory; //total available memory (MB)
double coreTemp; //gpu temperature (c)
double pciBandwidth; //pci-e bus bandwidth usage (%)
double memoryBandwidth; //memory bus bandwidth usage (%)
}GpuStates;
typedef list<GpuStates> Graph;
const int NUMBER_OF_STATES = 5; //number of states to be displayed
enum States
{
GPU = 0, //gpu usage
VRAM = 1, //memory usage
MBUS = 2, //memory bus usage
PBUS = 3, //pci-e bus usage
TEMP = 4, //gpu temperature
};
enum Color
{
NO_COLOUR = 0,
BLUE = 1,
RED = 2,
YELLOW = 3,
GREEN = 4,
LBLUE = 5,
};
enum DisplayMode
{
CURRENT_NEXT_TO_HISTORY = 0, //print the most recent state only
CURRENT_STATE_ONLY = 1, //print the previous states only
HISTORY_STATES_ONLY = 2, //print current followed by history for each gpu
CURRENT_THEN_HISTORY = 3, //print current for all gpus, then history for all gpus
};
//default display mode (will display current then previous states
// for each gpu)
const DisplayMode DEFAULT_DISPLAY_MODE = CURRENT_NEXT_TO_HISTORY;
const int DEFAULT_REFRESH_RATE = 2; //default refresh rate, 2 seconds
#endif