[v0.24] Make sure we have valid data before reporting peakperf in Intel

This commit is contained in:
Dr-Noob
2022-05-14 13:12:19 +02:00
parent fea985d08c
commit 5bf35ee6d7

View File

@@ -9,7 +9,13 @@
#include "../common/global.hpp"
int64_t get_peak_performance_intel(struct gpu_info* gpu) {
if(gpu->topo_i->eu_subslice < 0 || gpu->topo_i->subslices < 0) return -1;
// Check that we have valid data
if(gpu->topo_i->eu_subslice < 0 ||
gpu->topo_i->subslices < 0 ||
gpu->freq <= 0)
{
return -1;
}
return gpu->freq * 1000000 * gpu->topo_i->eu_subslice * gpu->topo_i->subslices * 8 * 2;
}