HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sort_impl.h
Go to the documentation of this file.
1 //
2 // Copyright 2025 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_SORT_IMPL_H
8 #define PXR_BASE_WORK_TBB_SORT_IMPL_H
9 
10 #include "pxr/pxr.h"
11 
12 #include <tbb/parallel_sort.h>
13 #include <algorithm>
14 
16 
17 /// TBB Sort Implementation
18 ///
19 /// Implements WorkParallelSort
20 ///
21 template <typename C>
22 void
23 WorkImpl_ParallelSort(C* container)
24 {
25  tbb::parallel_sort(container->begin(), container->end());
26 }
27 
28 /// Implements WorkParallelSort with custom comparator
29 ///
30 template <typename C, typename Compare>
31 void
32 WorkImpl_ParallelSort(C* container, const Compare& comp)
33 {
34  tbb::parallel_sort(container->begin(), container->end(), comp);
35 }
36 
38 
39 #endif // PXR_BASE_WORK_TBB_SORT_IMPL_H
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
PXR_NAMESPACE_OPEN_SCOPE void WorkImpl_ParallelSort(C *container)
Definition: sort_impl.h:23
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74