Skip to content

Commit

Permalink
Merge pull request #1 from Dr15Jones/defaultToThreadSafe
Browse files Browse the repository at this point in the history
Remove requirements to call Eigen::initParallel
  • Loading branch information
aledegano committed Nov 24, 2015
2 parents b4f6fea + 17b96fc commit 87b069e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Eigen/src/Core/products/GeneralBlockPanelKernel.h
Expand Up @@ -27,13 +27,8 @@ inline std::ptrdiff_t manage_caching_sizes_helper(std::ptrdiff_t a, std::ptrdiff
/** \internal */
inline void manage_caching_sizes(Action action, std::ptrdiff_t* l1=0, std::ptrdiff_t* l2=0)
{
static std::ptrdiff_t m_l1CacheSize = 0;
static std::ptrdiff_t m_l2CacheSize = 0;
if(m_l2CacheSize==0)
{
m_l1CacheSize = manage_caching_sizes_helper(queryL1CacheSize(),8 * 1024);
m_l2CacheSize = manage_caching_sizes_helper(queryTopLevelCacheSize(),1*1024*1024);
}
static std::ptrdiff_t m_l1CacheSize = manage_caching_sizes_helper(queryL1CacheSize(),8 * 1024);
static std::ptrdiff_t m_l2CacheSize = manage_caching_sizes_helper(queryTopLevelCacheSize(),1*1024*1024);

if(action==SetAction)
{
Expand Down
4 changes: 4 additions & 0 deletions Eigen/src/Core/products/Parallelizer.h
Expand Up @@ -17,12 +17,16 @@ namespace internal {
/** \internal */
inline void manage_multi_threading(Action action, int* v)
{
#ifdef EIGEN_HAS_OPENMP
static EIGEN_UNUSED int m_maxThreads = -1;
#endif

if(action==SetAction)
{
eigen_internal_assert(v!=0);
#ifdef EIGEN_HAS_OPENMP
m_maxThreads = *v;
#endif
}
else if(action==GetAction)
{
Expand Down

0 comments on commit 87b069e

Please sign in to comment.