Determing cache sizes -- request for testing
bearophile
bearophileHUGS at lycos.com
Wed Sep 10 04:22:10 PDT 2008
Don:
> To implement efficient memory-intensive operations (memcpy, array
> operations, matrix multiplication, etc), you really need to know the
> sizes of the data caches.
Your code is surely useful, but take a look at "cache oblivious data structures":
http://en.wikipedia.org/wiki/Cache-oblivious_algorithm
I presume your code doesn't work at compile time, so I presume you have to run your code once, save the results on disk, and then re-start the compilation to use those values to compute the tuning compile-time constants of the data structures :-)
On this Intel the data looks almost correct (I have used the second version of your code), but there isn't level 3 cache, and the RAM size is 2 GB.
Vendor string: GenuineIntel
Processor string: Intel(R) Pentium(R) Dual CPU E2180 @ 2.00GHz
Signature: Family=6 Model=15 Stepping=13
Features: MMX FXSR SSE SSE2 SSE3 SSSE3 AMD64 HTT
Multithreading: 2 threads / 2 cores
Family=6 Model=F Stepping=D
Data caches:
Level 1 size=16K, ways=8 linesize=64
Level 2 size=512K, ways=4 linesize=64
Level 3 size=4194303K, ways=1 linesize=64
Bye,
bearophile
More information about the Digitalmars-d
mailing list