Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Journeyman III

how to determine cache topology?


i'm new to the forum. sorry if posted this topic in wrong place.

I'm writting cpuid program. I need help with getting number of each type of cache. not its size, but the number. for example i need get info such as below:

L1 data cache = 2 x 64KB.

CPUID will give me the size of each sort of cache, but not its number.

I have wrote algorithm to discorever CPU topology, but dont know what to do to get cache topology. I have written code, but it not always work.

I tried to use thread per cache parameter with LogToNearestPowerOf2(CPUID.8000001Dh EAX[25:14]). When this leaf is supported it works well, but it is not always supported on CPUs which have a shared cache. What to do if that leaf is not supported?

On MSDN i've found that GetLogicalProcessorsInformationEx proc might be helpful to get that number. but i'm not sure do i understood it right. I

guess, that member of CACHE_RELATIONSHIP structure, the GROUP_AFFINITY will be related with quantity.

maybe AMD has sample code how to do it? I searched it but didnt found. any ideas?

thanks in advance

Tags (1)