[v0.01] Adding and creating basic source code base taken from cpufetch
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <cstddef>
|
||||
|
||||
#define STRING_UNKNOWN "Unknown"
|
||||
|
||||
|
||||
6
src/common/gpu.cpp
Normal file
6
src/common/gpu.cpp
Normal 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
22
src/common/gpu.hpp
Normal 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
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user