[eigen] Automatic cache and block size determination

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi list,

thanks to Thomas's cpuid piece of code, I managed to query the L1 and
L2 cache sizes. So now, L1 and L2 caching sizes are automatically
determined at runtime when the first matrix product is called. I've
also significantly simplified and optimized the way the blocking
parameters are computed from the L1 and L2 cache sizes.

Of course, for the architectures having three level of caches (e.g.,
nehalem), it uses the shared L3, ignoring the small L2 cache.

You can test it by going into eigen/bench and runnnig:

g++ -DNDEBUG -O2 -lrt bench_gemm.cpp -I .. -o gemm && ./gemm

At the beginning it reports the detected L1 and L2/L3 cache sizes and
-1 if cpuid is not supported. Currently I've tested with core2
processors only, so it would be great if some could try it on other
architectures and report failures (-1 and/or wrong cache sizes).
Thanks a lot.


gael



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/