Print all information

This commit is contained in:
Dr-Noob
2018-03-29 23:27:59 +02:00
parent 4ebcfbeed3
commit 978f283e1a
10 changed files with 409 additions and 15 deletions

54
main.c
View File

@@ -1,7 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#include "printer.h"
#include "01h.h"
#include "02h.h"
#include "udev.h"
#include "extended.h"
/***
@@ -24,13 +25,50 @@ Peak FLOPS: 512 GFLOP/s(in simple precision)
***/
int main() {
struct level2* level2 = fillLevel2(level2);
debugLevel2(level2);
freeLevel2(level2);
struct cpuInfo* cpu = getCPUInfo(cpu);
debugCpuInfo(cpu);
free(cpu);
struct cache* cach = new_cache(cach);
struct frequency* freq = new_frequency(freq);
char* cpuName = getString_CPUName();
char* maxFrequency = getString_MaxFrequency(freq);
char* nCores = getString_NumberCores(cpu);
char* avx = getString_AVX(cpu);
char* sse = getString_SSE(cpu);
char* fma = getString_FMA(cpu);
char* aes = getString_AES(cpu);
char* sha = getString_SHA(cpu);
char* l1 = getString_L1(cach);
char* l2 = getString_L2(cach);
char* l3 = getString_L3(cach);
printf(TITLE_NAME"%s\n",cpuName);
printf(TITLE_ARCH"%s\n","x86_64");
printf(TITLE_FREQUENCY"%s\n",maxFrequency);
printf(TITLE_NCORES"%s\n",nCores);
printf(TITLE_AVX"%s\n",avx);
printf(TITLE_SSE"%s\n",sse);
printf(TITLE_FMA"%s\n",fma);
printf(TITLE_AES"%s\n",aes);
printf(TITLE_SHA"%s\n",sha);
printf(TITLE_L1"%s\n",l1);
printf(TITLE_L3"%s\n",l2);
printf(TITLE_L2"%s\n",l3);
printf(TITLE_PEAK"%s\n","??? GFLOP/s");
free(cpuName);
free(maxFrequency);
free(nCores);
free(avx);
free(sse);
free(fma);
free(aes);
free(sha);
free(l1);
free(l2);
free(l3);
free(cpu);
freeCache(cach);
freeFrequency(freq);
printf("%s\n",getCPUName());
}