how to count caches

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
dancer
Posts: 7
Joined: Thu Feb 21, 2013 9:49 am

how to count caches

Post 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
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: how to count caches

Post 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.
Post Reply