diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-06-07 19:05:30 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-06-07 19:05:30 +0200 |
commit | f3a568c81d1b0b03ca9e7295f3db36fbd3c768af (patch) | |
tree | a6cbd6b9c35e0af9e572afcee7967315754dd376 /Eigen | |
parent | 727376b5f43bfa52aa7b7d492001824071f2d1dd (diff) |
remove ei_ prefix of public global functions, and s/cpu/l1
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/products/GeneralBlockPanelKernel.h | 30 | ||||
-rw-r--r-- | Eigen/src/Core/products/GeneralMatrixMatrix.h | 4 |
2 files changed, 24 insertions, 10 deletions
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index b17c8e2dc..f4a4ac2b4 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -80,8 +80,9 @@ inline void ei_manage_caching_sizes(Action action, std::ptrdiff_t* a=0, std::ptr } } -/** \returns the currently set cpu cache size (in bytes) used to estimate the ideal blocking size parameters */ -std::ptrdiff_t ei_cpuCacheSize() +/** \returns the currently set cpu cache size (in bytes) used to estimate the ideal blocking size parameters. + * \sa setL1CacheSize */ +std::ptrdiff_t l1CacheSize() { std::ptrdiff_t ret; ei_manage_caching_sizes(GetAction, &ret); @@ -89,28 +90,41 @@ std::ptrdiff_t ei_cpuCacheSize() } /** Set the cpu cache size (in bytes) for blocking. - * This function also automatically set the blocking size parameters for each scalar type using the following formula: + * This function also automatically set the blocking size parameters + * for each scalar type using the following formula: * \code * max_k = 4 * sqrt(cache_size/(64*sizeof(Scalar))); * max_m = 2 * k; * \endcode * overwriting custom values set using the ei_setBlockingSizes function. + * + * \b Explanations: \n + * Let A * B be a m x k times k x n matrix product. Then Eigen's product yield + * L2 blocking on B with panels of size max_k x n, and L1 blocking on A, + * with blocks of size max_m x max_k. + * * \sa ei_setBlockingSizes */ -void ei_setCpuCacheSize(std::ptrdiff_t cache_size) { ei_manage_caching_sizes(SetAction,&cache_size); } +void setL1CacheSize(std::ptrdiff_t cache_size) { ei_manage_caching_sizes(SetAction,&cache_size); } /** Set the blocking size parameters \a maxK and \a maxM for the scalar type \a Scalar. * Note that in practice there is no distinction between scalar types of same size. - * \sa ei_setCpuCacheSize */ + * + * See ei_setCpuCacheSize for an explanation about the meaning of maxK and maxM. + * + * \sa setL1CacheSize */ template<typename Scalar> -void ei_setBlockingSizes(std::ptrdiff_t maxK, std::ptrdiff_t maxM) +void setBlockingSizes(std::ptrdiff_t maxK, std::ptrdiff_t maxM) { ei_manage_caching_sizes(SetAction,&maxK,&maxM,sizeof(Scalar)); } /** \returns in \a makK, \a maxM the blocking size parameters for the scalar type \a Scalar. - * \sa ei_setBlockingSizes */ + * + * See ei_setCpuCacheSize for an explanation about the meaning of maxK and maxM. + * + * \sa setL1CacheSize */ template<typename Scalar> -void ei_getBlockingSizes(std::ptrdiff_t& maxK, std::ptrdiff_t& maxM) +void getBlockingSizes(std::ptrdiff_t& maxK, std::ptrdiff_t& maxM) { ei_manage_caching_sizes(GetAction,&maxK,&maxM,sizeof(Scalar)); } diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix.h b/Eigen/src/Core/products/GeneralMatrixMatrix.h index 3086616f8..3286379e8 100644 --- a/Eigen/src/Core/products/GeneralMatrixMatrix.h +++ b/Eigen/src/Core/products/GeneralMatrixMatrix.h @@ -77,7 +77,7 @@ static void run(Index rows, Index cols, Index depth, Index kc; // cache block size along the K direction Index mc; // cache block size along the M direction - ei_getBlockingSizes<Scalar>(kc, mc); + getBlockingSizes<Scalar>(kc, mc); kc = std::min<Index>(kc,depth); mc = std::min<Index>(mc,rows); @@ -239,7 +239,7 @@ struct ei_gemm_functor Index sharedBlockBSize() const { int maxKc, maxMc; - ei_getBlockingSizes<Scalar>(maxKc,maxMc); + getBlockingSizes<Scalar>(maxKc,maxMc); return std::min<Index>(maxKc,m_rhs.rows()) * m_rhs.cols(); } |