Go to the documentation of this file.
10 #ifndef EIGEN_PARALLELIZER_H
11 #define EIGEN_PARALLELIZER_H
13 #if EIGEN_HAS_CXX11_ATOMIC
24 static int m_maxThreads = -1;
35 #ifdef EIGEN_HAS_OPENMP
87 #if EIGEN_HAS_CXX11_ATOMIC
88 std::atomic<Index>
sync;
89 std::atomic<int>
users;
99 template<
bool Condition,
typename Functor,
typename Index>
107 #if (! defined(EIGEN_HAS_OPENMP)) || defined(EIGEN_USE_BLAS) || ((!EIGEN_HAS_CXX11_ATOMIC) && !(EIGEN_ARCH_i386_OR_x86_64))
126 Index pb_max_threads = std::max<Index>(1,
size / Functor::Traits::nr);
129 double work =
static_cast<double>(
rows) *
static_cast<double>(
cols) *
130 static_cast<double>(
depth);
131 double kMinTaskSize = 50000;
132 pb_max_threads = std::max<Index>(1, std::min<Index>(pb_max_threads,
static_cast<Index>( work / kMinTaskSize ) ));
144 func.initParallelSession(threads);
151 #pragma omp parallel num_threads(threads)
158 Index blockRows = (
rows / actual_threads);
159 blockRows = (blockRows/Functor::Traits::mr)*Functor::Traits::mr;
162 Index actualBlockRows = (
i+1==actual_threads) ?
rows-r0 : blockRows;
165 Index actualBlockCols = (
i+1==actual_threads) ?
cols-c0 : blockCols;
167 info[
i].lhs_start = r0;
168 info[
i].lhs_length = actualBlockRows;
180 #endif // EIGEN_PARALLELIZER_H
void manage_caching_sizes(Action action, std::ptrdiff_t *l1, std::ptrdiff_t *l2, std::ptrdiff_t *l3)
Namespace containing all symbols from the Eigen library.
void manage_multi_threading(Action action, int *v)
void parallelize_gemm(const Functor &func, Index rows, Index cols, Index depth, bool transpose)
#define ei_declare_aligned_stack_constructed_variable(TYPE, NAME, SIZE, BUFFER)
Pose3 x3(Rot3::Ypr(M_PI/4.0, 0.0, 0.0), l2)
#define eigen_internal_assert(x)
int omp_get_thread_num(void)
#define EIGEN_UNUSED_VARIABLE(var)
void swap(GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &a, GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &b)
int omp_get_max_threads(void)
Array< int, Dynamic, 1 > v
EIGEN_CONSTEXPR Index size(const T &x)
int omp_get_num_threads(void)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:33:54