11 #ifndef __UT_TASKLIST_H_INCLUDED__
12 #define __UT_TASKLIST_H_INCLUDED__
20 #include <tbb/parallel_for.h>
21 #include <tbb/task_group.h>
22 #include <type_traits>
34 return myTasks.isEmpty();
44 template <
typename Body>
47 myTasks.emplace_back(std::forward<Body>(task));
55 for (
auto&& task : myTasks)
57 tg.run([parent, task]() {
68 for (
auto&& task : myTasks)
80 template <typename RANGE, typename BODY>
91 [range = std::forward<RANGE>(range), body = std::forward<BODY>(body)]()
100 #endif // __UT_TASKLIST_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))
void spawnRootAndWait()
Spawn this task list as root tasks and wait.
static const UT_TaskScope * getCurrent()
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
void append(Body &&task)
Append a task.
static bool isThreadingEnabled()
#define SYS_DEPRECATED_REPLACE(__V__, __R__)
void UTparallelForAppendToTaskList(UT_TaskList &task_list, RANGE &&range, BODY &&body)
void UTparallelForRunInTaskGroup(UT_TaskGroup &task_group, RANGE &&range, BODY &&body)
void clear()
Removes all tasks.
bool isEmpty() const
Returns true when number of tasks is non-zero.
void runSerial()
Run this task list in serial.