Skip to content

Commit

Permalink
[SYCL][NFC] Rename custom swap to avoid collision (#14529)
Browse files Browse the repository at this point in the history
Current name (even though it is in sycl::detail namespace) somehow
affects accessor_iterator causing the nightly cts failure:
#14517
So rename the function as an easy fix.

Closes: #14517
  • Loading branch information
againull authored Jul 11, 2024
1 parent b7d13a3 commit 633a806
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit 633a806

Please sign in to comment.