make the cache size mechanism future proof by adding level 2 parameters

This commit is contained in:
Gael Guennebaud
2010-06-10 22:11:31 +02:00
parent 986f65c402
commit 842b54fe80
3 changed files with 112 additions and 51 deletions

View File

@@ -49,5 +49,22 @@ void test_product_large()
MatrixXf a = MatrixXf::Random(10,4), b = MatrixXf::Random(4,10), c = a;
VERIFY_IS_APPROX((a = a * b), (c * b).eval());
}
{
// check the functions to setup blocking sizes compile and do not segfault
// FIXME check they do what they are supposed to do !!
std::ptrdiff_t l1 = ei_random<int>(10000,20000);
std::ptrdiff_t l2 = ei_random<int>(1000000,2000000);
setCpuCacheSizes(l1,l2);
VERIFY(l1==l1CacheSize());
VERIFY(l2==l2CacheSize());
std::ptrdiff_t k1 = ei_random<int>(10,100)*16;
std::ptrdiff_t m1 = ei_random<int>(10,100)*16;
std::ptrdiff_t n1 = ei_random<int>(10,100)*16;
setBlockingSizes<float>(k1,m1,n1);
std::ptrdiff_t k, m, n;
getBlockingSizes<float>(k,m,n);
VERIFY(k==k1 && m==m1 && n==n1);
}
#endif
}