From 2ad618e1ffd27bfe8df2b966e1cb8049fa9d114b Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Wed, 2 Aug 2023 20:03:13 +0800 Subject: [PATCH] added Comp() in SOCGPUInfo --- inc/hgl/platform/SOC.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/inc/hgl/platform/SOC.h b/inc/hgl/platform/SOC.h index 5cff55d..03e1035 100644 --- a/inc/hgl/platform/SOC.h +++ b/inc/hgl/platform/SOC.h @@ -180,6 +180,25 @@ namespace hgl uint core_count; uint freq; + + public: + + int Comp(const SOCGPUInfo &info)const + { + int result; + + result=int(vendor)-int(info.vendor); + + if(result)return result; + + result=strcmp(model,info.model); + + if(result)return result; + + return core_count-info.core_count; + } + + CompOperator(const SOCGPUInfo &,Comp); }; /**