CPU Core Counts

Knowing what CPU resources are available is key to making good use of the CPU in any application. Today’s CPUs all have more than a single core available, and many are capable of executing multiple threads in parallel on those physical cores. Windows® presents that to you using the concept of physical and logical cores.

Maximising available CPU performance is especially true for games, given the demands they make of the CPU in order to do create a rich, immersive and incredibly interactive game world, and then efficiently drive the GPU to render it all.

This example code — available separately for Windows® XP and Windows® 7, with Windows® 10 coming soon — correctly detects the physical and logical cores of today’s modern processors, along with the processor vendor and family.

The Windows® 10 version of the code will also show you how to use the CPU Set API to detect which processors are allocated to your game when the new Game Mode, released to all Windows® 10 users in the latest Creators Update, is active. Look out for the Windows® 10 sample code soon!


CPU Core Count Detection on Windows®

Due to architectural differences between Zen and our previous processor architecture, Bulldozer, developers need to take care when using the Windows® APIs for processor and core enumeration.

You may also be interested in...

Some light reading to take away with you. Our ISAs, manuals, whitepapers, and many more.

Explore our huge collection of detailed tutorials, sample code, presentations, and documentation to find your answers to your graphics development questions.

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

Browse all our fantastic tutorials, including programming techniques, performance improvements, guest blogs, and how to use our tools.