11 #ifndef __UT_TASKGROUP_H_INCLUDED__
12 #define __UT_TASKGROUP_H_INCLUDED__
14 #ifndef __TBB_show_deprecation_message_task_H
15 #define __TBB_show_deprecation_message_task_H
16 #define UT_TASKGROUP_RESTORE_DEPRECATION_MESSAGE
21 #include <tbb/parallel_for.h>
23 #include <tbb/task_group.h>
28 typedef tbb::task_group_context me;
34 ISOLATED = me::isolated,
46 : task_group_context((kind_type)relation_to_parent)
71 return me::cancel_group_execution();
77 return me::is_group_execution_cancelled();
85 tbb::task::self().cancel_group_execution();
91 typedef tbb::task_group me;
102 template <
typename F>
105 me::run(std::forward<F>(
f));
108 template <
typename F>
109 void run(tbb::task_handle<F> &
f)
114 template <
typename F>
120 template <
typename F>
137 template <
typename RANGE,
typename BODY>
147 [
range = std::forward<RANGE>(
range), body = std::forward<BODY>(body)]()
154 #ifdef UT_TASKGROUP_RESTORE_DEPRECATION_MESSAGE
155 #undef __TBB_show_deprecation_message_task_H
156 #undef UT_TASKGROUP_RESTORE_DEPRECATION_MESSAGE
159 #endif // __UT_TASKGROUP_H_INCLUDED__
void parallel_for(int64_t start, int64_t end, std::function< void(int64_t index)> &&task, parallel_options opt=parallel_options(0, Split_Y, 1))
UT_TaskGroupContext(KindType relation_to_parent=BOUND)
static bool isThreadingEnabled()
void runAndWait(tbb::task_handle< F > &f)
tbb::task_group_status wait()
void runAndWait(const F &f)
void UTparallelForRunInTaskGroup(UT_TaskGroup &task_group, RANGE &&range, BODY &&body)
void run(tbb::task_handle< F > &f)
bool cancelGroupExecution()
bool isGroupExecutionCancelled() const
static void cancelCurrentGroupExecution()
Cancel the entire current task group context when run within a task.