-
Notifications
You must be signed in to change notification settings - Fork 0
/
collect-gpucpu.h
40 lines (29 loc) · 697 Bytes
/
collect-gpucpu.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
#ifndef __COLLECT_GPUCPU_H_INCLUDED__
#define __COLLECT_GPUCPU_H_INCLUDED__
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "common.h"
/* structures */
struct CoreAttr{
int online;
unsigned long long busy;
unsigned long long niceBusy;
unsigned long long idle;
};
struct CPUGPUAttr{
// utilisation
struct CoreAttr cpuCoreSet[NUM_CPU_CORES];
int gpuUtil;
// frequency
int cpuFreq;
int gpuFreq;
// misc
int clusterConfig;
};
/* functions */
void getCPUGPUStats(struct CPUGPUAttr *cgAttr, int sampleCount);
int getCurCPUFreq(void);
int getCurGPUFreq(void);
int getCurGPUUtil(void);
#endif // __COLLECT_GPUCPU_H_INCLUDED__