Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions sycl/include/sycl/detail/group_sort_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,13 @@ align_key_value_scratch(sycl::span<std::byte> scratch, Group g,
}
#endif

template <typename T> void swap_tuples(T &first, T &second) {
std::swap(first, second);
}

// Swap tuples of references.
template <template <typename...> class Tuple, typename... T>
void swap(Tuple<T &...> &&first, Tuple<T &...> &&second) {
void swap_tuples(Tuple<T &...> &&first, Tuple<T &...> &&second) {
auto lhs = first;
auto rhs = second;
// Do std::swap for each element of the tuple.
Expand Down Expand Up @@ -240,7 +244,7 @@ void bubble_sort(Iter first, const size_t begin, const size_t end,
// Handle intermediate items
for (size_t idx = begin; idx < begin + (end - 1 - i); ++idx) {
if (comp(first[idx + 1], first[idx])) {
detail::swap(first[idx], first[idx + 1]);
detail::swap_tuples(first[idx], first[idx + 1]);
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions sycl/include/sycl/detail/key_value_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ template <typename T1, typename T2> class key_value_iterator {
std::tuple<T1 *, T2 *> KeyValue;
};

template <typename T> void swap(T &first, T &second) {
std::swap(first, second);
}

} // namespace detail
} // namespace _V1
} // namespace sycl
} // namespace sycl