#include <ForkJoin.h>
|
template<typename LeftType , typename RightType > |
static void | ForkJoin (LeftType &&left_thunk, RightType &&right_thunk, Eigen::ThreadPool *thread_pool) |
|
static void | RunParallelForAsync (int start, int end, int granularity, std::function< void(int)> &do_func, std::function< void()> &done, Eigen::ThreadPool *thread_pool) |
|
static void | RunParallelForAsync (int start, int end, int granularity, std::function< void(int, int)> &do_func, std::function< void()> &done, Eigen::ThreadPool *thread_pool) |
|
◆ ForkJoin()
template<typename LeftType , typename RightType >
static void Eigen::ForkJoinScheduler::ForkJoin |
( |
LeftType && |
left_thunk, |
|
|
RightType && |
right_thunk, |
|
|
Eigen::ThreadPool * |
thread_pool |
|
) |
| |
|
inlinestaticprivate |
93 std::atomic<bool> right_done(
false);
94 auto execute_right = [&right_thunk, &right_done]() {
95 std::forward<RightType>(right_thunk)();
96 right_done.store(
true, std::memory_order_release);
98 thread_pool->
Schedule(execute_right);
99 std::forward<LeftType>(left_thunk)();
101 while (!right_done.load(std::memory_order_acquire)) {
103 if (task.f) task.f();
Environment::Task Task
Definition: NonBlockingThreadPool.h:22
void Schedule(std::function< void()> fn) EIGEN_OVERRIDE
Definition: NonBlockingThreadPool.h:120
void MaybeGetTask(Task *t)
Definition: NonBlockingThreadPool.h:157
References Eigen::ThreadPoolTempl< Environment >::MaybeGetTask(), and Eigen::ThreadPoolTempl< Environment >::Schedule().
Referenced by RunParallelForAsync().
◆ ParallelFor()
template<typename DoFnType >
static void Eigen::ForkJoinScheduler::ParallelFor |
( |
int |
start, |
|
|
int |
end, |
|
|
int |
granularity, |
|
|
DoFnType |
do_func, |
|
|
Eigen::ThreadPool * |
thread_pool |
|
) |
| |
|
inlinestatic |
80 auto dummy_done = []() {};
82 thread_pool->
Schedule([
start,
end, granularity, thread_pool, &do_func, &dummy_done, &barrier]() {
static void ParallelForAsync(int start, int end, int granularity, DoFnType do_func, std::function< void()> done, Eigen::ThreadPool *thread_pool)
Definition: ForkJoin.h:67
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79
void start(const unsigned &i)
(Re-)start i-th timer
Definition: oomph_utilities.cc:243
References Eigen::placeholders::end, Eigen::Barrier::Notify(), ParallelForAsync(), Eigen::ThreadPoolTempl< Environment >::Schedule(), oomph::CumulativeTimings::start(), and Eigen::Barrier::Wait().
◆ ParallelForAsync()
template<typename DoFnType >
static void Eigen::ForkJoinScheduler::ParallelForAsync |
( |
int |
start, |
|
|
int |
end, |
|
|
int |
granularity, |
|
|
DoFnType |
do_func, |
|
|
std::function< void()> |
done, |
|
|
Eigen::ThreadPool * |
thread_pool |
|
) |
| |
|
inlinestatic |
◆ RunParallelForAsync() [1/2]
static void Eigen::ForkJoinScheduler::RunParallelForAsync |
( |
int |
start, |
|
|
int |
end, |
|
|
int |
granularity, |
|
|
std::function< void(int)> & |
do_func, |
|
|
std::function< void()> & |
done, |
|
|
Eigen::ThreadPool * |
thread_pool |
|
) |
| |
|
inlinestaticprivate |
◆ RunParallelForAsync() [2/2]
static void Eigen::ForkJoinScheduler::RunParallelForAsync |
( |
int |
start, |
|
|
int |
end, |
|
|
int |
granularity, |
|
|
std::function< void(int, int)> & |
do_func, |
|
|
std::function< void()> & |
done, |
|
|
Eigen::ThreadPool * |
thread_pool |
|
) |
| |
|
inlinestaticprivate |
137 [
start, mid, granularity, &do_func, &done, thread_pool]() {
140 [mid,
end, granularity, &do_func, &done, thread_pool]() {
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
static void ForkJoin(LeftType &&left_thunk, RightType &&right_thunk, Eigen::ThreadPool *thread_pool)
Definition: ForkJoin.h:92
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T div_ceil(T a, T b)
Definition: MathFunctions.h:1251
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2
References Eigen::numext::div_ceil(), Eigen::placeholders::end, ForkJoin(), j, RunParallelForAsync(), size, and oomph::CumulativeTimings::start().
The documentation for this class was generated from the following file: