[v0.01] Defining a first approach of the application general structure

This commit is contained in:
Dr-Noob
2021-08-11 11:34:47 +02:00
parent 7b88845d71
commit a15f20a2cc
8 changed files with 129 additions and 3 deletions

View File

@@ -1,6 +1,30 @@
#include "gpu.hpp"
#include <cstddef>
char* get_str_gpu_name(struct gpu_info* gpu) {
return gpu->name;
}
char* get_str_freq(struct gpu_info* gpu) {
return NULL;
}
char* get_str_memory_size(struct gpu_info* gpu) {
return NULL;
}
char* get_str_memory_type(struct gpu_info* gpu) {
return NULL;
}
char* get_str_l1(struct gpu_info* gpu) {
return NULL;
}
char* get_str_l2(struct gpu_info* gpu) {
return NULL;
}
char* get_str_peak_performance(struct gpu_info* gpu) {
return NULL;
}

View File

@@ -8,15 +8,52 @@ enum {
GPU_VENDOR_NVIDIA
};
enum {
MEMTYPE_GDDR6
};
typedef int32_t VENDOR;
typedef int32_t MEMTYPE;
struct cach {
int32_t size;
uint8_t num_caches;
bool exists;
};
struct cache {
struct cach* L1;
struct cach* L2;
};
struct topology {
int32_t shared_mp;
int32_t cores_per_mp;
int32_t cuda_cores;
};
struct memory {
int32_t size_bytes;
MEMTYPE type;
};
struct gpu_info {
VENDOR vendor;
struct uarch* arch;
char* name;
int64_t freq;
struct topology* topo;
struct memory* mem;
struct cache* cach;
int64_t peak_performance;
};
char* get_str_gpu_name(struct gpu_info* gpu);
char* get_str_freq(struct gpu_info* gpu);
char* get_str_memory_size(struct gpu_info* gpu);
char* get_str_memory_type(struct gpu_info* gpu);
char* get_str_l1(struct gpu_info* gpu);
char* get_str_l2(struct gpu_info* gpu);
char* get_str_peak_performance(struct gpu_info* gpu);
#endif

View File

@@ -5,6 +5,7 @@
#include "args.hpp"
#include "global.hpp"
#include "../cuda/cuda.hpp"
#include "../cuda/uarch.hpp"
static const char* VERSION = "0.01";
@@ -52,7 +53,19 @@ int main(int argc, char* argv[]) {
if(gpu == NULL)
return EXIT_FAILURE;
printf("Name: %s\n", gpu->name);
printf("Name: %s\n", get_str_gpu_name(gpu));
printf("Microarchitecture: %s\n", get_str_uarch(gpu));
printf("Compute Capability: %s\n", get_str_cc(gpu));
printf("Technology: %s\n", get_str_process(gpu));
printf("Max Frequency: %s\n", get_str_freq(gpu));
printf("SM: %s\n", get_str_sm(gpu));
printf("Cores/MP: %s\n", get_str_cores_sm(gpu));
printf("CUDA cores: %s\n", get_str_cuda_cores(gpu));
printf("Memory size: %s\n", get_str_memory_size(gpu));
printf("Memory type: %s\n", get_str_memory_type(gpu));
printf("L1 size: %s\n", get_str_l1(gpu));
printf("L2 size: %s\n", get_str_l2(gpu));
printf("Peak performance: %s\n", get_str_peak_performance(gpu));
return EXIT_FAILURE;
}