diff --git a/src/cpuid.c b/src/cpuid.c index f1b627c..dee3f77 100755 --- a/src/cpuid.c +++ b/src/cpuid.c @@ -761,6 +761,11 @@ char* get_str_peak_performance(struct cpuInfo* cpu, struct topology* topo, int64 flops = flops*8; else if(cpu->SSE) flops = flops*4; + + // See https://sites.utexas.edu/jdm4372/2018/01/22/a-peculiar- + // throughput-limitation-on-intels-xeon-phi-x200-knights-landing/ + if(is_knights_landing(cpu)) + flops = flops * 6 / 7; if(flops >= (double)1000000000000.0) snprintf(string,size,"%.2f TFLOP/s",flops/1000000000000); @@ -768,6 +773,7 @@ char* get_str_peak_performance(struct cpuInfo* cpu, struct topology* topo, int64 snprintf(string,size,"%.2f GFLOP/s",flops/1000000000); else snprintf(string,size,"%.2f MFLOP/s",flops/1000000); + return string; } diff --git a/src/main.c b/src/main.c index 06a81b0..478e3bc 100644 --- a/src/main.c +++ b/src/main.c @@ -6,7 +6,7 @@ #include "cpuid.h" #include "global.h" -static const char* VERSION = "0.71"; +static const char* VERSION = "0.72"; void print_help(char *argv[]) { printf("Usage: %s [--version] [--help] [--levels] [--style \"fancy\"|\"retro\"|\"legacy\"] [--color \"intel\"|\"amd\"|'R,G,B:R,G,B:R,G,B:R,G,B']\n\n\ diff --git a/src/uarch.c b/src/uarch.c index 85ce6b5..2f1b41f 100644 --- a/src/uarch.c +++ b/src/uarch.c @@ -352,6 +352,11 @@ struct uarch* get_uarch_from_cpuid(struct cpuInfo* cpu, uint32_t ef, uint32_t f, bool vpus_are_AVX512(struct cpuInfo* cpu) { return cpu->arch->uarch != UARCH_ICE_LAKE; + return cpu->arch->uarch != UARCH_ICE_LAKE; +} + +bool is_knights_landing(struct cpuInfo* cpu) { + return cpu->arch->uarch == UARCH_KNIGHTS_LANDING; } int get_number_of_vpus(struct cpuInfo* cpu) { diff --git a/src/uarch.h b/src/uarch.h index 03c0d7f..0fc3267 100644 --- a/src/uarch.h +++ b/src/uarch.h @@ -9,6 +9,7 @@ struct uarch; struct uarch* get_uarch_from_cpuid(struct cpuInfo* cpu, uint32_t ef, uint32_t f, uint32_t em, uint32_t m, int s); bool vpus_are_AVX512(struct cpuInfo* cpu); +bool is_knights_landing(struct cpuInfo* cpu); int get_number_of_vpus(struct cpuInfo* cpu); char* get_str_uarch(struct cpuInfo* cpu); char* get_str_process(struct cpuInfo* cpu);