(BROKEN) Lib initit not working + started cuda information for GPUs

This commit is contained in:
Ben
2018-12-19 17:22:20 +00:00
parent ee4a95ec5e
commit 9c6bb25663
9 changed files with 44 additions and 17 deletions

Binary file not shown.

View File

@@ -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
View File

@@ -0,0 +1,9 @@
#include "gpu.h"
GPU::GPU() {
}
GPU::~GPU() {
}

View File

@@ -0,0 +1,10 @@
#pragma once
class GPU {
public:
GPU();
virtual ~GPU();
};
static GPU* GPU_Instance;

13
libsys/libsys.cpp Normal file
View 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;
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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() {

View File

@@ -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();