Loading...
Searching...
No Matches
sort_impl.h
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
15PXR_NAMESPACE_OPEN_SCOPE
16
21template <typename C>
22void
23WorkImpl_ParallelSort(C* container)
24{
25 tbb::parallel_sort(container->begin(), container->end());
26}
27
30template <typename C, typename Compare>
31void
32WorkImpl_ParallelSort(C* container, const Compare& comp)
33{
34 tbb::parallel_sort(container->begin(), container->end(), comp);
35}
36
37PXR_NAMESPACE_CLOSE_SCOPE
38
39#endif // PXR_BASE_WORK_TBB_SORT_IMPL_H