This self-contained code sample shows you how to correctly detect physical core and logical processor counts on AMD processors. The sample also makes recommendations about the default thread pool size you should create for game initialization and game execution, on AMD processors.
That recommendation is guidance only. Always profile and fit the thread pool size appropriately for your game's uses, since overall processor performance in games is affected by many factors.
windows
subdirectory.cl.exe AMDCoreCount.cpp
cl.exe
will build the code and generate a file called AMDCoreCount.exe
which you can then run.
If you spot a bug, need any guidance, or would like to see the samples evolve in a particular way, file an issue and we'll take a look!
v1.0
v2.0
RYZEN_CORES_THRESHOLD
to help document the thread pool sizing guidance code.These self-contained code samples show you how to correctly detect physical and logical processor core counts.
If you spot a bug, or would like to see the samples evolve in a particular way, file an issue and we'll take a look!