(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);
|
||||
std::vector<double> CPU_CORE_PERCENT();
|
||||
|
||||
bool m_isPolling;
|
||||
|
||||
virtual ~CPU();
|
||||
private:
|
||||
std::thread* m_pollThread;
|
||||
bool m_isPolling;
|
||||
};
|
||||
|
||||
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 "sys.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);
|
||||
void END_MEMORY_POLLING();
|
||||
|
||||
bool m_isPolling;
|
||||
|
||||
virtual ~Memory();
|
||||
private:
|
||||
std::thread* m_pollThread;
|
||||
bool m_isPolling;
|
||||
};
|
||||
|
||||
static Memory* Memory_Instance;
|
||||
|
||||
@@ -2,16 +2,6 @@
|
||||
|
||||
System::System() {
|
||||
this->m_Sys = new Sys();
|
||||
|
||||
if (CPU_Instance = NULL) {
|
||||
CPU_Instance = new CPU();
|
||||
}
|
||||
|
||||
if (Memory_Instance == NULL) {
|
||||
Memory_Instance = new Memory();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Sys System::getSystemSpec() {
|
||||
|
||||
@@ -4,15 +4,12 @@
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
CPU_Instance = new CPU();
|
||||
Memory_Instance = new Memory();
|
||||
System_Instance = new System();
|
||||
initialize_libsys();
|
||||
sleep(1);
|
||||
|
||||
CPU_Instance->START_CPU_POLLING();
|
||||
Memory_Instance->START_MEMORY_POLLING();
|
||||
|
||||
sleep(1);
|
||||
|
||||
std::cout << std::endl;
|
||||
Sys sys = System_Instance->getSystemSpec();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user