From 5bf35ee6d789882bb1207fc1803d32b5dea8999f Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Sat, 14 May 2022 13:12:19 +0200 Subject: [PATCH] [v0.24] Make sure we have valid data before reporting peakperf in Intel --- src/intel/intel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/intel/intel.cpp b/src/intel/intel.cpp index 696eede..bef7ada 100644 --- a/src/intel/intel.cpp +++ b/src/intel/intel.cpp @@ -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; }