HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
withScopedParallelism_impl.h
Go to the documentation of this file.
1 //
2 // Copyright 2021 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_BASE_WORK_TBB_WITH_SCOPED_PARALLELISM_IMPL_H
8 #define PXR_BASE_WORK_TBB_WITH_SCOPED_PARALLELISM_IMPL_H
9 
10 #include <tbb/task_arena.h>
11 
12 #include "pxr/pxr.h"
13 
14 #include <utility>
15 
17 
18 /// TBB Scoped Parallelism Implementation
19 ///
20 /// Implements WorkWithScopedParallelism
21 ///
22 template <class Fn>
23 auto
25 {
26  return tbb::this_task_arena::isolate(std::forward<Fn>(fn));
27 };
28 
30 
31 #endif // PXR_BASE_WORK_TBB_WITH_SCOPED_PARALLELISM_IMPL_H
32 
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
PXR_NAMESPACE_OPEN_SCOPE auto WorkImpl_WithScopedParallelism(Fn &&fn)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74