GPUOpen-LibrariesAndSDKs / cpu-core-counts

A sample demonstrating how to correctly detect physical core and logical processor counts on AMD processors.
MIT License
55 stars 13 forks source link

Use logical count for everything newer than dozer #4

Closed Artoria2e5 closed 3 years ago

Artoria2e5 commented 3 years ago

It probably doesn't make sense to kill the whole core detection completely, but we can still make everything a bit better by not limiting ourselves to dozer only. After all, Ken Mitchell 2017 does state that SMT is useful most of the time.

Fixes #2. Should be more in the spirit of @ThomasTheGerman's suggestion.

Artoria2e5 commented 3 years ago

Wait, when does AMD start having logical/core differences anyways? Isn't it just dozer with the clusters? What is this function good for anyways "usually" then, if all these SMT usually gets better performance? Shouldn't a README change be enough?

Eff this.

SylwesterZarebski commented 3 years ago

This patch is wrong. It should return logical core count when family is greater or equal than 0x15 not less or equal. Ryzen has family 0x17 (23).

Example: https://www.cpu-world.com/CPUs/Zen/AMD-Ryzen%207%201700.html

e0x70i commented 3 years ago

This patch is wrong. It should return logical core count when family is greater or equal than 0x15 not less or equal. Ryzen has family 0x17 (23).

Example: https://www.cpu-world.com/CPUs/Zen/AMD-Ryzen%207%201700.html

That’s exactly what the patch does.... (0x15 <= getCpuidFamily()) cpu family is greater or equal than 0x15 for that expression to return true.

SylwesterZarebski commented 3 years ago

Sorry, You're right, I replaced sides in my mind ;-), sorry!