Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB

  1. //-------------------------------------------------------------------------------------
  2. // CpuTopology.h
  3. //
  4. // CpuToplogy class declaration.
  5. //
  6. // Copyright (c) Microsoft Corporation. All rights reserved.
  7. //-------------------------------------------------------------------------------------
  8. #pragma once
  9. #ifndef CPU_TOPOLOGY_H
  10. #define CPU_TOPOLOGY_H
  11. #include "winlite.h"
  12. class ICpuTopology;
  13. //---------------------------------------------------------------------------------
  14. // Name: CpuToplogy
  15. // Desc: This class constructs a supported cpu topology implementation object on
  16. // initialization and forwards calls to it. This is the Abstraction class
  17. // in the traditional Bridge Pattern.
  18. //---------------------------------------------------------------------------------
  19. class CpuTopology
  20. {
  21. public:
  22. CpuTopology( BOOL bForceCpuid = FALSE );
  23. ~CpuTopology();
  24. BOOL IsDefaultImpl() const;
  25. DWORD NumberOfProcessCores() const;
  26. DWORD NumberOfSystemCores() const;
  27. DWORD_PTR CoreAffinityMask( DWORD coreIdx ) const;
  28. void ForceCpuid( BOOL bForce );
  29. private:
  30. void Destroy_();
  31. ICpuTopology* m_pImpl;
  32. };
  33. #endif // CPU_TOPOLOGY_H