diff options
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/util/Memory.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 30d9b2377..83b2dd90d 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -614,6 +614,7 @@ inline void ei_queryCacheSizes_intel(int& l1, int& l2, int& l3) int cache_id = 0; int cache_type = 0; do { + abcd[0] = abcd[1] = abcd[2] = abcd[3] = 0; EIGEN_CPUID(abcd,0x4,cache_id); cache_type = (abcd[0] & 0x0F) >> 0; if(cache_type==1||cache_type==3) // data or unified cache @@ -641,8 +642,10 @@ inline void ei_queryCacheSizes_intel(int& l1, int& l2, int& l3) inline void ei_queryCacheSizes_amd(int& l1, int& l2, int& l3) { int abcd[4]; + abcd[0] = abcd[1] = abcd[2] = abcd[3] = 0; EIGEN_CPUID(abcd,0x80000005,0); l1 = (abcd[2] >> 24) * 1024; // C[31:24] = L1 size in KB + abcd[0] = abcd[1] = abcd[2] = abcd[3] = 0; EIGEN_CPUID(abcd,0x80000006,0); l2 = (abcd[2] >> 16) * 1024; // C[31;16] = l2 cache size in KB l3 = ((abcd[3] & 0xFFFC000) >> 18) * 512 * 1024; // D[31;18] = l3 cache size in 512KB |