Loading...
Searching...
No Matches
withScopedParallelism_impl.h
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
16PXR_NAMESPACE_OPEN_SCOPE
17
22template <class Fn>
23auto
24WorkImpl_WithScopedParallelism(Fn &&fn)
25{
26 return tbb::this_task_arena::isolate(std::forward<Fn>(fn));
27};
28
29PXR_NAMESPACE_CLOSE_SCOPE
30
31#endif // PXR_BASE_WORK_TBB_WITH_SCOPED_PARALLELISM_IMPL_H
32