JD2022-TU1/main/extern/ITNetwork/gear/tools/systemdetection/systemdetectioncpu.h

84 lines
2.6 KiB
C++

////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Ubisoft Entertainment. All rights reserved.
//
// ProjectFolder: cpu
// BelongsToModule: gearsystemdetectionhardware
// ScanFlags: Ignore
//
////////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef GEAR_SYSTEMDETECTIONCPU__INCLUDED
#define GEAR_SYSTEMDETECTIONCPU__INCLUDED
GEAR_BEGIN_MODULE(systemdetection, gearsystemdetectionhardware)
namespace SystemDetection
{
class GEAR_DLL_ENTRY CPU
{
public:
virtual ~CPU() {}
/// Processor supported instruction set
enum InstructionSet
{
INSTRUCTIONSET_UNKNOWN = 0,
INSTRUCTIONSET_NONE = 1,
INSTRUCTIONSET_MMX = 2,
INSTRUCTIONSET_SSE = 3,
INSTRUCTIONSET_SSE2 = 4,
INSTRUCTIONSET_SSE3 = 5,
INSTRUCTIONSET_SSSE3 = 6,
INSTRUCTIONSET_SSE41 = 7,
INSTRUCTIONSET_SSE42 = 8
};
/// Cpu vendor
enum Vendor
{
//taken from http://en.wikipedia.org/wiki/CPUID
VENDOR_UNKNOWN = 0,
VENDOR_AMD = 1,
VENDOR_CENTAUR = 2,
VENDOR_CYRIX = 3,
VENDOR_INTEL = 4,
VENDOR_TRANSMETA = 5,
VENDOR_NATIONALSEMICONDUCTOR = 6,
VENDOR_NEXGEN = 7,
VENDOR_RISE = 8,
VENDOR_SIS = 9,
VENDOR_UMC = 10,
VENDOR_VIA = 11
};
/// Processor clock frequency
unsigned long long clockFrequencyHz;
// The following values are system-wide
/// Number of supported hardware thread
unsigned long nbHardwareThreads;
/// Number of physical processor cores
unsigned long nbCores;
/// Processor count
unsigned long nbCPUs;
/// Vendor
Vendor vendor;
/// Supported instruction set
InstructionSet supportedInstructionSet;
/// Processor's name
virtual const char* GetName() const = 0;
};
}//namespace SystemDetection
GEAR_END_MODULE()
#endif