Page 1 of 1

how to count caches

Posted: Sun Jul 07, 2013 8:58 am
by dancer
hi folks,

i'm writting CPUID program. i need help with cache counting. i know, that cpuid leafs 02h and 04h(for Intel) and 80000005, 6h (for AMD) gives me how much CPU has got cache and it's details, but i need know how many of specified sort caches there are. For example:

Intel Core i7-3820
Level 1 cache size 4 x 32 KB instruction caches
4 x 32 KB data caches

Level 2 cache size 4 x 256 KB

Level 3 cache size 10 MB

as it is described above - this cpu has got 4 times 32 KB instruction cache. how to get the number of times for specified sort of cache.

thanks in advance

Re: how to count caches

Posted: Sun Jul 07, 2013 9:48 am
by NickJohnson
The reason there are 4 L2 caches (etc.) is because there are four physical cores. That's something you should be able to count.