34 template <
typename T,
typename Container,
class BinaryCompare>
36 template <
typename T,
typename StorageT,
typename U,
typename StorageU,
class BinaryCompare>
42 template <
typename HandleType,
class BinaryCompare>
44 BinaryCompare binary_compare,
45 vtkm::cont::internal::radix::PSortTag)
51 vtkm::Id2 range(0, values.GetNumberOfValues());
53 using IterType =
typename std::decay<decltype(iter)>::type;
56 Sorter sorter(iter, binary_compare);
57 sorter.Execute(range);
61 template <
typename T,
typename StorageT,
class BinaryCompare>
63 BinaryCompare binary_compare,
64 vtkm::cont::internal::radix::RadixSortTag)
66 auto c = vtkm::cont::internal::radix::get_std_compare(binary_compare, T{});
70 valuesPortal.GetIteratorBegin(),
static_cast<std::size_t
>(values.
GetNumberOfValues()), c);
74 template <
typename T,
typename Container,
class BinaryCompare>
77 using namespace vtkm::cont::internal::radix;
78 using SortAlgorithmTag =
typename sort_tag_type<T, Container, BinaryCompare>::type;
84 template <
typename T,
typename StorageT,
typename U,
typename StorageU,
class BinaryCompare>
87 BinaryCompare binary_compare,
88 vtkm::cont::internal::radix::PSortTag)
91 constexpr
bool larger_than_64bits =
sizeof(U) >
sizeof(
vtkm::Int64);
92 if (larger_than_64bits)
101 IndexType indexArray;
102 ValueType valuesScattered;
118 vtkm::cont::internal::KeyCompare<T, vtkm::Id, BinaryCompare>(binary_compare),
119 vtkm::cont::internal::radix::PSortTag());
126 auto valuesOutPortal =
131 firstprivate(valuesInPortal, indexPortal, valuesOutPortal)
136 valuesOutPortal.Set(i, valuesInPortal.Get(indexPortal.Get(i)));
146 openmp::CopyHelper(inputPortal, outputPortal, 0, 0, size);
156 vtkm::cont::internal::KeyCompare<T, U, BinaryCompare>(binary_compare),
157 vtkm::cont::internal::radix::PSortTag{});
162 template <
typename T,
typename StorageT,
typename StorageU,
class BinaryCompare>
165 BinaryCompare binary_compare,
166 vtkm::cont::internal::radix::RadixSortTag)
168 using namespace vtkm::cont::internal::radix;
169 auto c = get_std_compare(binary_compare, T{});
174 valuesPortal.GetIteratorBegin(),
178 template <
typename T,
typename StorageT,
typename U,
typename StorageU,
class BinaryCompare>
181 BinaryCompare binary_compare,
182 vtkm::cont::internal::radix::RadixSortTag)
189 IndexType indexArray;
190 ValueType valuesScattered;
203 if (valuesBytes >
static_cast<vtkm::Id>(vtkm::cont::internal::radix::MIN_BYTES_FOR_PARALLEL))
211 vtkm::cont::internal::KeyCompare<T, vtkm::Id, BinaryCompare>(binary_compare),
212 vtkm::cont::internal::radix::PSortTag());
224 firstprivate(valuesInPortal, indexPortal, valuesOutPortal)
229 valuesOutPortal.Set(i, valuesInPortal.Get(indexPortal.Get(i)));
238 openmp::CopyHelper(inputPortal, outputPortal, 0, 0, valuesScattered.GetNumberOfValues());
243 template <
typename T,
typename StorageT,
typename U,
typename StorageU,
class BinaryCompare>
246 BinaryCompare binary_compare)
248 using namespace vtkm::cont::internal::radix;
249 using SortAlgorithmTag =
250 typename sortbykey_tag_type<T, U, StorageT, StorageU, BinaryCompare>::type;