Fix #26. Guess number of VPUs according to microarchitecture

This commit is contained in:
Dr-Noob
2020-08-31 14:04:41 +02:00
parent 5148962fa3
commit 35efdd8f2c
3 changed files with 57 additions and 11 deletions

View File

@@ -631,10 +631,9 @@ char* get_str_peak_performance(struct cpuInfo* cpu, struct topology* topo, int64
}
double flops = topo->physical_cores * topo->sockets * (freq*1000000);
int vpus = get_number_of_vpus(cpu);
// Intel USUALLY has two VPUs. I have never seen an AMD
// with two VPUs.
if(cpu->cpu_vendor == VENDOR_INTEL) flops = flops * 2;
flops = flops * vpus;
if(cpu->FMA3 || cpu->FMA4)
flops = flops*2;