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