[v0.01] Adding and creating basic source code base taken from cpufetch

This commit is contained in:
Dr-Noob
2021-08-11 10:12:27 +02:00
parent f824e3c4f2
commit 7b88845d71
9 changed files with 123 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <cstddef>
#define STRING_UNKNOWN "Unknown"

6
src/common/gpu.cpp Normal file
View File

@@ -0,0 +1,6 @@
#include "gpu.hpp"
char* get_str_gpu_name(struct gpu_info* gpu) {
return gpu->name;
}

22
src/common/gpu.hpp Normal file
View File

@@ -0,0 +1,22 @@
#ifndef __GPU__
#define __GPU__
#include <stdint.h>
#include <stdbool.h>
enum {
GPU_VENDOR_NVIDIA
};
typedef int32_t VENDOR;
struct gpu_info {
VENDOR vendor;
struct uarch* arch;
char* name;
};
char* get_str_gpu_name(struct gpu_info* gpu);
#endif

View File

@@ -4,6 +4,7 @@
#include "args.hpp"
#include "global.hpp"
#include "../cuda/cuda.hpp"
static const char* VERSION = "0.01";
@@ -47,5 +48,11 @@ int main(int argc, char* argv[]) {
return EXIT_SUCCESS;
}
struct gpu_info* gpu = get_gpu_info();
if(gpu == NULL)
return EXIT_FAILURE;
printf("Name: %s\n", gpu->name);
return EXIT_FAILURE;
}