mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-26 00:10:38 +01:00
Fix peak performance in KNL
This commit is contained in:
@@ -761,6 +761,11 @@ char* get_str_peak_performance(struct cpuInfo* cpu, struct topology* topo, int64
|
|||||||
flops = flops*8;
|
flops = flops*8;
|
||||||
else if(cpu->SSE)
|
else if(cpu->SSE)
|
||||||
flops = flops*4;
|
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)
|
if(flops >= (double)1000000000000.0)
|
||||||
snprintf(string,size,"%.2f TFLOP/s",flops/1000000000000);
|
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);
|
snprintf(string,size,"%.2f GFLOP/s",flops/1000000000);
|
||||||
else
|
else
|
||||||
snprintf(string,size,"%.2f MFLOP/s",flops/1000000);
|
snprintf(string,size,"%.2f MFLOP/s",flops/1000000);
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "cpuid.h"
|
#include "cpuid.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
static const char* VERSION = "0.71";
|
static const char* VERSION = "0.72";
|
||||||
|
|
||||||
void print_help(char *argv[]) {
|
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\
|
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\
|
||||||
|
|||||||
@@ -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) {
|
bool vpus_are_AVX512(struct cpuInfo* cpu) {
|
||||||
return cpu->arch->uarch != UARCH_ICE_LAKE;
|
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) {
|
int get_number_of_vpus(struct cpuInfo* cpu) {
|
||||||
|
|||||||
@@ -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);
|
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 vpus_are_AVX512(struct cpuInfo* cpu);
|
||||||
|
bool is_knights_landing(struct cpuInfo* cpu);
|
||||||
int get_number_of_vpus(struct cpuInfo* cpu);
|
int get_number_of_vpus(struct cpuInfo* cpu);
|
||||||
char* get_str_uarch(struct cpuInfo* cpu);
|
char* get_str_uarch(struct cpuInfo* cpu);
|
||||||
char* get_str_process(struct cpuInfo* cpu);
|
char* get_str_process(struct cpuInfo* cpu);
|
||||||
|
|||||||
Reference in New Issue
Block a user