7 #ifndef PXR_BASE_WORK_TBB_TASK_GRAPH_IMPL_H
8 #define PXR_BASE_WORK_TBB_TASK_GRAPH_IMPL_H
15 #if __has_include(<tbb/tbb_stddef.h>)
16 #include <tbb/tbb_stddef.h>
17 #elif __has_include(<tbb/version.h>)
18 #include <tbb/version.h>
21 #ifndef TBB_INTERFACE_VERSION_MAJOR
22 #error "TBB version macro TBB_INTERFACE_VERSION_MAJOR not found"
25 #if TBB_INTERFACE_VERSION_MAJOR < 12
31 #define WORK_IMPL_HAS_TASK_GRAPH
44 WorkImpl_TaskGraph &
operator=(WorkImpl_TaskGraph
const &) =
delete;
48 template <
typename F,
typename ... Args>
53 tbb::task::spawn(*task);
60 tbb::task_group_context _context;
64 tbb::empty_task *_rootTask;
73 increment_ref_count();
77 return decrement_ref_count();
80 template <
typename F,
typename... Args>
82 return new (tbb::task::allocate_additional_child_of(*
this))
83 F{std::forward<Args>(
args)...};
88 recycle_as_safe_continuation();
93 template <
typename F,
typename ... Args>
95 return new (tbb::task::allocate_additional_child_of(*_rootTask))
96 F{std::forward<Args>(
args)...};
101 #endif // TBB_INTERFACE_VERSION_MAJOR < 12
103 #endif // PXR_BASE_WORK_TBB_TASK_GRAPH_IMPL_H
WorkImpl_TaskGraph & operator=(WorkImpl_TaskGraph const &)=delete
#define PXR_NAMESPACE_OPEN_SCOPE
WORK_API WorkImpl_TaskGraph()
virtual WORK_API ~BaseTask()
WORK_API ~WorkImpl_TaskGraph() noexcept
void _RecycleAsContinuation()
int RemoveChildReference()
#define PXR_NAMESPACE_CLOSE_SCOPE
**If you just want to fire and args
F * AllocateChild(Args &&...args)
F * AllocateTask(Args &&...args)