add CpuInfo

This commit is contained in:
2020-08-19 11:44:25 +08:00
parent f5117f0a84
commit 12590b9c64
3 changed files with 105 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
#ifndef HGL_PLATFORM_CPU_INFO_INCLUDE
#define HGL_PLATFORM_CPU_INFO_INCLUDE
#include<hgl/type/DataType.h>
namespace hgl
{
enum class CpuArch
{
x86_64,
ARMv8,
};//
struct CpuInfo
{
uint cpu_count; ///<处理器数量
uint core_count; ///<处理器核心数量
uint logical_core_count; ///<逻辑处理器核心数量
};//struct CpuInfo
/**
* 取得CPU信息
*/
bool GetCpuInfo(CpuInfo *);
}//namespace hgl
#endif//HGL_PLATFORM_CPU_INFO_INCLUDE