10#ifndef EIGEN_PARALLELIZER_H
11#define EIGEN_PARALLELIZER_H
18inline void manage_multi_threading(Action action,
int* v)
20 static EIGEN_UNUSED
int m_maxThreads = -1;
24 eigen_internal_assert(v!=0);
27 else if(action==GetAction)
29 eigen_internal_assert(v!=0);
30 #ifdef EIGEN_HAS_OPENMP
34 *v = omp_get_max_threads();
41 eigen_internal_assert(
false);
48inline void initParallel()
51 internal::manage_multi_threading(GetAction, &nbt);
52 std::ptrdiff_t l1, l2, l3;
53 internal::manage_caching_sizes(GetAction, &l1, &l2, &l3);
61 internal::manage_multi_threading(GetAction, &ret);
67inline void setNbThreads(
int v)
69 internal::manage_multi_threading(SetAction, &v);
85template<
bool Condition,
typename Functor,
typename Index>
86void parallelize_gemm(
const Functor& func, Index rows, Index cols,
bool transpose)
90#if !(defined (EIGEN_HAS_OPENMP)) || defined (EIGEN_USE_BLAS)
95 EIGEN_UNUSED_VARIABLE(transpose);
107 Index size = transpose ? rows : cols;
115 if((!
Condition) || (threads==1) || (omp_get_num_threads()>1))
116 return func(0,rows, 0,cols);
118 Eigen::initParallel();
119 func.initParallelSession(threads);
126 #pragma omp parallel num_threads(threads)
128 Index i = omp_get_thread_num();
134 blockRows = (blockRows/Functor::Traits::mr)*Functor::Traits::mr;
136 Index
r0 = i*blockRows;
139 Index
c0 = i*blockCols;
142 info[i].lhs_start =
r0;
Pseudo expression representing a solving operation.
Definition Solve.h:63
NLOHMANN_BASIC_JSON_TPL_DECLARATION void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL &j1, nlohmann::NLOHMANN_BASIC_JSON_TPL &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name, cert-dcl58-cpp) is_nothrow_move_constructible< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value &&//NOLINT(misc-redundant-expression) is_nothrow_move_assignable< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value)
exchanges the values of two JSON objects
Definition json.hpp:24418
Definition Parallelizer.h:75