(BROKEN) Lib initit not working + started cuda information for GPUs
This commit is contained in:
Binary file not shown.
@@ -42,11 +42,11 @@ public:
|
|||||||
double CPU_PERCENT(int core);
|
double CPU_PERCENT(int core);
|
||||||
std::vector<double> CPU_CORE_PERCENT();
|
std::vector<double> CPU_CORE_PERCENT();
|
||||||
|
|
||||||
|
bool m_isPolling;
|
||||||
|
|
||||||
virtual ~CPU();
|
virtual ~CPU();
|
||||||
private:
|
private:
|
||||||
std::thread* m_pollThread;
|
std::thread* m_pollThread;
|
||||||
bool m_isPolling;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static CPU* CPU_Instance;
|
static CPU* CPU_Instance;
|
||||||
|
|||||||
9
libsys/gpu.cpp
Normal file
9
libsys/gpu.cpp
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include "gpu.h"
|
||||||
|
|
||||||
|
GPU::GPU() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GPU::~GPU() {
|
||||||
|
|
||||||
|
}
|
||||||
10
libsys/gpu.h
10
libsys/gpu.h
@@ -0,0 +1,10 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
class GPU {
|
||||||
|
public:
|
||||||
|
GPU();
|
||||||
|
|
||||||
|
virtual ~GPU();
|
||||||
|
};
|
||||||
|
|
||||||
|
static GPU* GPU_Instance;
|
||||||
|
|||||||
13
libsys/libsys.cpp
Normal file
13
libsys/libsys.cpp
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#include "libsys.h"
|
||||||
|
|
||||||
|
void initialize_libsys() {
|
||||||
|
__cpu = new CPU();
|
||||||
|
__mem = new Memory();
|
||||||
|
__gpu = new GPU();
|
||||||
|
__sys = new System();
|
||||||
|
|
||||||
|
CPU_Instance = __cpu;
|
||||||
|
Memory_Instance = __mem;
|
||||||
|
GPU_Instance = __gpu;
|
||||||
|
System_Instance = __sys;
|
||||||
|
}
|
||||||
@@ -3,3 +3,10 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "temp.h"
|
#include "temp.h"
|
||||||
|
|
||||||
|
void initialize_libsys();
|
||||||
|
|
||||||
|
static CPU* __cpu;
|
||||||
|
static Memory* __mem;
|
||||||
|
static GPU* __gpu;
|
||||||
|
static System* __sys;
|
||||||
|
|||||||
@@ -27,10 +27,11 @@ public:
|
|||||||
static void MEMORY_POLL(Memory* mem);
|
static void MEMORY_POLL(Memory* mem);
|
||||||
void END_MEMORY_POLLING();
|
void END_MEMORY_POLLING();
|
||||||
|
|
||||||
|
bool m_isPolling;
|
||||||
|
|
||||||
virtual ~Memory();
|
virtual ~Memory();
|
||||||
private:
|
private:
|
||||||
std::thread* m_pollThread;
|
std::thread* m_pollThread;
|
||||||
bool m_isPolling;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static Memory* Memory_Instance;
|
static Memory* Memory_Instance;
|
||||||
|
|||||||
@@ -2,16 +2,6 @@
|
|||||||
|
|
||||||
System::System() {
|
System::System() {
|
||||||
this->m_Sys = new Sys();
|
this->m_Sys = new Sys();
|
||||||
|
|
||||||
if (CPU_Instance = NULL) {
|
|
||||||
CPU_Instance = new CPU();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Memory_Instance == NULL) {
|
|
||||||
Memory_Instance = new Memory();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Sys System::getSystemSpec() {
|
Sys System::getSystemSpec() {
|
||||||
|
|||||||
@@ -4,15 +4,12 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
CPU_Instance = new CPU();
|
initialize_libsys();
|
||||||
Memory_Instance = new Memory();
|
sleep(1);
|
||||||
System_Instance = new System();
|
|
||||||
|
|
||||||
CPU_Instance->START_CPU_POLLING();
|
CPU_Instance->START_CPU_POLLING();
|
||||||
Memory_Instance->START_MEMORY_POLLING();
|
Memory_Instance->START_MEMORY_POLLING();
|
||||||
|
|
||||||
sleep(1);
|
|
||||||
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
Sys sys = System_Instance->getSystemSpec();
|
Sys sys = System_Instance->getSystemSpec();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user